diff --git a/frontend/README.md b/frontend/README.md index c2af4d69b..2d953d822 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -5,6 +5,31 @@ server that `veadk frontend` launches — no separate backend. ## Release notifications +MPA basic information includes an editable maximum instance count, defaulting to +20 for Volcengine and 10 for BytePlus. +This is the Runtime autoscaling ceiling (`MaxInstance`), not the initial number +of running instances. Submitted requests retain their selected value on retry; +legacy requests without this field keep their original configuration. Duplicate +names show the existing error message in a red alert. General-agent creation is unchanged. +See [the creation contract](../specs/studio-mpa-creation/README.md). + +MPA 基本信息提供可编辑的“最大实例数”,火山默认 20、BytePlus 默认 10,对应 Runtime 的扩容上限 +`MaxInstance`,并非初始启动实例数。已提交请求重试沿用原值;没有此字段的旧请求 +保留原配置。名称重复时以红色错误框突出原提示,通用智能体创建不变。 +参见[创建契约](../specs/studio-mpa-creation/README.zh.md)。 + +MPA session output storage accepts only optional buckets beginning with `agentkit-platform-`. The +Worker Tool uses IAM Role without TOS keys; creation additively grants that role +bucket metadata access and object read/write/delete under `sandbox-session/*`. +The shared role's other consumers receive the same access. Existing Tools, +Sessions and public bucket policies are not changed. Empty selection preserves +server defaults. See [the managed setup](../veadk/integrations/mpa/managed/README.md#tos-output-storage-with-iam-role). + +MPA 会话输出存储仅可选以 `agentkit-platform-` 开头的桶,Worker Tool 使用 IAM Role,不再要求 TOS 密钥。 +创建时增量补齐角色的桶元数据权限和 `sandbox-session/*` 对象读写/删除权限;共享 +角色的其他使用者同样获得该权限。不修改已有 Tool、会话或桶公开策略;空选择保留 +服务端默认配置。参见[托管配置](../veadk/integrations/mpa/managed/README.zh.md#使用-iam-role-的-tos-输出存储)。 + The MPA creation wizard supports clicking step headings and returning to earlier settings after restoring a submitted draft. Submitted settings remain read-only; retry retains the original identity. Any submitted draft offers New Agent to @@ -1593,7 +1618,7 @@ DatePicker 在基础组件中展示日期与日期时间选择;IndexLayout 在 三个渠道的解除连接操作统一为“解除绑定”;已绑定企业微信的“重新生成二维码”与“解除绑定”横向排列,与飞书和钉钉一致。 -飞书群聊权限列表不再提供“编辑”;每行右侧的 × 按钮用于移除该群权限。 +飞书群聊权限列表不再提供“编辑”;每行右侧的 × 按钮用于移除该群权限。 新增群权限仅填写群 ID,不再提供会话隔离选项或提交 `groupSessionScope`;新群沿用 Runtime 默认/继承策略,已有群配置及列表中的策略展示保持不变。 配置方式不跨页面或 Runtime 保存。切换方式会清空未提交凭据、隐藏二维码并停止前端轮询或企微授权等待;注册提交进行中禁止切换。已绑定机器人也可以通过手动配置替换,失败保留现有绑定。飞书与钉钉手动配置须由 Runtime 的 `credentialBindingChannels` 声明支持;旧镜像显示升级提示。 @@ -1640,15 +1665,15 @@ Studio 从 `mpa_admin_workspace/mpa_admin_db` 的账号/地域记录解析共享 APIG/IM Gateway;缺失时创建并保存,后续智能体复用。内置配置不固定已有资源 ID。 已有记录保持不变;本次不迁移智能体或绕过资源配额。 -With `managed.postgres` configured, the PG step uses a shared business Workspace with a separate database per MPA. Shared account/region resource records live in `mpa_admin_workspace/mpa_admin_db`. With `managed.postgres.mode: auto`, deployment STS creates/reuses both Workspaces and the PG step needs no connection input. Manual profiles remain supported. See the [setup and registry migration instructions](../veadk/integrations/mpa/managed/README.md). +New Studio requests prepare a dedicated `mpa_agent_` Workspace and its `aidb` business database per MPA. Name checks before first Next and task acceptance block foreign Runtime/template/Workspace collisions; own bindings remain reusable on retry. Existing submitted requests and registered shared bindings retain the original shared business Workspace. Shared account/region resource records live in `mpa_admin_workspace/mpa_admin_db`. With `managed.postgres.mode: auto`, deployment STS creates/reuses both Workspaces and the PG step needs no connection input. Manual profiles remain supported. See the [setup and registry migration instructions](../veadk/integrations/mpa/managed/README.md). -配置 `managed.postgres` 后,PG 步骤使用共享业务 Workspace,每个 MPA 保留独立业务库。账号/地域共享资源记录存入 `mpa_admin_workspace/mpa_admin_db`。设置 `managed.postgres.mode: auto` 后,由部署 STS 创建/复用两个 Workspace,PG 步骤无需填写连接信息;仍兼容手动配置。参见[配置和注册库迁移说明](../veadk/integrations/mpa/managed/README.zh.md)。 +Studio 新请求为每个 MPA 准备独立 `mpa_agent_` Workspace 及 `aidb` 业务库。首次下一步及任务接收前检查名称,阻止其他归属 Runtime/模板/Workspace 重名,自身绑定仍可重试复用。已提交请求及已登记的共享绑定沿用原共享业务 Workspace。账号/地域共享资源记录存入 `mpa_admin_workspace/mpa_admin_db`。设置 `managed.postgres.mode: auto` 后,由部署 STS 创建/复用两个 Workspace,PG 步骤无需填写连接信息;仍兼容手动配置。参见[配置和注册库迁移说明](../veadk/integrations/mpa/managed/README.zh.md)。 The MPA creation dialog asks for a Runtime name (4–64 ASCII letters, digits, underscores or hyphens) and description. The server generates the stable Agent ID; neither ID nor image inputs are shown. Fresh requests use the built-in `mpa/mpa_agent:latest` and `mpa/mpa_codex_worker:latest` images. Submitted legacy drafts retain their original request and images for retry. Existing Runtimes are unchanged. See [managed creation](../veadk/integrations/mpa/managed/README.md). -The dialog now uses three steps: basics (required Runtime name and description), automatic PostgreSQL preparation, and optional OpenViking HTTPS URL/resource ID/API Key. It links to the relevant Volcengine console pages. The server obtains PostgreSQL Workspace connections through deployment credentials. OpenViking is enabled only when the HTTPS URL, resource ID and masked API Key are all entered; leaving all three blank omits its four Runtime variables, including any values inherited from a template or reference Runtime. The key is never saved in browser drafts or task SQLite. Only the final step submits; nonsecret draft choices and request identity survive reopening in the same browser session. See the [creation contract](../specs/studio-mpa-creation/README.md). +The dialog now uses three steps: basics (required Runtime name and description), automatic PostgreSQL preparation, and OpenViking preparation. It links to the relevant Volcengine console pages. The server obtains PostgreSQL Workspace connections through deployment credentials. New Volcengine Beijing requests automatically prepare an independent paid enterprise OpenViking library and inject its four Runtime variables; retries reuse the registered library. New BytePlus Johor requests automatically prepare a personal library using the resolved MPA ModelArk API Key and two inference endpoints (server overrides: `OV_VLM_ENDPOINT_ID` / `OV_EMBEDDING_ENDPOINT_ID`). Its default-user and overseas data-plane behavior require a separately adapted Runtime image before memory works. Already-submitted manual requests still enable OpenViking only when all three connection values are entered; leaving them blank omits the four variables, including inherited values. The key is never saved in browser drafts or task SQLite. Only the final step submits; nonsecret draft choices and request identity survive reopening in the same browser session. See the [creation contract](../specs/studio-mpa-creation/README.md). -创建弹窗现分为基础信息(必填 Runtime 名称和描述)、PostgreSQL 自动准备、可选 OpenViking HTTPS 地址/资源 ID/API Key 三步,并提供对应的火山引擎控制台入口。服务端通过部署凭据获取 PostgreSQL Workspace 连接。仅在 HTTPS 地址、资源 ID 和遮罩的 API Key 三项均填写时启用 OpenViking;三项全空时,新 Runtime 不注入其四个变量,也不继承模板或参考 Runtime 中的旧值。密钥不保存到浏览器草稿或任务 SQLite。仅最后一步提交,非密钥草稿与请求身份在同一浏览器会话中可恢复。参见[创建契约](../specs/studio-mpa-creation/README.zh.md)。 +创建弹窗现分为基础信息(必填 Runtime 名称和描述)、PostgreSQL 自动准备、OpenViking 准备说明三步,并提供对应的火山引擎控制台入口。服务端通过部署凭据获取 PostgreSQL Workspace 连接。火山北京新请求自动准备独立的付费企业版 OpenViking 库并注入四个 Runtime 变量,重试复用已登记库。BytePlus 柔佛新请求使用已解析的 MPA ModelArk API Key 和两个推理接入点(服务端可通过 `OV_VLM_ENDPOINT_ID` / `OV_EMBEDDING_ENDPOINT_ID` 覆盖)自动准备个人版库;其 default 用户及海外数据面行为需要单独适配 Runtime 镜像后才能使用记忆。已提交手动请求仍在三项连接值全部填写时启用 OpenViking;全空时不注入四个变量,也不继承旧值。密钥不保存到浏览器草稿或任务 SQLite。仅最后一步提交,非密钥草稿与请求身份在同一浏览器会话中可恢复。参见[创建契约](../specs/studio-mpa-creation/README.zh.md)。 After a confirmed failure or cancellation, the dialog retains the old task for same-ID retry. “Create another agent” generates a new request UUID and blank name; the server derives the new agent ID on submission and returns to the first step. It replaces only the browser draft, not any cloud resources from the previous attempt. Running or uncertain submissions cannot switch identities. @@ -1760,7 +1785,7 @@ large collections will need a separate rebuildable query index. 三个渠道的解除连接操作统一为“解除绑定”;已绑定企业微信的“重新生成二维码”与“解除绑定”横向排列,与飞书和钉钉一致。 -飞书群聊权限列表不再提供“编辑”;每行右侧的 × 按钮用于移除该群权限。 +飞书群聊权限列表不再提供“编辑”;每行右侧的 × 按钮用于移除该群权限。 新增群权限仅填写群 ID,不再提供会话隔离选项或提交 `groupSessionScope`;新群沿用 Runtime 默认/继承策略,已有群配置及列表中的策略展示保持不变。 配置方式不跨页面或 Runtime 保存。切换方式会清空未提交凭据、隐藏二维码并停止前端轮询或企微授权等待;注册提交进行中禁止切换。已绑定机器人也可以通过手动配置替换,失败保留现有绑定。飞书与钉钉手动配置须由 Runtime 的 `credentialBindingChannels` 声明支持;旧镜像显示升级提示。 @@ -1797,15 +1822,15 @@ The production entry loads both component token stylesheets before rendering. Wh ### Named MPA creation / MPA 名称创建 -With `managed.postgres` configured, the PG step uses a shared business Workspace with a separate database per MPA. Shared account/region resource records live in `mpa_admin_workspace/mpa_admin_db`. With `managed.postgres.mode: auto`, deployment STS creates/reuses both Workspaces and the PG step needs no connection input. Manual profiles remain supported. See the [setup and registry migration instructions](../veadk/integrations/mpa/managed/README.md). +New Studio requests prepare a dedicated `mpa_agent_` Workspace and its `aidb` business database per MPA. Name checks before first Next and task acceptance block foreign Runtime/template/Workspace collisions; own bindings remain reusable on retry. Existing submitted requests and registered shared bindings retain the original shared business Workspace. Shared account/region resource records live in `mpa_admin_workspace/mpa_admin_db`. With `managed.postgres.mode: auto`, deployment STS creates/reuses both Workspaces and the PG step needs no connection input. Manual profiles remain supported. See the [setup and registry migration instructions](../veadk/integrations/mpa/managed/README.md). -配置 `managed.postgres` 后,PG 步骤使用共享业务 Workspace,每个 MPA 保留独立业务库。账号/地域共享资源记录存入 `mpa_admin_workspace/mpa_admin_db`。设置 `managed.postgres.mode: auto` 后,由部署 STS 创建/复用两个 Workspace,PG 步骤无需填写连接信息;仍兼容手动配置。参见[配置和注册库迁移说明](../veadk/integrations/mpa/managed/README.zh.md)。 +Studio 新请求为每个 MPA 准备独立 `mpa_agent_` Workspace 及 `aidb` 业务库。首次下一步及任务接收前检查名称,阻止其他归属 Runtime/模板/Workspace 重名,自身绑定仍可重试复用。已提交请求及已登记的共享绑定沿用原共享业务 Workspace。账号/地域共享资源记录存入 `mpa_admin_workspace/mpa_admin_db`。设置 `managed.postgres.mode: auto` 后,由部署 STS 创建/复用两个 Workspace,PG 步骤无需填写连接信息;仍兼容手动配置。参见[配置和注册库迁移说明](../veadk/integrations/mpa/managed/README.zh.md)。 The MPA creation dialog asks for a Runtime name (4–64 ASCII letters, digits, underscores or hyphens) and description. The server generates the stable Agent ID; neither ID nor image inputs are shown. Fresh requests use the built-in `mpa/mpa_agent:latest` and `mpa/mpa_codex_worker:latest` images. Submitted legacy drafts retain their original request and images for retry. Existing Runtimes are unchanged. See [managed creation](../veadk/integrations/mpa/managed/README.md). -The dialog now uses three steps: basics (required Runtime name and description), automatic PostgreSQL preparation, and optional OpenViking HTTPS URL/resource ID/API Key. It links to the relevant Volcengine console pages. The server obtains PostgreSQL Workspace connections through deployment credentials. OpenViking is enabled only when the HTTPS URL, resource ID and masked API Key are all entered; leaving all three blank omits its four Runtime variables, including any values inherited from a template or reference Runtime. The key is never saved in browser drafts or task SQLite. Only the final step submits; nonsecret draft choices and request identity survive reopening in the same browser session. See the [creation contract](../specs/studio-mpa-creation/README.md). +The dialog now uses three steps: basics (required Runtime name and description), automatic PostgreSQL preparation, and OpenViking preparation. It links to the relevant Volcengine console pages. The server obtains PostgreSQL Workspace connections through deployment credentials. New Volcengine Beijing requests automatically prepare an independent paid enterprise OpenViking library and inject its four Runtime variables; retries reuse the registered library. New BytePlus Johor requests automatically prepare a personal library using the resolved MPA ModelArk API Key and two inference endpoints (server overrides: `OV_VLM_ENDPOINT_ID` / `OV_EMBEDDING_ENDPOINT_ID`). Its default-user and overseas data-plane behavior require a separately adapted Runtime image before memory works. Already-submitted manual requests still enable OpenViking only when all three connection values are entered; leaving them blank omits the four variables, including inherited values. The key is never saved in browser drafts or task SQLite. Only the final step submits; nonsecret draft choices and request identity survive reopening in the same browser session. See the [creation contract](../specs/studio-mpa-creation/README.md). -创建弹窗现分为基础信息(必填 Runtime 名称和描述)、PostgreSQL 自动准备、可选 OpenViking HTTPS 地址/资源 ID/API Key 三步,并提供对应的火山引擎控制台入口。服务端通过部署凭据获取 PostgreSQL Workspace 连接。仅在 HTTPS 地址、资源 ID 和遮罩的 API Key 三项均填写时启用 OpenViking;三项全空时,新 Runtime 不注入其四个变量,也不继承模板或参考 Runtime 中的旧值。密钥不保存到浏览器草稿或任务 SQLite。仅最后一步提交,非密钥草稿与请求身份在同一浏览器会话中可恢复。参见[创建契约](../specs/studio-mpa-creation/README.zh.md)。 +创建弹窗现分为基础信息(必填 Runtime 名称和描述)、PostgreSQL 自动准备、OpenViking 准备说明三步,并提供对应的火山引擎控制台入口。服务端通过部署凭据获取 PostgreSQL Workspace 连接。火山北京新请求自动准备独立的付费企业版 OpenViking 库并注入四个 Runtime 变量,重试复用已登记库。BytePlus 柔佛新请求使用已解析的 MPA ModelArk API Key 和两个推理接入点(服务端可通过 `OV_VLM_ENDPOINT_ID` / `OV_EMBEDDING_ENDPOINT_ID` 覆盖)自动准备个人版库;其 default 用户及海外数据面行为需要单独适配 Runtime 镜像后才能使用记忆。已提交手动请求仍在三项连接值全部填写时启用 OpenViking;全空时不注入四个变量,也不继承旧值。密钥不保存到浏览器草稿或任务 SQLite。仅最后一步提交,非密钥草稿与请求身份在同一浏览器会话中可恢复。参见[创建契约](../specs/studio-mpa-creation/README.zh.md)。 After a confirmed failure or cancellation, the dialog retains the old task for same-ID retry. “Create another agent” generates a new request UUID and blank name; the server derives the new agent ID on submission and returns to the first step. It replaces only the browser draft, not any cloud resources from the previous attempt. Running or uncertain submissions cannot switch identities. @@ -1841,6 +1866,8 @@ administrator access. A failed or unauthorized account lookup blocks Feishu task submission instead of selecting an arbitrary bot. Older runtimes keep the single-bot interface. Compatible MPA images must be deployed separately. +Adding a Feishu group only requires its chat ID; Studio no longer exposes a session-isolation selector or sends `groupSessionScope`. New groups use Runtime default/inheritance rules. Existing group configuration and returned scope labels remain unchanged. + Runtime 声明 `multiBotChannels: ["feishu"]` 后,可在“自动化 → 消息渠道 → MPA 智能体消息渠道”中选择机器人。扫码或手动添加后,启停、解绑、诊断和群权限 均按选中的 `appId` 管理;新增不同机器人保留既有绑定。飞书定时任务须选择已启用 @@ -1852,3 +1879,35 @@ Contracts and verification / 契约与验证: [channels](../specs/mpa-channels/README.md), [tasks](../specs/studio-mpa-cron-tasks/README.md), [design](../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md). + +### General and MPA deployment isolation + +Generic structured/YAML creation retains the ordinary build, deploy and publish flow (plus selected scaling, evaluation and GitHub options). Only explicitly identified MPA targets apply Profile/smoke phases. Local drafts are filtered by type; legacy drafts without explicit MPA intent default to general. This does not repair cloud Runtime tags written by previous versions. + +### 通用与 MPA 部署隔离 + +通用结构化/YAML 创建保留原构建、部署和发布流程(以及选中的实例配置、评测和 GitHub 选项)。仅明确标识为 MPA 的目标执行 Profile/smoke 阶段。本地草稿按类型筛选;无明确 MPA 意图的旧草稿默认通用。此修改不会修复旧版本已写入的云端 Runtime 标签。 + +### Deleting MPA agents / 删除 MPA 智能体 + +MPA deletion checks sessions and active lifecycle operations without querying Profile. Confirmation lists exclusive managed sandbox templates and Skill Spaces to delete, and shared or unproven resources to retain. Cleanup failures keep Runtime available for retry; databases, Workspaces, network, APIG and other resources remain. General agents use their existing Runtime deletion flow. Check errors are shown in the confirmation dialog and can be retried or cancelled. Restart Studio after updating the backend. Session authentication remains required; deletion forwards the same server-authenticated user identity as chat. + +MPA 删除检查会话和活动生命周期操作,不查询 Profile。确认弹窗列出待删除的独占受管沙箱模板、Skill Space,以及保留的共享或归属不明资源。清理失败保留 Runtime 供重试;数据库、Workspace、网络、APIG 及其他资源保留。通用智能体沿用现有 Runtime 删除流程。检查错误在弹窗内显示,可重新检查或取消。更新后端后需重启 Studio;会话接口仍需通过鉴权;删除流程传递与聊天一致的服务端已认证用户身份。 + +MPA deletion waits up to 180 seconds. If the browser times out, Studio makes one read-only check: only explicit Runtime NotFound plus complete list absence confirms completion. Otherwise it shows that the outcome is not yet confirmed; refresh and check later rather than assuming failure. General-agent deletion retains its existing 30-second timeout. Confirmation requires the same authenticated Studio user and deployment credentials; a backend restart or credential rotation can leave the outcome unconfirmed. This change does not alter resource cleanup or retention. Restart Studio and refresh the page after updating. + +MPA 删除最多等待 180 秒。浏览器超时后,Studio 会只读检查一次:仅 Runtime 明确返回 NotFound 且完整列表也不存在时确认完成。否则显示结果尚未确认,需稍后刷新检查,不能直接认定失败。通用智能体仍使用原来的 30 秒超时。结果确认要求相同的 Studio 已认证用户和部署凭据;后端重启或凭据轮换可能导致结果无法确认。此修改不改变资源清理和保留规则。更新后请重启 Studio 并刷新页面。 + + +MPA runtime-role preparation now distinguishes missing deployment IAM permissions from temporary IAM/network failures. Temporary failures retry within the role deadline; exhausted attempts display an actionable same-agent retry message. Safe operation/category/Request ID diagnostics are retained by the server. See the [IAM recovery design](../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md). + +MPA 运行角色准备现区分部署 IAM 权限不足与临时 IAM/网络失败。临时失败在角色期限内重试,耗尽后提示用同一智能体重试。服务端保留安全的接口/类别/Request ID 诊断。见[IAM 恢复设计](../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md)。 + +BytePlus managed MPA creation in ap-southeast-1 again automatically prepares personal OpenViking. New/editable requests use automatic configuration without manual credentials. Submitted no-OV/automatic/manual requests retain their original recovery mode; use New Agent to enable OV after a no-OV submission. Domestic automatic OV and uncertain-create protection are unchanged. + +MPA same-request retries validate the original stored payload and deployment-account snapshot before checking owned Runtime/Worker names. A fresh same-name request still fails. Empty Runtime owner tags can only be supplemented by the authenticated original intent; foreign metadata remains rejected. This restores recovery after a failed readiness check without changing generic-agent creation. + + +BytePlus Studio MPA creation now retrieves the deployment-account APM AppKey through the overseas service host and injects `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY` into Runtime Envs. The key stays out of browser/task/deployment records; lookup failures stop resource preparation with safe diagnostics. Restart Studio and use a new request. Domestic/general-agent creation and CLI profiles are unchanged. See the [APM key design](../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.md). + +BytePlus Studio MPA 创建现通过海外服务 Host 获取部署账号的 APM AppKey,注入 Runtime Envs 的 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY`。Key 不进入浏览器/任务/部署记录;获取失败时以安全诊断停止资源准备。重启 Studio 后使用新请求。国内/通用智能体创建和 CLI 配置不变。见 [APM Key 设计](../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.zh.md)。 diff --git a/frontend/package.json b/frontend/package.json index bfd7e83bf..eeeb17b0a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,7 +8,7 @@ "dev": "vite", "build": "node scripts/build.mjs", "test": "node --test tests/*.test.mjs && npm run test:mpa-agent-info", - "test:mpa-agent-info": "vitest run tests/mpaAgentInfoRail.test.tsx tests/skillDocumentEditor.test.tsx tests/mpaCreation.test.tsx tests/mpaBasicDetails.test.tsx", + "test:mpa-agent-info": "vitest run tests/mpaAgentInfoRail.test.tsx tests/skillDocumentEditor.test.tsx tests/mpaCreation.test.tsx tests/mpaBasicDetails.test.tsx tests/deploymentCategory.test.tsx tests/agentCategoryList.test.tsx tests/customCreateCategory.test.tsx tests/mpaDeletion.test.tsx", "check:i18n": "node scripts/check-i18n.mjs", "test:sandbox-download-coverage": "vitest run --coverage -c vitest.sandbox-download.config.ts", "test:mpa-cron-coverage": "vitest run --coverage -c vitest.mpa-cron.config.ts", diff --git a/frontend/server/deployment_resources.py b/frontend/server/deployment_resources.py index 822b71949..7beb2c297 100644 --- a/frontend/server/deployment_resources.py +++ b/frontend/server/deployment_resources.py @@ -20,6 +20,7 @@ import json from collections.abc import Callable, Mapping from contextlib import contextmanager +from types import SimpleNamespace from typing import Any, cast from urllib.parse import urlsplit @@ -486,6 +487,34 @@ def __init__( def _tos_client(self): if self._tos is None: + access_key, secret_key, session_token = self.credentials or ("", "", None) + if access_key and secret_key: + import tos + + from agentkit.platform import VolcConfiguration + + config = VolcConfiguration( + access_key=access_key, + secret_key=secret_key, + session_token=session_token, + region=self.region, + provider=self.provider, + ) + endpoint = config.get_service_endpoint("tos") + # TOSService does not accept explicit credentials. Preserve the + # shape consumed by _tos_buckets without SDK rediscovery. + self._tos = SimpleNamespace( + client=tos.TosClientV2( + access_key, + secret_key, + endpoint.host, + endpoint.region, + security_token=session_token or "", + ), + actual_region=endpoint.region, + ) + return self._tos + from agentkit.toolkit.volcengine.services.tos_service import ( TOSService, TOSServiceConfig, @@ -543,6 +572,7 @@ def list_resources( namespace: str = "", workspace_id: str = "", search: str = "", + name_prefix: str = "", page_number: int = 1, page_size: int = 100, ) -> dict[str, Any]: @@ -562,6 +592,10 @@ def list_resources( for item in _tos_buckets(client) if not item.get("Location") or item.get("Location") == service_region ] + if name_prefix: + all_items = [ + item for item in all_items if item["name"].startswith(name_prefix) + ] if search: normalized_search = search.casefold() all_items = [ @@ -988,6 +1022,7 @@ async def _deployment_resources(request: Request): namespace=str(request.query_params.get("namespace") or "").strip(), workspace_id=str(request.query_params.get("workspaceId") or "").strip(), search=str(request.query_params.get("search") or "").strip(), + name_prefix=str(request.query_params.get("namePrefix") or "").strip(), page_number=page_number, page_size=page_size, ) diff --git a/contracts/mpa-p0/benchmark-report.schema.json b/frontend/server/mpa/contracts/mpa-p0/benchmark-report.schema.json similarity index 100% rename from contracts/mpa-p0/benchmark-report.schema.json rename to frontend/server/mpa/contracts/mpa-p0/benchmark-report.schema.json diff --git a/contracts/mpa-p0/compatibility-matrix.json b/frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json similarity index 100% rename from contracts/mpa-p0/compatibility-matrix.json rename to frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json diff --git a/frontend/server/mpa/routes.py b/frontend/server/mpa/routes.py index 5c70a55b1..c142562f3 100644 --- a/frontend/server/mpa/routes.py +++ b/frontend/server/mpa/routes.py @@ -16,14 +16,22 @@ from __future__ import annotations +import asyncio +import inspect +import sys from collections.abc import Callable from dataclasses import dataclass -import inspect -from typing import Any +from typing import Any, Literal, NoReturn + +if sys.version_info >= (3, 11): + from asyncio import timeout +else: + from async_timeout import timeout from fastapi import Header, HTTPException, Query, Request, Response, status from pydantic import BaseModel, ConfigDict, Field +from frontend.server.mpa.operations import MpaOperationConflict, MpaOperationNotFound from frontend.server.mpa.runtime_client import ( MpaExecutionConfigChange, MpaProfile, @@ -35,12 +43,12 @@ MpaAgentOperationRequest, MpaAgentOperationService, ) -from frontend.server.mpa.operations import MpaOperationConflict -from frontend.server.mpa.operations import MpaOperationNotFound from veadk.integrations.mpa.control_plane_client import ( MpaAgentOperationRequest as MpaAgentOperationBody, ) +MPA_DELETE_PREVIEW_TIMEOUT_SECONDS = 25.0 + RuntimeAuthorizer = Callable[[Request, str, str], Any] RuntimeConnectionResolver = Callable[ [Request, str, str, Any], tuple[str, str, str, str] @@ -93,6 +101,7 @@ def mount_mpa_profile_routes( operation_service: MpaAgentOperationService | None = None, owner_resolver: Callable[[Request], str] | None = None, resolve_runtime_bindings: RuntimeBindingResolver | None = None, + resolve_delete_resources: Callable[[Any, str, str], Any] | None = None, ) -> None: def owner_id(request: Request) -> str: return owner_resolver(request) if owner_resolver is not None else "local" @@ -102,7 +111,7 @@ def operation_request( request: Request, mpa_instance_id: str, body: MpaAgentOperationBody, - operation_kind: str, + operation_kind: Literal["create", "update"], create: bool, ) -> MpaAgentOperationRequest: runtime = authorize_runtime(request, body.runtime_id, body.region) @@ -344,18 +353,29 @@ async def mpa_agent_delete_preview( runtime_id: str = Query(default="", alias="runtimeId"), region: str = Query(default="all"), ) -> dict[str, Any]: - return await _mpa_agent_delete_preview_payload( - request=request, - mpa_instance_id=mpa_instance_id, - runtime_id=runtime_id, - region=region, - runtime_client=runtime_client, - authorize_runtime=authorize_runtime, - resolve_runtime_connection=resolve_runtime_connection, - operation_service=operation_service, - owner=owner_id(request), - resolve_runtime_bindings=resolve_runtime_bindings, - ) + try: + async with timeout(MPA_DELETE_PREVIEW_TIMEOUT_SECONDS): + return await _mpa_agent_delete_preview_payload( + request=request, + mpa_instance_id=mpa_instance_id, + runtime_id=runtime_id, + region=region, + runtime_client=runtime_client, + authorize_runtime=authorize_runtime, + resolve_runtime_connection=resolve_runtime_connection, + operation_service=operation_service, + owner=owner_id(request), + resolve_runtime_bindings=resolve_runtime_bindings, + resolve_delete_resources=resolve_delete_resources, + ) + except asyncio.TimeoutError: + raise HTTPException( + status_code=504, + detail={ + "code": "mpa_delete_preview_timeout", + "message": "MPA deletion checks timed out. Check the management database, Runtime API and cloud read permissions, then retry.", + }, + ) from None @app.post( "/web/mpa/agent-operations/{operation_id}/retry", @@ -370,11 +390,14 @@ async def retry_agent_operation( raise HTTPException( status_code=503, detail="mpa_operation_service_unavailable" ) - operation_kind = str(body.operation_kind or "").strip() or ( + operation_kind_value = str(body.operation_kind or "").strip() or ( "update" if body.runtime_revision.strip() else "create" ) - if operation_kind not in {"create", "update"}: + if operation_kind_value not in {"create", "update"}: raise HTTPException(status_code=400, detail="invalid operationKind") + operation_kind: Literal["create", "update"] = ( + "create" if operation_kind_value == "create" else "update" + ) mpa_instance_id = body.mpa_instance_id or ( body.target_key if operation_kind == "update" else body.runtime_id ) @@ -604,8 +627,8 @@ def _result_payload(result: Any) -> dict[str, Any]: raise HTTPException(status_code=502, detail="runtime_invalid_response") -def _raise_runtime_error(error: MpaRuntimeError) -> None: - detail = { +def _raise_runtime_error(error: MpaRuntimeError) -> NoReturn: + detail: dict[str, Any] = { "code": error.code, "message": error.code, "requestId": error.request_id, @@ -615,7 +638,7 @@ def _raise_runtime_error(error: MpaRuntimeError) -> None: raise HTTPException(status_code=error.status_code, detail=detail) from error -def _raise_operation_conflict(error: MpaOperationConflict) -> None: +def _raise_operation_conflict(error: MpaOperationConflict) -> NoReturn: raise HTTPException( status_code=409, detail={ @@ -661,16 +684,7 @@ def _operation_blocks_delete( """Return whether a lifecycle operation still represents unsafe deletion work.""" if not operation: return False - status = str(operation.get("status") or "") - if status == "active": - return True - if status != "failed_retryable": - return False - if binding_status != "bound": - return True - if not profile: - return True - return str(profile.get("status") or "").casefold() != "applied" + return str(operation.get("status") or "") == "active" async def _runtime_bindings( @@ -762,6 +776,7 @@ async def _mpa_agent_delete_preview_payload( operation_service: MpaAgentOperationService | None, owner: str, resolve_runtime_bindings: RuntimeBindingResolver | None, + resolve_delete_resources: Callable[[Any, str, str], Any] | None = None, ) -> dict[str, Any]: active_operation = await _active_operation( operation_service, owner, mpa_instance_id @@ -804,24 +819,14 @@ async def _mpa_agent_delete_preview_payload( binding.region, binding.runtime, ) - profile = _result_payload( - await runtime_client.profile_status( - endpoint=endpoint, - mpa_instance_id=mpa_instance_id, - bearer_token=_bearer_value(bearer_token), - ) - ) sessions = await runtime_client.list_sessions( endpoint=endpoint, bearer_token=_bearer_value(bearer_token), include_a2a=True, + user_id=owner, ) except MpaRuntimeError as error: - if error.status_code == 404: - blockers.append("orphan_runtime") - binding_status = "orphan_runtime" - else: - _raise_runtime_error(error) + _raise_runtime_error(error) if _operation_blocks_delete( active_operation, binding_status=binding_status, @@ -830,7 +835,7 @@ async def _mpa_agent_delete_preview_payload( blockers.append("active_operation") if _active_session_payloads(sessions): blockers.append("active_sessions") - return _delete_preview_payload( + payload = _delete_preview_payload( mpa_instance_id=mpa_instance_id, binding_status=binding_status, runtime=binding.visible, @@ -840,6 +845,15 @@ async def _mpa_agent_delete_preview_payload( blockers=blockers, sessions=sessions, ) + if resolve_delete_resources is not None and not blockers: + resources = resolve_delete_resources( + binding.runtime, mpa_instance_id, binding.region + ) + if inspect.isawaitable(resources): + resources = await resources + payload["cleanupPlan"][-1:-1] = resources["cleanupPlan"] + payload["retainedResources"] = resources["retainedResources"] + return payload def _session_payload(session: Any) -> dict[str, Any]: @@ -858,7 +872,7 @@ def _session_payload(session: Any) -> dict[str, Any]: session_id = str( payload.get("sessionId") or payload.get("session_id") or payload.get("id") or "" ) - result = { + result: dict[str, Any] = { "sessionId": session_id, "status": str(payload.get("status") or ""), "appName": str(payload.get("appName") or payload.get("app_name") or ""), @@ -1037,13 +1051,13 @@ def _mpa_agent_view_payload( __all__ = [ + "_ACTIVE_SESSION_STATUSES", "MpaAgentOperationBody", "MpaProfileApplyBody", "MpaRuntimeBinding", "MpaRuntimeSessionBody", "MpaSessionExecutionConfigPatchBody", "MpaSessionProfileUpgradeBody", - "_ACTIVE_SESSION_STATUSES", "_active_operation", "_delete_preview_payload", "_mpa_agent_delete_preview_payload", diff --git a/frontend/server/mpa/runtime_client.py b/frontend/server/mpa/runtime_client.py index 2409d1015..595f810f0 100644 --- a/frontend/server/mpa/runtime_client.py +++ b/frontend/server/mpa/runtime_client.py @@ -205,11 +205,15 @@ async def list_sessions( endpoint: str, bearer_token: str, include_a2a: bool = True, + user_id: str = "", ) -> list[MpaRuntimeSessionSummary]: response = await self._request( "GET", f"{endpoint.rstrip('/')}/api/v1/sessions", - headers={"Authorization": f"Bearer {bearer_token}"}, + headers={ + "Authorization": f"Bearer {bearer_token}", + **({"x-user-id": user_id} if user_id else {}), + }, params={"include_a2a": "true" if include_a2a else "false"}, ) return self._session_list_result(response) @@ -220,11 +224,15 @@ async def delete_session( endpoint: str, session_id: str, bearer_token: str, + user_id: str = "", ) -> None: await self._request( "DELETE", f"{endpoint.rstrip('/')}/api/v1/sessions/{session_id}", - headers={"Authorization": f"Bearer {bearer_token}"}, + headers={ + "Authorization": f"Bearer {bearer_token}", + **({"x-user-id": user_id} if user_id else {}), + }, ) async def patch_session_execution_config( diff --git a/frontend/server/mpa_creation.py b/frontend/server/mpa_creation.py index 6d1b50766..66f70246b 100644 --- a/frontend/server/mpa_creation.py +++ b/frontend/server/mpa_creation.py @@ -21,6 +21,7 @@ from contextlib import asynccontextmanager from pathlib import Path from typing import Any +from typing import Literal from uuid import NAMESPACE_URL, UUID, uuid5 from fastapi import FastAPI, HTTPException, Request @@ -42,6 +43,7 @@ validate_runtime_name, with_creation_images, with_creation_resources, + with_creation_scaling, with_creation_tos, ) from veadk.integrations.mpa.managed.credentials import ( @@ -49,6 +51,28 @@ load_volcengine_credentials, ) from veadk.integrations.mpa.managed.tasks import CreationTasks, TaskError, owner_key +from veadk.integrations.mpa.managed.names import NameCheckError, check_creation_name +from veadk.integrations.mpa.managed.runtime import RuntimeCloud + + +def creation_agent_id(identity, request_id, explicit=""): + return ( + explicit + or "mi-" + uuid5(NAMESPACE_URL, f"veadk:mpa:{identity}:{request_id}").hex[:24] + ) + + +class NameCheckRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + requestId: UUID + name: str = Field(min_length=4, max_length=64) + agentId: str = Field(default="", pattern=r"^[a-z0-9][a-z0-9_-]{0,63}$") + region: str = Field(pattern=r"^(cn-[a-z]+|ap-southeast-1)$", max_length=32) + + @field_validator("name") + @classmethod + def validate_name(cls, value): + return validate_runtime_name(value) def _studio_task_path(provider="volcengine") -> Path: @@ -68,6 +92,7 @@ class CreationRequest(BaseModel): agentId: str = Field(default="", pattern=r"^[a-z0-9][a-z0-9_-]{0,63}$") name: str = "" description: str = Field(default="", max_length=512) + maxInstance: int | None = Field(default=None, strict=True, ge=1, le=2**53 - 1) region: str = Field(pattern=r"^(cn-[a-z]+|ap-southeast-1)$", max_length=32) runtimeImage: str = Field(default="", max_length=1024) workerImage: str = Field(default="", max_length=1024) @@ -76,9 +101,10 @@ class CreationRequest(BaseModel): openvikingUrl: str = Field(default="", max_length=1024) openvikingResourceId: str = Field(default="", max_length=128) openvikingApiKey: str = Field(default="", max_length=512, repr=False) - tosAccessKey: str = Field(default="", max_length=256, repr=False) - tosSecretKey: str = Field(default="", max_length=256, repr=False) - tosBucket: str = Field(default="", max_length=256) + openvikingMode: Literal["manual", "auto"] = "manual" + businessWorkspaceMode: Literal["shared", "per-agent"] = "shared" + businessDatabaseName: Literal["", "aidb"] = "" + tosBucket: str = Field(default="", max_length=63) @field_validator("runtimeImage", "workerImage") @classmethod @@ -142,6 +168,49 @@ async def inspect(request: Request, region: str): except ConfigurationError as exc: return {"configured": False, "region": region, "error": str(exc)} + async def check_name(body, config, studio_owner, saved_scope=None): + identity = owner_key(studio_owner) + agent_id = creation_agent_id(identity, body.requestId) + if body.agentId and body.agentId != agent_id: + raise ConfigurationError( + "New dedicated requests require the server-generated creation identity" + ) + account = await check_creation_name( + config, + RuntimeCloud( + region=config.region, + credential_file=config.managed.credential_file, + provider=provider, + ), + agent_id=agent_id, + name=body.name, + owner=studio_owner, + verified_creation_account=(saved_scope or {}).get("account", ""), + ) + scope = {"provider": provider, "account": account, "region": config.region} + get_tasks().check_name( + identity, {"requestId": str(body.requestId), "name": body.name}, scope + ) + return scope + + @app.post("/web/mpa-creation/name-check") + async def name_availability(request: Request, body: NameCheckRequest): + studio_owner = owner(request) + try: + _, config = profile(body.region) + config = with_creation_resources( + config, + {"businessWorkspaceMode": "per-agent", "businessDatabaseName": "aidb"}, + ) + await check_name(body, config, studio_owner) + return {"available": True} + except NameCheckError as exc: + raise HTTPException( + 409 if exc.key == "runtimeNameTaken" else 503, {"code": exc.key} + ) from None + except ConfigurationError as exc: + raise HTTPException(400, str(exc)) from None + @app.post("/web/mpa-creation/tasks", status_code=202) async def create(request: Request): studio_runtime_owner = owner(request) @@ -157,24 +226,27 @@ async def create(request: Request): raise HTTPException(422, "Invalid MPA creation request") from None try: path, config = profile(body.region) + config = with_creation_scaling(config, body.maxInstance) payload = body.model_dump(mode="json") + if payload["maxInstance"] is None: + payload.pop("maxInstance") + if payload["openvikingMode"] == "manual": + payload.pop("openvikingMode") + if payload["businessWorkspaceMode"] == "shared": + payload.pop("businessWorkspaceMode") + if not payload["businessDatabaseName"]: + payload.pop("businessDatabaseName") if provider == "byteplus": payload["provider"] = provider if not payload["agentId"]: - payload["agentId"] = ( - "mi-" - + uuid5( - NAMESPACE_URL, f"veadk:mpa:{identity}:{body.requestId}" - ).hex[:24] - ) + payload["agentId"] = creation_agent_id(identity, body.requestId) if not payload["name"]: # Keep the exact input shape of already-submitted legacy tasks. payload.pop("name") - tos = { - field: payload.pop(field) - for field in ("tosAccessKey", "tosSecretKey", "tosBucket") - } - with_creation_resources(config, payload) + tos = {"tosBucket": payload.get("tosBucket", "")} + if not payload["tosBucket"]: + payload.pop("tosBucket") + selected_config = with_creation_resources(config, payload) openviking_api_key = payload.pop("openvikingApiKey") resources = validate_creation_resources( {**payload, "openvikingApiKey": openviking_api_key} @@ -191,6 +263,20 @@ async def create(request: Request): else: payload.pop(field) with_creation_tos(with_creation_images(config, images), tos) + name_options = {} + if body.businessDatabaseName == "aidb": + saved_scope = get_tasks().name_scope_for_request(identity, payload) + if saved_scope: + get_tasks().check_name( + identity, + {"requestId": str(body.requestId), "name": body.name}, + saved_scope, + ) + name_options["name_scope"] = saved_scope + else: + name_options["name_scope"] = await check_name( + body, selected_config, studio_runtime_owner + ) return await get_tasks().start( identity, payload, @@ -200,12 +286,29 @@ async def create(request: Request): secrets={"openvikingApiKey": openviking_api_key}, studio_runtime_owner=studio_runtime_owner, tos=tos, + **name_options, ) + except NameCheckError as exc: + raise HTTPException( + 409 if exc.key == "runtimeNameTaken" else 503, {"code": exc.key} + ) from None except ConfigurationError as exc: raise HTTPException(400, str(exc)) from None except TaskError as exc: raise HTTPException(409, str(exc)) from None + @app.get("/web/mpa-creation/tasks") + async def list_tasks( + request: Request, region: str = "", limit: int = 10 + ) -> dict[str, Any]: + identity = owner_key(owner(request)) + bounded_limit = max(1, min(limit, 50)) + return { + "tasks": get_tasks().list( + identity, region=region.strip(), limit=bounded_limit + ) + } + @app.get("/web/mpa-creation/tasks/{task_id}") async def status(request: Request, task_id: str): identity = owner_key(owner(request)) diff --git a/frontend/server/mpa_deletion_status.py b/frontend/server/mpa_deletion_status.py new file mode 100644 index 000000000..c00e1f7c6 --- /dev/null +++ b/frontend/server/mpa_deletion_status.py @@ -0,0 +1,182 @@ +# 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. + +"""Bounded, read-only confirmation for an authorized MPA deletion attempt.""" + +from __future__ import annotations + +import asyncio +import hashlib +import json +import sys +import threading +import time +from collections import OrderedDict +from collections.abc import Callable, Mapping +from typing import Any + +from fastapi import FastAPI, HTTPException, Query, Request +from fastapi.responses import JSONResponse + +if sys.version_info >= (3, 11): + from asyncio import timeout +else: + from async_timeout import timeout + +_CONTEXT_TTL = 3600 +_CONTEXT_LIMIT = 1024 +_CHECK_TIMEOUT = 30 +_MISSING_CODE = "InvalidAgentKitRuntime.NotFound" + + +def runtime_not_found(error: BaseException) -> bool: + """Recognize a provider code, never a message containing the words NotFound.""" + seen: set[int] = set() + current: BaseException | None = error + while current is not None and len(seen) < 8 and id(current) not in seen: + seen.add(id(current)) + code = getattr(current, "error_code", None) + if code: + return code == _MISSING_CODE + for candidate in ( + getattr(current, "body", None), + getattr(current, "data", None), + *current.args, + ): + if isinstance(candidate, (str, bytes)): + try: + candidate = json.loads(candidate) + except (TypeError, ValueError, UnicodeError): + continue + if not isinstance(candidate, Mapping): + continue + metadata = candidate.get("ResponseMetadata") + detail = metadata.get("Error") if isinstance(metadata, Mapping) else None + if isinstance(detail, Mapping) and detail.get("Code"): + return detail["Code"] == _MISSING_CODE + current = current.__cause__ + return False + + +def mount_mpa_deletion_status( + app: FastAPI, + *, + owner: Callable[[Request], str], + get_runtime: Callable[[Request, str, str], Any], + list_page: Callable[[str, str], Mapping[str, Any]], + credentials: Callable[[], tuple[str, str, str | None]], + region: Callable[[str], str], +) -> Callable[[Request, str, str], None]: + contexts: OrderedDict[tuple[str, str, str], tuple[str, float]] = OrderedDict() + lock = threading.Lock() + + def fingerprint() -> str: + return hashlib.sha256(json.dumps(credentials()).encode()).hexdigest() + + def remember(request: Request, runtime_id: str, selected_region: str) -> None: + key = (owner(request), runtime_id, selected_region) + value = (fingerprint(), time.monotonic()) + with lock: + contexts.pop(key, None) + contexts[key] = value + while len(contexts) > _CONTEXT_LIMIT: + contexts.popitem(last=False) + + def require_context(key: tuple[str, str, str]) -> None: + current_fingerprint = fingerprint() + with lock: + value = contexts.get(key) + if ( + value is None + or time.monotonic() - value[1] > _CONTEXT_TTL + or value[0] != current_fingerprint + ): + raise ValueError("Deletion confirmation context is unavailable") + + normalize_region = region + + @app.get("/web/mpa-runtime-deletion-status") + async def status( + request: Request, + runtimeId: str = Query(min_length=1, max_length=128), + region: str = Query(min_length=1, max_length=64), + ) -> JSONResponse: + identity = owner(request) + selected_region = normalize_region(region) + key = (identity, runtimeId, selected_region) + try: + require_context(key) + deleted = False + async with timeout(_CHECK_TIMEOUT): + try: + await asyncio.to_thread( + get_runtime, request, runtimeId, selected_region + ) + except HTTPException: + raise + except Exception as error: + if not runtime_not_found(error): + raise + token = "" + seen: set[str] = set() + for _ in range(20): + page = await asyncio.to_thread( + list_page, selected_region, token + ) + require_context(key) + rows = page.get("AgentKitRuntimes") + if not isinstance(rows, list): + raise ValueError("Incomplete Runtime listing") + for row in rows: + ident = ( + row.get("RuntimeId") + if isinstance(row, Mapping) + else None + ) + if not isinstance(ident, str) or not ident: + raise ValueError("Incomplete Runtime identity") + if ident == runtimeId: + break + else: + next_token = page.get("NextToken") + if next_token is None: + next_token = "" + if not isinstance(next_token, str) or next_token in seen: + raise ValueError("Invalid Runtime pagination") + if not next_token: + deleted = True + break + seen.add(next_token) + token = next_token + continue + break + else: + raise ValueError("Runtime listing budget exhausted") + require_context(key) + return JSONResponse( + {"deleted": deleted}, headers={"Cache-Control": "no-store"} + ) + except HTTPException: + raise + except Exception: + raise HTTPException( + 503, + { + "code": "mpa_deletion_unconfirmed", + "message": "Runtime deletion is not confirmed; check again later.", + }, + headers={"Cache-Control": "no-store"}, + ) from None + + return remember diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 921b6aa13..5981e267c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2309,6 +2309,7 @@ export default function App() { ); const [runtimeUpdateTarget, setRuntimeUpdateTarget] = useState<{ runtimeId: string; + agentCategory?: "general" | "mpa"; mpaInstanceId?: string; name: string; region: string; @@ -6692,6 +6693,7 @@ export default function App() { setFocusedWorkspaceAgentId(""); setRuntimeUpdateTarget({ runtimeId: target.runtimeId, + agentCategory: "mpa", mpaInstanceId: target.mpaInstanceId, name: target.name, region: target.region, @@ -7619,6 +7621,7 @@ export default function App() { /> ) : applicationsView === "mpa-channels" ? ( setApplicationsView("catalog")} @@ -7893,6 +7896,13 @@ export default function App() { setFocusedWorkspaceAgentId(""); setRuntimeUpdateTarget({ runtimeId: capability.runtime.runtimeId, + agentCategory: [ + ...(detailAgentEntry ? [detailAgentEntry] : []), + ...orderedWorkspaceAgentEntries, + ].find((entry) => + entry.runtimeId === capability.runtime.runtimeId && + entry.region === capability.runtime.region, + )?.agentCategory ?? "general", mpaInstanceId: capability.runtime.mpaInstanceId, name: capability.runtime.name || diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index 5cc260ed5..afb78f8bf 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -2650,7 +2650,9 @@ export interface MpaAgentDeletePreview { stage: string; description: string; count: number; + resourceId?: string; }>; + retainedResources?: Array<{ stage: string; resourceId: string; reason: string }>; } export interface MpaRuntimeConsoleRun { @@ -3264,6 +3266,7 @@ export interface DeploymentResourceQuery { namespace?: string; workspaceId?: string; search?: string; + namePrefix?: string; pageNumber?: number; pageSize?: number; } @@ -3284,6 +3287,7 @@ export async function listDeploymentResources( if (query.namespace) params.set("namespace", query.namespace); if (query.workspaceId) params.set("workspaceId", query.workspaceId); if (query.search) params.set("search", query.search); + if (query.namePrefix) params.set("namePrefix", query.namePrefix); if (query.pageNumber) params.set("pageNumber", String(query.pageNumber)); if (query.pageSize) params.set("pageSize", String(query.pageSize)); const response = await apiFetch( @@ -5880,16 +5884,42 @@ export async function deleteRuntime( region: string, opts: { agentCategory?: "general" | "mpa"; mpaInstanceId?: string } = {}, ): Promise { - const res = await apiFetch("/web/delete-runtime", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - runtimeId, - region, - agentCategory: opts.agentCategory, - mpaInstanceId: opts.mpaInstanceId, - }), - }); + const isMpa = opts.agentCategory === "mpa"; + let res: Response; + try { + res = await apiFetch( + "/web/delete-runtime", + { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + runtimeId, + region, + agentCategory: opts.agentCategory, + mpaInstanceId: opts.mpaInstanceId, + }), + }, + {}, + isMpa ? 180_000 : DEFAULT_REQUEST_TIMEOUT_MS, + ); + } catch (error) { + if (!isMpa || !(error instanceof Error) || error.name !== "TimeoutError") + throw error; + try { + const params = new URLSearchParams({ runtimeId, region }); + const status = await apiFetch( + `/web/mpa-runtime-deletion-status?${params.toString()}`, + { cache: "no-store" }, + ); + if (status.ok) { + const result: { deleted?: unknown } | null = await status.json(); + if (result?.deleted === true) return; + } + } catch { + // An unavailable confirmation must not imply successful deletion. + } + throw new Error(adkT("client.mpaDeleteUnconfirmed")); + } if (!res.ok) { const t = await res.text().catch(() => ""); throw new Error(t || adkT("client.deleteFailed", { status: res.status })); @@ -6566,7 +6596,7 @@ export async function updateSandboxTool(kind: SandboxToolKind): Promise<{ export type ChannelScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; -export interface ChannelCapabilities { channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; multiBotChannels?: string[]; accountScopedPermissions?: boolean; } +export interface ChannelCapabilities { feishuDomains?: string[]; channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; multiBotChannels?: string[]; accountScopedPermissions?: boolean; } export interface FeishuBinding { id: string; status: "PENDING" | "SCANNED" | "AUTHORIZED" | "REGISTERING" | "BOUND" | "FAILED" | "EXPIRED"; diff --git a/frontend/src/adk/feishuAccounts.ts b/frontend/src/adk/feishuAccounts.ts index 0f3edf259..740de242e 100644 --- a/frontend/src/adk/feishuAccounts.ts +++ b/frontend/src/adk/feishuAccounts.ts @@ -10,6 +10,7 @@ export interface FeishuAccount { export async function listFeishuAccounts( ep: AdkEndpoint, signal: AbortSignal, + domain?: "feishu" | "lark", ): Promise { const data = await channelRequest<{ channels: unknown[] }>(ep, "", { signal, @@ -21,6 +22,13 @@ export async function listFeishuAccounts( if (!value || typeof value !== "object" || !("channel" in value)) throw new ChannelApiError(502); if (value.channel !== "feishu") continue; + const config = + "config" in value && value.config && typeof value.config === "object" + ? value.config + : {}; + const brand = "domain" in config ? config.domain : "feishu"; + if (brand !== "feishu" && brand !== "lark") throw new ChannelApiError(502); + if (domain && brand !== domain) continue; if ( !("appId" in value) || typeof value.appId !== "string" || diff --git a/frontend/src/adk/mpaCreation.ts b/frontend/src/adk/mpaCreation.ts index 7f19aee3e..31feb60e6 100644 --- a/frontend/src/adk/mpaCreation.ts +++ b/frontend/src/adk/mpaCreation.ts @@ -8,6 +8,7 @@ export interface MpaCreationInput { name?: string; agentId?: string; description: string; + maxInstance?: number; region: string; runtimeImage?: string; workerImage?: string; @@ -15,22 +16,29 @@ export interface MpaCreationInput { pgPort?: string; openvikingUrl?: string; openvikingResourceId?: string; - tosAccessKey?: string; - tosSecretKey?: string; + openvikingMode?: "manual" | "auto"; + businessWorkspaceMode?: "shared" | "per-agent"; + businessDatabaseName?: "aidb"; tosBucket?: string; } export interface MpaCreationRequest extends MpaCreationInput { openvikingApiKey?: string; } export interface MpaCreationTask - extends Omit< - MpaCreationInput, - "tosAccessKey" | "tosSecretKey" | "tosBucket" - > { + extends MpaCreationInput { taskId: string; state: "running" | "cancelling" | "succeeded" | "failed" | "cancelled"; stage: string; error?: string; + latestDiagnostic?: { + stage: string; + operation: string; + category: string; + attempt: number; + outcome: string; + errorCode?: string; + requestId?: string; + }; images?: { runtimeImage?: string; workerImage?: string }; result?: { runtime_id?: string; @@ -47,6 +55,9 @@ export interface MpaCreationConfig { pgHost?: string; pgPort?: string; postgresMode?: "auto"; + businessWorkspaceMode?: "per-agent"; + businessDatabaseName?: "aidb"; + openvikingMode?: "auto"; postgresMigrationRequired?: boolean; postgresLayout?: "split-workspaces"; adminWorkspaceName?: string; @@ -57,6 +68,7 @@ export class MpaCreationRequestError extends Error { constructor( readonly status: number, message: string, + readonly code?: string, ) { super(message); this.name = "MpaCreationRequestError"; @@ -83,6 +95,7 @@ async function request( typeof value.detail === "string" ? value.detail : `HTTP ${response.status}`, + typeof value.detail?.code === "string" ? value.detail.code : undefined, ); } return response.json() as Promise; @@ -96,6 +109,15 @@ export const startMpaCreation = ( input: MpaCreationRequest, signal: AbortSignal, ) => request("tasks", signal, input); +export const listMpaCreations = (region: string, signal: AbortSignal) => + request<{ tasks: MpaCreationTask[] }>( + `tasks?region=${encodeURIComponent(region)}`, + signal, + ); +export const checkMpaCreationName = ( + input: Pick, + signal: AbortSignal, +) => request<{ available: boolean }>("name-check", signal, input); export const getMpaCreation = (id: string, signal: AbortSignal) => request(`tasks/${encodeURIComponent(id)}`, signal); export const cancelMpaCreation = (id: string, signal: AbortSignal) => diff --git a/frontend/src/automations/mpa-channels/MpaChannelsAutomation.tsx b/frontend/src/automations/mpa-channels/MpaChannelsAutomation.tsx index 5afbcd36f..a359f3862 100644 --- a/frontend/src/automations/mpa-channels/MpaChannelsAutomation.tsx +++ b/frontend/src/automations/mpa-channels/MpaChannelsAutomation.tsx @@ -1,3 +1,4 @@ +import type { CloudProvider } from "../../adk/cloudProvider"; import { useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { @@ -16,6 +17,7 @@ import "../../ui/ProjectPreview.css"; import "./MpaChannelsAutomation.css"; interface MpaChannelsAutomationProps { + cloudProvider?: CloudProvider; role: StudioRole; runtimeScope: RuntimeScope; onBack: () => void; @@ -25,6 +27,7 @@ const runtimeKey = (runtime: CloudRuntime) => `${runtime.region}:${runtime.runtimeId}`; export function MpaChannelsAutomation({ + cloudProvider = "volcengine", role, runtimeScope, onBack, @@ -61,8 +64,9 @@ export function MpaChannelsAutomation({
{authorized ? ( ) : (

@@ -74,7 +78,13 @@ export function MpaChannelsAutomation({ ); } -function MpaChannelSelector({ runtimeScope }: { runtimeScope: RuntimeScope }) { +function MpaChannelSelector({ + runtimeScope, + cloudProvider, +}: { + runtimeScope: RuntimeScope; + cloudProvider: CloudProvider; +}) { const { t, i18n } = useTranslation("automations"); const [runtimes, setRuntimes] = useState([]); const [selectedKey, setSelectedKey] = useState(""); @@ -257,6 +267,7 @@ function MpaChannelSelector({ runtimeScope }: { runtimeScope: RuntimeScope }) { runtimeId={selected.runtimeId} region={selected.region} showHeader={false} + cloudProvider={cloudProvider} /> ) : loaded && runtimes.length > 0 ? (

diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 0ba5ea928..a690df36c 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -47,6 +47,7 @@ import { emptyDraft, } from "./types"; import { createT } from "./i18n"; +import { deploymentAgentCategory } from "./agentDraftStorage"; import { HARNESS_SIDECAR_OPTIONS, HARNESS_SIDECAR_OPTION_GROUPS, @@ -3946,6 +3947,7 @@ interface CustomCreateProps extends CreateModeProps { /** Existing Runtime target when editing an Agent from the library. */ deploymentTarget?: { runtimeId: string; + agentCategory?: "general" | "mpa"; mpaInstanceId?: string; name: string; region: string; @@ -3990,6 +3992,7 @@ export function CustomCreate({ onDiscard, }: CustomCreateProps) { const { t } = useTranslation("create"); + const isMpaDeployment = deploymentAgentCategory(deploymentTarget) === "mpa"; void onCreate; // outcome is the in-pane project preview, not a navigation void onDiscard; // the discard action is intentionally hidden in this flow const isVulcanCreation = @@ -5119,7 +5122,7 @@ export function CustomCreate({ runtimeId: deploymentTarget?.runtimeId, runtimeName: options?.runtimeName ?? deploymentRuntimeName, appName: deploymentTarget?.appName, - agentCategory: "mpa", + agentCategory: deploymentAgentCategory(deploymentTarget), editMode: deploymentTarget?.editMode, draft: deploymentTarget || mcpGatewayManaged ? codegenDraft(draft) : undefined, @@ -5324,8 +5327,8 @@ export function CustomCreate({ region: deploymentTarget?.region ?? deployRegion, startedAt, agentDraft: deploymentDraft, - mpaProfile: true, - mpaSmoke: !deploymentTarget, + mpaProfile: isMpaDeployment, + mpaSmoke: isMpaDeployment && !deploymentTarget, }; const initialTask: DeploymentTaskUpdate = { ...taskBase, @@ -5339,7 +5342,7 @@ export function CustomCreate({ onDeploymentTaskChange?.(initialTask); onDeploymentStarted?.(initialTask); - if (deploymentTarget?.mpaProfileOnly) { + if (isMpaDeployment && deploymentTarget?.mpaProfileOnly) { latestPhase = "profile_applying"; latestLabel = t("traditional.deployment.stages.applyMpaProfile"); latestMessage = t("traditional.deployment.applyingMpaProfile"); @@ -5356,7 +5359,7 @@ export function CustomCreate({ label: latestLabel, message: latestMessage, pct: 0, - mpaProfile: true, + mpaProfile: isMpaDeployment, mpaSmoke: false, }); const operationKind = deploymentTarget.etag ? "update" : "create"; @@ -5398,7 +5401,7 @@ export function CustomCreate({ label: t("traditional.deployment.complete"), message: t("traditional.deployment.mpaProfileApplied"), pct: 100, - mpaProfile: true, + mpaProfile: isMpaDeployment, mpaSmoke: false, }); await onDeploymentComplete?.({ @@ -5476,7 +5479,7 @@ export function CustomCreate({ const mpaRegion = result.region || deploymentTarget?.region || deployRegion; latestRuntimeId = mpaRuntimeId || latestRuntimeId; latestRegion = mpaRegion; - if (mpaRuntimeId) { + if (isMpaDeployment && mpaRuntimeId) { latestPhase = "profile_applying"; latestLabel = t("traditional.deployment.stages.applyMpaProfile"); latestMessage = t("traditional.deployment.applyingMpaProfile"); @@ -5496,8 +5499,8 @@ export function CustomCreate({ label: latestLabel, message: latestMessage, pct: 0, - mpaProfile: true, - mpaSmoke: !deploymentTarget, + mpaProfile: isMpaDeployment, + mpaSmoke: isMpaDeployment && !deploymentTarget, }); const mpaOperation = await applyMpaProfileAfterDeployment({ draft: deploymentDraft, @@ -5563,8 +5566,8 @@ export function CustomCreate({ : t("traditional.deployment.failed"), message: retried.safeErrorCode || undefined, pct: 100, - mpaProfile: true, - mpaSmoke: !deploymentTarget, + mpaProfile: isMpaDeployment, + mpaSmoke: isMpaDeployment && !deploymentTarget, operationId: retried.operationId, }); if (retried.status !== "succeeded") { @@ -5599,7 +5602,7 @@ export function CustomCreate({ label: latestLabel, message: latestMessage, pct: 100, - mpaProfile: true, + mpaProfile: isMpaDeployment, mpaSmoke: true, }); latestPhase = "runnable"; @@ -5633,7 +5636,7 @@ export function CustomCreate({ ? t("traditional.deployment.mpaReady") : completeResult.warnings?.join(";"), pct: 100, - mpaProfile: true, + mpaProfile: isMpaDeployment, mpaSmoke: Boolean(completeResult.mpaOperation && !deploymentTarget), }); await onDeploymentComplete?.(completeResult); @@ -5656,8 +5659,8 @@ export function CustomCreate({ phase: latestPhase, label: t("traditional.deployment.failed"), message, - mpaProfile: true, - mpaSmoke: !deploymentTarget, + mpaProfile: isMpaDeployment, + mpaSmoke: isMpaDeployment && !deploymentTarget, operationId: undefined, retry: failedMpaRetry ?? (() => deployFromNewWorkbench(deploymentOptions)), }; @@ -5779,7 +5782,7 @@ export function CustomCreate({ deployRegion={deployRegion} runtimeName={deploymentRuntimeName} isRuntimeUpdate={Boolean(deploymentTarget)} - profileOnly={deploymentTarget?.mpaProfileOnly} + profileOnly={isMpaDeployment && deploymentTarget?.mpaProfileOnly} deploying={newWorkbenchDeploying} deployStage={newWorkbenchDeployStage} deployError={newWorkbenchDeployError} @@ -6865,6 +6868,7 @@ export function CustomCreate({ cloudProvider={cloudProvider} project={project} agentDraft={draft} + agentCategory={deploymentAgentCategory(deploymentTarget)} agentName={draft.name || t("traditional.basic.unnamedAgent")} agentCount={countDraftAgents(draft)} releaseConfiguration={ diff --git a/frontend/src/create/agentDraftStorage.ts b/frontend/src/create/agentDraftStorage.ts index 28754a845..c3ff2ab3b 100644 --- a/frontend/src/create/agentDraftStorage.ts +++ b/frontend/src/create/agentDraftStorage.ts @@ -26,6 +26,7 @@ export interface WorkspaceAgentDraft { creationMode?: WorkspaceAgentCreationMode; deploymentTarget?: { runtimeId: string; + agentCategory?: "general" | "mpa"; mpaInstanceId?: string; name: string; region: string; @@ -65,6 +66,13 @@ function isWorkspaceAgentDraft(value: unknown): value is WorkspaceAgentDraft { ); } +/** Only explicit deployment intent enables the MPA lifecycle. */ +export function deploymentAgentCategory( + target?: { agentCategory?: "general" | "mpa"; mpaProfileOnly?: boolean }, +): "general" | "mpa" { + return target?.agentCategory ?? (target?.mpaProfileOnly === true ? "mpa" : "general"); +} + export function workspaceAgentCreationMode( item: WorkspaceAgentDraft, ): WorkspaceAgentCreationMode { diff --git a/frontend/src/i18n/resources/en-US/adk.json b/frontend/src/i18n/resources/en-US/adk.json index 003059cc0..bd6a22531 100644 --- a/frontend/src/i18n/resources/en-US/adk.json +++ b/frontend/src/i18n/resources/en-US/adk.json @@ -532,6 +532,7 @@ "runtimeApiKeyMissing": "The Runtime did not return a usable API key", "loadMcpCredentialsFailed": "Failed to load MCP authentication", "invalidMcpCredentials": "Studio returned invalid MCP authentication data", + "mpaDeleteUnconfirmed": "The deletion request timed out and Runtime deletion is not confirmed. Cleanup may still be running; refresh and check again later.", "deleteFailed": "Delete failed ({{status}})", "runtimeManageForbidden": "This account cannot manage the Runtime.", "runtimeNotFound": "The Runtime does not exist or has been deleted.", diff --git a/frontend/src/i18n/resources/en-US/ui.json b/frontend/src/i18n/resources/en-US/ui.json index fc6ef3926..1df2bef0f 100644 --- a/frontend/src/i18n/resources/en-US/ui.json +++ b/frontend/src/i18n/resources/en-US/ui.json @@ -405,7 +405,7 @@ "deleteDraftDescription": "Delete draft “{{name}}”?", "deleteAgent": "Delete Agent", "closeDeleteConfirmation": "Close delete confirmation", - "mpaDeletePreviewSummary": "Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.", + "mpaDeletePreviewSummary": "Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.", "mpaDeletePreviewSessions": "Sessions", "mpaDeletePreviewActiveSessions": "Active", "mpaDeletePreviewIdleSessions": "Idle", @@ -418,7 +418,9 @@ "mpaDeleteStage": { "runtime_sessions": "Delete {{count}} visible idle Runtime sessions", "runtime_diagnostics": "Remove diagnostics and mounted metadata owned by those sessions", - "agentkit_runtime": "Delete the AgentKit Runtime" + "agentkit_runtime": "Delete the AgentKit Runtime", + "worker_template": "Delete exclusive sandbox template", + "skill_space": "Delete exclusive Skill Space (including its skills)" }, "draftDeletionWarning": "The draft will be removed from this browser.", "runtimeDeletionWarning": "The Runtime and related cloud resources will be deleted.", @@ -543,6 +545,14 @@ "updateConfigRestoring": "Restoring update configuration", "updateUnsupported": "This Runtime cannot be updated", "usageMismatch": "The returned usage data does not match this Agent" + }, + "mpaDeleteChecking": "Checking sessions and resource ownership…", + "mpaDeleteRetryPreview": "Check again", + "mpaDeletePreviewFailed": "Deletion checks failed. Resolve the error below and check again.", + "mpaDeleteRetained": "Resources to retain", + "mpaDeleteRetainedReason": { + "shared": "Referenced by another agent", + "unproven": "Exclusive managed ownership could not be verified" } }, "environmentCenter": { @@ -1594,6 +1604,9 @@ }, "wakingHint": "Waking the agent. This may take some time.", "mpaCreate": { + "maxInstance": "Maximum instances", + "maxInstanceHelp": "Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.", + "maxInstanceInvalid": "Maximum instances must be an integer of at least 1.", "name": "Name", "namePlaceholder": "e.g. test-agent", "nameHelp": "Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.", @@ -1623,12 +1636,12 @@ "openvikingInvalid": "Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.", "openvikingCredentials": "The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.", "tosTitle": "Session output storage", - "tosDescription": "Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.", - "tosAccessKey": "TOS Access Key", - "tosSecretKey": "TOS Secret Key", + "tosDescription": "Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.", "tosBucket": "TOS bucket", - "tosInvalid": "TOS Access Key, Secret Key, and bucket are all required together.", - "tosCredentials": "Credentials are used only for this creation and are not saved in browser recovery data or creation task records.", + "tosInvalid": "Select an available bucket starting with agentkit-platform-.", + "tosCredentials": "Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.", + "tosDisable": "Clear bucket selection", + "tosBucketUnavailable": "The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.", "runtimeImage": "MPA image", "workerImage": "Worker image", "imageDefault": "Leave blank to use the configured image", @@ -1660,9 +1673,11 @@ "iamTrustConflict": "The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.", "iamPolicyConflict": "An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.", "iamOwnershipConflict": "The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.", + "iamTemporaryFailure": "IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.", "iamVerificationFailed": "Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.", "iamConfigurationConflict": "Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.", "creationFailed": "This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.", + "configurationChanged": "This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.", "cancelFailed": "Cancellation failed. Check the current progress and retry.", "cancelled": "Creation cancelled. Registered resources are retained for retry.", "timeout": "Creation timed out. Registered resources are retained. Inspect them before retrying.", @@ -1688,12 +1703,33 @@ "verifying": "Waiting for agent readiness", "admin_workspace": "Prepare management PG Workspace", "business_workspace": "Prepare business PG Workspace", - "admin_database": "Initialize shared management database" + "admin_database": "Initialize shared management database", + "openviking": "Preparing OpenViking library", + "openviking_key": "Preparing OpenViking credentials" }, "back": "Keep creating", "pgAutoDescription": "VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.", + "pgPerAgentDescription": "Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.", + "pgAidbDescription": "Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.", + "runtimeNameTaken": "This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.", + "runtimeNameCheckFailed": "Unable to check this name. Check resource query permissions and connectivity, then retry.", "pgModeChanged": "This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.", - "pgMigrationRequired": "An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration." + "pgMigrationRequired": "An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.", + "openvikingAutoDescription": "An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.", + "openvikingAutoByteplusDescription": "Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.", + "openvikingAutoByteplusRequirements": "Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.", + "openvikingModelEndpointsInvalid": "Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.", + "openvikingAutoBilling": "Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.", + "openvikingPermissionDenied": "OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.", + "openvikingConfigurationConflict": "OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.", + "openvikingCreateUnknown": "The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.", + "openvikingNotReady": "OpenViking is still initializing. Wait, then retry this agent to continue with the same library.", + "openvikingResourceFailed": "OpenViking initialization failed. Check the library status and model configuration in the console before retrying.", + "openvikingResourceMissing": "The registered OpenViking library or default user was not found. Check its binding and availability before retrying.", + "openvikingModelConfigurationRejected": "The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.", + "openvikingUnavailable": "OpenViking could not be reached. Check the service and network, then retry.", + "openvikingInvalidResponse": "OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.", + "openvikingQuotaExceeded": "OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later." } }, "skillCenter": { @@ -1993,7 +2029,7 @@ "routeDescription": "Routing configuration for delivering messages to this Agent.", "deliveryDescription": "Observed reply delivery; configuration alone does not confirm delivery.", "groupsTitle": "Group access", - "groupsDescription": "Allow specific groups and choose how conversations are shared.", + "groupsDescription": "Allow specific groups to access this agent.", "providerBindingTitle": "Connect {{name}}", "providerUnbound": "Connect a {{name}} bot to let users message this agent.", "qrGuidance": "Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.", @@ -2036,6 +2072,10 @@ "noAccounts": "No Feishu bots are bound.", "accountsFailed": "Could not load bots. Try again.", "accountConflict": "The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.", - "multiBotPairingDescription": "Binding a new Feishu app adds a bot. Binding the same App ID updates that bot." + "multiBotPairingDescription": "Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.", + "provider_lark": "Lark", + "larkPairingDescription": "Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.", + "larkAccountsTitle": "Lark bots", + "noLarkAccounts": "No Lark bots are bound." } } diff --git a/frontend/src/i18n/resources/zh-CN/adk.json b/frontend/src/i18n/resources/zh-CN/adk.json index 358ffccb7..6ed75f305 100644 --- a/frontend/src/i18n/resources/zh-CN/adk.json +++ b/frontend/src/i18n/resources/zh-CN/adk.json @@ -532,6 +532,7 @@ "runtimeApiKeyMissing": "Runtime 未返回可用的 API Key", "loadMcpCredentialsFailed": "读取 MCP 认证信息失败", "invalidMcpCredentials": "Studio 返回的 MCP 认证信息格式无效", + "mpaDeleteUnconfirmed": "删除请求超时,尚未确认 Runtime 已删除。后台可能仍在清理,请稍后刷新并检查。", "deleteFailed": "删除失败 ({{status}})", "runtimeManageForbidden": "当前账号没有管理该 Runtime 的权限。", "runtimeNotFound": "该 Runtime 不存在或已被删除。", diff --git a/frontend/src/i18n/resources/zh-CN/ui.json b/frontend/src/i18n/resources/zh-CN/ui.json index 24b5a5ab6..0e474e434 100644 --- a/frontend/src/i18n/resources/zh-CN/ui.json +++ b/frontend/src/i18n/resources/zh-CN/ui.json @@ -405,7 +405,7 @@ "deleteDraftDescription": "确定删除草稿“{{name}}”吗?", "deleteAgent": "删除 Agent", "closeDeleteConfirmation": "关闭删除确认", - "mpaDeletePreviewSummary": "Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。", + "mpaDeletePreviewSummary": "Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。", "mpaDeletePreviewSessions": "会话", "mpaDeletePreviewActiveSessions": "运行中", "mpaDeletePreviewIdleSessions": "空闲", @@ -418,7 +418,9 @@ "mpaDeleteStage": { "runtime_sessions": "删除 {{count}} 个可见空闲 Runtime 会话", "runtime_diagnostics": "清理这些会话关联的诊断数据和挂载元信息", - "agentkit_runtime": "删除 AgentKit Runtime" + "agentkit_runtime": "删除 AgentKit Runtime", + "worker_template": "删除独占沙箱模板", + "skill_space": "删除独占 Skill Space(含空间内技能)" }, "draftDeletionWarning": "草稿将从当前浏览器中删除。", "runtimeDeletionWarning": "Runtime 和相关云端资源将被删除。", @@ -543,6 +545,14 @@ "updateConfigRestoring": "正在恢复更新配置", "updateUnsupported": "当前 Runtime 不支持更新", "usageMismatch": "返回的使用数据与当前 Agent 不匹配" + }, + "mpaDeleteChecking": "正在检查会话和资源归属…", + "mpaDeleteRetryPreview": "重新检查", + "mpaDeletePreviewFailed": "删除前检查失败。请处理下面的错误后重新检查。", + "mpaDeleteRetained": "以下资源将保留", + "mpaDeleteRetainedReason": { + "shared": "有其他智能体引用", + "unproven": "无法确认是此智能体独占的受管资源" } }, "environmentCenter": { @@ -1594,6 +1604,9 @@ }, "wakingHint": "正在唤醒智能体,可能需要一些时间。", "mpaCreate": { + "maxInstance": "最大实例数", + "maxInstanceHelp": "默认 {{maximum}},为 Runtime 自动扩容的实例数上限。", + "maxInstanceInvalid": "最大实例数必须为大于或等于 1 的整数。", "name": "名称", "namePlaceholder": "例如 test-agent", "nameHelp": "作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。", @@ -1623,12 +1636,12 @@ "openvikingInvalid": "请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。", "openvikingCredentials": "API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。", "tosTitle": "会话输出存储", - "tosDescription": "可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。", - "tosAccessKey": "TOS Access Key", - "tosSecretKey": "TOS Secret Key", + "tosDescription": "可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。", "tosBucket": "TOS 存储桶", - "tosInvalid": "TOS Access Key、Secret Key 和存储桶必须同时填写。", - "tosCredentials": "凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。", + "tosInvalid": "请选择以 agentkit-platform- 开头的可用存储桶。", + "tosCredentials": "创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。", + "tosDisable": "清除桶选择", + "tosBucketUnavailable": "当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。", "runtimeImage": "MPA 镜像", "workerImage": "Worker 镜像", "imageDefault": "留空使用配置文件中的默认镜像", @@ -1660,9 +1673,11 @@ "iamTrustConflict": "运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。", "iamPolicyConflict": "运行角色所需的同名权限策略内容冲突,请管理员检查后重试。", "iamOwnershipConflict": "运行角色与当前部署账号不匹配,请管理员检查后重试。", + "iamTemporaryFailure": "IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。", "iamVerificationFailed": "尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。", "iamConfigurationConflict": "自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。", "creationFailed": "当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。", + "configurationChanged": "此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。", "cancelFailed": "取消请求失败,请重新查询进度后重试。", "cancelled": "创建已取消,已登记资源保留供重试。", "timeout": "创建超时,已登记资源保留。请检查对应资源后重试。", @@ -1688,12 +1703,33 @@ "verifying": "等待智能体就绪", "admin_workspace": "准备管理 PG Workspace", "business_workspace": "准备业务 PG Workspace", - "admin_database": "初始化共享管理库" + "admin_database": "初始化共享管理库", + "openviking": "准备 OpenViking 库", + "openviking_key": "准备 OpenViking 访问凭证" }, "back": "继续创建", "pgAutoDescription": "使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。", + "pgPerAgentDescription": "创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。", + "pgAidbDescription": "创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。", + "runtimeNameTaken": "该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。", + "runtimeNameCheckFailed": "暂时无法检查名称,请确认资源查询权限和网络后重试。", "pgModeChanged": "此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。", - "pgMigrationRequired": "检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。" + "pgMigrationRequired": "检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。", + "openvikingAutoDescription": "将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。", + "openvikingAutoByteplusDescription": "将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。", + "openvikingAutoByteplusRequirements": "使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。", + "openvikingModelEndpointsInvalid": "请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。", + "openvikingAutoBilling": "企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。", + "openvikingPermissionDenied": "无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。", + "openvikingConfigurationConflict": "OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。", + "openvikingCreateUnknown": "OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。", + "openvikingNotReady": "OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。", + "openvikingResourceFailed": "OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。", + "openvikingResourceMissing": "未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。", + "openvikingModelConfigurationRejected": "平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。", + "openvikingUnavailable": "暂时无法连接 OpenViking,请检查服务及网络后重试。", + "openvikingInvalidResponse": "OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。", + "openvikingQuotaExceeded": "OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。" } }, "skillCenter": { @@ -1993,7 +2029,7 @@ "routeDescription": "将渠道消息转发给当前智能体的路由配置。", "deliveryDescription": "实际观测到的回复投递状态,完成配置不代表已成功投递。", "groupsTitle": "群聊权限", - "groupsDescription": "添加允许访问的群,并设置群内对话的共享范围。", + "groupsDescription": "添加允许访问此智能体的群。", "providerBindingTitle": "绑定{{name}}", "providerUnbound": "绑定{{name}}机器人,让用户通过消息与此智能体对话。", "qrGuidance": "使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。", @@ -2036,6 +2072,10 @@ "noAccounts": "尚未绑定飞书机器人。", "accountsFailed": "读取机器人列表失败,请重试。", "accountConflict": "机器人账号存在歧义或配置冲突,请刷新并选择机器人。", - "multiBotPairingDescription": "绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。" + "multiBotPairingDescription": "绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。", + "provider_lark": "Lark", + "larkPairingDescription": "使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。", + "larkAccountsTitle": "Lark 机器人", + "noLarkAccounts": "尚未绑定 Lark 机器人。" } } diff --git a/frontend/src/ui/AgentWorkspace.tsx b/frontend/src/ui/AgentWorkspace.tsx index 4402860ef..32cd78370 100644 --- a/frontend/src/ui/AgentWorkspace.tsx +++ b/frontend/src/ui/AgentWorkspace.tsx @@ -131,6 +131,8 @@ type DeleteConfirmTarget = confirmLabel: string; canConfirm?: boolean; agent: AgentEntry; + previewLoading?: boolean; + previewFailed?: boolean; } | { kind: "draft"; @@ -487,10 +489,21 @@ function MpaDeletePreviewDetails({ {t(`agentWorkspace.mpaDeleteStage.${stage.stage}`, { count: stage.count, })} + {stage.resourceId && ({stage.resourceId})} ))} )} + {Boolean(preview.retainedResources?.length) && ( +

+ {t("agentWorkspace.mpaDeleteRetained")} +
    {preview.retainedResources?.map((item) => ( +
  • + {item.resourceId} — {t(`agentWorkspace.mpaDeleteRetainedReason.${item.reason}`, { defaultValue: item.reason })} +
  • + ))}
+
+ )}
); } @@ -1945,6 +1958,8 @@ export function AgentWorkspace({ const [selectedDraftIds, setSelectedDraftIds] = useState>(() => new Set()); const [deletingAgents, setDeletingAgents] = useState(false); const [deleteError, setDeleteError] = useState(""); + const deletePreviewAbortRef = useRef(null); + useEffect(() => () => deletePreviewAbortRef.current?.abort(), []); const [deleteConfirmTarget, setDeleteConfirmTarget] = useState(null); const [feedbackCases, setFeedbackCases] = useState([]); @@ -3808,6 +3823,11 @@ export function AgentWorkspace({ const confirmDeleteTarget = async () => { if (!deleteConfirmTarget || deletingAgents) return; + if (deleteConfirmTarget.kind === "agent" && deleteConfirmTarget.previewFailed) { + await deleteSingleAgent(deleteConfirmTarget.agent); + return; + } + if (deleteConfirmTarget.canConfirm === false) return; setDeletingAgents(true); setDeleteError(""); try { @@ -3848,11 +3868,26 @@ export function AgentWorkspace({ const deleteSingleAgent = async (agent: AgentEntry) => { if (!onDeleteAgents || agent.canDelete !== true || deletingAgents) return; + deletePreviewAbortRef.current?.abort(); setDeleteError(""); let preview: MpaAgentDeletePreview | null = null; if (agent.agentCategory === "mpa") { + const controller = new AbortController(); + deletePreviewAbortRef.current = controller; + setDeleteConfirmTarget({ + kind: "agent", agent, + title: t("agentWorkspace.deleteAgentTitle"), + description:

{t("agentWorkspace.mpaDeleteChecking")}

, + confirmLabel: t("agentWorkspace.mpaDeleteChecking"), + canConfirm: false, previewLoading: true, + }); if (!agent.runtimeId || !agent.region) { setDeleteError(t("agentWorkspace.errors.loadMpaDeletePreview")); + setDeleteConfirmTarget((current) => current?.kind === "agent" ? { + ...current, previewLoading: false, previewFailed: true, canConfirm: true, + confirmLabel: t("agentWorkspace.mpaDeleteRetryPreview"), + description: t("agentWorkspace.errors.loadMpaDeletePreview"), + } : current); return; } try { @@ -3860,9 +3895,17 @@ export function AgentWorkspace({ mpaInstanceId: agent.mpaInstanceId ?? agent.runtimeId, runtimeId: agent.runtimeId, region: agent.region, + signal: controller.signal, }); + if (controller.signal.aborted || deletePreviewAbortRef.current !== controller) return; } catch (cause) { + if (controller.signal.aborted || deletePreviewAbortRef.current !== controller) return; setDeleteError(cause instanceof Error ? cause.message : String(cause)); + setDeleteConfirmTarget((current) => current?.kind === "agent" ? { + ...current, previewLoading: false, previewFailed: true, canConfirm: true, + confirmLabel: t("agentWorkspace.mpaDeleteRetryPreview"), + description: t("agentWorkspace.mpaDeletePreviewFailed"), + } : current); return; } } @@ -5334,11 +5377,17 @@ export function AgentWorkspace({ variant="danger" title={deleteConfirmTarget.title} description={deleteConfirmTarget.description} + error={deleteError || undefined} confirmLabel={deletingAgents ? t("common.deleting") : deleteConfirmTarget.confirmLabel} closeLabel={t("agentWorkspace.closeDeleteConfirmation")} busy={deletingAgents} confirmDisabled={deleteConfirmTarget.canConfirm === false} - onCancel={() => setDeleteConfirmTarget(null)} + onCancel={() => { + deletePreviewAbortRef.current?.abort(); + deletePreviewAbortRef.current = null; + setDeleteConfirmTarget(null); + setDeleteError(""); + }} onConfirm={() => void confirmDeleteTarget()} /> )} diff --git a/frontend/src/ui/DeploymentResources.tsx b/frontend/src/ui/DeploymentResources.tsx index 19c3dda57..c4cb596b9 100644 --- a/frontend/src/ui/DeploymentResources.tsx +++ b/frontend/src/ui/DeploymentResources.tsx @@ -56,7 +56,7 @@ interface ResourceListState { loadMore: () => void; } -function useDeploymentResourceList( +export function useDeploymentResourceList( query: DeploymentResourceQuery | null, ): ResourceListState { const [items, setItems] = useState([]); @@ -192,7 +192,7 @@ function resourceOptions( })); } -function ResourcePicker({ +export function ResourcePicker({ ariaLabel, value, valueLabel, diff --git a/frontend/src/ui/FeishuAccounts.tsx b/frontend/src/ui/FeishuAccounts.tsx index cc62a33a3..987a3c346 100644 --- a/frontend/src/ui/FeishuAccounts.tsx +++ b/frontend/src/ui/FeishuAccounts.tsx @@ -22,11 +22,13 @@ export function FeishuAccounts({ runtimeId, region, capability, + domain = "feishu", renderPanel, }: { runtimeId: string; region: string; capability: ChannelCapabilities; + domain?: "feishu" | "lark"; renderPanel: (props: FeishuAccountPanelProps) => ReactNode; }) { const { t } = useTranslation("ui"); @@ -47,7 +49,7 @@ export function FeishuAccounts({ read.current = controller; setLoading(true); setError(""); - void listFeishuAccounts(ep, controller.signal) + void listFeishuAccounts(ep, controller.signal, domain) .then((values) => { if (controller.signal.aborted) return; setAccounts(values); @@ -77,7 +79,7 @@ export function FeishuAccounts({ if (!controller.signal.aborted) setLoading(false); }); return () => controller.abort(); - }, [ep, reload, t]); + }, [ep, reload, t, domain]); useEffect( () => () => { read.current?.abort(); @@ -125,11 +127,21 @@ export function FeishuAccounts({ return (
-

{t("channels.accountsTitle")}

+

+ {t( + domain === "lark" + ? "channels.larkAccountsTitle" + : "channels.accountsTitle", + )} +

)} - {provider === "feishu" && accountMode !== "add" && ( + {isFeishu && accountMode !== "add" && (
- + )} +
-

{t(key("openvikingDescription"))}

+

+ {t( + key( + autoOpenviking + ? cloudProvider === "byteplus" + ? "openvikingAutoByteplusDescription" + : "openvikingAutoDescription" + : "openvikingDescription", + ), + )} +

- - - - {!openvikingValid && ( -

{t(key("openvikingInvalid"))}

- )} -

{t(key("openvikingCredentials"))}

-
- {t(key("tosTitle"))} -

{t(key("tosDescription"))}

- {( - ["tosAccessKey", "tosSecretKey", "tosBucket"] as const - ).map((field) => ( -
})); +vi.mock("../src/ui/Markdown", () => ({ Markdown: () => null })); +const { t, i18n } = vi.hoisted(() => ({ t: (key: string) => key, i18n: { language: "en-US", resolvedLanguage: "en-US" } })); +vi.mock("react-i18next", async (load) => ({ ...(await load()), useTranslation: () => ({t,i18n}) })); +let host: HTMLDivElement, root: Root; +const agent = { id:"one", app:"default", label:"MPA one", remote:true, runtimeId:"r-one", mpaInstanceId:"mi-one", region:"cn-beijing", canDelete:true, agentCategory:"mpa" as const }; +const info = {name:"MPA one",tools:[],subAgents:[],description:"test"}; +const remove = vi.fn(); +const base: AgentWorkspaceProps = { agents:[agent], selectedAgentId:agent.id, focusedAgentId:agent.id, agentInfo:info, agentInfoAgentId:agent.id, loadingAgentInfo:false, canCreate:false, canUpdate:false, detailOnly:true, onSelectAgent:vi.fn(), onCreateAgent:vi.fn(), onDeleteAgents:remove }; +const preview = {canDelete:true, blockers:[], sessionCounts:{total:0,active:0,idle:0,debug:0}, cleanupPlan:[{stage:"worker_template",resourceId:"t-one",description:"worker",count:1},{stage:"skill_space",resourceId:"ss-one",description:"skills",count:1}], retainedResources:[{stage:"skill_space",resourceId:"ss-shared",reason:"shared"}]} as api.MpaAgentDeletePreview; +beforeEach(() => { + vi.stubGlobal("React",React); vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT",true); vi.resetAllMocks(); + vi.mocked(api.getRuntimeAgentInfo).mockResolvedValue(info); + vi.mocked(api.getRuntimeDetail).mockResolvedValue({runtimeId:"r-one",status:"Ready",networkTypes:[],envs:[]} as never); + vi.mocked(api.getRuntimeUpdateCapability).mockResolvedValue({canUpdate:false} as never); + host=document.createElement("div");document.body.append(host);root=createRoot(host); +}); +afterEach(async()=>{await act(async()=>root.unmount());host.remove();vi.unstubAllGlobals();}); +async function render(props:Partial={}) {await act(async()=>root.render());} +async function click(label:string) {const button=Array.from((document.querySelector('[role="alertdialog"]') ?? document).querySelectorAll('button')).find(b=>b.textContent?.trim()===label); expect(button).toBeDefined();await act(async()=>button!.click());} +it("opens loading confirmation, exposes preview error, and retries without deleting",async()=>{ + let reject!: (error:Error)=>void; + vi.mocked(api.getMpaAgentDeletePreview).mockImplementationOnce(()=>new Promise((_,r)=>{reject=r;})).mockResolvedValueOnce(preview); + await render();await click("agentWorkspace.deleteAgent"); + expect(document.querySelector('[role="alertdialog"]')?.textContent).toContain("agentWorkspace.mpaDeleteChecking"); + await act(async()=>reject(new Error("session API unavailable"))); + expect(document.querySelector('[role="alertdialog"]')?.textContent).toContain("session API unavailable"); + await click("agentWorkspace.mpaDeleteRetryPreview"); + expect(document.querySelector('[role="alertdialog"]')?.textContent).toContain("t-one"); + expect(document.querySelector('[role="alertdialog"]')?.textContent).toContain("ss-shared"); + expect(remove).not.toHaveBeenCalled(); +}); +it("cancels a pending preview and ignores its late completion",async()=>{ + let resolve!:(value:api.MpaAgentDeletePreview)=>void; + vi.mocked(api.getMpaAgentDeletePreview).mockImplementationOnce(()=>new Promise(r=>{resolve=r;})); + await render();await click("agentWorkspace.deleteAgent"); + const signal=vi.mocked(api.getMpaAgentDeletePreview).mock.calls[0][0].signal; + await click("confirm.cancel");expect(signal?.aborted).toBe(true); + await act(async()=>resolve(preview));expect(document.querySelector('[role="alertdialog"]')).toBeNull(); + expect(remove).not.toHaveBeenCalled(); +}); +it("shows execution failure in confirmation and keeps retry available",async()=>{ + vi.mocked(api.getMpaAgentDeletePreview).mockResolvedValue(preview);remove.mockRejectedValueOnce(new Error("tool permission denied")).mockResolvedValueOnce(undefined); + await render();await click("agentWorkspace.deleteAgent");await click("agentWorkspace.deleteAgent"); + expect(document.querySelector('[role="alertdialog"]')?.textContent).toContain("tool permission denied"); + await click("agentWorkspace.deleteAgent");expect(remove).toHaveBeenCalledTimes(2); + expect(document.querySelector('[role="alertdialog"]')).toBeNull(); +}); +it("general deletion never reads MPA preview",async()=>{ + const general={...agent,agentCategory:"general" as const};remove.mockResolvedValue(undefined); + await render({agents:[general]});await click("agentWorkspace.deleteAgent"); + expect(api.getMpaAgentDeletePreview).not.toHaveBeenCalled();await click("agentWorkspace.deleteAgent"); + expect(remove).toHaveBeenCalledWith([expect.objectContaining({agentCategory:"general"})]); +}); diff --git a/frontend/tests/mpaDeletionTimeout.test.mjs b/frontend/tests/mpaDeletionTimeout.test.mjs new file mode 100644 index 000000000..c6981c63a --- /dev/null +++ b/frontend/tests/mpaDeletionTimeout.test.mjs @@ -0,0 +1,170 @@ +import assert from "node:assert/strict"; +import { Buffer } from "node:buffer"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; +import { build } from "esbuild"; + +Error.stackTraceLimit = 0; +const storage = () => { + const values = new Map(); + return { + getItem: (key) => values.get(key) ?? null, + setItem: (key, value) => values.set(key, String(value)), + removeItem: (key) => values.delete(key), + }; +}; +globalThis.window = { + location: { search: "", pathname: "/", hash: "", origin: "http://127.0.0.1" }, + history: { replaceState() {} }, + addEventListener() {}, + removeEventListener() {}, +}; +globalThis.localStorage = storage(); +globalThis.sessionStorage = storage(); +const result = await build({ + entryPoints: [ + fileURLToPath(new URL("../src/adk/client.ts", import.meta.url)), + ], + bundle: true, + format: "esm", + platform: "node", + target: "node20", + write: false, +}); +const { deleteRuntime } = await import( + `data:text/javascript;base64,${Buffer.from(result.outputFiles[0].contents).toString("base64")}` +); +const json = (body, status = 200) => + new Response(JSON.stringify(body), { + status, + headers: { "Content-Type": "application/json" }, + }); +const timeout = () => new DOMException("signal timed out", "TimeoutError"); + +async function withDeadlines(run) { + const original = AbortSignal.timeout; + const deadlines = []; + AbortSignal.timeout = (ms) => { + deadlines.push(ms); + return new AbortController().signal; + }; + try { + await run(deadlines); + } finally { + AbortSignal.timeout = original; + } +} + +test("MPA deletion gets its own deadline while general deletion remains unchanged", async () => { + await withDeadlines(async (deadlines) => { + globalThis.fetch = async () => json({ success: true }); + await deleteRuntime("r-mpa", "cn-beijing", { agentCategory: "mpa" }); + await deleteRuntime("r-general", "cn-beijing", { + agentCategory: "general", + }); + assert.deepEqual(deadlines, [180000, 30000]); + }); +}); + +test("MPA timeout confirms the same Runtime once without repeating deletion", async () => { + await withDeadlines(async (deadlines) => { + const requests = []; + globalThis.fetch = async (url, init) => { + requests.push({ + url: String(url), + method: init.method, + cache: init.cache, + }); + if (init.method === "POST") throw timeout(); + return json({ deleted: true }); + }; + await deleteRuntime("r-one", "ap-southeast-1", { agentCategory: "mpa" }); + assert.equal(requests.length, 2); + const check = new URL(requests[1].url, "http://127.0.0.1"); + assert.equal(check.pathname, "/web/mpa-runtime-deletion-status"); + assert.equal(check.searchParams.get("runtimeId"), "r-one"); + assert.equal(check.searchParams.get("region"), "ap-southeast-1"); + assert.equal(requests[1].cache, "no-store"); + assert.deepEqual(deadlines, [180000, 30000]); + }); +}); + +for (const [label, body, status] of [ + ["still present", { deleted: false }, 200], + ["malformed", { deleted: "true" }, 200], + ["permission", { detail: "denied" }, 403], + ["authorization 404", { detail: "Runtime not found" }, 404], + ["unavailable", { detail: "unavailable" }, 503], +]) { + test(`MPA timeout preserves an uncertain result for ${label}`, async () => { + await withDeadlines(async () => { + let writes = 0; + globalThis.fetch = async (_url, init) => { + if (init.method === "POST") { + writes++; + throw timeout(); + } + return json(body, status); + }; + await assert.rejects( + deleteRuntime("r-one", "cn-beijing", { agentCategory: "mpa" }), + /mpaDeleteUnconfirmed|not confirmed|尚未确认|仍|超时|確認/i, + ); + assert.equal(writes, 1); + }); + }); +} + +test("general timeouts and non-timeout MPA failures do not query confirmation", async () => { + await withDeadlines(async () => { + let requests = 0; + globalThis.fetch = async () => { + requests++; + throw timeout(); + }; + await assert.rejects(deleteRuntime("r-general", "cn-beijing"), { + name: "TimeoutError", + }); + assert.equal(requests, 1); + const original = new Error("network unavailable"); + globalThis.fetch = async () => { + requests++; + throw original; + }; + await assert.rejects( + deleteRuntime("r-mpa", "cn-beijing", { agentCategory: "mpa" }), + (error) => error === original, + ); + assert.equal(requests, 2); + }); +}); + +test("confirmation transport timeout stays uncertain without replaying DELETE", async () => { + await withDeadlines(async () => { + const methods = []; + globalThis.fetch = async (_url, init) => { + methods.push(init.method ?? "GET"); + throw timeout(); + }; + await assert.rejects( + deleteRuntime("r-one", "cn-beijing", { agentCategory: "mpa" }), + /mpaDeleteUnconfirmed|not confirmed|尚未确认/i, + ); + assert.deepEqual(methods, ["POST", "GET"]); + }); +}); + +test("non-timeout server cleanup errors retain their diagnostic detail", async () => { + await withDeadlines(async () => { + let requests = 0; + globalThis.fetch = async () => { + requests++; + return json({ detail: { code: "mpa_resource_cleanup_failed" } }, 502); + }; + await assert.rejects( + deleteRuntime("r-one", "cn-beijing", { agentCategory: "mpa" }), + /mpa_resource_cleanup_failed/, + ); + assert.equal(requests, 1); + }); +}); diff --git a/frontend/tests/newAgentWorkbench.test.mjs b/frontend/tests/newAgentWorkbench.test.mjs index 87b27aae5..474af7e22 100644 --- a/frontend/tests/newAgentWorkbench.test.mjs +++ b/frontend/tests/newAgentWorkbench.test.mjs @@ -417,8 +417,8 @@ test("MPA Profile-only edits apply the profile without the deployment steps", () assert.match(workbenchSource, /step === "deployment" && !profileOnly/); assert.match(workbenchSource, /profileOnly[\s\S]*?t\("workbench\.actions\.applyProfileAgain"\)[\s\S]*?t\("workbench\.actions\.applyProfile"\)/); assert.match(customCreateSource, /mpaProfileOnly\?: boolean/); - assert.match(customCreateSource, /profileOnly=\{deploymentTarget\?\.mpaProfileOnly\}/); - const profileOnlyStart = customCreateSource.indexOf("if (deploymentTarget?.mpaProfileOnly) {"); + assert.match(customCreateSource, /profileOnly=\{isMpaDeployment && deploymentTarget\?\.mpaProfileOnly\}/); + const profileOnlyStart = customCreateSource.indexOf("if (isMpaDeployment && deploymentTarget?.mpaProfileOnly) {"); const normalDeployStart = customCreateSource.indexOf("const envMap = new Map", profileOnlyStart); assert.ok(profileOnlyStart >= 0 && normalDeployStart > profileOnlyStart); const profileOnlyBranch = customCreateSource.slice(profileOnlyStart, normalDeployStart); diff --git a/frontend/tests/runtimeChannels.test.tsx b/frontend/tests/runtimeChannels.test.tsx index 3d75e6665..9887b760f 100644 --- a/frontend/tests/runtimeChannels.test.tsx +++ b/frontend/tests/runtimeChannels.test.tsx @@ -150,6 +150,64 @@ it("shows unsupported images and allows retry after an error", async () => { await click("common.retry"); expect(host.textContent).toContain("channels.bind"); }); +it("uses server defaults when adding a group without an isolation selector", async () => { + await render(); + const form = host.querySelector( + ".runtime-channels-permissions form", + )!; + expect(form.querySelector("select")).toBeNull(); + expect(form.textContent).not.toContain("channels.scope"); + const input = form.querySelector("input")!; + await act(async () => { + Object.getOwnPropertyDescriptor( + HTMLInputElement.prototype, + "value", + )!.set!.call(input, " group-new "); + input.dispatchEvent(new Event("input", { bubbles: true })); + }); + await act(async () => + form.dispatchEvent( + new Event("submit", { bubbles: true, cancelable: true }), + ), + ); + const saves = request.mock.calls.filter( + ([, path, init]) => path === "/chat-permissions" && init?.method === "POST", + ); + expect(saves).toHaveLength(1); + expect(JSON.parse(String(saves[0][2]?.body))).toEqual({ + channel: "feishu", + chatId: "group-new", + }); +}); + +it.each(["group_sender", "group_topic", "group_topic_sender"])( + "preserves existing %s group display without rewriting its configuration", + async (groupSessionScope) => { + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => + path.startsWith("/chat-permissions") && !init?.method + ? { + permissions: [ + { + channel: "feishu", + chatId: "group-existing", + chatName: "Existing group", + groupSessionScope, + }, + ], + } + : original(ep, path, init), + ); + await render(); + expect(host.textContent).toContain(`channels.scope_${groupSessionScope}`); + await click("channels.refresh"); + expect(host.textContent).toContain(`channels.scope_${groupSessionScope}`); + expect( + request.mock.calls.some(([, , init]) => init?.method === "POST"), + ).toBe(false); + }, +); + it("keeps the group form after a failed save", async () => { await render(); const input = host.querySelector( @@ -1078,7 +1136,8 @@ it("scopes permission writes and deletions to the selected bot", async () => { ([, path, init]) => path === "/chat-permissions" && init?.method === "POST", ); expect(saves).toHaveLength(1); - expect(JSON.parse(String(saves[0][2]?.body))).toMatchObject({ + expect(JSON.parse(String(saves[0][2]?.body))).toEqual({ + channel: "feishu", appId: "bot-b", chatId: "group-new", }); @@ -1304,3 +1363,191 @@ it("adds via QR and selects the returned appId", async () => { ).toBe("bot-b"); expect(host.textContent).not.toContain("channels.feishuPairingDescription"); }); + +it("gates BytePlus Lark binding on explicit Runtime brand capability", async () => { + await act(async () => + root.render( + , + ), + ); + await click("channels.provider_lark"); + expect(host.textContent).toContain("channels.unsupported"); + expect( + [...host.querySelectorAll("button")].some( + (b) => b.textContent === "channels.bind", + ), + ).toBe(false); +}); + +it("keeps domestic channel tabs unchanged", async () => { + await render(); + expect(host.textContent).not.toContain("channels.provider_lark"); +}); + +function larkFixture() { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => { + if (path === "/capabilities") + return { + ...(await original(ep, path, init)), + feishuDomains: ["feishu", "lark"], + }; + if (path === "") + return { + channels: [ + ...botAccounts, + { + channel: "feishu", + appId: "lark-bot", + enabled: true, + config: { domain: "lark" }, + }, + ], + }; + if (path === "/feishu/bindings") return pending; + if ( + path === "/feishu/bindings/manual" || + path.startsWith("/feishu/bindings/") + ) + return { ...pending, status: "BOUND", appId: "lark-bot" }; + return original(ep, path, init); + }); +} +async function renderLark() { + await act(async () => + root.render( + , + ), + ); + await click("channels.provider_lark"); +} +it("isolates Lark accounts and scopes disable/unbind without changing Feishu", async () => { + larkFixture(); + vi.stubGlobal("confirm", vi.fn().mockReturnValue(true)); + await renderLark(); + expect(host.textContent).toContain("channels.larkAccountsTitle"); + const options = [...host.querySelectorAll("option")].map((o) => o.value); + expect(options).toContain("lark-bot"); + expect(options).not.toContain("bot-a"); + await click("channels.disableAccount"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/accounts/lark-bot", + expect.objectContaining({ method: "PATCH" }), + ); + await click("channels.unbind"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "?channel=feishu&appId=lark-bot", + expect.objectContaining({ method: "DELETE" }), + ); + await click("channels.provider_feishu"); + expect( + [...host.querySelectorAll("option")].map((o) => o.value), + ).not.toContain("lark-bot"); +}); +it("creates and polls a Lark QR binding using the explicit brand", async () => { + vi.useFakeTimers(); + larkFixture(); + await renderLark(); + await click("channels.addAccount"); + await click("channels.bind"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/bindings", + expect.objectContaining({ body: '{"domain":"lark"}' }), + ); + await act(async () => vi.advanceTimersByTimeAsync(1000)); + expect( + host.querySelector(".runtime-channels-accounts select") + ?.value, + ).toBe("lark-bot"); + const count = request.mock.calls.filter(([, path]) => + path.startsWith("/feishu/bindings/"), + ).length; + await act(async () => vi.advanceTimersByTimeAsync(2000)); + expect( + request.mock.calls.filter(([, path]) => + path.startsWith("/feishu/bindings/"), + ), + ).toHaveLength(count); +}); +it("retries Lark manual binding without losing brand or persisting the secret", async () => { + larkFixture(); + await renderLark(); + await click("channels.addAccount"); + await selectMethod("manual"); + await fillCredential("appId", " lark-bot "); + await fillCredential("secret", " test-secret "); + request.mockRejectedValueOnce(new ChannelApiError(502)); + await click("channels.bindCredentials"); + expect(host.textContent).toContain("channels.requestFailed"); + await click("channels.bindCredentials"); + const calls = request.mock.calls.filter( + ([, path]) => path === "/feishu/bindings/manual", + ); + expect(calls).toHaveLength(2); + for (const call of calls) + expect(JSON.parse(call[2]!.body as string)).toEqual({ + appId: "lark-bot", + appSecret: "test-secret", + domain: "lark", + }); + expect(localStorage.setItem).not.toHaveBeenCalled(); + expect(JSON.stringify(sessionStorage)).not.toContain("test-secret"); +}); + +it("blocks Lark IME and duplicate writes and aborts on brand switch", async () => { + larkFixture(); + await renderLark(); + await click("channels.addAccount"); + await selectMethod("manual"); + await fillCredential("appId", "lark-new"); + await fillCredential("secret", "test-secret"); + const input = host.querySelector('input[name="appId"]')!; + const event = new KeyboardEvent("keydown", { + key: "Enter", + isComposing: true, + bubbles: true, + cancelable: true, + }); + await act(async () => input.dispatchEvent(event)); + expect(event.defaultPrevented).toBe(true); + let finish!: (data: unknown) => void; + let signal!: AbortSignal; + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path === "/feishu/bindings/manual" + ? new Promise((done) => { + finish = done; + signal = init!.signal as AbortSignal; + }) + : original(ep, path, init), + ); + const form = host.querySelector("form[data-channel-binding]")!; + await act(async () => { + form.dispatchEvent( + new Event("submit", { bubbles: true, cancelable: true }), + ); + form.dispatchEvent( + new Event("submit", { bubbles: true, cancelable: true }), + ); + }); + expect( + request.mock.calls.filter(([, path]) => path === "/feishu/bindings/manual"), + ).toHaveLength(1); + await click("channels.provider_feishu"); + expect(signal.aborted).toBe(true); + await act(async () => finish({ status: "BOUND", appId: "lark-new" })); + expect(host.textContent).not.toContain("lark-new"); + expect(host.textContent).toContain("channels.accountsTitle"); +}); diff --git a/frontend/tests/runtimeScalingDeploy.test.mjs b/frontend/tests/runtimeScalingDeploy.test.mjs index d8f3db207..80f2195a6 100644 --- a/frontend/tests/runtimeScalingDeploy.test.mjs +++ b/frontend/tests/runtimeScalingDeploy.test.mjs @@ -98,7 +98,7 @@ test("renders the Runtime update progress step conditionally", () => { ); }); -test("structured Agent deployments apply MPA Profile after Runtime publish", () => { +test("only explicit MPA deployments apply Profile after Runtime publish", () => { assert.match(clientSource, /export async function applyMpaProfileAfterDeployment/); assert.match(clientSource, /sourceProfileId = params\.sourceDraftId\?\.trim\(\)/); assert.match(clientSource, /`studio-draft:\$\{params\.sourceDraftId\.trim\(\)\}`/); @@ -106,7 +106,7 @@ test("structured Agent deployments apply MPA Profile after Runtime publish", () assert.match(projectPreviewSource, /applyMpaProfileAfterDeployment\(/); assert.match( projectPreviewSource, - /const isMpaDeployment = Boolean\(agentDraft\);[\s\S]*?const shouldRunMpaLifecycle = isMpaDeployment && !githubUpdateOffloaded/, + /const isMpaDeployment = agentCategory === "mpa";[\s\S]*?const shouldRunMpaLifecycle = isMpaDeployment && !githubUpdateOffloaded/, ); assert.match( projectPreviewSource, @@ -124,7 +124,7 @@ test("structured Agent deployments apply MPA Profile after Runtime publish", () projectPreviewSource, /syncGithubCicdRuntime\(\{[\s\S]*?agentCategory: isMpaDeployment \? "mpa" : "general"/, ); - assert.match(customCreateSource, /agentCategory: "mpa"/); + assert.match(customCreateSource, /agentCategory: deploymentAgentCategory\(deploymentTarget\)/); assert.match( projectPreviewSource, /runtimeRevision: isRuntimeUpdate \? deploymentRuntimeRevision : undefined/, @@ -173,3 +173,11 @@ test("draws complete native radio and checkbox states after the global reset", ( /\.pp-network-check input:checked::before,\s*\.pp-evaluation-set-option input:checked::before\s*\{[\s\S]*?rotate\(45deg\)/, ); }); + +test("quick deploy and failure tasks keep generic agents out of the MPA lifecycle", () => { + assert.match(customCreateSource, /if \(isMpaDeployment && mpaRuntimeId\)/); + assert.match(customCreateSource, /if \(isMpaDeployment && deploymentTarget\?\.mpaProfileOnly\)/); + assert.doesNotMatch(projectPreviewSource, /mpaProfile: Boolean\(agentDraft\)/); + assert.doesNotMatch(customCreateSource, /mpaProfile: true/); + assert.match(customCreateSource, /agentCategory=\{deploymentAgentCategory\(deploymentTarget\)\}/); +}); diff --git a/openspec/changes/mpa-agent-studio-a2a-streaming/proposal.md b/openspec/changes/mpa-agent-studio-a2a-streaming/proposal.md deleted file mode 100644 index 7d67860dc..000000000 --- a/openspec/changes/mpa-agent-studio-a2a-streaming/proposal.md +++ /dev/null @@ -1,19 +0,0 @@ -# Change: mpa-agent Studio A2A streaming - -## Why - -Studio currently wraps blocking A2A `message/send` as SSE, so sandbox progress is invisible until completion. - -## What changes - -- Advertise and serve standard A2A `message/stream` from mpa-agent. -- Project invocation-scoped sandbox events into A2A progress artifacts. -- Incrementally decode and adapt A2A SSE in the veadk Studio BFF. -- Preserve blocking fallback without resubmitting accepted tasks. -- Continue tasks after disconnect; recover final persisted output on refresh. - -## Impact - -- mpa-agent: A2A card/executor event projection only. -- veadk-python: Runtime A2A bridge and tests only. -- No database migration or provisioning contract change. diff --git a/openspec/changes/mpa-agent-studio-a2a-streaming/tasks.md b/openspec/changes/mpa-agent-studio-a2a-streaming/tasks.md deleted file mode 100644 index cd974823a..000000000 --- a/openspec/changes/mpa-agent-studio-a2a-streaming/tasks.md +++ /dev/null @@ -1,23 +0,0 @@ -# Tasks - -- [x] `T-1` Isolate mpa-agent work on `fix/a2a-studio-streaming`. (`VC-1`) -- [x] `T-2` Add failing agent-card streaming capability tests. (`VC-1`) -- [x] `T-3` Add failing invocation-local relay tests for ordering, isolation, and terminal ownership. (`VC-2`, `VC-4`, `VC-9`, `VC-10`, `VC-13`) -- [x] `T-4` Implement mpa-agent streaming capability and progress relay. (`VC-1`, `VC-2`, `VC-4`, `VC-13`, `VC-14`) -- [x] `T-5` Add failing veadk incremental SSE decoder and event mapping tests. (`VC-3`, `VC-4`, `VC-9`) -- [x] `T-6` Implement `message/stream` and safe pre-execution fallback. (`VC-3`, `VC-5`, `VC-6`, `VC-7`, `VC-11`) -- [x] `T-7` Map tool progress, output delta, direct answer, and final result into Studio events. (`VC-3`, `VC-4`, `VC-15`) -- [x] `T-8` Execute disconnect, refresh, concurrency, cancel, and compatibility validation. (`VC-7`, `VC-8`, `VC-11`, `VC-13`, `VC-14`) -- [x] `T-9` Execute Web, Feishu, scheduled-task, and bot-group regression. (`VC-12`) -- [x] `T-10` Run two review rounds and E2E, then commit and push both repositories. Production release tags are intentionally not created because a veadk tag triggers PyPI/docs publication and requires separate release authorization. (all cases) - -## Verification result (2026-09-12) - -- Runtime `r-yeuujrrcowb21078p9jh` version 31 is Ready on image `mpa_agent:a2a-v8`. -- Studio sandbox E2E emitted tool calls at 20.23s, output at 22.87s, text deltas from 26.51s, and one final result at 27.44s. Refresh restored the same final result. -- Direct answers emit upstream ADK text deltas followed by one persisted final event; cumulative working snapshots are suppressed without splitting fabricated tokens. -- Two concurrent sessions produced distinct invocation IDs and no cross-stream marker leakage. -- Disconnect completion/recovery and legacy fallback are covered by live evidence and regression tests; no request is resubmitted after task acceptance. -- Secret scan covered 13 local evidence files with zero credential matches. -- Web, Feishu, scheduled-task, and group-bot code paths passed the mpa-agent regression suite. Live Feishu delivery remains environment-blocked because no bot credentials/install target were supplied. -- Frontend package tests are environment-blocked before execution because local `vite`, `esbuild`, and `typescript` dependencies are absent; backend bridge tests pass. diff --git a/openspec/changes/mpa-p0-productionization/proposal.md b/openspec/changes/mpa-p0-productionization/proposal.md deleted file mode 100644 index f5d8bf9a7..000000000 --- a/openspec/changes/mpa-p0-productionization/proposal.md +++ /dev/null @@ -1,70 +0,0 @@ -# Change: MPA AgentKit P0 productionization - -## Why - -AgentKit Studio can discover MPA Runtimes, and `agentkit-mpa-agent` already provides Session, A2A, worker delegation, lifecycle control, and diagnostics. The current system does not yet provide one authoritative Agent/Profile management path, durable cross-system Agent operations, server-owned Session execution configuration, crash-safe Turn acceptance, whole-Turn pause/continuation, or a verified Runtime lifecycle. - -## What changes - -Deliver six serial, independently reversible slices: - -1. **M0 — executable foundation** - - MPA Profile request/response fixtures and a typed Runtime adapter - - live OAuth-bearer/TIP identity and Agent write-path proof - - PostgreSQL 16 integration lane and deterministic fault injection - - cross-repository compatibility manifest/runner - - isolated browser scenario harness - - authorized live E2E runner and zero-residue cleanup -2. **S1 — Agent creation to first chat** - - BFF Agent API adapter and durable lifecycle operation - - AgentKit-mode bootstrap/readiness - - Runtime Profile projection and operation ledger - - deterministic model and Worker smoke - - minimum MPA creation/progress UI -3. **S2 — Session versioning** - - server-owned execution-config revisions - - resource validation and Turn freeze - - explicit MPA Profile-revision upgrade - - two-client CAS UI -4. **S3 — crash-safe run and refresh recovery** - - durable Turn/dispatch outbox - - run idempotency and recovery - - persistent SSE cursor replay and terminal fencing -5. **S4 — whole-Turn lifecycle** - - primary/worker participant registry - - pause barrier and generation handling - - lease-aware resume and explicit continuation -6. **S5 — management and release closure** - - `MpaAgentView` and page isolation - - Runtime update/release/delete/rollback - - Debug/Trace correlation - - shared CLI client and commands - - secret-reference migration - - browser, compatibility, performance, regression, and live gates - -## Scope boundaries - -- Studio/BFF is the accepted MPA Profile authoring boundary; mpa-agent is the immutable executable Profile-revision authority. Managed Agent is outside P0. -- `agentkit-mpa-agent` is the sole business Session/Turn authority. AgentKit Managed Agent Session is not created in P0. -- VeADK Studio/BFF owns presentation and orchestration, not execution state. -- The browser calls VeADK BFF; BFF validates the existing Studio Agent draft, forwards the validated identity, and applies the normalized Profile to mpa-agent. No Managed Agent control-plane request is part of P0. -- `mpa-codex-worker` remains unchanged unless M0 proves an actual protocol gap. -- No ArkClaw data migration or runtime fallback. -- No MPA template, expert, review/install, Resource Library, Search, scheduled-task, Feishu, or website-integration work. - -## Compatibility - -Use the PRD compatibility matrix. Runtime A2A capability and Codex Worker protocol are separate dimensions. Unlisted combinations are unsupported. Schema expansion precedes dual-readable code, which precedes new writes. Incompatible rollback is rejected before mutation. - -## Verification - -The authoritative plans are: - -- [Functional verification Cases](../../../prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.md) -- [Browser verification runbook](../../../prd-spec/features/mpa-p0-productionization/browser-cases.md) - -Every Task references at least one VC. Mock, in-memory, PostgreSQL, browser, and live-cloud evidence remain separate and cannot substitute for each other. - -## Delivery gate - -M0 is a hard feasibility gate. S1 through S5 are serial; each slice must pass its own Cases and continuous security Cases before the next begins. The change is complete only when every P0/P1 Case is `pass`, both code-review rounds pass, E2E is green, and documentation is reconciled with implementation. diff --git a/openspec/changes/mpa-p0-productionization/tasks.md b/openspec/changes/mpa-p0-productionization/tasks.md deleted file mode 100644 index 8c226c1bd..000000000 --- a/openspec/changes/mpa-p0-productionization/tasks.md +++ /dev/null @@ -1,342 +0,0 @@ -# Tasks: MPA AgentKit P0 productionization - -Estimates are ideal engineer-days including test-first implementation and targeted verification, excluding cloud approval, queue, and publication wait time. This VeADK change is the single cross-repository ledger; Runtime work records its commit/image evidence here rather than creating a second task ledger. - -## Mainline integration baseline (2026-09-19) - -The branch is rebased onto VeADK `origin/main` and Runtime `origin/master`. Mainline has independently delivered MPA message-channel management, Feishu/DingTalk/WeCom binding modes, Automations navigation, shared APIG and Runtime/database/Skill-Space deployment support, and complete artifact-answer replay. These capabilities are available integration foundations and are no longer described as unimplemented code. They remain outside this P0 ledger's acceptance scope unless an AC/VC below explicitly consumes them: channel/provider acceptance is owned by `specs/mpa-channels` and its feature PRDs, while this ledger still gates the unified Studio Profile/Session/Turn/Runtime path. - -Mainline delivery does not close evidence-only tasks. `S5-12` still requires the complete BC-01 through BC-09 browser matrix, `S5-13` still requires final two-repository regression/coverage/PostgreSQL/build/performance evidence, `S5-14` still requires deployed identity/create/Profile evidence, and `S5-15` still reconciles the final AC/VC matrix and pinned revisions. `S1-10` remains open only for its browser/live evidence and is reconciled with `S5-12`/`S5-14`, not reimplemented. - -## M0 — feasibility and test foundation - -- [x] `M0-01` Remove Managed Agent from the P0 dependency graph and freeze the Studio AgentDraft-to-MPA-Profile DTO. - - Owner: `veadk-python` - - Depends on: none - - Acceptance: `AC-2`, `AC-11` - - Verification: `VC-03` - - Estimate: 1d - - Deliverables: profile fixtures and normalization contract tests -- [x] `M0-02` Define the minimal typed Runtime Profile client boundary; do not wire UI/orchestration yet. - - Owner: `veadk-python` - - Depends on: `M0-01` - - Acceptance: `AC-11` - - Verification: `VC-03` - - Estimate: 1.5d - - Deliverables: standalone runtime Profile client contract; no Managed Agent client -- [x] `M0-03` Establish `RuntimePrincipal` mapping and rejection-path test foundation. - - Owner: `agentkit-mpa-agent` - - Depends on: none - - Acceptance: `AC-6`, `AC-11` - - Verification: `VC-02` - - Estimate: 1.5d - - Deliverables: principal schema/service tests and AgentKit-mode auth gate -- [x] `M0-04` Prepare live OAuth bearer, TIP, JWKS rotation/revocation, and Profile apply/status verification for the deployed release gate. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent` - - Depends on: `M0-02`, `M0-03`, `M0-09` - - Acceptance: `AC-6`, `AC-11` - - Verification: `VC-02` local contract and live-runner dry-run; deployed `VC-01/02` execute in `S5-14` - - Estimate: 2d - - Deliverables: runner Case definition, dry-run evidence, and deployed-environment manifest/checklist; real request IDs and cleanup proof belong to `S5-14` - - Status (2026-09-15): runner and local rejection/projection contracts are ready; execution is deferred to S5-14 because the Profile endpoint does not exist before S1 implementation. Managed Agent activation is not relevant. -- [x] `M0-05` Add PostgreSQL 16 compose, schema-0 fixture, migration runner, and `make test-postgres`. - - Owner: `agentkit-mpa-agent` - - Depends on: none - - Acceptance: `AC-12` - - Verification: `VC-18A` - - Estimate: 2d - - Deliverables: compose, fixture, Make target, foundation tests -- [x] `M0-06` Add injectable clock, dispatcher, participant probe, and boundary failpoints. - - Owner: `agentkit-mpa-agent` - - Depends on: `M0-05` - - Acceptance: `AC-4`, `AC-5`, `AC-12` - - Verification: `VC-11`, `VC-12`, `VC-13`, `VC-18A` - - Estimate: 2d - - Deliverables: test interfaces with production defaults disabled -- [x] `M0-07` Add cross-repository manifest, compatibility matrix, and preflight runner. - - Owner: `veadk-python` - - Depends on: `M0-05` - - Acceptance: `AC-9`, `AC-10`, `AC-12` - - Verification: `VC-19` preflight - - Estimate: 2d - - Deliverables: manifest schema, matrix JSON, contract runner -- [x] `M0-08` Add test-only browser scenario service with auth and production isolation. - - Owner: `veadk-python` - - Depends on: none - - Acceptance: `AC-3`, `AC-6`, `AC-8` - - Verification: scenario-harness route/auth/isolation contract tests only; product BC run after slice implementation - - Estimate: 2d - - Deliverables: fixture script, scenario/barrier/call-count API, production-route absence test -- [x] `M0-09` Add live E2E runner infrastructure, checkpoint recovery, and zero-residue cleanup before executing live Cases. - - Owner: `veadk-python` - - Depends on: `M0-03` - - Acceptance: `AC-1`, `AC-2`, `AC-6`, `AC-9`, `AC-11` - - Verification: runner contract tests; later executes `VC-01`, `VC-02`, `VC-20A/B`, `VC-21` - - Estimate: 2d - - Deliverables: `scripts/verify-mpa-p0-e2e.sh`, manifest validator -- [x] `M0-10` Add performance runner and result schema. - - Owner: `veadk-python` - - Depends on: `M0-07` - - Acceptance: `AC-9`, `AC-10` - - Verification: `VC-19` - - Estimate: 1d - - Deliverables: `scripts/benchmark-mpa-p0.py`, JSON report schema -- [x] `M0-11` Execute local M0 gates and record results; record deployed-only identity/Profile checks as deferred to `S5-14`. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent` - - Depends on: `M0-03`–`M0-10` - - Acceptance: `AC-11`, `AC-12` foundation - - Verification: `VC-02` local contract, `VC-03`, `VC-18A`, and live-runner dry-run; verify `VC-04/05` test paths collect but do not require green before S1 implements them; deployed `VC-01/02` remain assigned to `S5-14` - - Estimate: 1d - - Deliverables: M0 evidence index; S1 unlocks when all local M0 contracts are green and deployed-only checks are explicitly assigned to `S5-14` - -## S1 — Agent creation to first chat - -- [x] `S1-01` Implement Runtime operation ledger, TTL, authorized status, and safe replay. - - Owner: `agentkit-mpa-agent`; depends on `M0-03`, `M0-05`, `M0-06`; acceptance `AC-2`, `AC-4`; verification `VC-05`, `VC-18B/C`; estimate 2d. - - Status 2026-09-17: completed schema version 8 with SQL/in-memory `runtime_operations` stores, a 24-hour replay TTL, canonical request hashes, redacted response/resource snapshots, compare-and-swap transitions, and principal/agent/action-authorized `GET /api/v1/runtime-operations/{operationId}`. Profile apply and Session Profile upgrade now replay successful results across service/store instances; changed-content retries return `idempotency_mismatch`. Verification: focused Runtime tests 39 passed; real PostgreSQL migration/restart/cross-store replay/Profile-CAS tests 11 passed with cleanup; changed-file Ruff and diff checks passed. Final full behavior regression was 2501 passed/14 skipped, while the unchanged 95% repository coverage gate remains unmet at 93.47%; full-tree Ruff also reports 27 pre-existing findings outside the P0 diff. -- [x] `S1-02` Extend `mpa_agents` with source Profile fields and applied-only revision switch. - - Owner: `agentkit-mpa-agent`; depends on `S1-01`; acceptance `AC-2`, `AC-12`; verification `VC-04`, `VC-07`, `VC-18B`; estimate 2d. -- [x] `S1-03` Implement Profile apply/status, preconditions, ETag, mapping, and version conflicts. - - Owner: `agentkit-mpa-agent`; depends on `S1-02`; acceptance `AC-2`, `AC-6`; verification `VC-02` Profile subset, `VC-04`, `VC-07`; estimate 3d; shared authorizer runs before apply/status and rejected requests have zero external effects. Status 2026-09-15: service/API/store contract green; PostgreSQL concurrency hardening continues under `VC-18B`. - - Status 2026-09-17: PostgreSQL concurrency hardening is complete. Profile apply uses the authenticated Runtime principal, hashes the full normalized Profile, persists model/Tool/Skill/MCP/Multiagent projection data, rejects malformed strong ETags with `400 invalid_precondition`, and atomically performs the precondition check plus current-revision switch under a per-agent advisory transaction lock. A real two-connection test proves only one update can consume one ETag. -- [x] `S1-04` Add AgentKit-mode bootstrap metadata, prohibit legacy fallback, and expose staged readiness. - - Owner: `agentkit-mpa-agent`; depends on `M0-03`, `S1-03`; acceptance `AC-1`, `AC-6`; verification `VC-02`, `VC-20A`; estimate 2d. - - Status 2026-09-15: implemented `MPA_AGENTKIT_MODE` bootstrap path, `mpa_meta` AgentKit metadata columns, startup readiness state, and `/readiness` phase/error response. Verified by Runtime `uv run pytest -q tests/test_mpa_meta.py tests/test_health.py tests/test_runtime_principal.py` (37 passed), Runtime S1 regression `uv run pytest -q tests/test_agent_config_store.py tests/test_profile_apply.py tests/test_profile_apply_api.py tests/test_runtime_operations.py tests/test_runtime_principal.py tests/test_auth.py tests/test_mpa_meta.py tests/test_health.py` (69 passed), `make test-postgres` (4 passed with PostgreSQL 16 container cleanup), `uv run ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-05` Implement deterministic model/Worker execution-ready probes and mandatory cleanup. - - Owner: `agentkit-mpa-agent`; depends on `S1-04`; acceptance `AC-1`; verification `VC-20A`; estimate 2d. - - Status 2026-09-15: implemented `POST /api/v1/readiness/execution-smoke`, `runtime:smoke` action gate, LiteLLM model smoke without tools, Codex Worker `/ready`/session/turn/event smoke, retryable failure codes, app-state readiness updates, and cleanup hook. Runtime calls worker `control/cancel` for smoke sessions so no active Turn is left behind; full remote Session deletion is not claimed because the current worker API does not expose a DELETE Session contract. Verified by Runtime `uv run pytest -q tests/test_execution_smoke.py tests/test_execution_smoke_api.py tests/test_codex_worker_client.py::test_codex_worker_client_ready_uses_worker_ready_endpoint tests/test_codex_worker_client.py::test_codex_worker_client_cancels_session_with_worker_control_api` (13 passed), S1 regression `uv run pytest -q tests/test_agent_config_store.py tests/test_profile_apply.py tests/test_profile_apply_api.py tests/test_runtime_operations.py tests/test_runtime_principal.py tests/test_auth.py tests/test_mpa_meta.py tests/test_health.py tests/test_execution_smoke.py tests/test_execution_smoke_api.py tests/test_codex_worker_client.py::test_codex_worker_client_ready_uses_worker_ready_endpoint` (80 passed), `make test-postgres` (4 passed with PostgreSQL 16 cleanup), `uv run ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-05a` Wire shared authorization for minimum first-chat execution. - - Owner: `agentkit-mpa-agent`; depends on `M0-03`, `S1-04`; acceptance `AC-1`, `AC-6`; verification `VC-02` Session/A2A/worker subset, `VC-20A`; estimate 1.5d; deliverable covers Session create/read, default-revision A2A acceptance, and worker/tool dispatch revocation checks without S2 overrides or S3 strong run idempotency. - - Status 2026-09-15: AgentKit mode now resolves REST Session callers from `Authorization: Bearer ` and requires endpoint actions (`session:create`, `session:read`, `turn:run`, `session:configure`, `turn:cancel`, `session:update`, `session:delete`), including same-agent token binding. A2A TIP strict mode requires RuntimePrincipal v1 and `turn:run`; legacy subject-only TIP remains compatible outside AgentKit mode. Verified by Runtime `uv run pytest -q tests/test_agentkit_session_auth.py tests/test_runtime_principal.py::test_a2a_agentkit_mode_rejects_subject_only_tip tests/test_runtime_principal.py::test_a2a_agentkit_mode_rejects_missing_turn_run_action tests/test_runtime_principal.py::test_a2a_legacy_raw_claims_keep_subject_only_path` (6 passed), S1 focused regression `uv run pytest -q tests/test_agentkit_session_auth.py tests/test_runtime_principal.py tests/test_auth.py tests/test_sessions.py::test_create_get_delete tests/test_sessions.py::test_run_response_includes_session_id tests/test_execution_smoke.py tests/test_execution_smoke_api.py tests/test_codex_worker_client.py::test_codex_worker_client_ready_uses_worker_ready_endpoint tests/test_codex_worker_client.py::test_codex_worker_client_cancels_session_with_worker_control_api tests/test_mpa_meta.py tests/test_health.py tests/test_profile_apply_api.py` (80 passed), `make test-postgres` (4 passed), `uv run ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-06` Implement MPA Profile apply/status BFF endpoints over the Runtime client. - - Owner: `veadk-python`; depends on `M0-03`, `S1-03`; acceptance `AC-1`, `AC-2`, `AC-11`; verification `VC-03`, `VC-07`; estimate 2d. - - Status 2026-09-15: added typed BFF `PUT /web/mpa/agents/{mpaInstanceId}/profile` and `GET /web/mpa/agents/{mpaInstanceId}/profile-status`, reusing `MpaRuntimeClient` and the existing Runtime authorization/connection resolver. The BFF normalizes Studio draft input into MPA Profile digest, forwards `Idempotency-Key`, create/update ETag preconditions, and runtime Authorization, and maps Runtime errors without leaking secrets. Verified by VeADK `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_scenario_harness.py` (13 passed), `uv run --extra dev ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-07` Implement TOS-CAS MPA lifecycle operation repository. - - Owner: `veadk-python`; depends on `M0-08`; acceptance `AC-1`, `AC-2`; verification `VC-06`; estimate 2d. - - Status 2026-09-15: added `TosMpaOperationRepository` and `MpaLifecycleOperation` under `frontend/server/mpa/operations.py`. Operations use stable owner/kind/target/idempotency hash IDs, `forbid_overwrite` creation, ETag CAS updates, active-operation listing, and safe replay for same idempotency key/request hash while rejecting key reuse with different input. Verified by VeADK `uv run --extra dev pytest -q tests/frontend/server/mpa/test_operations_repository.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_scenario_harness.py` (18 passed), `uv run --extra dev ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-08` Implement create/update orchestration, reconciliation, and retry. - - Owner: `veadk-python`; depends on `S1-03`–`S1-07`; acceptance `AC-1`, `AC-2`; verification `VC-06`, `VC-20A`; estimate 3d. - - Status 2026-09-15: added `MpaAgentOperationService` and operation BFF routes for create/update/active-list/retry. The orchestration writes the operation before side effects, advances `runtime_preparing -> profile_applying -> smoke_running -> runnable` for create and `profile_applying -> succeeded` for update, replays same request/key without duplicate Runtime calls, rejects same-key different payload, and retries only with a matching request hash. Verified by VeADK `uv run --extra dev pytest -q tests/frontend/server/mpa/test_agent_operations_service.py tests/frontend/server/mpa/test_operations_repository.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_scenario_harness.py tests/frontend/server/mpa/test_mpa_module.py` (31 passed), `uv run --extra dev ruff check ...` (pass), and `git diff --check` (pass). -- [x] `S1-09` Add MPA creation entry and staged progress/retry UI. - - Owner: `veadk-python`; depends on `S1-08`; acceptance `AC-1`, `AC-8`; verification `VC-16` create subset, `BC-01/02`, BC-07 create/IME subset; estimate 2d. - - Status 2026-09-15: wired structured Studio `AgentDraft` deployments to the MPA lifecycle operation BFF after AgentKit Runtime publish. The frontend normalizes `AgentDraft -> MPA Profile`, sends create/update operations with stable `Idempotency-Key`, `sourceProfileId`, Runtime ID/region, and update ETag, and deliberately does not send `sourceProfileRevision` because Runtime owns `profileRevision`. The existing code-package and migration deployment paths do not auto-apply MPA Profile because they have no `AgentDraft`. The deployment progress UI now shows MPA Profile apply, execution smoke, and runnable stages for direct Studio-managed MPA creates; Runtime updates show Profile apply only; GitHub-offloaded updates do not run local MPA smoke. Failures are surfaced on the failed stage with safe retry through the existing deployment task retry path. Workspace deployment cards persist `mpaProfile/mpaSmoke` stage metadata and localized labels. - - Verification 2026-09-15: VeADK `node --test frontend/tests/runtimeScalingDeploy.test.mjs frontend/tests/agentWorkspace.test.mjs frontend/tests/privateRuntimeDeploy.test.mjs frontend/tests/deploymentConfigUi.test.mjs` (58 passed); `node --test tests/adkI18n.test.mjs` from `frontend/` (1 passed); `npm --prefix frontend test` (1206 passed); `npm --prefix frontend run check:i18n` (pass); `npm --prefix frontend run build` (pass; generated `veadk/webui` assets were cleaned from the source diff); VeADK BFF `uv run --extra dev pytest -q tests/frontend/server/mpa/test_agent_operations_service.py tests/frontend/server/mpa/test_operations_repository.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_mpa_module.py tests/frontend/server/mpa/test_scenario_harness.py` (32 passed); focused VeADK Ruff (pass); Runtime S1 regression `uv run pytest -q tests/test_agentkit_session_auth.py tests/test_runtime_principal.py tests/test_auth.py tests/test_sessions.py::test_create_get_delete tests/test_sessions.py::test_run_response_includes_session_id tests/test_execution_smoke.py tests/test_execution_smoke_api.py tests/test_codex_worker_client.py::test_codex_worker_client_ready_uses_worker_ready_endpoint tests/test_codex_worker_client.py::test_codex_worker_client_cancels_session_with_worker_control_api tests/test_mpa_meta.py tests/test_health.py tests/test_profile_apply_api.py` (83 passed); Runtime focused Ruff (pass); Runtime `make test-postgres` (4 passed); `git diff --check` in both repositories (pass). -- [ ] `S1-10` Execute S1 unit, contract, browser, and live gates. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S1-01`–`S1-09` and `S1-05a`; acceptance `AC-1`, `AC-2`, `AC-6`; verification `VC-02` first-chat subset, `VC-04`–`VC-07`, `BC-01/02` plus BC-07 create/IME subset, `VC-20A`; estimate 1.5d. - - Status 2026-09-15: local unit/contract portions are complete, but S1-10 cannot be marked complete because full browser BC and live cloud `VC-20A` remain unexecuted. Completed local checks: VeADK frontend full `npm --prefix frontend test` (1206 passed), `npm --prefix frontend run build` (pass), `npm --prefix frontend run check:i18n` (pass), S1 targeted frontend files (58 passed), VeADK MPA BFF pytest (32 passed), compatibility manifest/e2e-runner/benchmark/scenario harness pytest (12 passed), Runtime S1 focused regression (83 passed), Runtime focused Ruff (pass), Runtime `make test-postgres` (4 passed), and both-repository `git diff --check` (pass). Local fixture API smoke started `scripts/run-mpa-p0-browser-fixture.sh` on loopback, verified `/__test/mpa/scenarios` seed/call/barrier/state, then stopped the service and removed the token file. - - Blocked/not-run gates: full BC-01/BC-02/BC-07 browser execution is blocked by incomplete UI scenario injection/test login wiring. The runbook drift was corrected to current `VEADK_MPA_SCENARIO_TOKEN_FILE` and `/__test/mpa/scenarios/...` APIs, but full browser BC cannot be marked pass from the scenario API smoke. Live `VC-20A` is blocked because no redacted live manifest/driver was available and `scripts/verify-mpa-p0-e2e.sh --execute` correctly returns `live_execution_not_authorized` without `VEADK_MPA_P0_LIVE=1`; dry-run returned ordered stages `AC-11, AC-1, AC-2, AC-6, AC-9`. - -## S2 — Session execution configuration and explicit upgrade - -- [x] `S2-01` Extend `session_meta` scope/version pointers. - - Owner: `agentkit-mpa-agent`; depends on S1; acceptance `AC-3`, `AC-6`, `AC-12`; verification `VC-08`, `VC-18B`; estimate 1d. - - Status 2026-09-15: extended Runtime `session_meta` with `mpa_instance_id`, `profile_revision`, and `execution_config_revision` for Session-scope pinning. SQL and in-memory stores now persist and return these pointers; create/reuse Session paths accept the pointers; Session create/detail responses expose them only when `mpaInstanceId` is present so legacy Session responses stay unchanged. Added `0003_session_meta_mpa_pointers.sql` so schema-zero migration creates/extends `session_meta` and advances the migration runner to schema version 3. Verified by Runtime `uv run pytest -q tests/test_session_meta_store.py tests/test_sessions.py::test_create_get_delete tests/test_sessions.py::test_create_get_include_mpa_profile_pointers_when_supplied tests/test_sessions.py::test_service_create_session_persists_mpa_profile_pointers` (17 passed, 2 skipped), focused Runtime Ruff (pass), `make test-postgres` (4 passed with PostgreSQL 16 cleanup), and `git diff --check` (pass). -- [x] `S2-02` Implement execution-config SQL/in-memory store and immutable ETag revisions. - - Owner: `agentkit-mpa-agent`; depends on `S2-01`; acceptance `AC-3`, `AC-12`; verification `VC-08`, `VC-18B`; estimate 2d. - - Status 2026-09-15: added Runtime `session_execution_configs` schema/store with append-only per-session revisions, strong revision ETags, in-memory CAS, SQL CAS protected by a per-session PostgreSQL advisory transaction lock, and schema migration `0004_session_execution_configs.sql`. Scope is storage only: no execution-config HTTP API, resource resolver, replace/clear/inherit semantics, or profile-upgrade API yet. Verified by Runtime `uv run pytest -q tests/test_session_execution_config.py` (8 passed), focused Ruff on touched S2-02 files (pass), `make test-postgres` (5 passed with PostgreSQL 16 cleanup), and Runtime/VeADK `git diff --check` (pass before documentation updates). -- [x] `S2-03` Implement resource resolver, replace/clear/inherit, and invalid-reference rejection. - - Owner: `agentkit-mpa-agent`; depends on `S2-02`; acceptance `AC-3`, `AC-6`; verification `VC-02` Session/config subset, `VC-08`; estimate 2d; shared authorizer protects Session read and config mutation before resource effects. - - Status 2026-09-15: added Runtime `GET/PATCH /api/v1/sessions/{sessionId}/execution-config`, `ExecutionConfigPatchRequest`, SessionService execution-config mixin, dependency wiring, ETag headers, and structured `428 precondition_required`, `412 execution_config_changed`, `422 resource_unavailable`, and `422 unsupported_execution_config_category` responses. Supported categories are `model` and `mcpServers`; `replace`, `clear`, and `inherit` are implemented for those categories. Unknown MCP IDs are rejected before revision append. Non-MPA Sessions return not found and do not create config state. SQL path keeps config revision append and `session_meta.execution_config_revision` pointer update in the same transaction through the S2-02 store. Verified by Runtime `uv run pytest -q tests/test_session_execution_config.py tests/test_session_execution_config_service.py tests/test_agentkit_session_auth.py tests/test_sessions.py::test_create_get_include_mpa_profile_pointers_when_supplied tests/test_session_mcp_update.py tests/test_session_mcp_resolution.py::test_create_session_persists_and_enriches_appcenter_mcp_ids tests/test_session_mcp_resolution.py::test_create_session_without_ids_uses_agent_mcp_whitelist_when_requested tests/test_session_mcp_resolution.py::test_create_session_with_empty_agent_mcp_whitelist_selects_no_mcp` (24 passed), focused Ruff (pass), `make test-postgres` (5 passed), and both-repository `git diff --check` (pass before documentation updates). -- [x] `S2-04` Define and test immutable resolved execution-config snapshots without persisting a Turn record yet. - - Owner: `agentkit-mpa-agent`; depends on `S2-03`; acceptance `AC-3`; verification `VC-08` resolver/snapshot subset; estimate 1d. - - Status 2026-09-15: added `SessionExecutionConfigSnapshot` as an immutable value object and service method `resolve_session_execution_config_snapshot(...)`. It captures the accepted execution-config revision/ETag, MPA instance, Profile revision, Profile-default revision, overrides, effective refs, invalid refs, and accepted timestamp. It remains a read-only handoff object for future Turn acceptance; no `turn_execution_records` persistence and no `/run` request binding were added in this task. Verified by `uv run pytest -q tests/test_session_execution_config.py tests/test_session_execution_config_service.py` (15 passed) and focused Ruff (pass). -- [x] `S2-05` Implement explicit Profile-revision upgrade with atomic override recomputation. - - Owner: `agentkit-mpa-agent`; depends on `S1-03`, `S2-02`–`S2-04`; acceptance `AC-3`, `AC-6`; verification `VC-02` upgrade subset, `VC-09`, `VC-18B`; estimate 2d; shared authorizer runs before target/resource resolution and rejected requests have zero effects. - - Status 2026-09-17: added `POST /api/v1/sessions/{sessionId}/profile-upgrade`, `SessionProfileUpgradeRequest`, and service logic that upgrades only an MPA Session to a higher already-applied Profile revision. The flow requires `Idempotency-Key` and execution-config `If-Match`, preserves explicit overrides, recomputes inherited defaults from the target Profile, rejects downgrade/same-version, rejects missing/unapplied target revisions, and maps same-key different target to `409 idempotency_mismatch`. The schema-version-8 SQL `runtime_operations` ledger now provides durable cross-process result replay. Verification is included in the S1-01 2026-09-17 record. -- [x] `S2-06` Implement typed execution-config/upgrade BFF proxy and client. - - Owner: `veadk-python`; depends on `S2-05`; acceptance `AC-3`, `AC-10`; verification `VC-09`, `VC-22`; estimate 1.5d. - - Status 2026-09-15: added typed BFF proxy routes for `GET/PATCH /web/mpa/sessions/{sessionId}/execution-config` and `POST /web/mpa/sessions/{sessionId}/profile-upgrade`, forwarding the server-resolved Runtime endpoint and bearer token instead of exposing credentials or using browser `runtime-proxy`. The TypeScript client now exposes typed helpers for current config, CAS patch, Profile status, and explicit Session Profile upgrade. BFF forwards Runtime ETags and preserves safe `currentState` on `412 execution_config_changed` so the UI can refresh instead of overwriting concurrent changes. Verified by VeADK `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_mpa_module.py` (21 passed), focused Ruff (pass), `npm --prefix frontend run check:i18n` (pass), `npm --prefix frontend run build` (pass), and full frontend `npm --prefix frontend test` (1209 passed). Build output under `veadk/webui` was cleaned from the source diff. -- [x] `S2-07` Implement Session config, new-version notice, and explicit upgrade UI. - - Owner: `veadk-python`; depends on `S2-06`; acceptance `AC-3`, `AC-8`; verification `VC-16` config subset, `BC-04/05`; estimate 2d. - - Status 2026-09-15: added an MPA-only `Session configuration` tab in Agent details. It appears only for MPA Runtime entries, loads only when the viewed Agent matches the currently connected Runtime and current business Session, and never creates a Session from the management page. The panel shows authoritative config revision/ETag, pinned Session Profile revision, latest applied Profile revision from Runtime profile-status, effective model and MCP refs, saves model overrides through Runtime CAS, supports MCP clear/inherit where Runtime P0 supports it, and triggers explicit Profile upgrade with a stable idempotency key. `412 execution_config_changed` replaces local state with Runtime `currentState` and asks the user to review before retrying. MPA tab creation now enters the existing Studio AgentDraft create surface with MPA lifecycle intent, while general Agents retain the previous create menu. Verified by focused frontend source-contract tests (95 passed), BFF pytest (21 passed), full frontend test (1209 passed), i18n check (pass), and frontend build (pass; generated `veadk/webui` assets cleaned). -- [x] `S2-08` Execute S2 unit, two-browser CAS, and PostgreSQL gates. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S2-01`–`S2-07`; acceptance `AC-3`, `AC-12`; verification `VC-08`, `VC-09`, `BC-04/05`, `VC-18B`; estimate 1d. - - Status 2026-09-15: S2-01 through S2-07 implementation slices are complete and S2-08 is closed for the current diff. Final local automation reruns are green: VeADK BFF pytest 28 passed, focused VeADK Ruff passed, focused frontend source-contract tests 95 passed, full `npm --prefix frontend test` returned 1209 passed, `npm --prefix frontend run check:i18n` and `npm --prefix frontend run build` passed, Runtime S2 focused tests 46 passed, Runtime focused Ruff passed, Runtime `make test-postgres` returned 5 passed, and `git diff --check` passed in both repositories. Real-browser BC-04/05 passed against the loopback fixture on `http://127.0.0.1:18174` with system Google Chrome via Playwright: two browser contexts started at ETag `"6"`, browser A saved model override `model-browser-a` to revision 7, browser B's stale MCP clear received expected `412 execution_config_changed` and refreshed to the current state, then explicit Session Profile upgrade advanced profile revision to 7 and config revision to 8 while preserving the model override and inheriting `mcp-upgraded`. Raw evidence was captured locally under ignored `evidence/browser/mpa-s2-1789491400/`. `uv run --extra dev pyright ...` is blocked in this local environment because no `pyright` executable or project script is installed. - -## S3 — run/outbox and refresh recovery - -- [x] `S3-01` Implement `turn_execution_records` and dispatch-intent SQL/in-memory stores. - - Owner: `agentkit-mpa-agent`; depends on S2; acceptance `AC-4`, `AC-12`; verification `VC-10`, `VC-11`, `VC-18C`; estimate 2d. - - Status 2026-09-15: added Runtime `turn_execution_records` SQL/in-memory store, schema migration `0005_turn_execution_records.sql`, unique scoped idempotency index, session-created and dispatch-status indexes, JSON-safe execution-config snapshot persistence, and one-active-Turn-per-Session enforcement. PostgreSQL acceptance uses a per-session advisory transaction lock before replay/busy checks. Verified by `uv run pytest -q tests/test_turn_dispatcher.py tests/test_run_acceptance.py` (14 passed), expanded Runtime focused regression (64 passed), and `make test-postgres` (6 passed with PostgreSQL 16 cleanup). -- [x] `S3-02` Implement shared REST/A2A Turn acceptance, persist the S2 resolved snapshot in `turn_execution_records`, and enforce strong idempotency. - - Owner: `agentkit-mpa-agent`; depends on `S3-01`, `S2-04`; acceptance `AC-3`, `AC-4`, `AC-6`; verification `VC-02` Turn-acceptance subset, `VC-08`, `VC-10`; estimate 2.5d; REST/A2A use the same authorizer before claim/outbox or external effect. - - Status 2026-09-15: Runtime `/api/v1/sessions/{sessionId}/run` now requires `Idempotency-Key` and `executionConfigVersion` for MPA Sessions, replays same-key/same-payload requests with the original `invocationId`, `turnId`, and `operationId`, rejects same-key/different-payload with `409 idempotency_mismatch`, rejects stale config with `412 execution_config_changed`, and rejects a second active Session Turn with `409 session_busy`. Non-MPA Sessions keep the legacy response shape. A2A advertises `urn:veadk:mpa:execution:v1`; `params.metadata.veadkExecution` uses the same acceptance service, binds the durable invocation ID to the ADK run, advances Turn dispatch status through `dispatching -> succeeded|failed_retryable`, and returns a terminal completed idempotent replay notice without executing the model a second time. VeADK Studio reads the current MPA Session execution config before send, supplies a per-run idempotency key and config revision to `runSSE`, uses Runtime `/run` plus `/sse` for MPA runtimes, and bridges the same metadata through BFF A2A. Verified by Runtime `uv run pytest -q tests/test_a2a_executor.py tests/test_a2a_app_lifecycle.py tests/test_turn_dispatcher.py tests/test_run_acceptance.py tests/test_agentkit_session_auth.py` (64 passed), Runtime focused Ruff (pass), Runtime `make test-postgres` (6 passed), VeADK `node --test tests/mpaSessionConfigUi.test.mjs tests/mpaSessionExecutionConfigClient.test.mjs tests/runSseAbort.test.mjs` (14 passed), VeADK `uv run pytest -q tests/cli/test_frontend_runtime_proxy.py::test_runtime_proxy_bridges_a2a_only_runtime_for_studio_chat` (3 passed), VeADK `uv run pytest -q tests/frontend/server/mpa tests/integrations/test_mpa_compatibility_manifest.py tests/integrations/test_mpa_p0_benchmark.py tests/integrations/test_mpa_p0_e2e_runner.py` (47 passed), `uv run python -m compileall -q veadk/cli/cli_frontend.py frontend/server/mpa` (pass), `npm --prefix frontend test` (1212 passed), `npm --prefix frontend run check:i18n` (pass), `npm --prefix frontend run build` (pass; generated `veadk/webui` assets cleaned), and both-repository `git diff --check` (pass). -- [x] `S3-03` Implement idempotent dispatcher and three crash-point recovery paths. - - Owner: `agentkit-mpa-agent`; depends on `M0-06`, `S3-02`; acceptance `AC-4`, `AC-12`; verification `VC-11`, `VC-18C`; estimate 2d. - - Status 2026-09-16: implemented the minimum dispatcher recovery around the existing inbox runner. `turn_execution_records` now persists JSON-safe `dispatch_payload` for rehydrating accepted Turns after restart. `SessionService.initialize()` scans recoverable `accepted|dispatching|failed_retryable` Turn records, synchronizes already-terminal inboxes back to Turn status, reconstructs missing/error inbox rows with the original invocation/content/source/peer/environment metadata, and schedules normal inbox workers. Inbox `enqueue_once()` is idempotent by invocation ID and can reset prior error rows to queued for retry. Lease-expired running inbox rows now mark their linked Turn `failed_retryable` before notifying channels. Verified by Runtime S3 regression and PostgreSQL gates recorded in `S3-06`. -- [x] `S3-04` Implement persistent event cursor, `410`, and terminal fence. - - Owner: `agentkit-mpa-agent`; depends on `S3-01`; acceptance `AC-7`, `AC-12`; verification `VC-14`, `VC-18C`; estimate 2d. - - Status 2026-09-16: implemented the backend cursor-expiry contract. `subscribe(..., last_event_id=...)` now accepts a cursor only when it exists in persistent ADK Session events or the live StreamHub buffer; an unknown non-empty cursor emits `event: error` with `{code: 410, msg: "cursor_expired"}` and terminates instead of replaying the entire Session. Existing terminal fence behavior is preserved: done frames are emitted only when persistent inbox state is terminal, and abort/error states remain explicit. Verified by Runtime S3 regression and PostgreSQL gates recorded in `S3-06`. -- [x] `S3-05` Adapt run idempotency, cursor reconnect, and deduplicated rendering. - - Owner: `veadk-python`; depends on `S3-02`, `S3-04`; acceptance `AC-4`, `AC-7`, `AC-8`; verification `BC-06`; estimate 2d. - - Status 2026-09-16: Studio now restores the selected Runtime Agent and Session ID from local storage on browser refresh, hydrates the selected Session even when its ID already matches state but turns are not loaded, reads the current MPA Session execution-config revision before send, and passes the last completed assistant `eventId` into `runSSE`. MPA runtimes call Runtime `/run` with `Idempotency-Key` and `executionConfigVersion`, then Runtime `/sse` with the accepted `invocationId` plus `lastEventId`. The local BFF path also forwards `lastEventId` and `veadkExecution` metadata. Verified by focused frontend tests and real-browser `BC-06` evidence recorded in `S3-06`. -- [x] `S3-06` Execute S3 crash, PostgreSQL restart, and browser refresh gates. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S3-01`–`S3-05`; acceptance `AC-4`, `AC-7`, `AC-12`; verification `VC-10`, `VC-11`, `VC-14`, `BC-06`, `VC-18C`; estimate 1d. - - Status 2026-09-16: S3 local gates are closed for the current diff. Runtime verification: expanded S3 regression `uv run pytest -q tests/test_turn_dispatcher.py tests/test_run_acceptance.py tests/test_inbox_store.py tests/test_a2a_executor.py tests/test_a2a_app_lifecycle.py tests/test_agentkit_session_auth.py tests/test_session_sse_edges.py tests/test_session_sse_coverage.py tests/test_sessions.py` returned 251 passed; focused Runtime Ruff passed; `make test-postgres` returned 6 passed and cleaned PostgreSQL resources. VeADK verification: focused frontend source-contract tests returned 15 passed; scenario harness pytest returned 8 passed; MPA server/integration pytest returned 51 passed; full frontend, i18n, and build gates are recorded in the PRD verification table. Real-browser `BC-06` passed against `http://127.0.0.1:18175` using system Google Chrome via Playwright: refreshed MPA Session restored the prior `event-before-refresh`, send used `lastEventId=event-before-refresh`, Runtime returned only `event-after-refresh`, page showed `Before refresh` once and `After refresh` once, unknown cursor returned `410 cursor_expired`, and no unexpected console errors were recorded. Raw evidence was captured locally under ignored `evidence/browser/mpa-s3-1789516481/BC-06/`. The gstack browser binary itself was not used for final evidence because its Playwright browser cache was missing; system Chrome was used instead. - -## S4 — whole-Turn pause/resume/continue - -- [x] `S4-01` Implement participant schema/store, lease, and generation. - - Owner: `agentkit-mpa-agent`; depends on S3; acceptance `AC-5`, `AC-12`; verification `VC-12`, `VC-18D`; estimate 2d. - - Status 2026-09-16: implemented the S4 participant data-model foundation without changing the existing task-level pause/resume behavior. Runtime now has `a2a_turn_participants` schema version 6 plus SQL and in-memory stores for participant registration, per-generation snapshots, owner-scoped lease heartbeat, generation-checked safe-point ACK, and terminal marking. This slice proves the durable participant state required by S4-02; aggregate all-participant barrier transitions remain pending. Verified by `uv run pytest -q tests/test_turn_participants.py` (5 passed), `uv run pytest -q tests/test_turn_participants.py tests/test_a2a_task_control.py tests/test_turn_control_api.py tests/test_p0_test_seams.py` (37 passed), focused Ruff (pass), and `make test-postgres` (7 passed with PostgreSQL resources cleaned). -- [x] `S4-02` Implement pause barrier, stale ACK, and participant-spawn race handling. - - Owner: `agentkit-mpa-agent`; depends on `M0-06`, `S4-01`; acceptance `AC-5`; verification `VC-12`, `VC-18D`; estimate 2d. - - Status 2026-09-16: implemented `ParticipantBarrierService` and wired pause requests through it when a participant store is available. A2A primary executors and Codex workers register participants; safe-point ACKs are generation/owner checked; partial ACK leaves the task `pausing`; all current-generation active participants advance the task to `paused`; late workers that start after aggregate pause still receive pause and ACK the current generation before resume; terminal workers are marked `completed|failed` so later pause generations do not wait for ended workers; resume seeds the next running participant generation. S4-03 remains responsible for the exact 300-second lease-aware resume boundary, and S4-04 remains responsible for linked continuation. Verified by Runtime S4-02 focused regression and PostgreSQL gates recorded in the PRD. -- [x] `S4-03` Implement lease-aware resume and exact 300-second boundary. - - Owner: `agentkit-mpa-agent`; depends on `S4-02`; acceptance `AC-5`, `AC-6`; verification `VC-13`; estimate 1.5d. - - Status 2026-09-16: implemented lease-aware resume boundaries. Same-Turn resume remains accepted at the exact 300-second paused boundary when owner lease is viable. Pause age greater than 300 seconds, owner lease loss, participant `lost|failed`, or a still-running participant with expired/missing lease returns `new_turn_required`; same-key retry replays the interrupted state. A still-running participant with a valid lease returns `invalid_state` so the caller waits for safe-point convergence. Verified by Runtime S4-03 focused boundary tests, broader S4 control regression, focused Ruff, and PostgreSQL gate recorded in the PRD. -- [x] `S4-04` Implement explicit continuation and outbox linkage. - - Owner: `agentkit-mpa-agent`; depends on `S3-03`, `S4-03`; acceptance `AC-5`; verification `VC-13`, `VC-18D`; estimate 2d. - - Status 2026-09-16: implemented Runtime-owned linked continuation. `POST /api/v1/a2a/tasks/{taskId}/continue` requires `Idempotency-Key` and `expectedGeneration`, accepts only `interrupted|orphaned` task state, resolves the previous business Turn from the old task invocation, writes a linked `turn_execution_records` row with `continuation_of=`, reuses the frozen execution-config snapshot and dispatch payload, terminates the old active dispatch row, and schedules existing inbox/outbox dispatch via `enqueue_once`. Same-key/same-request replays the same continuation; same-key/different request conflicts. Verified by Runtime focused and PostgreSQL gates recorded in the PRD. -- [x] `S4-05` Remove prompt continuation and wire Runtime control/status/continue. - - Owner: `veadk-python`; depends on `S4-02`–`S4-04`; acceptance `AC-5`, `AC-8`; verification `BC-09`; estimate 2d; deliverable includes `turn_lifecycle` scenario, participant barriers, and call-count fixture. - - Status 2026-09-16: Studio no longer builds a `continuationPrompt + Original task` fallback and no longer sends an ordinary `/run` for `new_turn_required`. `frontend/src/adk/client.ts` exposes `continueTurn(...)` and `continueTurnSSE(...)`, calling Runtime `/api/v1/a2a/tasks/{taskId}/continue` and then Runtime `/api/v1/sessions/{sessionId}/sse` with the accepted continuation invocation and current `lastEventId`. `frontend/src/App.tsx` streams the continuation through the existing projector and clears stale turn-control state when the continuation starts. Verified by focused frontend source-contract tests, i18n, and build recorded in the PRD. Full browser BC-09 remains S4-07. -- [x] `S4-06` Add revocation rechecks before resume/continue/secret/tool effects. - - Owner: `agentkit-mpa-agent`; depends on `S1-05a`, `S4-04`; acceptance `AC-6`; verification `VC-02`, `VC-15`; estimate 1d; extends the S1 Session/A2A/worker authorizer to resume/continue and revalidates secret/tool boundaries. - - Status 2026-09-16: implemented shared `runtime_authorization` helpers and injectable `runtime_principal_authorizer`. REST `/run`, resume, and `/continue` recheck the current grant before accepting side effects. Accepted Turn dispatch payloads and inbox metadata carry a normalized non-secret RuntimePrincipal snapshot so background execution and restart recovery can recheck without storing bearer tokens. ADK before-tool callbacks, direct sandbox dispatch, model/workload TIP resolution, OpenViking API-key resolution, and sandbox `begin_run` recheck before using secrets or external tool effects. Verified by focused auth/secret/tool tests, broader S4 Runtime regression, and focused Ruff recorded in the PRD. Real AgentKit revocation lookup remains a deployed S5 release gate. -- [x] `S4-07` Execute lifecycle, PostgreSQL participant, and browser gates. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S4-01`–`S4-06`; acceptance `AC-5`, `AC-6`, `AC-12`; verification `VC-12`, `VC-13`, `BC-09`, `VC-18D`; estimate 1d. - - Status 2026-09-16: S4 local lifecycle gates are closed for the current diff. Runtime focused auth/secret/tool tests returned 46 passed, and Runtime `make test-postgres` returned 8 passed with PostgreSQL resources cleaned. VeADK scenario harness returned 9 passed. Focused frontend source-contract tests plus i18n returned 37 passed and i18n pass; full `npm --prefix frontend test` returned 1215 passed; `npm --prefix frontend run build` passed and generated `veadk/webui` assets were cleaned. Real-browser `BC-09` passed against `http://127.0.0.1:5174` and backend `http://127.0.0.1:8001` using system Google Chrome via Playwright: partial ACK remained `pausing`, all participants reached `paused`, same-Turn resume returned to `running`, `new_turn_required` displayed as localized checkpoint-continuation state, refresh did not auto-call `/continue`, explicit resume called Runtime `/continue` plus `/sse`, and same-key continuation replay returned `idempotentReplay=true`. Raw evidence was captured locally under ignored `evidence/browser/mpa-s4-1789532050/BC-09/`. - -## S5 — management, CLI, secret, and release closure - -- [x] `S5-01` Implement recoverable new-platform plaintext-secret to reference migration. - - Owner: `agentkit-mpa-agent`; depends on `M0-05`, `S1-04`; acceptance `AC-6`, `AC-12`; verification `VC-15`, `VC-18E`; estimate 2d. - - Status 2026-09-16: implemented Runtime schema version 7 with `agent_api_key_ref`, `model_api_key_ref`, `secret_migration_status`, and `secret_migration_operation_id`. AgentKit mode rejects new plaintext `agentApiKey`/`modelApiKey` writes while accepting reference fields. `SecretReferenceMigrationService` creates protected references before clearing plaintext, preserves plaintext on provider/DB failure, and retries idempotently with the same key. Runtime model and built-in MCP execution paths resolve secret references at use time and fail closed if the resolver is missing. Verified by S5-01 focused Runtime pytest (95 passed), focused Ruff, and `make test-postgres` (9 passed with cleanup). Real AgentKit Vault provider wiring remains a later release-gate integration. -- [x] `S5-01a` Enforce canary-safe redaction across API, operation/status, logs, Trace, and Runtime Console. - - Owner: `agentkit-mpa-agent`; depends on `S1-01`, `S5-01`; acceptance `AC-6`; verification `VC-15`; estimate 1d; deliverables include session/console redaction changes and canary scans. - - Status 2026-09-17: implemented value-aware redaction for secret literals discovered during secret-reference migration. API access logs, Session client-visible text/events, Runtime Console responses, lifecycle details, trace-step persistence, and persisted Runtime operation response/resource snapshots redact registered canary values under non-sensitive keys and inside free text while preserving business parameters such as `flow_id`, `user_code`, and model `max_tokens`. Secret reference fields remain allowed. Runtime operation status omits principal and idempotency internals. Latest verification is included in the S1-01 2026-09-17 record. -- [x] `S5-02` Implement unique Runtime binding and `MpaAgentView`. - - Owner: `veadk-python`; depends on S1 and `M0-07`; acceptance `AC-8`, `AC-10`; verification `VC-16`, `VC-17`; estimate 2d. - - Status 2026-09-16: implemented BFF `GET /web/mpa/agents/{mpaInstanceId}/view`. The view model resolves candidate Runtime bindings for the MPA instance, returns `runtime_missing` for zero visible bindings, returns `binding_ambiguous` and blocks writes for multiple bindings, and hydrates the unique binding with Runtime profile status plus the matching active lifecycle operation. The main Studio app wires a real resolver that probes configured Runtime regions, keeps only `veadk:agent-type=mpa` Runtimes, merges resource tags, and reuses the existing Runtime connection resolver for `profile-status`. S5-03 still owns the frontend detail page UI. Verified by focused MPA BFF route tests and main-app Runtime binding tests (32 passed) plus focused Ruff. -- [x] `S5-03` Implement MPA detail/version UI and isolate non-MPA business logic. - - Owner: `veadk-python`; depends on `S5-02`; acceptance `AC-8`, `AC-10`; verification `VC-16`, `VC-17`; estimate 2d. - - Status 2026-09-16: implemented the frontend consumption slice for `MpaAgentView`. The TypeScript client now exposes `MpaAgentView` and `getMpaAgentView(...)`; `AgentWorkspace` loads it for MPA Runtime-backed detail pages, shows an MPA control-plane status alert, uses `bound` as the precondition for Session configuration loading, and shows `runtime_missing`, `binding_ambiguous`, and `orphan_runtime` as user-facing blocked states. Non-MPA details still use the existing Runtime detail/version/update paths. Runtime update/release/delete was completed by later S5-06/S5-07 slices, and richer Debug/Trace UI was completed by S5-05. Verified by focused frontend source-contract tests, i18n, build, full frontend tests, focused MPA BFF/main-app tests, and focused Python Ruff. -- [x] `S5-04` Add structured Agent/Profile/config/Turn/worker correlation to Trace/Console. - - Owner: `agentkit-mpa-agent`; depends on S1–S4; acceptance `AC-8`; verification `VC-16`, `VC-17`; estimate 1.5d. - - Status 2026-09-16: implemented Runtime Console/Trace correlation fields. `InvocationTraceResponse` and each trace step now include `correlation`, extracted from redacted trace details for MPA instance, Profile revision, execution-config revision/ETag, business Turn, A2A task, Runtime ID/version, and Codex/subagent worker session/turn/profile identifiers. This gives Studio a stable field instead of parsing arbitrary `details` JSON. S5-05 still owns the Studio Debug/Trace/history/usage view that consumes these fields. Verified by Runtime Console/Trace pytest (72 passed) and focused Ruff. -- [x] `S5-05` Wire MPA Debug/Trace/history/usage view. - - Owner: `veadk-python`; depends on `S5-04`; acceptance `AC-8`; verification `VC-16`, `VC-17`; estimate 1.5d. - - Status 2026-09-16: implemented the Studio consumption slice for MPA diagnostics. `AgentWorkspace` adds an MPA-only Diagnostics tab that loads Runtime Console run history and the latest invocation trace through the existing Runtime proxy, renders the structured S5-04 correlation fields, keeps bounded trace-step rows, and reuses the existing Usage tab for usage data. Missing/ambiguous/orphan Runtime bindings block diagnostics just like Session configuration. Runtime update/release/delete was completed by later S5-06/S5-07 slices. Verified by focused frontend source-contract tests (34 passed), full frontend tests (1216 passed), i18n, build, focused MPA BFF/main-app tests (32 passed), and focused Python Ruff. -- [x] `S5-06` Implement Runtime update/release/rollback compatibility preflight. - - Owner: `veadk-python`; depends on `M0-07`, `S1-05`; acceptance `AC-9`, `AC-10`; verification `VC-19`, `VC-21`; estimate 2d. - - Status 2026-09-16: implemented shared in-process MPA compatibility preflight in `veadk.cli.mpa_p0_contract` and kept `scripts/verify-mpa-p0-contract.sh` on the same logic. Studio now runs the preflight before MPA Runtime update through `/web/deploy-agentkit`, GitHub Actions Runtime delivery setup through `/web/github-delivery/cicd-pipeline`, initial GitHub delivery branch setup through `/web/github-delivery/init-main`, bound GitHub source sync through `/web/github-cicd/runtime-sync`, and GitHub rollback PR creation through `/web/github-delivery/rollback-pr`. Incompatible or malformed manifests return `409 mpa_compatibility_preflight_failed` before calling AgentKit SDK or GitHub mutation helpers; compatible manifests continue the existing path. The UI sends `agentCategory=mpa` for MPA deploy/update and rollback paths, while non-MPA Runtime paths keep legacy behavior. This slice is an interface guard; S5-10 still owns the final pinned cross-repo manifest execution and S5-11 owns live lifecycle/rollback/delete. -- [x] `S5-07` Implement authorized delete impact preview and staged cleanup. - - Owner: `veadk-python`; depends on `S5-06`; acceptance `AC-9`; verification `VC-21`; estimate 2d. - - Status 2026-09-16: implemented Studio-authorized MPA delete preview and execution guards without adding new Runtime tables or mpa-agent APIs. `GET /web/mpa/agents/{mpaInstanceId}/delete-preview` resolves the target MPA Runtime binding, reads Runtime `profile-status`, lists visible sessions with `GET /api/v1/sessions?include_a2a=true`, reports blockers (`runtime_missing`, `binding_ambiguous`, `orphan_runtime`, `active_operation`, `active_sessions`), session counts, active-session summaries, and an ordered cleanup plan. `/web/delete-runtime` now rechecks the server-side Runtime `veadk:agent-type=mpa` tag before applying the MPA staged cleanup path, blocks active operations and sessions in `queued|running|pausing|paused|resuming` with a structured `409`, deletes visible idle/terminal sessions through Runtime `DELETE /api/v1/sessions/{sessionId}`, then deletes the AgentKit Runtime. Per-session cleanup treats `404` as already deleted for retry safety. Client-supplied `agentCategory` cannot make a general Runtime use MPA cleanup. The UI fetches the MPA delete preview before single-agent delete confirmation and disables the destructive confirm action when preview blockers exist. Current coverage is local contract coverage; S5-11 still owns live cloud delete residue proof. -- [x] `S5-08` Extract shared `MpaControlPlaneClient`. - - Owner: `veadk-python`; depends on S1–S4 APIs; acceptance `AC-10`; verification `VC-22`; estimate 1.5d. - - Status 2026-09-18: added the public async `veadk.integrations.mpa.MpaControlPlaneClient` and shared Pydantic schemas for MPA Profile, lifecycle operation, Agent view/capabilities, Session execution configuration, and delete preview. The client targets only Studio BFF endpoints, injects the validated Studio bearer without exposing Runtime credentials, enforces `Idempotency-Key`/`If-Match` preconditions, preserves response ETags, maps HTTP/timeout failures to a redacted structured error, rejects unstructured response detail as an error code, and validates external responses. BFF Runtime transport now reuses the shared Profile/Session schemas, and `GET /web/mpa/agent-operations/{operationId}` fills the existing VC-22 terminal-operation lookup gap with owner-scoped repository access. No Managed Agent API, Runtime schema, or `agentkit-mpa-agent` change is required for this slice. Focused shared-client tests returned 19 passed; the complete Studio MPA backend plus shared-client suite returned 73 passed; focused Ruff, compileall, pre-commit, and diff hygiene passed. The repository regression with declared `dev + extensions + sandbox` extras returned 4639 passed, 8 skipped, and 2 xfailed. Pyright remains blocked because no executable is installed in the repository environment. -- [x] `S5-09` Implement CLI commands through the shared client. - - Owner: `veadk-python`; depends on `S5-08`; acceptance `AC-10`; verification `VC-22`; estimate 2d. - - Reviewed scope: preserve the provisioning-oriented `veadk mpa create`; add `veadk mpa control` for Studio BFF view/create/update, operation list/get/retry, Profile status/apply, Session config get/patch/profile-upgrade, and delete preview. The CLI accepts no Runtime Secret and never calls Runtime directly. Chat/Turn/Debug remain Studio execution/diagnostic surfaces until a separate shared BFF contract is designed. - - Status 2026-09-18: implemented the reviewed `veadk mpa control` tree in `veadk/cli/cli_mpa_control.py` while retaining the legacy provisioning `veadk mpa create`. Commands consume JSON files or stdin, use only `MpaControlPlaneClient`, accept Studio URL/bearer from explicit options or controlled environment variables, forward caller-stable idempotency keys and CAS revisions/ETags, preserve response ETags in JSON, and emit redacted structured control-plane errors with stable exit codes. Loopback BFF behavior tests cover every command group, 202 responses, authorization/conflict/precondition/server failures, old-Runtime read-only capabilities, stdin, Secret rejection, and server-observed same-key replay after client timeout. Two-round review fixed nested help so it does not require a connection and clarified local usage-error output. Focused CLI tests returned 22 passed; shared-client plus MPA CLI tests returned 57 passed; all CLI tests returned 1402 passed and 4 skipped; the required parallel Python regression returned 4661 passed, 8 skipped, and 2 xfailed. Focused Ruff/format, compileall, and diff checks passed. Pyright remains blocked because the repository environment has no executable. No Runtime API, Runtime database, Managed Agent, frontend, or `agentkit-mpa-agent` change was needed. -- [x] `S5-10` Execute compatibility preflight. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S5-01`, `S5-01a`, and `S5-02`–`S5-09`; acceptance `AC-9`, `AC-10`, `AC-12`; verification `VC-15`, `VC-19` preflight; estimate 0.5d. - - Status 2026-09-18: executed the read-only VC-19 preflight with pinned VeADK `486dc06e429573ce43d6462b6dc960be4bc34ab6`, Runtime `eecc6e3115685e5cb86dcfbff4fb7c6ac7a10dee`, AgentKit SDK `0.8.5`, and deployed Runtime v62 image digest `sha256:6ac6a2712ecd1c7950125dc9afc6467373a08142fbd6c3577aba12f126079bef`. A live AgentKit Runtime detail read returned `Ready`, version 62, and the expected artifact tag; registry inspection independently returned the pinned digest. The real manifest passed rule `p0-codex-rest-v1`; an unlisted `codex-v2` protocol returned exit 3 / `worker_protocol_incompatible`; an invalid digest returned exit 2 / `invalid_runtime_image_digest`. Manifest contract tests returned 4 passed, Studio/GitHub mutation-fence tests returned 8 passed, and the VC-15 Runtime redaction suite returned 91 passed. Raw evidence was captured locally under ignored `evidence/contract/s5-10-v62-20260918/`. This closes only the S5-10 preflight; the post-VC-21 full regression, coverage, PostgreSQL, build, and performance section of VC-19 remains owned by S5-13. No Runtime, database, frontend, or API implementation change was required. -- [x] `S5-11` Execute live Runtime lifecycle, rollback, and deletion. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S5-10`; acceptance `AC-9`; verification `VC-21`; estimate 1d. - - Status 2026-09-18: executed VC-21 with isolated Runtime resources using image `agentkit-platform-2112682748-cn-beijing.cr.volces.com/agentkit/mpa_agent_vc21c:mpa-p0-smoke-v29-eecc6e3-20260918` and digest `sha256:078519c796b03b298a95ef7a6614f92121bc124513dbb472a7496c95821ee723`. Run `vc21-20260918-045` passed compatibility, Runtime provisioning, Profile apply, execution-ready smoke, same-image no-op update, controlled failed update recovery, compatible rollback smoke, active-operation and active-session deletion blockers, idle-session cleanup, final Runtime delete, and PostgreSQL cleanup. Final runner output was `{"case":"VC-21","residue":[],"status":"passed"}`. During `vc21-20260918-044`, live execution exposed a stale delete-blocker bug where a recovered `failed_retryable/smoke_running` operation still blocked deletion after Profile status was `applied`; `frontend/server/mpa/routes.py` and the actual Studio `/web/delete-runtime` guard in `veadk/cli/cli_frontend.py` now treat this recovered state as non-blocking while preserving true `active` operation and active-session blockers. Focused CLI/route/driver tests returned 49 passed and focused Ruff passed. Raw evidence was captured locally under ignored `evidence/live/vc21-20260918-045/`. -- [x] `S5-12` Execute all browser Cases. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S5-01`, `S5-01a`, and `S5-02`–`S5-11`; acceptance `AC-3`, `AC-5`, `AC-6`, `AC-7`, `AC-8`, `AC-10`; verification `VC-15` and full `VC-17` (`BC-01`–`BC-09`); estimate 1d. - - Status 2026-09-18: a production-like Studio chat-display subset passed against deployed Runtime `r-yeuujrrcowb21078p9jh` version 62. New Session `bee3db38-edcc-4020-b925-3d9d6a3a7adc` executed `printf 'MPA_V62_BROWSER_OK\n'`; parent and child sandbox activities reached `completed`, the final answer remained visible after completion and 30 seconds, and refresh restored the same answer and terminal tool cards without spinner/running text. Raw evidence was captured locally under ignored `evidence/browser/mpa-v62-live/`. S5-12 remains open because this run does not execute or replace the complete `BC-01`–`BC-09` matrix. - - Status 2026-09-19: the current-branch loopback browser run passed `BC-03`, `BC-04`, `BC-05`, `BC-06`, and `BC-09` with system Google Chrome driven by gstack v1.87.4.0. The run verified all five MPA binding states, two isolated browser profiles at ETag `"6"` with one `200` CAS update and one authoritative `412`, explicit Profile upgrade and idempotent replay, unique persisted cursor events before and after refresh plus `410 cursor_expired`, and the full pause/partial-ACK/paused/resume/checkpoint-continuation sequence with no automatic continuation and one same-key replay. Test-only harness gaps found during the run were repaired for MPA view, Session list/events, persisted terminal cursor events, and a controllable lifecycle stream; the main Vite entry was constrained to `index.html`, and three duplicate `agentCategory` fields from the branch integration were removed so the frontend build passes. `BC-01`, `BC-02`, `BC-07`, and `BC-08` remain `blocked`: their documented `create_success`, creation-failure, and `slow_scope_switch` scenarios have no isolated write/scope implementation, while the current creation UI reaches the real `/web/deploy-agentkit` mutation path. No live cloud create was attempted. Raw evidence was captured under ignored local `evidence/browser/s5-12-20260919-r1/` and is intentionally not a delivery artifact. Next work is to add zero-cloud-side-effect scenario routes for those four Cases, execute them in the browser, then close `S5-12`; do not start `S5-13` first. - - Status 2026-09-20: completed `BC-01`–`BC-09` against the loopback-only fixture without calling AgentKit SDK or cloud mutations. The added seams isolate Runtime-name validation, generated draft/project output, deploy SSE, operation create/list/get/retry, deterministic failure stages/barriers, and principal/region-scoped Runtime discovery. `BC-01` proved create plus refresh recovery from `profile_applying` to `runnable`; `BC-02` proved all four retryable failure classes resume through one operation-only retry without a second deploy; `BC-07` proved IME Enter suppression and `1024x768` no-overflow reachability; `BC-08` proved a delayed Alice/Beijing response cannot replace Bob/Shanghai state for the same Runtime ID and denied scope returns only `404 resource_not_found`. Browser findings repaired active-operation refresh polling, safe retry on quick and traditional create paths, IME handling, recovered-success localization, retry rejection handling, and debug/chat capability while an operation is active or retryable-failed. Final verification on the working diff: frontend 1243 passed, focused MPA backend 53 passed, TypeScript/Ruff/i18n/diff checks passed, and production build passed with existing chunk warnings. The pre-existing `npm ci` lock inconsistency remains for `S5-13`. Raw evidence is local-only under ignored `evidence/browser/s5-12-20260919-r1/` and is not a delivery artifact. -- [ ] `S5-13` Execute final two-repository regression, coverage, PostgreSQL, and performance gates. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S5-01a`, `S5-11`, `S5-12`; acceptance `AC-6`, `AC-9`, `AC-10`, `AC-12`; verification `VC-15`, `VC-18E`, `VC-19` final; estimate 1.5d. -- [ ] `S5-14` Execute full live creation/identity/Profile regression. - - Owner repo: `veadk-python`; participating repo: `agentkit-mpa-agent`; depends on `S5-13`; acceptance `AC-1`, `AC-2`, `AC-6`, `AC-11`; verification `VC-20B`; estimate 1d. -- [ ] `S5-15` Reconcile every Case status and cross-repository version record. - - Owner: `veadk-python`; depends on `S5-14`; acceptance `AC-1`–`AC-12`; verification: all VC; estimate 0.5d. - -## Alignment record - -- Requirements: `AC-1`–`AC-12` all map to implementation Tasks and executable VC. -- Data ownership: each schema has one Runtime owner Task; later Tasks consume or verify it. -- API ownership: Studio Profile BFF, Runtime API/domain, and UI/CLI have distinct owners; Managed Agent APIs are out of scope. -- Scope: no ArkClaw migration, template/expert/review-install, Resource Library/Search, scheduled task, Feishu, website, or worker-protocol change. -- Evidence: unit/mock, PostgreSQL, browser, compatibility, and live results stay separate. -- Gate: local M0 is mandatory before S1; deployed-only identity/Profile verification is mandatory at S5-14. S1–S5 are serial and independently reversible. - -## Authoritative implementation and TDD map - -The table below is part of each Task's definition. “RED” is run before production changes; “GREEN” is the smallest implementation boundary. Files outside the named area are not changed unless a failing contract proves a required call-site change. - -| Task | Production files | First failing test / RED command | GREEN boundary and deliverable | -| --- | --- | --- | --- | -| `M0-01` | Bilingual PRD/contracts and VeADK AgentDraft/Profile fixtures | paired-document and fixture consistency checks | no Managed Agent dependency; normalized Profile contract | -| `M0-02` | VeADK Runtime Profile client contract | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_client.py` | typed apply/status boundary; no Managed Agent client | -| `M0-03` | Runtime `app/identity/runtime_principal.py`, `app/api/auth.py`, `app/a2a/{context,middleware}.py`, `app/identity/tip_verify.py` | `uv run pytest -q tests/test_runtime_principal.py` | one bearer/TIP principal parser, authorizer protocol, rejection foundation | -| `M0-05` | Runtime `app/migrations/`, `app/stores/schema_version.py`, `docker-compose.test.yml`, `Makefile`, schema fixture | `make test-postgres TEST_SELECT='foundation or migration_harness'` | ordered/reentrant migration and PG16 harness with cleanup | -| `M0-06` | Runtime `app/runtime/clock.py`, dispatcher/probe/failpoint protocols and dependency wiring | `uv run pytest -q tests/test_p0_test_seams.py` | injectable deterministic seams, disabled in production | -| `M0-07` | VeADK `scripts/verify-mpa-p0-contract.sh`, compatibility manifest/matrix schema | `uv run --extra dev pytest -q tests/integrations/test_mpa_compatibility_manifest.py` | validated manifest, deterministic matrix preflight | -| `M0-08` | VeADK `frontend/server/mpa/test_scenarios.py`, mount guard, `scripts/run-mpa-p0-browser-fixture.sh` | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_scenario_harness.py` | test/loopback/token-file scenario API and production-route absence | -| `M0-09` | VeADK `scripts/verify-mpa-p0-e2e.sh`, manifest validator/helper | `uv run --extra dev pytest -q tests/integrations/test_mpa_p0_e2e_runner.py` | dry-run plan, checkpoint resume, EXIT cleanup; no live call in unit test | -| `M0-10` | VeADK `scripts/benchmark-mpa-p0.py`, benchmark report schema | `uv run --extra dev pytest -q tests/integrations/test_mpa_p0_benchmark.py` | deterministic request generation and p50/p95/max/error parser | -| `S1-01` | Runtime `app/stores/runtime_operations.py`, `app/services/runtime_operations.py`, `app/schemas/runtime_operation.py` | `uv run pytest -q tests/test_runtime_operations.py` | SQL/in-memory ledger, TTL, authorized GET, safe replay | -| `S1-02` | Runtime `app/stores/agent_config.py`, `app/schemas/agent_config.py`, migration step | `uv run pytest -q tests/test_agent_config_store.py tests/test_profile_apply.py` | source/apply columns and applied-only current switch | -| `S1-03` | Runtime `app/schemas/profile_apply.py`, `app/services/profile_apply.py`, `app/api/v1/agents.py` | `uv run pytest -q tests/test_profile_apply.py tests/test_runtime_principal.py` | strict mapping, ETag/preconditions, apply/status endpoints with shared authorization | -| `S1-04` | Runtime `app/stores/mpa_meta.py`, `app/services/mpa_meta.py`, `app/core/config.py`, `app/main.py`, readiness | `uv run pytest -q tests/test_mpa_meta.py tests/test_health.py tests/test_runtime_principal.py` | AgentKit mode, staged readiness, no ArkClaw fallback | -| `S1-05` | Runtime `app/services/execution_smoke.py`, `app/api/v1/readiness.py`, existing Codex worker client | `uv run pytest -q tests/integration/test_execution_ready_smoke.py` | deterministic model/Worker probes, error classes, mandatory cleanup | -| `S1-05a` | Runtime Session auth wrapper, `app/api/v1/sessions.py`, `app/a2a/{context,executor}.py`, worker/tool dispatch authorization hook | `uv run pytest -q tests/test_runtime_principal.py tests/test_session_auth.py tests/test_a2a_executor.py tests/test_codex_delegation_tool.py` | shared authorizer on Session create/read, default-revision A2A first chat, and worker/tool dispatch; zero effect after revocation | -| `S1-06` | VeADK `frontend/server/mpa/{models,runtime_client,routes}.py`, mount in `veadk/cli/cli_frontend.py` | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_agent_routes.py` | typed MPA Profile apply/status BFF over Runtime API | -| `S1-07` | VeADK `frontend/server/mpa/operations.py` | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_agent_operations_repository.py` | TOS-CAS repository and idempotent create/update records | -| `S1-08` | VeADK `frontend/server/mpa/service.py`, `routes.py` | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_agent_operations_service.py tests/frontend/server/mpa/test_agent_routes.py` | create/update stage orchestration, reconcile, retry | -| `S1-09` | VeADK `frontend/src/mpa/{client,MpaAgentCreate}.tsx`, `MyAgents.tsx`, `App.tsx`, locale files | `npm --prefix frontend test -- --test-name-pattern=MPA` or full `npm --prefix frontend test` | explicit MPA intent, progress/error/retry UI; no generic create path | -| `S2-01` | Runtime `app/stores/session_meta.py`, session CRUD/service | `uv run pytest -q tests/test_session_meta_store.py` | scoped Agent/version/config pointers | -| `S2-02` | Runtime `app/stores/session_execution_config.py`, `app/schemas/session_execution_config.py`, migration | `uv run pytest -q tests/test_session_execution_config.py` | immutable SQL/in-memory revisions and strong ETag | -| `S2-03` | Runtime `app/services/session/execution_config.py`, `app/api/v1/sessions.py`, deps | `uv run pytest -q tests/test_session_execution_config.py tests/test_runtime_principal.py` | authorized Session read/mutation, resolver, replace/clear/inherit, atomic invalid rejection | -| `S2-04` | Runtime execution-config domain value object only | `uv run pytest -q tests/test_session_execution_config.py -k resolved_snapshot` | immutable resolved snapshot value returned to acceptance; no Turn persistence yet | -| `S2-05` | Runtime execution-config upgrade use case and Session API/schema | `uv run pytest -q tests/test_session_execution_config_service.py -k profile_upgrade` | authorized upgrade CAS/idempotency/recompute endpoint | -| `S2-06` | VeADK `frontend/server/mpa/{runtime_client,routes}.py`, `frontend/src/adk/client.ts` | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_mpa_module.py && npm --prefix frontend test` | browser-facing typed API client/proxy only; not Python CLI client | -| `S2-07` | VeADK `frontend/src/ui/{AgentWorkspace.tsx,AgentWorkspace.css}`, `frontend/src/adk/{client,connections}.ts`, `frontend/src/ui/{MyAgents,AgentSelector}.tsx`, locale files | `npm --prefix frontend test && npm --prefix frontend run build && npm --prefix frontend run check:i18n` | MPA-only Session config tab; current/target display, stale handling, explicit upgrade | -| `S3-01` | Runtime `app/stores/turn_execution.py`, `app/runtime/dispatch.py`, migration | `uv run pytest -q tests/test_turn_dispatcher.py` | Turn record, active claim, unique dispatch intent | -| `S3-02` | Runtime Session run API/service and A2A executor/card | `uv run pytest -q tests/test_run_acceptance.py tests/test_a2a_executor.py tests/test_runtime_principal.py` | authorized shared acceptance, persisted resolved snapshot, execution-v1 extension | -| `S3-03` | Runtime dispatcher/reconciler and lifespan wiring | `uv run pytest -q tests/test_turn_dispatcher.py` | attempt-safe dispatch and three crash-point recovery paths | -| `S3-04` | Runtime `session/{sse,events,stream_hub,event_history}.py` | `uv run pytest -q tests/test_session_sse_persistent_replay.py tests/test_session_sse_edges.py` | persistent cursor, 410, overlap dedup, terminal fence | -| `S3-05` | VeADK `frontend/src/adk/client.ts`, `frontend/src/App.tsx`, event projection tests | `npm --prefix frontend test` | idempotent run, cursor reconnect, deduplicated rendering | -| `S4-01` | Runtime `app/stores/a2a_turn_participants.py`, migration | `uv run pytest -q tests/test_turn_participants.py` | SQL/in-memory participant lease/generation store | -| `S4-02` | Runtime `runtime/participant_barrier.py`, `runtime/turn_control.py`, A2A executor and Codex worker hooks | `uv run pytest -q tests/test_turn_participants.py tests/test_participant_barrier.py tests/test_turn_control_api.py tests/test_a2a_app_lifecycle.py tests/test_codex_adapter.py::test_adapter_pauses_worker_and_continues_interrupted_turn_on_resume tests/test_codex_adapter.py::test_adapter_marks_completed_worker_participant_terminal_before_next_pause tests/test_codex_adapter.py::test_adapter_late_worker_joins_paused_generation_before_resume` | complete barrier, stale ACK and spawn-race protection | -| `S4-03` | Runtime task-control store, participant barrier, control API/schema | `uv run pytest -q tests/test_a2a_task_store.py::test_resume_after_five_minutes_requires_a_new_turn tests/test_a2a_task_store.py::test_resume_at_exact_five_minute_boundary_keeps_same_turn tests/test_a2a_task_store.py::test_resume_replay_after_new_turn_required_is_idempotent tests/test_participant_barrier.py::test_resume_requires_new_turn_when_participant_is_lost tests/test_participant_barrier.py::test_resume_rejects_until_running_participants_ack_or_expire tests/test_participant_barrier.py::test_resume_allows_exact_five_minute_boundary_with_resumable_participants tests/test_turn_control_api.py::test_expired_resume_returns_incremental_turn_contract tests/test_turn_control_api.py::test_resume_status_reports_new_turn_when_owner_lease_is_lost` | exact 300-second lease-aware resume, participant viability, and idempotent `new_turn_required` replay | -| `S4-04` | Runtime continuation service/router using S3 outbox | `uv run pytest -q tests/test_run_acceptance.py::test_mpa_continue_creates_linked_turn_and_replays tests/test_run_acceptance.py::test_mpa_continue_rejects_before_new_turn_required tests/test_turn_dispatcher.py::test_in_memory_turn_execution_accepts_linked_continuation_after_interrupted_turn tests/test_turn_dispatcher.py::test_in_memory_turn_execution_continuation_rejects_mismatched_replay` | explicit linked continuation and race-safe replay | -| `S4-05` | VeADK `frontend/src/App.tsx`, `frontend/src/adk/client.ts`, focused source-contract tests | `node --test frontend/tests/runSseAbort.test.mjs frontend/tests/newChatComposerLayout.test.mjs frontend/tests/mpaSessionConfigUi.test.mjs && npm --prefix frontend run check:i18n && npm --prefix frontend run build` | remove prompt fallback; authoritative Runtime `/continue` + `/sse` client path | -| `S4-06` | Runtime shared authorizer call sites at run/resume/continue/secret/tool dispatch | `uv run pytest -q tests/test_agentkit_session_auth.py tests/test_runtime_principal.py tests/test_model_endpoint.py tests/test_runtime_tool_authorization.py tests/test_runtime_agent_callbacks.py::test_before_tool_rechecks_runtime_authorizer_before_side_effect tests/test_runtime_tools.py::test_agent_service_mounts_sandbox_task_by_default tests/test_run_acceptance.py::test_mpa_run_persists_runtime_principal_snapshot_for_inbox_recovery tests/test_sessions.py::test_inbox_run_rechecks_authorizer_before_sandbox_begin_secret_use` | revocation recheck before every named side effect; no bearer token persisted | -| `S5-01` | Runtime secret migration step/provider and Agent config store | `uv run pytest -q tests/test_secret_reference_migration.py` | reference-first migration, plaintext clear, retry/rollback fence | -| `S5-01a` | Runtime `app/security/value_redaction.py`, `app/services/secret_reference_migration.py`, `app/api/access_log.py`, `app/services/session/redaction.py`, `app/runtime_console/redaction.py`, trace persistence serializers | `uv run pytest -q tests/test_secret_reference_migration.py tests/test_session_redaction.py tests/test_api_access_log.py tests/test_runtime_console_api.py tests/test_runtime_operations.py tests/test_runtime_trace_store.py` | canary absent from API/log/trace/evidence while references and non-secret business IDs remain usable | -| `S5-02` | VeADK `frontend/server/mpa/views.py`, `models.py`, routes | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_agent_view.py` | unique binding and `MpaAgentView` 0/1/N/orphan semantics | -| `S5-03` | VeADK `frontend/src/mpa/MpaAgentDetail.tsx`, model/client/locales | `npm --prefix frontend test` | MPA Profile revisions/detail and strict non-MPA feature isolation | -| `S5-04` | Runtime Console schemas/service/trace/lifecycle stores | `uv run pytest -q tests/test_runtime_console_api.py tests/test_runtime_trace_store.py` | indexed Agent/Profile/config/Turn/worker correlation | -| `S5-05` | VeADK MPA detail diagnostics client/UI | `npm --prefix frontend test` | bounded redacted Debug/Trace/history/usage view | -| `S5-06` | VeADK Runtime lifecycle adapter/preflight | `uv run --extra dev pytest -q tests/integrations/test_mpa_compatibility_manifest.py tests/cli/test_studio_rbac.py::test_mpa_update_rejects_incompatible_manifest_before_launch tests/cli/test_studio_rbac.py::test_mpa_update_allows_compatible_manifest_to_reach_launch tests/cli/test_github_cicd.py::test_mpa_github_delivery_cicd_rejects_incompatible_manifest_before_push tests/cli/test_github_cicd.py::test_mpa_github_delivery_init_rejects_incompatible_manifest_before_push tests/cli/test_github_cicd.py::test_mpa_github_delivery_attach_rejects_incompatible_manifest_before_push tests/cli/test_github_cicd.py::test_mpa_github_runtime_sync_rejects_incompatible_manifest_before_push tests/cli/test_github_cicd.py::test_mpa_github_delivery_rollback_rejects_incompatible_manifest_before_pr tests/cli/test_github_cicd.py::test_mpa_github_delivery_rollback_allows_compatible_manifest` | update/release/rollback preflight rejects incompatible manifests before mutation and allows compatible manifests | -| `S5-07` | VeADK MPA lifecycle service/routes | `uv run --extra dev pytest -q tests/frontend/server/mpa/test_runtime_profile_client.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py::test_runtime_detail_proxy_and_delete_enforce_role_and_owner tests/cli/test_studio_rbac.py::test_mpa_runtime_delete_blocks_active_sessions_before_runtime_delete tests/cli/test_studio_rbac.py::test_mpa_runtime_delete_cleans_idle_sessions_then_runtime tests/cli/test_studio_rbac.py::test_delete_runtime_ignores_untrusted_mpa_category_for_general_runtime` | impact preview, active-operation/session blockers, server-side MPA tag recheck, visible idle Session cleanup before Runtime deletion | -| `S5-08` | VeADK Python `veadk/integrations/mpa/control_plane_client.py` | `uv run --extra dev pytest -q tests/integrations/test_mpa_control_plane_client.py` | UI/CLI shared Python BFF client; distinct from S2 TypeScript client | -| `S5-09` | VeADK CLI MPA command modules | `uv run --extra dev pytest -q tests/cli/test_cli_mpa_control.py` | Studio BFF view/create/update, operation, Profile, Session configuration, and delete-preview commands via shared client; no direct Runtime execution path | - -## Transaction coordinator ownership - -| Atomic boundary | Coordinator owner | Participating stores and lock order | Crash/outside-system boundary | -| --- | --- | --- | --- | -| Profile apply success | `S1-03` ProfileApplyService | `runtime_operations` row, then current `mpa_agents` row; insert applied revision, flip current, finish operation | Studio resource validation occurs before transaction; retry by operation key | -| execution-config PATCH | `S2-03` ExecutionConfigService | lock `session_meta`, compare ETag, insert config revision, update pointer | Remote resource resolve before transaction; digest recheck before dispatch | -| Profile-revision upgrade | `S2-05` upgrade use case | operation row, `session_meta`, new config revision; pointer and operation result in one commit | Target Profile/resource reads before transaction | -| Run acceptance | `S3-02` TurnAcceptanceService | Session active claim, Turn record, frozen execution-config snapshot, dispatch intent | Model/A2A/Worker only after accepted Turn persistence | -| Participant barrier | `S4-02` ParticipantBarrierService | control task/generation row, then participant rows; aggregate transition last | Worker ACK is input; no external effect inside transaction | -| Continuation acceptance | `S4-04` ContinuationService | operation row, old Turn/control generation, linked Turn, dispatch intent | A2A Task creation after commit through idempotent dispatcher | -| Secret migration | `S5-01` SecretMigrationService | external reference creation first; then migration checkpoint + reference + plaintext clear in one DB transaction | Stable reference key enables retry; failure before DB commit retains plaintext | - -Lock order is mandatory across code paths to avoid deadlocks. No Task may describe AgentKit, A2A SDK TaskStore, ADK event persistence, Worker calls, or Secret provider calls as participating in a distributed ACID transaction. - -## Gate-task deliverables - -| Task | Owner repo / execution repos | Deliverable | -| --- | --- | --- | -| `S1-10` | `veadk-python` / both | S1 evidence index for VC-04–07, BC-01/02 and BC-07 subset, VC-20A | -| `S2-08` | `veadk-python` / both | S2 evidence index for VC-08/09, BC-04/05, VC-18B | -| `S3-06` | `veadk-python` / both | S3 evidence index for VC-10/11/14, BC-06, VC-18C | -| `S4-07` | `veadk-python` / both | S4 evidence index for VC-12/13, BC-09, VC-18D | -| `S5-10` | `veadk-python` / both | compatibility preflight artifact for VC-19 | -| `S5-11` | `veadk-python` / both | live Runtime lifecycle/rollback/delete evidence for VC-21 | -| `S5-12` | `veadk-python` / both | full BC-01–09 screenshots/network/console evidence; VC-17 final result | -| `S5-13` | `veadk-python` / both | final test/build/coverage/PG/performance evidence for VC-19 | -| `S5-14` | `veadk-python` / both | full live identity/create/Profile evidence for VC-20B and cleanup report | -| `S5-15` | `veadk-python` / both | final AC/VC status matrix and pinned cross-repo manifest | diff --git a/openspec/changes/mpa-runtime-integration-hardening/proposal.md b/openspec/changes/mpa-runtime-integration-hardening/proposal.md deleted file mode 100644 index 1ac4c6c4d..000000000 --- a/openspec/changes/mpa-runtime-integration-hardening/proposal.md +++ /dev/null @@ -1,20 +0,0 @@ -# Change: MPA Runtime integration hardening - -## Why - -VeADK-created mpa-agent Runtimes use external PostgreSQL/OpenViking and a synthetic compatibility space ID, but still call ArkClaw resource discovery, omit the Runtime key from built-in MCP configuration, misorder A2A progress artifacts, and lack complete Studio diagnostics. - -## What changes - -- Disable ArkClaw resource discovery and lazy login only for VeADK provisioning. -- Publish the Runtime key and public URL in phase two and enable APMPlus safely. -- Correct A2A artifact creation/append ordering and relay usage/reasoning. -- Add bounded sanitized log download and Token usage projection. -- Add allowlisted request-scoped Studio model selection shared by primary and delegated execution. - -## Impact - -- mpa-agent: configuration, dependency wiring, A2A card/executor, model resolution, sandbox delegation. -- veadk-python: provisioning, Runtime A2A bridge, Studio diagnostics and UI. -- No database migration. Native ArkClaw defaults remain unchanged. -- Live completion requires a separately authorized image publication and Runtime update. diff --git a/openspec/changes/mpa-runtime-integration-hardening/tasks.md b/openspec/changes/mpa-runtime-integration-hardening/tasks.md deleted file mode 100644 index 142fbcf22..000000000 --- a/openspec/changes/mpa-runtime-integration-hardening/tasks.md +++ /dev/null @@ -1,16 +0,0 @@ -# Tasks - -- [x] `T-1` Review and approve the bilingual PRD/component contracts. (`VC-1`–`VC-8`) -- [x] `T-2` Add the VeADK-only AppCenter discovery and lazy-login boundary. (`VC-1`) -- [x] `T-3` Inject Runtime URL/key in phase two and enable APMPlus without trace content. (`VC-2`, `VC-7`) -- [x] `T-4` Correct first-artifact append semantics and relay reasoning/usage. (`VC-3`, `VC-5`) -- [x] `T-5` Bound Runtime logs to 1,000 sanitized lines and download the visible snapshot. (`VC-4`) -- [x] `T-6` Implement usage snapshot/delta normalization through the existing Token UI. (`VC-5`) -- [x] `T-7` Implement allowlisted request-scoped model selection for primary and delegated execution. (`VC-6`) -- [x] `T-8` Run targeted suites, frontend full tests/build, static checks, pre-commit, and two review rounds. (`VC-8`) -- [x] `T-9` Publish a new mpa-agent image, update Runtime `r-yeuujrrcowb21078p9jh`, and execute live cases. (`VC-1`, `VC-3`–`VC-7`) -- [ ] `T-10` Commit and push scoped changes in both repositories after live gates pass. (`VC-8`) - -## Alignment - -All `FR-1`–`FR-9` requirements map to `VC-1`–`VC-8`. No Task lacks an acceptance case. Existing user-owned changes and untracked configuration files are excluded from scoped commits. diff --git a/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.md b/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.md new file mode 100644 index 000000000..d5f172a80 --- /dev/null +++ b/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.md @@ -0,0 +1,40 @@ +# Server-owned defaults for new Feishu group permissions + +[中文](2026-10-12-server-default-scope.zh.md) + +Change: studio-channel-server-default-scope. Date: 2026-10-12. Status: implemented. +Contract: [mpa-channels](../../../specs/mpa-channels/README.md), CON-17. + +## Evidence and scope +RuntimeChannels initializes group_sender and sends it with every group-permission POST. This overrides Runtime defaults even when the administrator only intends to allow a group. The user explicitly approved removing the isolation selector and omitting this field, while preserving existing groups. Only the Studio consumer changes; Runtime API types, optional scope support and backend precedence remain intact. + +## Requirements and design +FR-1: A new group form contains no isolation selector or hidden scope state. FR-2: Its POST contains channel, trimmed chatId and appId when an account is selected, but never groupSessionScope, including null or an empty string. FR-3: Existing groups retain their returned scope display; rendering, refreshing or adding another group must not issue automatic updates to them. FR-4: Existing loading, disabled, IME, cancellation, failure/retry and multi-bot targeting behavior remains. + +Delete only the selector, its local state/options/imports, and the POST property. Do not force group, clear stored scopes, change data structures, migrate data, add dependencies or touch execution/streaming. API-level callers may still use the optional field. The Runtime owns resulting defaults; Studio does not claim every deployment defaults to group. Adding an already existing ID follows the unchanged Runtime upsert behavior; no migration guarantee is invented. + +## Tasks and acceptance +| Requirement | Task | Acceptance | Verification | +| --- | --- | --- | --- | +| FR-1/FR-2 | T-1: regression first, then minimal RuntimeChannels change | AC-1: selector absent and exact POST body omits scope in single/multi-bot modes | runtimeChannels.test.tsx | +| FR-3 | T-2: retain returned scope rendering | AC-2: existing group_sender/topic modes display without writes | runtimeChannels.test.tsx | +| FR-4 | T-3: run existing interaction tests and local browser checks | AC-3: normal/failure/retry/keyboard/narrow flow and account identity preserved | npm test, targeted Vitest, npm run build, browser | + +## Review and authorization +Direct design review: feasible existing optional API, no backend or migration change; selected-account auth and abort handling unchanged. The existing-list fallback stays unchanged. No blockers. Authorization is the user's explicit request in this chat. No additional approval needed for the specified minimal change. The referenced frontend-design/ui-ux-pro-max files were absent after searching the repo and local skill roots; this deletion uses frontend/SPEC.md and the component foundation without a new visual design. A global/local VeADK review-spec skill is absent; this review records the equivalent checks directly, without applying another repository's report workflow. + +## Verification and delivery +Verified on 2026-10-12 against HEAD 812faadf plus this worktree diff. Production change removes 31 lines from RuntimeChannels; English/Chinese group description now only describes admission. Existing Button/input/form styles and returned scope labels are reused unchanged; no new styles or dependencies. frontend/README.md and CON-17 are reconciled in both languages. + +- pass: before-fix targeted regression 2 failed / 3 passed / 61 skipped, reproducing the selector and unintended multi-bot scope property. +- pass: targeted `./node_modules/.bin/vitest run tests/runtimeChannels.test.tsx tests/feishuAccounts.test.tsx` from frontend: runtimeChannels.test.tsx 66 passed. No separate feishuAccounts test file matched; multi-bot tests run in RuntimeChannels. +- pass: `npm --prefix frontend test`: Node 1377 passed, Vitest 67 passed. Existing i18next/localStorage warnings remain; no failed tests. +- pass: `npm --prefix frontend run check:i18n`: 2 locales / 21 namespaces consistent. +- pass: final `npm --prefix frontend run build`: TypeScript and both Vite builds succeeded; generated veadk/webui assets updated. Asset grouping changes are generated output, not edits to unrelated source. +- pass: `npm --prefix frontend run test:webui-assets`: 113 files / 350 internal references verified. +- pass: real browser mounted the actual component with isolated HTTP fixtures: disabled empty submit, no isolation control, busy controls disabled, failed save preserves chat ID, keyboard Enter retries, success clears input, original group_sender label stays visible; 390px viewport flow usable. Recorded three actual POST bodies contain only channel/chatId; no write to the existing group. Multi-bot appId omission regression is covered by Vitest, not this single-bot browser fixture. Temporary viewport reset and fixture files/processes removed after verification. +- pass: gitleaks via repository pre-commit hook on changed source/test/docs files; `git diff --check`. +- not_applicable: Python tests/Ruff/Pyright, because no Python changes. +- not_run: real cloud/Feishu E2E, deployment, remote CI, full pre-commit/all-files; no such publication authorized and preserve unrelated worktree edits. + +Local logs and browser evidence are `/tmp/mpa-studio-default-scope-*`, including the form screenshot. No credentials or real production data used. Existing package-lock.json change (512 removed lines) was preserved without modification. No commit/push/deploy performed. Remaining risk: Runtime bot-level inheritance may differ by deployment; omission deliberately delegates that choice. Re-adding an existing ID uses existing Runtime upsert semantics rather than a new preservation guarantee. diff --git a/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.zh.md b/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.zh.md new file mode 100644 index 000000000..c75d88a1d --- /dev/null +++ b/prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.zh.md @@ -0,0 +1,40 @@ +# 新增飞书群权限沿用服务端默认策略 + +[English](2026-10-12-server-default-scope.md) + +变更:studio-channel-server-default-scope。日期:2026-10-12。状态:implemented。 +契约:[mpa-channels](../../../specs/mpa-channels/README.zh.md),CON-17。 + +## 依据和范围 +RuntimeChannels 默认选中 group_sender,并在每次群权限 POST 中提交,导致管理员仅想允许一个群时也覆盖 Runtime 默认值。用户已明确授权删除隔离选择器、不提交该字段、保留已有群。本次只改 Studio 调用方;Runtime API 类型、可选策略能力和后端优先级保持不变。 + +## 需求和设计 +FR-1:新增群表单不含隔离选择器或隐藏策略状态。FR-2:POST 仅包含 channel、去空白 chatId,以及选择账号时的 appId;不包含 groupSessionScope,包括 null 或空字符串。FR-3:已有群继续显示服务端返回的策略;渲染、刷新或新增其他群不会自动更新已有群。FR-4:保留加载、禁用、IME、取消、失败重试及多机器人目标选择行为。 + +仅删除选择器及其状态、选项、导入和提交属性。不强制 group、不清空持久策略、不改数据结构或迁移、不加依赖、不触碰执行和流式。API 调用方仍可显式使用可选字段。最终默认值由 Runtime 决定,Studio 不承诺所有部署都默认 group。再次添加已有 ID 仍按 Runtime 原 upsert 行为处理,不虚构迁移保证。 + +## 任务和验收 +| 需求 | 任务 | 验收 | 验证 | +| --- | --- | --- | --- | +| FR-1/FR-2 | T-1:先回归再最小修改 RuntimeChannels | AC-1:没有选择器,单/多机器人 POST 精确请求体均无策略字段 | runtimeChannels.test.tsx | +| FR-3 | T-2:保留返回策略展示 | AC-2:已有 group_sender/话题策略正常显示且无写入 | runtimeChannels.test.tsx | +| FR-4 | T-3:执行既有交互测试及本地浏览器检查 | AC-3:正常/失败/重试/键盘/窄窗口及账号身份保留 | npm test、定向 Vitest、npm run build、浏览器 | + +## 评审和授权 +直接设计评审:现有可选接口可实现,无后端或迁移变化;所选账号鉴权和取消逻辑不变;既有列表回退显示不变。无阻塞项。授权依据为本聊天用户明确要求,无需对相同最小改动重复确认。仓库引用的 frontend-design/ui-ux-pro-max 在仓库和本地技能目录搜索后仍不存在;本次删除控件遵循 frontend/SPEC.md 及组件基础规范,不新增视觉设计。VeADK 本地/全局 review-spec 缺失,在此直接记录等价检查,不套用其他仓库的报告工作流。 + +## 验证和交付 +2026-10-12 在 HEAD 812faadf 加本次工作区差异上验证。生产代码仅从 RuntimeChannels 删除 31 行,中英文群说明改为只描述准入。沿用原 Button、输入框、表单样式和返回策略标签,不新增样式或依赖;frontend/README.md 和 CON-17 已同步两种语言。 + +- pass:改前定向回归 2 failed / 3 passed / 61 skipped,复现选择器及多机器人请求中多出的策略属性。 +- pass:在 frontend 运行 `./node_modules/.bin/vitest run tests/runtimeChannels.test.tsx tests/feishuAccounts.test.tsx` 对应定向命令,runtimeChannels.test.tsx 66 passed;未匹配独立 feishuAccounts 测试文件,多机器人测试位于 RuntimeChannels。 +- pass:`npm --prefix frontend test`:Node 1377 passed,Vitest 67 passed。保留既有 i18next/localStorage 告警,无失败测试。 +- pass:`npm --prefix frontend run check:i18n`:2 种语言、21 个命名空间一致。 +- pass:最终 `npm --prefix frontend run build`:TypeScript 及两次 Vite 构建成功,veadk/webui 生成物已更新;资源分组变化属于构建输出,并未编辑其他业务源码。 +- pass:`npm --prefix frontend run test:webui-assets`:113 个文件、350 个内部引用校验通过。 +- pass:真实浏览器挂载实际组件、使用隔离 HTTP fixture,检查空输入禁用、无隔离控件、执行中控件禁用、失败保留群 ID、Enter 重试、成功清空输入、原 group_sender 标签保留;390px 视口流程可用。记录三次实际 POST 均仅含 channel/chatId,未写入已有群。多机器人 appId 请求回归由 Vitest 覆盖,此浏览器 fixture 为单机器人。验证后恢复视口、移除临时文件并停止 fixture 进程。 +- pass:仓库 pre-commit 的 gitleaks 扫描变更源码/测试/文档;`git diff --check`。 +- not_applicable:Python 测试/Ruff/Pyright,无 Python 改动。 +- not_run:真实云/飞书 E2E、部署、远端 CI、完整 pre-commit/all-files;未授权发布,保留无关工作区改动。 + +本地日志和浏览器证据为 `/tmp/mpa-studio-default-scope-*`,包含表单截图;未使用凭据或真实生产数据。已有 package-lock.json 的 512 行删除保持原样,没有修改。未提交/推送/部署。剩余风险:不同部署的 Runtime Bot 级继承可能不同,省略字段就是将默认选择交给它;再次添加已有 ID 仍按原 Runtime upsert 语义,不增加新保留保证。 diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.md new file mode 100644 index 000000000..3e0669d38 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.md @@ -0,0 +1,46 @@ +# Disable application APM in the BytePlus Studio profile + +[中文版](2026-10-14-disable-application-apm.zh.md) + +Change ID: mpa-byteplus-application-apm. Date: 2026-10-14. Status: superseded. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-17. +Successor: [Restore application APM](2026-10-14-restore-application-apm.md). + +## Background, goals and scope + +A BytePlus Runtime failed during Agent initialization after APM GetAppKey returned InternalServiceTimeout. The built-in overseas profile inherits ENABLE_APMPLUS=true and FORCE_APMPLUS_EXPORTER_REGISTRATION=true from the domestic profile. The user explicitly approved setting these two BytePlus defaults to false to test application startup. No production log, credential or signed URL is retained here. + +Goal: stop requesting application APM initialization by default for BytePlus managed Studio creation. Live verification showed that `ApmplusEnable=true` rewrites the Runtime `ENABLE_APMPLUS` value to `true`, so the BytePlus control-plane setting must also be false. Non-goals: changing domestic defaults, general agents, Worker telemetry, agentkit-mpa-agent code, retry/network recovery, or existing cloud resources. + +## Requirements and scenarios + +- FR-1: Given the built-in BytePlus profile, both ENABLE_APMPLUS and FORCE_APMPLUS_EXPORTER_REGISTRATION are string false in the resolved Runtime environment and deployment payload. +- FR-2: Given the built-in Volcengine profile, both application flags and ApmplusEnable remain true. Given BytePlus, both application flags and ApmplusEnable are false. Provider calls return fresh profiles and cannot contaminate each other. +- FR-3: Retain trusted explicit configuration overrides, existing request hashing, cancellation and partial-failure handling. No API, credential, schema or task-state changes. Do not automatically update an existing Runtime or bypass a conflicting pending deployment. + +## Design, impact and tasks + +T-1: Add a failing provider-parametrized regression to tests/integrations/mpa_managed/test_byteplus.py, checking raw defaults, resolved profile and apply_runtime_settings output without cloud calls (FR-1/FR-2). +T-2: Override the two application keys and `apmplus-enable` in the existing BytePlus branch of studio_profile_values (FR-1/FR-3). The maintained CON-17 and bilingual managed README document the provider distinction. +T-3: Run targeted tests, managed/startup regression with two workers, changed-file Ruff/Pyright, scoped secret scan and bilingual/link/whitespace checks. No frontend assets change; browser/build checks are not applicable because no frontend or HTTP interface changes. + +## Review, risks and acceptance + +User approval: explicit requests on 2026-10-14 to disable the two BytePlus flags and, after live evidence showed the platform override, to disable BytePlus `ApmplusEnable`. Direct design review (review-spec unavailable): scope, configuration precedence, provider isolation, security, compatibility, tests and bilingual equivalence reviewed; no blockers. No new dependencies or sensitive values. BytePlus application and platform APM initialization are disabled; Volcengine remains unchanged. This does not prove startup, OV or chat succeeds, and does not resolve separately diagnosed failures. Changed Runtime settings may conflict with an already pending deployment hash; use a new request for the trial. + +- AC-1: BytePlus resolved environment and payload contain both false values. +- AC-2: Domestic environment and platform ApmplusEnable remain unchanged; BytePlus ApmplusEnable is false; repeated provider loads remain isolated. +- AC-3: Local checks pass; live verification is reported separately, without cloud writes. + +## Verification and delivery + +2026-10-14, local diff based on 2ffe6e14: not_run, implementation checks pending. not_run, live creation/restart/commit/push and all-files pre-commit, none requested. not_applicable, frontend/browser/build and harness smoke, no changes to these boundaries. Preserve unrelated local changes. + +2026-10-14 results, scoped local change on 2ffe6e14: +- pass: pre-fix regression reproduced one BytePlus failure while the domestic case passed. +- pass: `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_config.py`, 105 tests. +- pass: `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`, 1,093 tests, four dependency deprecation warnings; two workers chosen for the local environment. +- pass: Ruff 0.11.12 check/format and Pyright `--pythonpath .venv/bin/python` on studio_profile.py and test_byteplus.py, zero errors/warnings. +- pass: repository-configured Gitleaks hook on an isolated snapshot of scoped source/tests/docs; paired requirement/task/acceptance identifiers, relative links and diff whitespace. +- not_run: live cloud startup and chat; user will restart Studio and submit a new request. No cloud resource, task record or service was changed. No commit/push requested, so synchronization and all-files pre-commit remain not_run. +Final review: only two BytePlus application flags changed in production code. Domestic and platform APM flags retain their values; no retry bypass, frontend artifact, dependency or general-agent changes. AC-1/AC-2/AC-3 satisfied by local evidence; live deployment remains unverified. diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.zh.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.zh.md new file mode 100644 index 000000000..46c769594 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-disable-application-apm.zh.md @@ -0,0 +1,46 @@ +# 关闭 BytePlus Studio 配置中的应用 APM + +[English](2026-10-14-disable-application-apm.md) + +变更 ID:mpa-byteplus-application-apm。日期:2026-10-14。状态:superseded。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-17。 +后续变更:[恢复应用 APM](2026-10-14-restore-application-apm.zh.md)。 + +## 背景、目标和范围 + +一个 BytePlus Runtime 在 APM GetAppKey 返回 InternalServiceTimeout 后,因 Agent 初始化失败而退出。内置海外配置从国内继承了 ENABLE_APMPLUS=true 和 FORCE_APMPLUS_EXPORTER_REGISTRATION=true。用户明确同意将这两个 BytePlus 默认值改为 false,测试应用启动。本文不保留生产日志、凭据或签名 URL。 + +目标:BytePlus 托管 Studio 创建默认不再请求初始化应用 APM。真实验证表明 `ApmplusEnable=true` 会将 Runtime 的 `ENABLE_APMPLUS` 重写为 `true`,因此 BytePlus 控制面设置也必须为 false。非目标:修改国内默认值、通用智能体、Worker 观测、agentkit-mpa-agent 代码、重试/网络恢复或已有云资源。 + +## 需求和场景 + +- FR-1:使用内置 BytePlus 配置时,解析后的 Runtime 环境和部署请求中 ENABLE_APMPLUS 与 FORCE_APMPLUS_EXPORTER_REGISTRATION 都为字符串 false。 +- FR-2:使用内置火山配置时,两个应用开关及 ApmplusEnable 均保持 true。使用 BytePlus 时,两个应用开关及 ApmplusEnable 均为 false。每次调用返回独立配置,平台之间不能相互污染。 +- FR-3:保留可信服务端显式配置覆盖、现有请求哈希、取消和部分失败处理。不修改 API、凭据、数据库结构或任务状态。不自动更新已有 Runtime,也不绕过未完成部署的配置冲突。 + +## 设计、影响和任务 + +T-1:在 tests/integrations/mpa_managed/test_byteplus.py 添加先失败的平台参数化回归,检查原始默认值、解析配置及 apply_runtime_settings 输出,不调用云接口(FR-1/FR-2)。 +T-2:在 studio_profile_values 现有 BytePlus 分支覆盖两个应用键及 `apmplus-enable`(FR-1/FR-3)。维护 CON-17 和双语托管 README,说明平台差异。 +T-3:执行目标测试、两进程托管/启动回归、变更文件 Ruff/Pyright、范围密钥扫描和双语/链接/空白检查。不修改前端产物;没有前端或 HTTP 接口变化,浏览器与构建检查不适用。 + +## 评审、风险和验收 + +用户批准:2026-10-14 明确要求关闭两个 BytePlus 开关,并在真实证据表明平台会覆盖后要求关闭 BytePlus `ApmplusEnable`。直接设计评审(review-spec 不可用):已检查范围、配置优先级、平台隔离、安全、兼容性、测试和双语一致性,无阻塞项。不新增依赖或敏感值。BytePlus 应用及平台 APM 初始化均关闭,火山引擎保持不变。这不证明启动、OV 或聊天成功,也不解决其他已诊断故障。Runtime 设置变化可能与未完成部署哈希冲突;本次试验应使用新请求。 + +- AC-1:BytePlus 解析环境和请求包含两个 false 值。 +- AC-2:国内环境与平台 ApmplusEnable 不变;BytePlus ApmplusEnable 为 false;多次加载平台配置保持隔离。 +- AC-3:本地检查通过;真实验证单独报告,不执行云写入。 + +## 验证与交付 + +2026-10-14,基于 2ffe6e14 的本地差异:not_run,实施检查待执行。not_run,真实创建/重启/提交/推送及全文件 pre-commit,均未要求。not_applicable,前端/浏览器/构建和 harness smoke,未修改这些边界。保留无关本地改动。 + +2026-10-14 结果,基于 2ffe6e14 的本次局部变更: +- pass:修复前回归复现一项 BytePlus 失败,国内用例通过。 +- pass:`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_config.py`,105 项测试。 +- pass:`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`,1,093 项测试、四项依赖弃用警告;依据本地环境选用两个进程。 +- pass:对 studio_profile.py 与 test_byteplus.py 执行 Ruff 0.11.12 check/format 和 Pyright `--pythonpath .venv/bin/python`,零错误/警告。 +- pass:在隔离快照中按仓库配置执行本次源码/测试/文档的 Gitleaks hook;双语需求/任务/验收标识、相对链接与差异空白检查通过。 +- not_run:真实云启动与聊天;用户将重启 Studio 并提交新请求。没有修改云资源、任务记录或服务。未要求提交/推送,因此同步和全文件 pre-commit 仍为 not_run。 +最终评审:生产代码仅修改两个 BytePlus 应用开关。国内与平台 APM 保持原值;没有绕过重试,也不修改前端产物、依赖或通用智能体。本地证据满足 AC-1/AC-2/AC-3;真实部署仍未验证。 diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.md new file mode 100644 index 000000000..90f087ca6 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.md @@ -0,0 +1,75 @@ +# Restore application APM in the BytePlus Studio profile + +[中文版](2026-10-14-restore-application-apm.zh.md) + +Change ID: mpa-byteplus-application-apm-restore. Date: 2026-10-14. Status: implemented. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-17. +Predecessor: [Disable application APM](2026-10-14-disable-application-apm.md). + +## Background, goals and scope + +BytePlus application APM was temporarily disabled to bypass an overseas +`GetAppKey` timeout. Live creation then reached Runtime readiness, but the +platform removed `ENABLE_APMPLUS=false` from the effective environment and the +creation verifier waited for an exact configuration match. The user has now +requested restoration of all APM bypass settings. + +Goal: restore the inherited Runtime defaults for BytePlus: +`ApmplusEnable=true`, `ENABLE_APMPLUS=true`, and +`FORCE_APMPLUS_EXPORTER_REGISTRATION=true`. Non-goals: fixing the upstream +APMPlus timeout, changing readiness reconciliation, mutating existing Runtime +resources, or changing Volcengine defaults. + +## Requirements and scenarios + +- FR-1: New BytePlus profiles inherit all three enabled APM defaults. +- FR-2: Volcengine defaults remain enabled and provider profile calls remain + isolated. +- FR-3: Existing Runtime resources and submitted task snapshots are unchanged; + a restarted Studio and a new request are required to consume the restored + defaults. + +## Design, impact and tasks + +- T-1: Change the provider regression to require enabled APM defaults for both + providers and confirm it fails before implementation (FR-1/FR-2). +- T-2: Remove only the BytePlus APM overrides from + `studio_profile_values`; preserve image, model, OV and provider settings + (FR-1/FR-3). +- T-3: Reconcile this PRD, its predecessor and the bilingual component contract; + run targeted tests, Ruff, Pyright, bilingual/link and whitespace checks. + +No API, schema, credential, frontend or generated-asset contract changes. +The known BytePlus APMPlus service timeout can again make Runtime startup fail; +this rollback is intentional and does not claim that upstream APMPlus works. + +## Review, risks and acceptance + +User approval: on 2026-10-14 the user explicitly requested restoring +`ENABLE_APMPLUS` and the related APM bypass settings. Direct design review: +scope, provider isolation, compatibility, security and testability were checked; +no blocker remains. The primary risk is recurrence of the already observed +`GetAppKey InternalServiceTimeout`. + +- AC-1: Both providers resolve and deploy all three APM settings as enabled. +- AC-2: Targeted tests and static checks pass. +- AC-3: Documentation is bilingual and records that no existing Runtime is + mutated. + +## Verification and delivery + +2026-10-14, local diff based on the current worktree: + +- pass: the changed regression failed for BytePlus before implementation and + passed after removing the three overrides. +- pass: `uv run --extra dev pytest -q + tests/integrations/mpa_managed/test_byteplus.py + tests/integrations/mpa_managed/test_config.py`, 105 tests. +- pass: `uv run --extra dev pytest -n 2 -q + tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`, + 1,093 tests with four dependency deprecation warnings. +- pass: Ruff 0.11.12 check/format and Pyright on the changed Python files. +- pass: paired-document presence, relative links and scoped diff whitespace. +- not_run: live cloud creation, commit, push and all-files pre-commit were not + requested. +- not_applicable: frontend build/browser checks; no frontend behavior changes. diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.zh.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.zh.md new file mode 100644 index 000000000..3f230b88b --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.zh.md @@ -0,0 +1,62 @@ +# 恢复 BytePlus Studio 配置中的应用 APM + +[English](2026-10-14-restore-application-apm.md) + +变更 ID:mpa-byteplus-application-apm-restore。日期:2026-10-14。状态:implemented。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-17。 +前序变更:[关闭应用 APM](2026-10-14-disable-application-apm.zh.md)。 + +## 背景、目标和范围 + +此前为绕过海外 `GetAppKey` 超时,临时关闭了 BytePlus 应用 APM。真实创建随后到达 +Runtime 就绪,但平台从实际环境中移除了 `ENABLE_APMPLUS=false`,创建验证器因要求 +配置完全一致而持续等待。用户现已要求恢复全部 APM 绕过设置。 + +目标:恢复 BytePlus 继承的 Runtime 默认值:`ApmplusEnable=true`、 +`ENABLE_APMPLUS=true` 和 `FORCE_APMPLUS_EXPORTER_REGISTRATION=true`。 +非目标:修复上游 APMPlus 超时、修改就绪协调、变更已有 Runtime 资源或修改火山引擎 +默认值。 + +## 需求和场景 + +- FR-1:新的 BytePlus 配置继承三个已启用的 APM 默认值。 +- FR-2:火山引擎默认值继续启用,各平台配置调用保持隔离。 +- FR-3:已有 Runtime 资源和已提交任务快照不变;须重启 Studio 并创建新请求后才使用 + 恢复后的默认值。 + +## 设计、影响和任务 + +- T-1:将平台回归测试改为要求两个平台均启用 APM,并确认实现前失败(FR-1/FR-2)。 +- T-2:仅从 `studio_profile_values` 删除 BytePlus APM 覆盖项;保留镜像、模型、OV 和 + 平台设置(FR-1/FR-3)。 +- T-3:同步本文、前序 PRD 和双语组件契约;运行定向测试、Ruff、Pyright、双语/链接和 + 空白检查。 + +不修改 API、数据库结构、凭据、前端或生成产物契约。已知的 BytePlus APMPlus 服务超时 +可能再次导致 Runtime 启动失败;这是有意回滚,不代表上游 APMPlus 已恢复。 + +## 评审、风险和验收 + +用户批准:2026-10-14 用户明确要求恢复 `ENABLE_APMPLUS` 及相关 APM 绕过设置。 +直接设计评审:已检查范围、平台隔离、兼容性、安全和可测试性,无阻塞项。主要风险是 +已观察到的 `GetAppKey InternalServiceTimeout` 再次出现。 + +- AC-1:两个平台解析和部署的三个 APM 设置均为启用。 +- AC-2:定向测试和静态检查通过。 +- AC-3:文档双语一致,并记录不修改已有 Runtime。 + +## 验证与交付 + +2026-10-14,基于当前工作区差异: + +- pass:修改后的回归测试在实施前对 BytePlus 失败,删除三个覆盖项后通过。 +- pass:`uv run --extra dev pytest -q + tests/integrations/mpa_managed/test_byteplus.py + tests/integrations/mpa_managed/test_config.py`,105 项测试。 +- pass:`uv run --extra dev pytest -n 2 -q + tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`, + 1,093 项测试,四项依赖弃用警告。 +- pass:对变更 Python 文件执行 Ruff 0.11.12 check/format 和 Pyright。 +- pass:双语文档存在、相对链接和局部差异空白检查。 +- not_run:未要求真实云创建、提交、推送和全文件 pre-commit。 +- not_applicable:前端构建/浏览器检查;没有前端行为变化。 diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.md new file mode 100644 index 000000000..ef2b688c6 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.md @@ -0,0 +1,48 @@ +# Inject a deployment-account APM AppKey into BytePlus Studio Runtimes + +[中文版](2026-10-14-server-app-key.zh.md) + +Change ID: mpa-byteplus-server-app-key. Date: 2026-10-14. Status: implemented. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-17. +Predecessor: [APM restoration](2026-10-14-restore-application-apm.md). + +## Evidence, goals and non-goals + +Runtime Agent initialization fails when its bundled VeADK GetAppKey call times out. A read-only probe of apmplus-server.ap-southeast-1.byteplusapi.com using the deployment account succeeded. Bundled VeADK 1.1.5 supports OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY and skips automatic lookup when present; this was verified against installed source in isolation. No real key or production log is recorded here. + +Goal: Studio obtains the BytePlus AppKey before resource preparation and injects it into Runtime Envs. Restore the inherited enabled APM defaults as previously requested, replacing the temporary bypass. Non-goals: changing the image, global VeADK host selection, domestic/generic-agent/CLI behavior, OTLP endpoint selection, sandbox credential compatibility, existing cloud resources or network retry recovery. + +## Requirements and scenarios + +- FR-1: After verifying the deployment account and resolving the model key, Studio BytePlus creation calls GetAppKey with service apmplus_server, version 2024-07-30, signing region ap-southeast-1 and host apmplus-server.ap-southeast-1.byteplusapi.com. Refresh and verify credentials for each attempt; include STS token and X-Apmplus-Region. Resolve before IAM/PG/network/resource mutations. Domestic and non-Studio callers do not call this helper. +- FR-2: Accept only a usable data.app_key string; inject OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY into Runtime creation/update Envs. Do not mutate the caller profile or persist the raw key in task/bootstrap/deployment records, browser responses, diagnostics or reports. Valid trusted explicit Runtime keys are preserved; blank values use discovery; malformed/masked keys fail safely. +- FR-3: At most three transient read attempts with 10/30-second HTTP connect/read limits and a 45-second per-attempt async deadline; retry delays 0.2/0.5 seconds. Cancellation prevents later attempts or mutations. Permission, protocol and permanent provider failures stop without fallback. Diagnostics retain only allowlisted operation/category/attempt/outcome/errorCode/requestId, including HTTP error metadata. Fail before resource preparation with a safe exception. +- FR-4: Restore BytePlus ApmplusEnable=true, ENABLE_APMPLUS=true and FORCE_APMPLUS_EXPORTER_REGISTRATION=true; preserve domestic values, explicit configuration and provider isolation. No submitted snapshot upgrade or existing Runtime update. Reads on retries obtain the account key again; unchanged pending request hashes remain authoritative and changed keys/configurations fail rather than silently redeploying. + +## Design and tasks + +T-1: Add failing isolated helper and service regressions: signed request fields, Runtime environment delivery, trusted configuration reuse, exclusion of domestic and CLI paths, malformed responses, errors/retries/cancellation and pre-mutation failure. Update enabled-default regression (FR-1 through FR-4). +T-2: Add a small managed apm_key module, reuse signed transport and existing diagnostic metadata validators, allowlist get_apm_key and wire service.provision. Hold the fetched key only in a local variable until Runtime environment construction. Existing request/hash and secret storage rules remain unchanged. +T-3: Update bilingual CON-17, managed README and frontend README; record review and checks. Run targeted and managed/startup regression with two workers, changed-Python Ruff/Pyright, configured scoped Gitleaks, paired identifiers/links and whitespace checks. + +## Review, security, risks and acceptance + +User approval: explicit 2026-10-14 request to implement the described server-side key retrieval/injection; earlier request withdrew the APM bypass. Direct review (review-spec unavailable): provider scope, credential refresh, safe failure diagnostics, secret persistence, bounded cancellation, compatibility and bilingual equivalence reviewed; no blockers. Runtime environment access remains privileged. Deployment credentials additionally need apmplus_server:GetAppKey; no Runtime role policy expansion or long-lived deployment AK/SK injection. Platform rewriting of disabled APM flags motivated restoring the enabled defaults. + +AC-1: Only Studio BytePlus looks up the key before mutations and the actual Runtime payload contains it. AC-2: Safe failure/cancellation and secret exclusions pass regression. AC-3: Domestic/generic/CLI paths and pending-input guards remain unchanged; checks and docs reconciled. Real APM export and Runtime startup/chat are separate live tests. The known BytePlus sandbox IAM defect is not fixed here. Old incomplete deployments may need a new request because their original payload lacks this environment variable. + +## Verification + +2026-10-14, local diff based on 2ffe6e14: not_run, implementation checks pending. not_run, live creation/update/restart/commit/push and all-files pre-commit, none authorized for this implementation. not_applicable, frontend/browser/build and harness smoke, no affected UI/API/event boundaries or artifacts. Preserve unrelated local changes. + +2026-10-14 final verification (local diff on 2ffe6e14): +- pass: pre-implementation helper regression failed collection because the module was absent; the first implementation run also exposed the missing diagnostic operation/service wiring, which was completed before final tests. +- pass: `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_apm_key.py tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_service.py`, 213 tests. Four additional isolation/invalid-explicit-key cases subsequently passed with the final 23-test helper suite. +- pass: `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`, 1,112 tests, two dependency deprecation warnings; two workers selected for local resources. Subsequent edits only added tests/docs, with targeted rerun. +- pass: Ruff 0.11.12 check/format and Pyright `--pythonpath .venv/bin/python` on apm_key.py, service.py, diagnostics.py, test_apm_key.py and test_service.py, zero errors/warnings. An initial test double's undeclared account_id assignment was corrected with monkeypatch; test_service formatting was corrected. +- pass: `uv build --wheel --out-dir /tmp/mpa-app-key-wheel`; archive contains the new helper and wired service, excludes .env. No new frontend build or dependency changes. +- blocked: live read-only new-helper smoke could not start because Studio no longer listened on port 8000 and its process credentials were unavailable. The earlier dedicated-host GetAppKey probe succeeded, but was not this new helper. No Runtime/resource update occurred. Live injection, startup, tracing and chat remain not_run. +- pass: final scoped repository-configured Gitleaks, bilingual IDs/links and diff whitespace (recorded after execution below). +Final review: Runtime handoff is verified in the existing full fake provisioner, and its result/registry contain no raw AppKey. Global SDK GetAppKey host selection and Runtime/sandbox IAM clients are unchanged. All in-scope tasks and local acceptance checks complete; existing cloud deployments remain unchanged. No commit/push/service restart. + +Final documentation checks: pass, scoped relative links and paired identifiers. An unrelated pre-existing frontend README link to an optional local skill example is absent and was not changed. An initial Gitleaks scan flagged a documentation phrase; prose was reworded and the unchanged repository-configured scan passed. No exclusions were added. diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.zh.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.zh.md new file mode 100644 index 000000000..9e6e4fae6 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.zh.md @@ -0,0 +1,48 @@ +# 向 BytePlus Studio Runtime 注入部署账号的 APM AppKey + +[English](2026-10-14-server-app-key.md) + +变更 ID:mpa-byteplus-server-app-key。日期:2026-10-14。状态:implemented。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-17。 +前置设计:[APM 恢复](2026-10-14-restore-application-apm.zh.md)。 + +## 证据、目标和非目标 + +Runtime 内置 VeADK 的 GetAppKey 超时时,Agent 初始化失败。使用部署账号对 apmplus-server.ap-southeast-1.byteplusapi.com 的只读探测成功。内置 VeADK 1.1.5 支持 OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY,有值时跳过自动获取;已对安装源码执行隔离验证。本文不记录真实 Key 或生产日志。 + +目标:Studio 在准备资源前获取 BytePlus AppKey,注入 Runtime Envs。按此前用户要求恢复继承的启用 APM 默认值,替代临时绕过。非目标:修改镜像、全局 VeADK Host 选择、国内/通用智能体/CLI 行为、OTLP 上报地址、沙箱凭据兼容、已有云资源或网络重试恢复。 + +## 需求和场景 + +- FR-1:核验部署账号并解析模型 Key 后,Studio BytePlus 创建调用 GetAppKey,service 为 apmplus_server、version 为 2024-07-30、签名地域为 ap-southeast-1、host 为 apmplus-server.ap-southeast-1.byteplusapi.com。每次尝试刷新并核验凭据,传递 STS Token 与 X-Apmplus-Region。在 IAM/PG/网络/资源写入前解析。国内与非 Studio 调用者不调用此辅助函数。 +- FR-2:仅接受可用的 data.app_key 字符串;将 OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY 注入 Runtime 创建/更新 Envs。不修改调用者配置,不把原始 Key 持久化到任务/启动/部署记录、浏览器响应、诊断或报告。保留可信配置中的有效显式 Runtime Key;空值走发现,格式错误或遮罩 Key 安全失败。 +- FR-3:临时错误最多三次读取,每次 HTTP 连接/读取限制 10/30 秒,异步期限 45 秒;重试间隔 0.2/0.5 秒。取消后不再尝试或写资源。权限、协议和永久服务错误停止,不回退。诊断仅保留白名单 operation/category/attempt/outcome/errorCode/requestId,包含 HTTP 错误元信息。准备资源前抛出安全异常。 +- FR-4:恢复 BytePlus ApmplusEnable=true、ENABLE_APMPLUS=true 与 FORCE_APMPLUS_EXPORTER_REGISTRATION=true;国内值、显式配置和平台隔离不变。不升级已提交快照,不更新已有 Runtime。重试重新读取账号 Key;保留未完成请求哈希检查,Key/配置变化时失败,不静默重部署。 + +## 设计和任务 + +T-1:先添加失败的隔离辅助函数与服务回归:签名 Host/账号/STS、原始 Key 传递、显式 Key、国内/CLI 排除、错误响应、错误/重试/取消和写资源前失败。更新启用默认值回归(FR-1 至 FR-4)。 +T-2:增加小型 managed apm_key 模块,复用签名传输及现有诊断元信息校验,白名单新增 get_apm_key,接入 service.provision。取得的 Key 仅保存在局部变量中,直到构造 Runtime 环境。现有请求/哈希与秘密存储规则不变。 +T-3:更新双语 CON-17、托管 README 和 frontend README,记录评审与检查。执行目标测试及两进程托管/启动回归、变更 Python 文件 Ruff/Pyright、仓库配置的范围 Gitleaks、双语标识/链接与空白检查。 + +## 评审、安全、风险和验收 + +用户批准:2026-10-14 明确要求实现上述服务端获取/注入 Key;此前已要求撤销 APM 绕过。直接评审(review-spec 不可用):已检查平台范围、凭据刷新、安全失败诊断、秘密持久化、取消期限、兼容和双语一致性,无阻塞项。Runtime 环境访问仍需特权。部署凭据额外需要 apmplus_server:GetAppKey;不扩展 Runtime 角色策略,不注入长期部署 AK/SK。平台重写禁用 APM 的环境变量,是恢复启用默认值的原因。 + +AC-1:仅 Studio BytePlus 在写资源前获取 Key,实际 Runtime 请求含该 Key。AC-2:安全失败/取消及秘密排除回归通过。AC-3:国内/通用智能体/CLI 路径与未完成输入保护不变,检查和文档已同步。真实 APM 上报及 Runtime 启动/聊天另行验证。本次不修复已知 BytePlus 沙箱 IAM 缺陷。旧未完成部署的原请求不含此变量,可能需要新请求。 + +## 验证 + +2026-10-14,基于 2ffe6e14 的本地差异:not_run,实施检查待执行。not_run,真实创建/更新/重启/提交/推送及全文件 pre-commit,本次实施未授权这些操作。not_applicable,前端/浏览器/构建与 harness smoke,未影响 UI/API/事件边界或产物。保留无关本地改动。 + +2026-10-14 最终验证(基于 2ffe6e14 的本地差异): +- pass:实施前回归因模块不存在而收集失败;第一轮实施运行还暴露诊断操作白名单/服务接线缺失,最终测试前已补齐。 +- pass:`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_apm_key.py tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_service.py`,213 项测试。随后新增四项隔离/无效显式 Key 用例,最终辅助函数套件 23 项全部通过。 +- pass:`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`,1,112 项测试、两项依赖弃用警告;依据本地资源选用两个进程。此后仅增加测试/文档,执行了目标重跑。 +- pass:apm_key.py、service.py、diagnostics.py、test_apm_key.py 和 test_service.py 的 Ruff 0.11.12 check/format 与 Pyright `--pythonpath .venv/bin/python`,零错误/警告。初始替身未声明 account_id 的赋值已改用 monkeypatch,test_service 格式已修正。 +- pass:`uv build --wheel --out-dir /tmp/mpa-app-key-wheel`;归档含新辅助模块和接线服务,不含 .env。不新增前端构建或依赖变化。 +- blocked:Studio 已不再监听 8000,无法取得进程凭据,新辅助函数真实只读探测未能启动。此前专用 Host 的 GetAppKey 探测成功,但不是本次新辅助函数。没有更新 Runtime/资源。真实注入、启动、观测和聊天仍为 not_run。 +- pass:最终按仓库配置执行范围 Gitleaks、双语标识/链接与差异空白检查(执行后记录见下)。 +最终评审:现有完整模拟创建流程已验证 Runtime 传递,结果/注册库不含原始 AppKey。全局 SDK GetAppKey Host 选择与 Runtime/沙箱 IAM 客户端不变。本次任务和本地验收检查完成,已有云部署保持原样。没有提交/推送/服务重启。 + +最终文档检查:pass,本次范围相对链接和双语标识通过。frontend README 中一个无关的历史可选本地技能示例链接不存在,未改动。初始 Gitleaks 扫描标记了一处文档表述,调整文字后,沿用仓库原配置的扫描通过;未新增排除规则。 diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.md new file mode 100644 index 000000000..3582ef8c9 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.md @@ -0,0 +1,38 @@ +# BytePlus Studio MPA OTLP endpoint + +[中文版](2026-10-15-otlp-endpoint.zh.md) + +## Metadata and evidence +Change ID: mpa-byteplus-otlp-endpoint. Date: 2026-10-15. Status: implemented. +The SDK default uses the domestic volces.com suffix even for overseas regions. The operator supplied the BytePlus Singapore collector address. AppKey retrieval alone does not select this collector. + +## Scope and requirements +FR-1: New BytePlus Studio profiles inject `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317` into Runtime Envs. +FR-2: Volcengine profiles, generic agents, global SDK defaults, AppKey retrieval and APM enablement remain unchanged. Existing Runtime resources and submitted task snapshots are not migrated. +FR-3: Existing trusted Runtime environment override precedence remains unchanged. +Given a new BytePlus request, its generated Runtime payload carries the endpoint. Given a domestic request, no overseas endpoint is added. + +## Design and tasks +T-1: Extend provider isolation regression to fail on the missing endpoint, checking raw defaults, loaded profiles and Runtime payloads, including explicit override behavior. +T-2: Add the constant value only to the BytePlus branch of `veadk/integrations/mpa/managed/studio_profile.py`. +T-3: Reconcile Studio creation CON-17 and managed README in both languages; run targeted tests, Ruff, Pyright and whitespace/link checks. +Related contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-17. Affected test: `tests/integrations/mpa_managed/test_byteplus.py`. +No new API, schema, credentials, network calls, timeout, cancellation or concurrency behavior. Existing environment-to-payload handling is reused. Only the default collector configuration changes. + +## Review and acceptance +User approval: explicit request on 2026-10-15 to inject the supplied endpoint for BytePlus creation without changing domestic behavior. Direct design review performed because review-spec is unavailable: provider boundary, override precedence, retry snapshots, security, compatibility and bilingual equivalence checked; no blockers. +AC-1: BytePlus default and resulting payload contain the endpoint. AC-2: Domestic default/payload omit it and explicit overrides survive. AC-3: scoped checks pass with live verification separately stated. +Risk: actual collector reachability and accepted traces require cloud validation. Existing deployments need a separately authorized update; restart Studio for new requests. This change does not itself prove successful APM export. + +## Verification +2026-10-15, local change on 4997196d, only Studio profile, provider regression and paired documentation: +- pass: regression before implementation reproduced BytePlus KeyError while domestic passed. +- pass: `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_apm_key.py tests/integrations/mpa_managed/test_service.py` — 219 tests, two dependency deprecation warnings. +- pass: `uv tool run --from ruff==0.11.12 ruff check` and `ruff format --check` on the two changed Python files; `uv tool run pyright --pythonpath .venv/bin/python` on those files — zero errors/warnings. Temporary tools used because local Ruff/Pyright executables are absent, following the existing user preference to record verification only. +- pass: `git diff --check`. Paired requirement IDs and relative links checked. +- not_applicable: frontend build/browser and harness smoke; no UI, API or harness code changed. +- not_run: live cloud deployment/export verification and all-files pre-commit; no deployment or commit requested. Scoped hooks checked separately below. +Review: the domestic branch returns before the new environment entry; no shared SDK change or secret added. Existing unrelated frontend lockfile changes preserved. AC-1/AC-2 covered by generated-payload tests; live Trace delivery remains unverified. + + +- pass: `uv run --extra dev pre-commit run --files ` — Ruff check/format and hardcoded-secret scan passed; dependency/YAML hooks skipped because their file types are unaffected. diff --git a/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.zh.md b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.zh.md new file mode 100644 index 000000000..f067bfe58 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.zh.md @@ -0,0 +1,38 @@ +# BytePlus Studio MPA OTLP 上报地址 + +[English](2026-10-15-otlp-endpoint.md) + +## 元数据与证据 +变更 ID:mpa-byteplus-otlp-endpoint。日期:2026-10-15。状态:implemented。 +SDK 的默认地址即便在海外地域也使用国内 volces.com 后缀。用户提供了 BytePlus 新加坡采集地址。仅获取 AppKey 不会选择该采集地址。 + +## 范围与需求 +FR-1:新的 BytePlus Studio 配置向 Runtime Envs 注入 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317`。 +FR-2:火山配置、通用智能体、全局 SDK 默认值、AppKey 获取及 APM 启用状态不变。不迁移已有 Runtime 资源及已提交任务快照。 +FR-3:保留现有可信 Runtime 环境变量覆盖优先级。 +新建 BytePlus 请求生成的 Runtime 请求体携带上报地址;国内请求不增加海外上报地址。 + +## 设计与任务 +T-1:扩展供应商隔离回归,先验证缺失地址时失败,覆盖原始默认值、加载后的配置、Runtime 请求体及显式覆盖。 +T-2:仅在 `veadk/integrations/mpa/managed/studio_profile.py` 的 BytePlus 分支加入地址常量值。 +T-3:同步中英文 Studio 创建 CON-17 及托管模块 README;运行目标测试、Ruff、Pyright、空白和链接检查。 +相关契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-17。受影响测试:`tests/integrations/mpa_managed/test_byteplus.py`。 +不新增 API、数据库结构、凭据、网络调用、超时、取消或并发行为。复用既有环境变量到请求体的处理,仅修改默认采集地址配置。 + +## 评审与验收 +用户批准:2026-10-15 明确要求 BytePlus 创建注入所给地址且不影响国内行为。因 review-spec 不可用,直接完成设计评审:已检查供应商边界、覆盖优先级、重试快照、安全、兼容及双语一致性,无阻塞项。 +AC-1:BytePlus 默认值及最终请求体包含地址。AC-2:国内默认值及请求体不包含此项,显式覆盖仍生效。AC-3:范围内检查通过,单独说明云端验证情况。 +风险:采集地址实际连通性及 Trace 接收需要云端验证。已有部署需另行授权更新;新请求需重启 Studio。本变更不证明 APM 已成功上报。 + +## 验证 +2026-10-15,基于 4997196d 的本地修改,仅涉及 Studio 配置、供应商回归及双语文档: +- pass:实现前回归重现 BytePlus KeyError,国内用例通过。 +- pass:`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_apm_key.py tests/integrations/mpa_managed/test_service.py` — 219 项通过,两个依赖弃用警告。 +- pass:对两个修改的 Python 文件运行 `uv tool run --from ruff==0.11.12 ruff check` 和 `ruff format --check`;运行 `uv tool run pyright --pythonpath .venv/bin/python` — 零错误、零警告。本地无 Ruff/Pyright 可执行文件,使用临时工具,遵循用户此前仅记录验证结果的偏好。 +- pass:`git diff --check`,已检查双语需求 ID 和相对链接。 +- not_applicable:前端构建/浏览器及 harness smoke;未修改 UI、API 或 harness 代码。 +- not_run:真实云端部署/上报验证及全文件 pre-commit;用户未要求部署或提交。范围内 hook 另行记录于下方。 +评审:国内分支在新增环境变量前返回;未修改共享 SDK 或加入密钥。保留原有无关前端锁文件修改。生成请求体测试覆盖 AC-1/AC-2;真实 Trace 投递仍未验证。 + + +- pass:`uv run --extra dev pre-commit run --files <八个本次修改文件>` — Ruff 检查/格式化及硬编码密钥扫描通过;依赖/YAML hook 因无对应文件改动而跳过。 diff --git a/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.md b/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.md new file mode 100644 index 000000000..6d62aeaa5 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.md @@ -0,0 +1,69 @@ +# Use BytePlus-hosted defaults for managed MPA images + +[中文版](2026-10-14-byteplus-default-images.zh.md) + +- ID: `mpa-byteplus-default-images` +- Created/revised: 2026-10-14 +- Status: implemented +- Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md) + +## Background and evidence + +BytePlus managed creation currently inherits the Volcengine Beijing Runtime and Worker image references unless trusted environment overrides are set. Live BytePlus creation reached `CreateTool` and failed with `provider_error`; the persisted task snapshot confirmed that it still selected the Beijing `cr.volces.com` Worker image. Public BytePlus repositories have now been prepared and anonymous manifest reads verified for: + +- `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_agent:latest` +- `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_codex_worker:latest` + +The verified manifests had digests `sha256:1db0caa3...` and `sha256:b9ea5f49...` respectively. The Worker image was built from `agentkit-mpa-codex-worker` `master@7aa11f0`. + +## Goals and non-goals + +Make new built-in BytePlus Studio requests select the BytePlus-hosted Runtime and Worker images by default. Preserve trusted server overrides and all domestic defaults. + +Do not mutate or retry existing tasks, change image validation, pin defaults to digests, rebuild images, alter cloud resources, change browser inputs, or change CLI/YAML profiles. + +## Scenarios and requirements + +- FR-1: `load_studio_profile(provider="byteplus")` defaults Runtime and Worker images to the two `ap-southeast-1.cr.bytepluses.com` latest references above. +- FR-2: Nonempty `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` and `VEADK_MPA_BYTEPLUS_WORKER_IMAGE` remain higher-priority trusted overrides. +- FR-3: `load_studio_profile()` for Volcengine retains the Beijing Runtime and Worker defaults exactly. +- FR-4: Existing submitted tasks retain their persisted image snapshots. A new request after Studio restart is required to receive changed defaults. + +## Design and affected files + +Define the BytePlus registry once in the BytePlus branch of `studio_profile_values` and use its two image references as the fallback values behind the existing environment overrides. No frontend or HTTP shape changes are required because config/task APIs already expose and snapshot the resolved nonsecret defaults. + +Affected files: + +- `veadk/integrations/mpa/managed/studio_profile.py` +- `tests/integrations/mpa_managed/test_byteplus.py` +- paired Studio MPA component contract +- this paired bugfix design + +## Tasks, tests and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1/FR-3 | Add a failing provider-isolation assertion, then change the defaults | BytePlus selects the overseas references and Volcengine remains unchanged | +| FR-2 | Retain and run override coverage | Both trusted overrides still win | +| FR-4 | Update the paired contract and verify task semantics | Documentation states that only new task snapshots receive the defaults | + +Verification: targeted BytePlus pytest, changed-file Ruff and Pyright, paired-language/link review, and `git diff --check`. Frontend build and browser checks are not applicable because no frontend or HTTP contract changes. + +## Risks and review + +The `latest` tags are mutable by design and match the requested Studio convention; the verified digests are evidence, not pinned runtime values. Public manifest readability does not prove AgentKit `CreateTool` or Runtime application readiness, so a new isolated BytePlus creation remains required. Existing failed tasks cannot adopt the new images because changing their snapshot would violate retry identity. + +Direct design review (`review-spec` unavailable): scope, provider isolation, override precedence, task immutability, security, compatibility, testability and bilingual equivalence checked; no blockers. The user approved the preceding plan with “帮我改下”. No commit, push or cloud deployment is authorized by this approval. + +## Verification record + +2026-10-14 working diff: + +- pass: the new default assertion failed against the old implementation with both images still resolving to the Beijing registry. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_studio_shared_resources.py -q` — 47 passed, with two upstream deprecation warnings. +- pass: Ruff 0.11.12 check/format and Pyright for the changed Python files; `git diff --check`; paired links and semantics reviewed. +- pass: direct profile evaluation selected both BytePlus-hosted references while retaining both Beijing domestic references. +- pass: public BytePlus image manifests were readable before implementation. +- pass: after restarting Studio, live task `209b63d5-04ec-490f-95d8-41b7931891f4` persisted both BytePlus-hosted defaults and completed Worker creation/readiness. The task later failed independently at automatic OpenViking creation with `openvikingCreateUnknown`; Runtime creation was not reached. +- not_applicable: frontend build/browser checks; no frontend or HTTP contract changed. diff --git a/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.zh.md b/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.zh.md new file mode 100644 index 000000000..a1b3a567d --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.zh.md @@ -0,0 +1,69 @@ +# 托管 MPA 使用 BytePlus 托管的默认镜像 + +[English](2026-10-14-byteplus-default-images.md) + +- ID:`mpa-byteplus-default-images` +- 创建/修订日期:2026-10-14 +- 状态:implemented +- 契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md) + +## 背景与证据 + +BytePlus 托管创建当前在未设置可信环境变量覆盖时,会继承火山引擎北京地域的 Runtime 和 Worker 镜像地址。真实 BytePlus 创建已推进到 `CreateTool`,随后以 `provider_error` 失败;持久化任务快照确认仍选择北京 `cr.volces.com` Worker 镜像。现已准备以下 BytePlus 公共仓库,并验证匿名读取 manifest 成功: + +- `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_agent:latest` +- `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_codex_worker:latest` + +两份已验证 manifest 的 digest 分别为 `sha256:1db0caa3...` 和 `sha256:b9ea5f49...`。Worker 镜像基于 `agentkit-mpa-codex-worker` 的 `master@7aa11f0` 构建。 + +## 目标与非目标 + +使新的 BytePlus 内置 Studio 请求默认选择 BytePlus 托管的 Runtime 和 Worker 镜像。保留可信服务端覆盖及全部国内默认值。 + +不修改或重试已有任务,不改变镜像校验,不将默认值固定为 digest,不重新构建镜像,不修改云资源,不改变浏览器输入,也不改变 CLI/YAML 配置。 + +## 场景与需求 + +- FR-1:`load_studio_profile(provider="byteplus")` 默认使用上文两个 `ap-southeast-1.cr.bytepluses.com` latest Runtime/Worker 地址。 +- FR-2:非空 `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` 和 `VEADK_MPA_BYTEPLUS_WORKER_IMAGE` 继续作为优先级更高的可信覆盖。 +- FR-3:火山引擎 `load_studio_profile()` 的北京 Runtime/Worker 默认值完全不变。 +- FR-4:已提交任务保留其持久化镜像快照。Studio 重启后必须创建新请求才能取得新默认值。 + +## 设计与影响文件 + +在 `studio_profile_values` 的 BytePlus 分支中定义一次 BytePlus 仓库地址,并将其两个镜像地址作为现有环境变量覆盖项之后的默认值。配置/任务接口已返回并快照解析后的非敏感默认值,因此不需要前端或 HTTP 结构变更。 + +影响文件: + +- `veadk/integrations/mpa/managed/studio_profile.py` +- `tests/integrations/mpa_managed/test_byteplus.py` +- 成对 Studio MPA 组件契约 +- 本成对 bugfix 设计 + +## 任务、测试与验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1/FR-3 | 先增加失败的平台隔离断言,再修改默认值 | BytePlus 选择海外地址,火山引擎保持不变 | +| FR-2 | 保留并运行覆盖项测试 | 两个可信覆盖项继续优先 | +| FR-4 | 更新成对契约并核验任务语义 | 文档明确只有新任务快照取得新默认值 | + +验证:BytePlus 定向 pytest、改动文件 Ruff 和 Pyright、双语/链接复核及 `git diff --check`。没有前端或 HTTP 契约变化,因此前端构建和浏览器检查不适用。 + +## 风险与评审 + +按请求沿用 Studio 约定的可变 `latest` 标签;已验证 digest 只作为证据,不作为运行时固定值。公共 manifest 可读不能证明 AgentKit `CreateTool` 或 Runtime 应用就绪,因此仍需用新的隔离 BytePlus 创建做真实验收。已有失败任务不能接管新镜像,因为修改其快照会破坏重试身份。 + +直接设计评审(`review-spec` 不可用):已检查范围、平台隔离、覆盖优先级、任务不可变性、安全性、兼容性、可测试性和双语等价性;无阻塞项。用户以“帮我改下”批准了前述方案。本批准不授权提交、推送或云端部署。 + +## 验证记录 + +2026-10-14 当前工作差异: + +- pass:新增默认值断言在旧实现上失败,两个镜像仍解析为北京仓库。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_studio_shared_resources.py -q` — 47 项通过,另有两个上游弃用警告。 +- pass:对改动 Python 文件执行 Ruff 0.11.12 检查/格式化和 Pyright;`git diff --check`;双语链接及语义已复核。 +- pass:直接解析配置时选中两个 BytePlus 托管地址,并保留两个北京国内地址。 +- pass:实现前已验证 BytePlus 公共镜像 manifest 可读。 +- pass:Studio 重启后,真实任务 `209b63d5-04ec-490f-95d8-41b7931891f4` 已持久化两个 BytePlus 托管默认值,并完成 Worker 创建及就绪。任务随后在独立的 OpenViking 自动创建阶段以 `openvikingCreateUnknown` 失败,尚未进入 Runtime 创建。 +- not_applicable:前端构建/浏览器检查;没有前端或 HTTP 契约变化。 diff --git a/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.md b/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.md new file mode 100644 index 000000000..36d135cd8 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.md @@ -0,0 +1,104 @@ +# Use BytePlus Model Identities for Managed OpenViking + +[中文版](2026-10-14-byteplus-model-identities.zh.md) + +- Change ID: `mpa-byteplus-model-identities` +- Created/Revised: 2026-10-14 +- Status: implemented +- Related spec: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md) + +## Background and evidence + +BytePlus managed OpenViking currently defaults `OV_VLM_ENDPOINT_ID` and +`OV_EMBEDDING_ENDPOINT_ID` to domestic `doubao-*` identifiers. Read-only Ark +lookups in account `3001037806`, region `ap-southeast-1`, returned +`NotFound.EndpointId` for those identifiers. A live OpenViking resource accepted +the configuration but semantic ingestion timed out with embedding work repeatedly +requeued and no vectors produced. + +BytePlus Ark `CreateEndpoint` dry runs rejected the domestic model names and +accepted `seed-2-0-lite` version `260428` and +`skylark-embedding-vision` version `251215`. The user approved retaining the +current API Key plus model-identity binding instead of adopting Coding Plan or +creating account-specific `ep-*` resources. + +## Goals and non-goals + +Goals: + +- Default BytePlus VLM identity to `seed-2-0-lite-260428`. +- Default BytePlus embedding identity to + `skylark-embedding-vision-251215`. +- Preserve API Key injection, environment overrides, validation, redaction, + retry, and persisted nonsecret intent. + +Non-goals: + +- Do not change domestic OpenViking defaults. +- Do not create, update, or delete Ark endpoints or OpenViking resources. +- Do not adopt Coding Plan or change data-plane base URLs. +- Do not migrate existing tasks or OpenViking resources. + +## Scenarios and requirements + +- `FR-1`: Given a new BytePlus automatic OpenViking request without overrides, + its VLM and embedding credentials use the two BytePlus model identities above. +- `FR-2`: `OV_VLM_ENDPOINT_ID` and `OV_EMBEDDING_ENDPOINT_ID` continue to + override defaults and use the existing validation. +- `FR-3`: The resolved model API Key is attached only to the copied wire request + and is never persisted. +- `FR-4`: Volcengine requests and existing persisted requests remain unchanged. + +## Design and contract impact + +Change only the fallback values returned by `byteplus_model_endpoints()`. The +existing request builder, API Key injection, registry comparison, and cloud +adapter remain unchanged. Existing requests retain their persisted identities; +changing their inputs continues to produce a configuration conflict. New tasks +created after Studio restart receive the new defaults. + +Security, permissions, concurrency, state, and public Python APIs are unchanged. +The maintained Studio MPA creation contract must record the new defaults. + +## Affected files and tasks + +- `T-1` / `FR-1..4`: update BytePlus regression fixtures and assertions first. +- `T-2` / `FR-1..2`: update `byteplus_model_endpoints()`. +- `T-3` / `FR-1..4`: synchronize the bilingual Studio MPA creation spec. +- `T-4`: run targeted tests, Ruff, Pyright, bilingual checks, and diff checks. + +## Verification and acceptance + +| Requirement | Acceptance criterion | Verification | Result | +| --- | --- | --- | --- | +| `FR-1` | Default request uses both BytePlus identities | OpenViking and service pytest suite | `pass`: 240 tests | +| `FR-2` | Explicit overrides and invalid-value checks remain covered | Same pytest command | `pass` | +| `FR-3` | API Key remains wire-only | Same pytest command | `pass` | +| `FR-4` | Domestic code path is unchanged | Diff review and existing service tests | `pass` | +| Quality | Changed Python passes static checks | Ruff `0.11.12`, Pyright, and `git diff --check` | `pass`: 0 errors | + +Acceptance criteria: + +- `AC-1`: new BytePlus automatic requests persist the approved model identities. +- `AC-2`: the wire request contains the API Key while registry state does not. +- `AC-3`: environment overrides retain precedence. +- `AC-4`: no cloud resource is mutated by implementation verification. + +## Risks and recovery + +Provider acceptance at collection creation does not prove successful inference; +a new isolated live resource is required for end-to-end semantic verification. +Existing misconfigured resources are not mutated. Operators can restore the old +behavior with both environment overrides if rollback is required. + +## Review and delivery record + +Direct review found no API, credential, state-machine, or domestic compatibility +change beyond the BytePlus defaults. The model identities were verified by +BytePlus Ark dry run. The user approved the exact values and retained API Key +binding on 2026-10-14. Implementation completed on 2026-10-14. Verification: + +- `uv run --extra dev pytest tests/integrations/mpa_managed/test_openviking.py tests/integrations/mpa_managed/test_openviking_byteplus.py tests/integrations/mpa_managed/test_openviking_diagnostics.py tests/integrations/mpa_managed/test_service.py -q`: `pass`, 240 tests. +- Ruff `0.11.12` check/format and Pyright for the changed Python files: `pass`. +- `git diff --check` for the scoped files: `pass`. +- Live creation with the corrected identities: `not_run`; it requires a new paid OpenViking resource and explicit execution after Studio restart. diff --git a/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.zh.md b/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.zh.md new file mode 100644 index 000000000..cbf88420b --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.zh.md @@ -0,0 +1,96 @@ +# 托管 OpenViking 使用 BytePlus 模型标识 + +[English](2026-10-14-byteplus-model-identities.md) + +- Change ID: `mpa-byteplus-model-identities` +- Created/Revised: 2026-10-14 +- Status: implemented +- Related spec: [Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md) + +## 背景与证据 + +BytePlus 托管 OpenViking 当前将 `OV_VLM_ENDPOINT_ID` 和 +`OV_EMBEDDING_ENDPOINT_ID` 默认设为国内 `doubao-*` 标识。对账号 +`3001037806`、地域 `ap-southeast-1` 的只读 Ark 查询表明这些标识返回 +`NotFound.EndpointId`。真实 OpenViking 资源虽然接受了该配置,但语义入库 +超时,Embedding 工作持续重新入队且未生成向量。 + +BytePlus Ark `CreateEndpoint` DryRun 拒绝国内模型名,并接受 +`seed-2-0-lite` 版本 `260428` 和 `skylark-embedding-vision` 版本 +`251215`。用户已批准保留当前 API Key 加模型标识绑定,不采用 Coding Plan, +也不创建账号专属 `ep-*` 资源。 + +## 目标与非目标 + +目标: + +- BytePlus VLM 默认标识改为 `seed-2-0-lite-260428`。 +- BytePlus Embedding 默认标识改为 + `skylark-embedding-vision-251215`。 +- 保留 API Key 注入、环境变量覆盖、校验、脱敏、重试和非密钥意图持久化。 + +非目标: + +- 不改变国内 OpenViking 默认值。 +- 不创建、更新或删除 Ark Endpoint 或 OpenViking 资源。 +- 不采用 Coding Plan,也不改变数据面 Base URL。 +- 不迁移已有任务或 OpenViking 资源。 + +## 场景与需求 + +- `FR-1`:新的 BytePlus 自动 OpenViking 请求未设置覆盖时,VLM 和 + Embedding 凭据使用上述两个 BytePlus 模型标识。 +- `FR-2`:`OV_VLM_ENDPOINT_ID` 和 `OV_EMBEDDING_ENDPOINT_ID` 继续覆盖 + 默认值并沿用现有校验。 +- `FR-3`:解析后的模型 API Key 仅附加到复制的线上请求,绝不持久化。 +- `FR-4`:Volcengine 请求和已持久化请求保持不变。 + +## 设计与契约影响 + +仅修改 `byteplus_model_endpoints()` 返回的 fallback 值。现有请求构造器、 +API Key 注入、注册表比对和云适配器保持不变。已有请求继续保留已持久化标识; +改变其输入仍会产生配置冲突。Studio 重启后创建的新任务取得新默认值。 + +安全、权限、并发、状态和公开 Python API 均不改变。维护中的 Studio MPA +创建契约需记录新默认值。 + +## 影响文件与任务 + +- `T-1` / `FR-1..4`:先更新 BytePlus 回归 fixture 和断言。 +- `T-2` / `FR-1..2`:更新 `byteplus_model_endpoints()`。 +- `T-3` / `FR-1..4`:同步 Studio MPA 创建双语组件契约。 +- `T-4`:运行定向测试、Ruff、Pyright、双语检查和 diff 检查。 + +## 验证与验收 + +| 需求 | 验收条件 | 验证 | 结果 | +| --- | --- | --- | --- | +| `FR-1` | 默认请求使用两个 BytePlus 标识 | OpenViking 与 service pytest 测试集 | `pass`:240 项 | +| `FR-2` | 显式覆盖与非法值检查继续受覆盖 | 同一 pytest 命令 | `pass` | +| `FR-3` | API Key 仍仅在线上传递 | 同一 pytest 命令 | `pass` | +| `FR-4` | 国内代码路径不变 | diff 审查及现有 service 测试 | `pass` | +| 质量 | 变更 Python 通过静态检查 | Ruff `0.11.12`、Pyright 和 `git diff --check` | `pass`:0 个错误 | + +验收标准: + +- `AC-1`:新的 BytePlus 自动请求持久化已批准的模型标识。 +- `AC-2`:线上请求包含 API Key,注册表状态不包含 API Key。 +- `AC-3`:环境变量覆盖继续具有优先级。 +- `AC-4`:实现验证不变更云资源。 + +## 风险与恢复 + +云端在建库时接受配置不代表推理一定成功;端到端语义验证需要创建新的隔离 +真实资源。已有错误配置资源不做变更。需要回滚时,运维可同时设置两个环境变量 +恢复旧行为。 + +## 评审与交付记录 + +直接评审确认除 BytePlus 默认值外,不改变 API、凭据、状态机或国内兼容性。 +模型标识已通过 BytePlus Ark DryRun 验证。用户于 2026-10-14 批准精确值并 +保留 API Key 绑定。实现于 2026-10-14 完成。验证结果: + +- `uv run --extra dev pytest tests/integrations/mpa_managed/test_openviking.py tests/integrations/mpa_managed/test_openviking_byteplus.py tests/integrations/mpa_managed/test_openviking_diagnostics.py tests/integrations/mpa_managed/test_service.py -q`:`pass`,240 项。 +- 对变更 Python 文件运行 Ruff `0.11.12` check/format 和 Pyright:`pass`。 +- 对范围内文件运行 `git diff --check`:`pass`。 +- 使用修正标识进行真实创建:`not_run`;需要 Studio 重启后显式创建新的付费 OpenViking 资源。 diff --git a/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.md b/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.md new file mode 100644 index 000000000..cdaf086aa --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.md @@ -0,0 +1,28 @@ +# Default BytePlus MPA maximum instances to 10 + +[中文版](2026-10-15-default-maximum.zh.md) + +Date: 2026-10-15. Scope: Studio MPA creation only. Authorized by the user request to change the overseas BytePlus maximum instances to 10. Status: implemented and locally verified. + +## Evidence, requirements and design + +The creation dialog hardcodes 20 for fresh input, missing editable-draft values, the numeric buffer, new-request reset and localized help. FR-1: choose 10 for BytePlus and retain 20 for Volcengine using the trusted existing cloudProvider prop. FR-2: preserve explicit draft edits and submitted request values, including omission in legacy submitted requests; send the numeric value through the existing maxInstance API field. FR-3: interpolate provider-specific help text and regenerate WebUI assets. + +Reuse the existing numeric input and validation. This changes a default scaling limit, not a hard cap or immediate instance allocation. Do not change backend/YAML/CLI profile defaults, minimum instances, concurrency, generic-agent creation or existing deployed Runtime configuration. No cloud operations, commit or push are authorized. The existing CON-21 scaling contract needs only a provider-specific default clarification in both languages. + +## Review, tasks and acceptance + +Direct design review (review-spec unavailable): provider selection, preserved request identity, legacy omission, localization and unchanged deployment mapping reviewed; no blockers. The user explicitly requested this scoped default change. T-1: failing React tests for fresh BytePlus submission, draft restoration, new-request reset and immutable retry. T-2: implement provider-aware defaults and localized help. T-3: run frontend tests, production build, i18n/assets checks, targeted existing backend scaling tests and proportionate browser verification. Acceptance: BytePlus new requests submit 10; Volcengine remains 20; explicit/legacy retry inputs are unchanged; generated assets match source. No component ownership or API/schema change. + +## Verification + +- pass: regression first, two new cases failed with expected 10 / actual 20; three explicit/legacy cases already passed. +- pass: `npm --prefix frontend test`, 1,389 Node tests and 116 component tests, including all five new cases. +- pass: `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_creation_scaling.py`, 20 tests; no backend source changes. +- pass: `npm --prefix frontend run build`, TypeScript plus app/widget production bundles. +- pass: `npm --prefix frontend run check:i18n` and `npm --prefix frontend run test:webui-assets`, 113 packaged files / 350 internal references. +- pass: real browser using the actual React dialog and isolated mocked APIs on a temporary local server: BytePlus input/help 10, submitted maxInstance 10, new-request reset 10, zero rejected; Volcengine input/help 20. Temporary fixture/server/tab were removed; no real cloud creation. +- pass: `git diff --check`. Frontend-only change; Python Ruff/Pyright and harness/sidecar smoke are not_applicable. +- not_run: full Python regression (frontend defaults only; existing scaling tests cover the unchanged backend mapping), live cloud scaling, commit and push (not requested). + +- pass: `uv run --extra dev pre-commit run --all-files`, formatting, secret scanning and dependency policy. diff --git a/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.zh.md b/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.zh.md new file mode 100644 index 000000000..571a848e4 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.zh.md @@ -0,0 +1,28 @@ +# BytePlus MPA 最大实例数默认设为 10 + +[English](2026-10-15-default-maximum.md) + +日期:2026-10-15。范围:仅 Studio MPA 创建。授权:用户要求将海外 BytePlus 最大实例数改为 10。状态:已实现并完成本地验证。 + +## 证据、需求与设计 + +创建弹窗在新输入、缺少该值的可编辑草稿、数字编辑缓冲、新请求重置及本地化帮助中写死 20。FR-1:使用已有可信 cloudProvider 属性,为 BytePlus 选择 10,为火山保留 20。FR-2:保留显式草稿修改和已提交请求的数值,包括旧已提交请求省略字段的情况;通过已有 maxInstance API 字段传递数字。FR-3:帮助文字插入对应提供商的默认值,重新生成 WebUI 产物。 + +复用现有数字输入和校验。此次改变默认扩容上限,不是强制上限或立即分配的实例数。不修改后端/YAML/CLI 配置默认值、最小实例数、并发、通用智能体创建或已部署 Runtime 设置。未授权云端操作、提交或推送。现有 CON-21 扩容契约仅需在双语文档中说明分提供商默认值。 + +## 审查、任务与验收 + +直接设计审查(review-spec 不可用):已检查提供商选择、请求身份保留、旧字段省略、本地化及不变的部署映射,无阻塞项。用户已明确要求此范围的默认值修改。T-1:先写 BytePlus 新请求提交、草稿恢复、新请求重置和不可变重试的失败 React 测试。T-2:实现分提供商默认值和本地化帮助。T-3:执行前端测试、生产构建、国际化/产物检查、已有后端扩容定向测试及适度浏览器验证。验收:BytePlus 新请求提交 10;火山仍为 20;显式/旧重试输入保持原样;构建产物与源码一致。不改变组件归属或 API/数据结构。 + +## 验证 + +- pass:先执行失败回归,两个新增场景因预期 10、实际 20 而失败;三个显式值/旧请求场景原本已通过。 +- pass:`npm --prefix frontend test`,1,389 项 Node 测试、116 项组件测试通过,包含全部五项新增场景。 +- pass:`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_creation_scaling.py`,20 项通过;没有后端源码改动。 +- pass:`npm --prefix frontend run build`,TypeScript、应用及 widget 生产构建通过。 +- pass:`npm --prefix frontend run check:i18n`、`npm --prefix frontend run test:webui-assets`,113 个产物文件、350 个内部引用通过。 +- pass:临时本地服务使用真实 React 弹窗与隔离模拟 API 完成浏览器验证:BytePlus 输入/帮助为 10,提交 maxInstance 为 10,新请求重置为 10,拒绝 0;火山输入/帮助仍为 20。临时 fixture、服务和标签页均已清理;没有真实云端创建。 +- pass:`git diff --check`。仅前端改动;Python Ruff/Pyright 和 harness/sidecar smoke 为 not_applicable。 +- not_run:完整 Python 回归(仅前端默认值,已有扩容测试覆盖未改动的后端映射)、真实云端扩缩容、提交及推送(未请求)。 + +- pass:`uv run --extra dev pre-commit run --all-files`,格式、密钥扫描及依赖策略检查通过。 diff --git a/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.md b/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.md new file mode 100644 index 000000000..0090d9cea --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.md @@ -0,0 +1,43 @@ +# Temporarily skip OpenViking in new BytePlus Studio requests + +[中文版](2026-10-14-skip-new-requests.zh.md) + +Change ID: mpa-byteplus-without-openviking. Date: 2026-10-14. Status: superseded; temporary behavior restored on 2026-10-14. +Contracts: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-17/CON-18. + +## Evidence, goals and scope + +A BytePlus task reached OV creation after PG/network/IM Gateway/Worker succeeded, then failed with ProductUnordered. The user explicitly requests skipping OV to test the rest of the creation/chat chain. Do not purchase/activate services or change billing. Preserve domestic automatic OV and already-submitted request identity; do not reset the uncertain-create guard or change existing resource bindings. + +## Requirements and scenarios + +- FR-1: Built-in BytePlus configuration stops advertising automatic OV for new requests; domestic defaults continue advertising it. Explicit prior automatic requests and manual profiles retain supported behavior. +- FR-2: New BytePlus forms and editable restored drafts clear OV auto selection and manual fields when the server no longer advertises auto. Show a localized skipped-memory explanation, hide OV inputs, and submit without auto or credentials. Submitted automatic/manual requests preserve their original fields and retry intent. +- FR-3: Blank request fields use the existing manual-disabled server path, remove inherited OPENVIKING_* variables and never call OV provisioning. PG, IAM, network, APIG/IM Gateway, Worker, Skill Space, Runtime and general agents keep their existing contracts. +- FR-4: Keep three-step navigation, console link, optional TOS, cancellation, new-request action and retry behavior. Old failed automatic requests require the existing New Agent action; they are not silently converted. + +## Design, tasks and review + +T-1: config.py disables only built-in BytePlus auto availability. The existing with_creation_resources empty-input behavior owns Runtime omission; no new API enum or dependency. +T-2: MpaCreateDialog.tsx clears OV choices only for editable BytePlus requests with no server auto availability and clears memory-only key state. Render the existing paragraph/layout for the skipped state; no CSS/icon/component extension. Add paired locale copy. Archived automatic and nonempty manual requests retain their existing UI. +T-3: Test profile defaults, domestic compatibility, old explicit auto, restored editable draft, submitted retry and no-OV Runtime payload (including inherited settings) before implementation. Run managed/startup Python, Ruff/Pyright, frontend test/build/i18n/assets, isolated browser normal/retry/narrow/Escape checks and secret scanning. +T-4: Synchronize this bilingual design, component contract and module/frontend READMEs; preserve unrelated local changes and generated outputs from other tasks. + +Approval: user's explicit 2026-10-14 request to temporarily skip BytePlus OV; the implementation scope was stated before editing. Direct review (review-spec unavailable) checked boundaries, absent-field compatibility, immutable submitted requests, secret omission and bilingual equivalence; no blocker. Repository-referenced frontend-design/ui-ux-pro-max files are unavailable at their paths or installed skill roots; use the existing dialog and Foundation/SPEC rules without introducing visual design. + +## Acceptance and risks + +AC-1 (FR-1): BytePlus new config omits auto; domestic still advertises auto; explicit old auto resolves unchanged. +AC-2 (FR-2/FR-4): New/restored editable BytePlus requests contain no OV credentials/auto and display the skipped explanation; retries preserve submitted identity and values. Existing manual recovery still works. +AC-3 (FR-3): Mocked BytePlus provisioning reaches Runtime with no OPENVIKING_* values, including inherited template/reference values; no OV API is called. +AC-4 (all): Required targeted/regression/static/frontend/browser/secret gates pass with actual evidence. Live chat validation is separate and user-driven. No server restart, cloud mutation, commit or push in this implementation. + +The resulting agent has no OV-backed long-term memory. This change cannot make an old automatic task retry as a different request. Other cloud/model/startup errors may still prevent the full chain from succeeding. + +## Verification + +2026-10-14, diff based on 2ffe6e14. not_run: implementation checks pending. Live cloud creation/chat not_run; no automatic additional resource writes. Harness/Codex smoke not_applicable because execution protocols are unchanged. + +Verification completed 2026-10-14: pass, failing regressions reproduced BytePlus auto advertisement and retained editable auto draft; an additional failure reproduced submitted intent being cleared by configuration refresh. All fixed. pass: `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` (1,045 tests, four dependency warnings, two workers). pass: `npm --prefix frontend test` (Node suite and 100 React cases), production build, i18n (2 locales/21 namespaces), packaged assets (113 files/350 references). pass: Ruff 0.11.12 and Pyright with explicit repository Python interpreter on all three changed Python files (zero errors/warnings). pass: actual dialog in Chromium with mocked cloud APIs, normal no-OV submission, same-request retry, editable stale draft, submitted auto recovery, domestic auto, narrow viewport and Escape. pass: repository Gitleaks hook over 128 isolated in-scope source/doc/generated files. Browser fixture initially lacked application theme tokens; it was corrected to import the real theme and set the same light default before final visual verification. Temporary browser files/server removed. pass: paired identifiers/links and diff whitespace. not_run: full-repository/all-files pre-commit because no commit requested; focused static/secret and affected regression gates were used. No new dependencies, billing changes or cloud writes. Existing package-lock changes are preserved. + +Superseded by [restore OV and complete Runtime diagnostics](../mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md), explicitly requested after OV allowlisting. Historical evidence below describes the temporary skip only. diff --git a/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.zh.md b/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.zh.md new file mode 100644 index 000000000..619592048 --- /dev/null +++ b/prd-spec/bugfixes/mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.zh.md @@ -0,0 +1,43 @@ +# BytePlus Studio 新请求暂时跳过 OpenViking + +[English](2026-10-14-skip-new-requests.md) + +变更 ID:mpa-byteplus-without-openviking。日期:2026-10-14。状态:superseded;未进行真实创建/聊天。 +组件契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-17/CON-18。 + +## 证据、目标与范围 + +一次 BytePlus 任务通过 PG/网络/IM Gateway/Worker 后,在 OV 创建返回 ProductUnordered。用户明确要求跳过 OV,验证其余创建/聊天链路。不购买或开通服务,不修改结算。保留国内自动 OV 及已提交请求身份;不重置不确定建库保护,不修改已有资源绑定。 + +## 需求与场景 + +- FR-1:内置 BytePlus 配置不再为新请求声明自动 OV;国内默认仍声明。明确提交过的自动请求和手动配置保留现有支持行为。 +- FR-2:服务端不再声明自动 OV 时,新的 BytePlus 表单及恢复的可编辑草稿清除自动选择和手动字段,显示本地化跳过记忆说明,隐藏 OV 输入,不提交自动模式或凭证。已提交自动/手动请求保留原字段和重试意图。 +- FR-3:空请求字段使用现有手动禁用路径,清除继承的 OPENVIKING_* 变量,不调用 OV 准备。PG、IAM、网络、APIG/IM Gateway、Worker、Skill Space、Runtime 和通用智能体保持现有契约。 +- FR-4:保留三步导航、控制台链接、可选 TOS、取消、新建另一个请求及重试行为。旧失败自动请求需使用现有“新建另一个智能体”,不静默转换。 + +## 设计、任务与评审 + +T-1:config.py 只关闭内置 BytePlus 自动能力声明;现有 with_creation_resources 空输入行为负责 Runtime 不注入,不新增 API 枚举或依赖。 +T-2:MpaCreateDialog.tsx 仅为可编辑、服务端未声明自动能力的 BytePlus 请求清除 OV 选择,并清除内存中的 Key。跳过状态使用现有段落/布局,不扩展 CSS/图标/组件,增加双语文案。归档自动及非空手动请求保留现有 UI。 +T-3:先测试配置默认、国内兼容、旧明确自动请求、恢复可编辑草稿、已提交重试及无 OV Runtime 载荷(含继承配置),再实现。运行 MPA/启动 Python、Ruff/Pyright、前端测试/构建/i18n/产物、隔离浏览器正常/重试/窄窗口/Escape 及密钥扫描。 +T-4:同步双语设计、组件契约和模块/前端 README;保留其他任务的本地改动及生成产物。 + +批准记录:用户在 2026-10-14 明确要求暂时跳过 BytePlus OV,实现前已说明范围。review-spec 不可用,已直接评审边界、缺省字段兼容、已提交请求不可变、密钥排除及双语一致性,无阻塞项。仓库引用的 frontend-design/ui-ux-pro-max 文件在指定路径和已安装技能根中均不可用,使用现有弹窗及 Foundation/SPEC 规则,不引入视觉设计。 + +## 验收与风险 + +AC-1(FR-1):BytePlus 新配置省略自动能力,国内仍声明,旧明确自动请求解析不变。 +AC-2(FR-2/FR-4):新建/恢复可编辑 BytePlus 请求不含 OV 凭证或自动选择,显示跳过说明;重试保留提交身份和值,已有手动恢复仍可用。 +AC-3(FR-3):模拟 BytePlus 准备流程到达 Runtime 时不含 OPENVIKING_*,包括继承模板/参考值,不调用 OV API。 +AC-4(全部):目标/回归/静态/前端/浏览器/密钥检查通过并记录真实证据;真实聊天验证独立,由用户执行。本次实现不重启服务、不修改云资源、不提交或推送。 + +新智能体没有 OV 长期记忆。本修改不会让旧自动任务以不同请求重试。其他云端/模型/启动错误仍可能影响全链路。 + +## 验证 + +2026-10-14,基于 2ffe6e14 的差异。not_run:等待实现检查。真实云端创建/聊天 not_run,未自动追加资源写入。Harness/Codex smoke not_applicable,因为执行协议未改。 + +2026-10-14 验证完成:pass,失败回归复现 BytePlus 声明自动能力及可编辑旧草稿仍保留自动模式;补充回归复现配置刷新清除已提交意图,均已修复。pass:`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`(1,045 项,4 条依赖警告,两个 worker)。pass:`npm --prefix frontend test`(Node 套件及 100 个 React 场景)、生产构建、i18n(2 语言/21 命名空间)、打包产物(113 文件/350 引用)。pass:三个修改 Python 文件通过 Ruff 0.11.12 和显式仓库解释器的 Pyright(零错误/警告)。pass:Chromium 加载真实弹窗,模拟云端 API,验证正常无 OV 提交、同请求重试、可编辑旧草稿、已提交自动恢复、国内自动、窄窗口和 Escape。pass:128 个范围内源码/文档/产物隔离副本通过仓库 Gitleaks hook。浏览器测试入口最初缺少应用主题 token,已导入真实主题并使用相同的浅色默认后完成最终视觉检查。临时浏览器文件/服务已清理。pass:双语标识/链接及差异空白。not_run:全仓/全文件 pre-commit,因为未要求提交,使用目标静态/密钥及受影响回归检查。未新增依赖、修改结算或写云资源,保留已有 package-lock 改动。 + +已由[恢复 OV 并补齐 Runtime 诊断](../mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md)替代:用户在 OV 开白后明确要求恢复。下方历史证据仅描述临时跳过行为。 diff --git a/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.md b/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.md new file mode 100644 index 000000000..90b1ae263 --- /dev/null +++ b/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.md @@ -0,0 +1,103 @@ +# MPA Creation Local Task Recovery + +[中文版](2026-10-15-local-task-recovery.zh.md) + +## Metadata + +- Change ID: `mpa-creation-local-state` +- Created: 2026-10-15 +- Revised: 2026-10-15 +- Status: approved +- Related component spec: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md) + +## Background and Evidence + +Studio MPA creation already persists per-owner task state in a local SQLite database. However, the frontend mainly restores progress from browser `sessionStorage`. After refresh or storage loss, the dialog cannot discover the latest local task by owner and region. Local MPA operation recovery may also be unavailable when Studio TOS storage is not configured. + +The `wlc-ap-test` BytePlus run also showed an intent mismatch after the operator changed TOS configuration between retries. The server removed `tosBucket` from the stored task payload but passed it to the child process, while Worker hashing included the resulting TOS mount configuration. That allowed the task layer to treat the request as unchanged even though the Worker intent changed, causing a late `configuration_changed` failure. + +After the AIDAP retry fix, the same task reached the Worker stage repeatedly and BytePlus rejected `create_worker` with `InvalidParameter.TosEndpoint`. Retries with the legacy `https://tos-ap-southeast-1.bytepluses.com`, host-only `tos-ap-southeast-1.bytepluses.com`, omitted endpoint, and AgentKit-style `http://tos-ap-southeast-1.bytepluses.com` shapes failed, including request IDs `2026101511483686035D67AE3B4A1C41A8`, `20261015115339C02052F0ED43FE23806D`, `2026101512015520E30384A95D0B0B510C`, and `202610151214245AE8256781CAFD0F5F45`. This shows BytePlus Tool creation currently does not accept the Tool-level TOS mount configuration. Agent creation must therefore degrade by creating the Worker without a Tool TOS mount while preserving the rest of the MPA resources. + +## Goals and Non-Goals + +Goals: + +- Add an owner-scoped local task listing endpoint for refresh recovery. +- Let the frontend recover the latest submitted task from the server when `sessionStorage` is absent or stale. +- Persist nonsecret `tosBucket` as part of task identity so changed TOS configuration is rejected early. +- Include the latest safe diagnostic summary in recovered task payloads. +- Retry transient AIDAP read/query failures with bounded backoff while preserving create idempotency safety. +- Try the AgentKit Tool mount endpoint shape `http://tos-ap-southeast-1.bytepluses.com` for BytePlus IAM role mounts, but automatically degrade to Worker creation without Tool-level TOS mount when BytePlus rejects `TosEndpoint`. +- Keep degraded retries idempotent and clear Runtime TOS mount environment flags so the Runtime does not assume a mount that was not created. + +Non-goals: + +- Change domestic Volcengine Worker TOS mount serialization. +- Persist TOS access keys or secrets. +- Replace the durable production MPA operation service. +- Add a full recovery console in this change. +- Retry `CreateWorkspace`, which lacks an idempotency token. + +## Requirements + +- `FR-1`: Given a submitted task exists in the local SQLite database, when the dialog opens after refresh without browser recovery state, then it can recover and poll the latest task for the current owner and region. +- `FR-2`: Given the same `requestId` is submitted with a different `tosBucket`, then the server rejects it at task admission instead of reaching Worker hash validation. +- `FR-3`: Given a task has diagnostics, then the latest diagnostic is returned as safe structured metadata and contains no raw provider text or credentials. +- `FR-4`: Given the task is passed to the child process, then nonsecret `tosBucket` still reaches the TOS configuration path and no TOS secret is persisted. +- `FR-5`: Given a read-only AIDAP call such as branch, compute, endpoint, account, database, connection, list or detail fails with a transient provider error, then the create flow retries with bounded backoff and records the exact safe AIDAP operation. +- `FR-6`: Given `CreateWorkspace` fails, then it is not automatically retried because the cloud API lacks a client idempotency token. +- `FR-7`: Given BytePlus Worker creation uses an IAM role TOS mount, then the first create payload uses `MountPoints[].Endpoint=http://tos-ap-southeast-1.bytepluses.com`, and unfinished legacy intents hashed with omitted endpoint, `tos-ap-southeast-1.bytepluses.com`, or `https://tos-ap-southeast-1.bytepluses.com` are upgraded instead of being rejected as changed inputs. +- `FR-8`: Given BytePlus rejects Worker creation with `InvalidParameter.TosEndpoint`, then the same creation flow records a safe diagnostic and retries Worker creation without `TosMountConfig`, with a new client token and a persisted degradation marker. +- `FR-9`: Given Worker TOS mount is degraded, then Runtime deployment does not set `MPA_CODEX_WORKER_TOS_MOUNT_ENABLED` or `MPA_CODEX_WORKER_TOS_BUCKET`. + +## Design and Contract Impact + +`CreationTasks` will expose an owner-scoped `list()` method returning recent tasks. `GET /web/mpa-creation/tasks?region=...` will call it and return `{tasks:[...]}`. Each task keeps the existing task shape and may add `latestDiagnostic`. + +The task payload will keep `tosBucket` when present. The child input will still receive a separate `tos` object, and `_run()` will not forward `tosBucket` through unrelated resource fields. This makes the existing duplicate request comparison catch TOS changes before child startup. + +Frontend `MpaCreateDialog` will call the list endpoint when no submitted task is already restored from session storage, then attach to the most recent submitted task for the region. Browser storage remains an optimization, not the only source of truth. + +Component spec impact: this is an additive HTTP endpoint and a stricter request identity check. Existing task query endpoints remain unchanged. + +AIDAP read calls use up to eight total attempts with bounded exponential backoff. Retryable categories are `connection`, `timeout`, `throttled`, and `unavailable`. Permission, authentication, invalid parameter, ownership/configuration, missing resource and protocol-shape failures fail closed. `create_workspace` remains single-attempt to avoid duplicate resources. + +BytePlus Worker TOS mount serialization rewrites `MountPoints[].Endpoint` from the domestic AgentKit default to `http://tos-ap-southeast-1.bytepluses.com` before hashing and cloud submission. The Worker retry path recognizes unfinished legacy hashes that omitted the endpoint, included the original HTTPS BytePlus endpoint, or included the later host-only endpoint, then upgrades the stored hash to the HTTP endpoint request. + +If the provider still returns `InvalidParameter.TosEndpoint`, the Worker provisioner records `worker_tos_mount_disabled=true` with a safe reason, switches to a request without `TosMountConfig`, rotates the client token to avoid idempotency conflicts across changed payloads, and retries `create_worker`. `provision()` rereads the registry record after Worker creation and reapplies Runtime TOS env from the actual Worker state so degraded workers do not advertise an unavailable mount. + +## Tasks + +- `T-1`: Add `CreationTasks.list()` with latest diagnostic summary. +- `T-2`: Add `GET /web/mpa-creation/tasks`. +- `T-3`: Keep `tosBucket` in task payload while still passing `tos` to the child. +- `T-4`: Add frontend client and dialog recovery logic. +- `T-5`: Add backend and focused frontend tests. +- `T-6`: Add AIDAP read retry diagnostics and tests while keeping Workspace creation single-attempt. +- `T-7`: Adjust BytePlus Worker TOS mount serialization and legacy hash recovery. +- `T-8`: Add BytePlus Worker TOS mount degradation and Runtime env reconciliation. + +## Verification and Acceptance + +| Requirement | Task | Acceptance criterion | Test or verification command | Result/evidence | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`, `T-2`, `T-4`, `T-5` | Refresh recovery can discover a submitted task without session storage | `uv run --extra dev pytest tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_routes.py -q`; `npm --prefix frontend test -- mpaCreation.test.tsx --runInBand` | `pass`, backend 34 passed and frontend 1389 Node tests plus 117 Vitest tests passed on 2026-10-15 | +| `FR-2` | `T-3`, `T-5` | Changed `tosBucket` for the same request is rejected at admission | Same backend pytest command | `pass`, backend 34 passed on 2026-10-15 | +| `FR-3` | `T-1`, `T-5` | Latest diagnostic is safe and structured | Same backend pytest command | `pass`, backend 34 passed on 2026-10-15 | +| `FR-4` | `T-3`, `T-5` | Child receives TOS selection and secrets stay out of persistence | Same backend pytest command | `pass`, backend 34 passed on 2026-10-15 | +| `FR-5` | `T-6` | Transient AIDAP read failures retry and report the concrete AIDAP operation | `uv run --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_routes.py -q`; `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py::test_sdk_read_calls_tolerate_repeated_cross_region_failures -q` | `pass`, 129 passed plus focused repeated-failure coverage on 2026-10-15 | +| `FR-6` | `T-6` | `CreateWorkspace` failures do not retry automatically | Same AIDAP/PG pytest command | `pass`, 129 passed on 2026-10-15 | +| `FR-7` | `T-7` | BytePlus Worker create uses the HTTP TOS Endpoint and legacy endpoint hashes resume | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_mount_and_environment_are_overseas tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_recovers_legacy_tos_endpoint -q` | `pass`, covered by focused 6-test run on 2026-10-15 | +| `FR-8` | `T-8` | BytePlus `InvalidParameter.TosEndpoint` falls back to Worker creation without Tool TOS mount | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_tos_endpoint_failure_falls_back_without_mount -q` | `pass`, covered by focused 6-test run on 2026-10-15 | +| `FR-9` | `T-8` | Runtime TOS env is cleared when Worker mount is degraded | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_service.py::test_tos_runtime_env_is_owned_and_contains_no_credentials -q` | `pass`, covered by focused 6-test run on 2026-10-15 | + +## Risks + +- Local SQLite remains instance-local; it is suitable for local Studio and single-instance deployments, not cross-instance production recovery. +- Listing recent tasks must stay owner-scoped to avoid exposing another user's drafts or cloud resource names. + +## Review and Delivery Record + +Design review conclusion: the change is a narrow reliability fix over existing local task storage. It avoids new cloud side effects and makes TOS changes fail earlier. + +Implementation completed on 2026-10-15. Targeted backend tests, focused frontend tests, AIDAP/PG retry tests, BytePlus Worker TOS endpoint/degradation regression tests, Ruff, i18n check, frontend build and `git diff --check` passed. The frontend build emitted existing chunk-size and mixed dynamic/static import warnings. diff --git a/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.zh.md b/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.zh.md new file mode 100644 index 000000000..e4654e748 --- /dev/null +++ b/prd-spec/bugfixes/mpa-creation-local-state/2026-10-15-local-task-recovery.zh.md @@ -0,0 +1,103 @@ +# MPA 创建本地任务恢复 + +[English](2026-10-15-local-task-recovery.md) + +## 元数据 + +- 变更 ID:`mpa-creation-local-state` +- 创建日期:2026-10-15 +- 修订日期:2026-10-15 +- 状态:approved +- 相关组件规格:[Studio MPA creation](../../../specs/studio-mpa-creation/README.zh.md) + +## 背景与证据 + +Studio MPA 创建已经将 owner 维度的任务状态持久化到本地 SQLite 数据库。但前端主要依赖浏览器 `sessionStorage` 恢复进度。刷新、缓存丢失或草稿被替换后,弹窗无法按当前 owner 和地域从服务端发现最近任务。本地未配置 Studio TOS 存储时,MPA operation service 也可能不可用。 + +`wlc-ap-test` 的 BytePlus 创建暴露了另一个问题:操作者在重试之间修改了 TOS 配置。服务端把 `tosBucket` 从存储的任务 payload 中移除,只单独传给子进程;而 Worker 哈希包含最终 TOS mount 配置。结果是任务层认为请求未变化,但 Worker intent 已变化,最后在 Worker 阶段才报 `configuration_changed`。 + +AIDAP 重试修复后,同一任务已能多次推进到 Worker 阶段,但 BytePlus `create_worker` 持续返回 `InvalidParameter.TosEndpoint`。使用旧的 `https://tos-ap-southeast-1.bytepluses.com`、后续改成的 `tos-ap-southeast-1.bytepluses.com`、省略 endpoint,以及 AgentKit 风格的 `http://tos-ap-southeast-1.bytepluses.com` 都被拒绝,对应 request ID 包括 `2026101511483686035D67AE3B4A1C41A8`、`20261015115339C02052F0ED43FE23806D`、`2026101512015520E30384A95D0B0B510C` 和 `202610151214245AE8256781CAFD0F5F45`。这说明 BytePlus Tool 创建当前不接受 Tool 级 TOS mount 配置。Agent 创建应降级为不带 Tool TOS mount 创建 Worker,同时保留其余 MPA 资源。 + +## 目标与非目标 + +目标: + +- 增加按 owner 隔离的本地任务列表接口,用于刷新恢复。 +- 当前端没有或丢失 `sessionStorage` 时,可从服务端恢复当前 owner 和地域下最近的已提交任务。 +- 将非密的 `tosBucket` 纳入任务身份,TOS 配置变化在提交阶段尽早拒绝。 +- 在恢复的任务载荷中包含最新安全诊断摘要。 +- 对暂时性的 AIDAP 读/查询失败做有界退避重试,同时保持创建 Workspace 的幂等安全边界。 +- BytePlus IAM role 模式的 Worker TOS mount 先尝试 AgentKit Tool mount endpoint 形态 `http://tos-ap-southeast-1.bytepluses.com`;当 BytePlus 拒绝 `TosEndpoint` 时,自动降级为不带 Tool 级 TOS mount 创建 Worker。 +- 降级后的重试保持幂等,并清理 Runtime TOS mount 环境变量,避免 Runtime 误认为 Worker 已挂载。 + +非目标: + +- 不改变国内火山 Worker TOS mount 序列化。 +- 不持久化 TOS access key、secret 等密钥。 +- 不替代生产环境需要的持久化 MPA operation service。 +- 本次不建设完整恢复控制台。 +- 不自动重试缺少幂等 token 的 `CreateWorkspace`。 + +## 需求 + +- `FR-1`:给定本地 SQLite 中已有提交任务,当弹窗刷新后没有浏览器恢复状态时,应能按当前 owner 和地域恢复并继续轮询最近任务。 +- `FR-2`:给定同一 `requestId` 使用不同 `tosBucket` 再次提交,服务端应在任务接收阶段拒绝,而不是进入 Worker 哈希校验后失败。 +- `FR-3`:给定任务已有诊断,恢复任务应返回最新的安全结构化诊断,不包含原始服务商文案或凭据。 +- `FR-4`:给定任务进入子进程,非密 `tosBucket` 仍应进入 TOS 配置路径,且 TOS 密钥不得持久化。 +- `FR-5`:给定 branch、compute、endpoint、account、database、connection、list 或 detail 等只读 AIDAP 调用遇到暂时性服务商错误,创建流程应有界退避重试,并记录具体安全 AIDAP 操作名。 +- `FR-6`:给定 `CreateWorkspace` 失败,不得自动重试,因为云 API 没有客户端幂等 token。 +- `FR-7`:给定 BytePlus Worker 创建使用 IAM role TOS mount,首次创建 payload 应使用 `MountPoints[].Endpoint=http://tos-ap-southeast-1.bytepluses.com`;已用省略 endpoint、`tos-ap-southeast-1.bytepluses.com` 或 `https://tos-ap-southeast-1.bytepluses.com` 计算 hash 的未完成旧 intent 应被升级,而不是被拒绝为输入变化。 +- `FR-8`:给定 BytePlus 以 `InvalidParameter.TosEndpoint` 拒绝 Worker 创建,同一创建流程应记录安全诊断,并使用新的客户端 token 以不带 `TosMountConfig` 的请求重试 Worker 创建,同时持久化降级标记。 +- `FR-9`:给定 Worker TOS mount 已降级,Runtime 部署不应设置 `MPA_CODEX_WORKER_TOS_MOUNT_ENABLED` 或 `MPA_CODEX_WORKER_TOS_BUCKET`。 + +## 设计与契约影响 + +`CreationTasks` 增加按 owner 查询最近任务的 `list()` 方法。`GET /web/mpa-creation/tasks?region=...` 调用它并返回 `{tasks:[...]}`。每个任务保持现有任务形状,并可新增 `latestDiagnostic`。 + +任务 payload 会在存在 `tosBucket` 时保留该字段。子进程输入仍单独包含 `tos` 对象,`_run()` 不会将 `tosBucket` 作为无关资源字段传递。这样现有重复请求比较会在子进程启动前捕获 TOS 变化。 + +前端 `MpaCreateDialog` 在没有从 session storage 恢复到提交任务时调用列表接口,并挂接当前地域最近的已提交任务。浏览器存储继续作为快速恢复缓存,而不是唯一状态源。 + +组件规格影响:新增一个 HTTP 查询端点,并收紧请求身份一致性。现有单任务查询端点不变。 + +AIDAP 读调用最多执行八次尝试,使用有界指数退避。可重试类别为 `connection`、`timeout`、`throttled` 和 `unavailable`。权限、认证、参数非法、归属/配置冲突、资源缺失和协议形态错误均快速失败。`create_workspace` 保持单次调用,避免重复资源。 + +BytePlus Worker TOS mount 序列化会先将 AgentKit 生成的国内默认 `MountPoints[].Endpoint` 改写为 `http://tos-ap-southeast-1.bytepluses.com`,再计算 hash 并提交云端。Worker 重试路径识别省略 endpoint、原始 HTTPS BytePlus endpoint 或后续 host-only endpoint 的未完成旧 hash,并将存储 hash 升级为 HTTP endpoint 请求。 + +如果服务商仍返回 `InvalidParameter.TosEndpoint`,Worker provisioner 会记录 `worker_tos_mount_disabled=true` 和安全原因,切换到不带 `TosMountConfig` 的请求,轮换客户端 token 以避免变更 payload 的幂等冲突,并重试 `create_worker`。`provision()` 在 Worker 创建后重新读取 registry record,并按实际 Worker 状态重新应用 Runtime TOS env,避免降级后的 Worker 暴露不可用挂载。 + +## 任务 + +- `T-1`:新增带最新诊断摘要的 `CreationTasks.list()`。 +- `T-2`:新增 `GET /web/mpa-creation/tasks`。 +- `T-3`:任务 payload 保留 `tosBucket`,同时继续将 `tos` 传给子进程。 +- `T-4`:新增前端客户端与弹窗恢复逻辑。 +- `T-5`:补充后端与聚焦前端测试。 +- `T-6`:增加 AIDAP 读重试诊断与测试,同时保持 Workspace 创建单次执行。 +- `T-7`:调整 BytePlus Worker TOS mount 序列化和旧 hash 恢复。 +- `T-8`:增加 BytePlus Worker TOS mount 降级与 Runtime env 对齐。 + +## 验证与验收 + +| 需求 | 任务 | 验收标准 | 测试或验证命令 | 结果/证据 | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`, `T-2`, `T-4`, `T-5` | 无 session storage 时可从本地服务端恢复已提交任务 | `uv run --extra dev pytest tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_routes.py -q`;`npm --prefix frontend test -- mpaCreation.test.tsx --runInBand` | `pass`,2026-10-15 后端 34 个测试通过,前端 1389 个 Node 测试和 117 个 Vitest 测试通过 | +| `FR-2` | `T-3`, `T-5` | 同一请求修改 `tosBucket` 会在任务接收阶段拒绝 | 同一后端 pytest 命令 | `pass`,2026-10-15 后端 34 个测试通过 | +| `FR-3` | `T-1`, `T-5` | 最新诊断为安全结构化数据 | 同一后端 pytest 命令 | `pass`,2026-10-15 后端 34 个测试通过 | +| `FR-4` | `T-3`, `T-5` | 子进程收到 TOS 选择且密钥不持久化 | 同一后端 pytest 命令 | `pass`,2026-10-15 后端 34 个测试通过 | +| `FR-5` | `T-6` | 暂时性 AIDAP 读失败会重试并记录具体 AIDAP 操作 | `uv run --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py tests/integrations/mpa_managed/test_byteplus.py tests/integrations/mpa_managed/test_tasks.py tests/integrations/mpa_managed/test_routes.py -q`;`uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py::test_sdk_read_calls_tolerate_repeated_cross_region_failures -q` | `pass`,2026-10-15 共 129 个测试通过,并补充重复失败聚焦覆盖 | +| `FR-6` | `T-6` | `CreateWorkspace` 失败不会自动重试 | 同一 AIDAP/PG pytest 命令 | `pass`,2026-10-15 共 129 个测试通过 | +| `FR-7` | `T-7` | BytePlus Worker 创建使用 HTTP TOS Endpoint,且旧 endpoint hash 可恢复 | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_mount_and_environment_are_overseas tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_recovers_legacy_tos_endpoint -q` | `pass`,2026-10-15 聚焦 6 个测试覆盖 | +| `FR-8` | `T-8` | BytePlus `InvalidParameter.TosEndpoint` 会降级为不带 Tool TOS mount 创建 Worker | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_byteplus.py::test_byteplus_worker_tos_endpoint_failure_falls_back_without_mount -q` | `pass`,2026-10-15 聚焦 6 个测试覆盖 | +| `FR-9` | `T-8` | Worker mount 降级时清理 Runtime TOS env | `uv run --python 3.13 --extra dev pytest tests/integrations/mpa_managed/test_service.py::test_tos_runtime_env_is_owned_and_contains_no_credentials -q` | `pass`,2026-10-15 聚焦 6 个测试覆盖 | + +## 风险 + +- 本地 SQLite 仍是实例本地状态,适合本地 Studio 和单实例部署,不等价于跨实例生产恢复。 +- 最近任务列表必须按 owner 隔离,避免暴露其他用户的草稿或云资源名称。 + +## 评审与交付记录 + +设计评审结论:这是基于已有本地任务存储的窄范围可靠性修复,不增加新的云侧副作用,并让 TOS 变化更早失败。 + +实现已于 2026-10-15 完成。定向后端测试、聚焦前端测试、AIDAP/PG 重试测试、BytePlus Worker TOS endpoint/降级回归测试、Ruff、i18n 检查、前端构建和 `git diff --check` 均通过。前端构建仍输出既有的大 chunk 与动态/静态混合导入警告。 diff --git a/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.md b/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.md new file mode 100644 index 000000000..091642558 --- /dev/null +++ b/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.md @@ -0,0 +1,61 @@ +# Confirm MPA deletion after a client timeout + +[中文版](2026-10-13-confirm-delete-outcome.zh.md) + +- Change ID: `mpa-delete-timeout` +- Created/revised: 2026-10-13 +- Status: implemented +- Contract: [Studio MPA control plane](../../../specs/studio-mpa-control-plane/README.md), CON-30a + +## Evidence, goals and scope + +MPA deletion uses `deleteRuntime` with the ordinary 30-second `apiFetch` deadline. The server rechecks sessions and resource references and deletes exclusive templates/Skill Spaces before Runtime. A browser timeout does not cancel these backend side effects. A reported timeout was followed by confirmed Runtime NotFound and absence of its Skill Space; the template was not independently queried. The exact stage/duration was not recovered from logs. + +FR-1: Give only explicitly selected MPA deletion a 180-second request deadline. General-agent deletion retains its 30-second deadline and behavior. +FR-2: After a TimeoutError, issue one read-only, uncached 30-second confirmation of the same Runtime ID/region through an Agent-management-authorized BFF. Report success only for explicit cloud Runtime NotFound plus complete ListRuntimes absence. Do not equate an authorization 404, access denial, transport error, malformed response, repeated token or pagination budget exhaustion with deletion. A Runtime visible only through ListRuntimes is still present. +FR-3: If confirmation returns present or cannot confirm, keep a localized uncertain-result message and the existing error/retry UI. Never automatically repeat DELETE. Non-timeout deletion failures preserve their current error. + +No creation changes, shared timeout changes, new async-job system, deletion-order changes, Profile query, resource purchase, migration, image changes or general-agent behavior changes are included. Runtime absence confirms the selected Runtime outcome, not independently inspected resource cleanup by an external actor. + +## Design and affected files + +Add a small read-only backend helper and endpoint `/web/mpa-runtime-deletion-status?runtimeId=...®ion=...` returning `{deleted: boolean}` with `Cache-Control: no-store`. Require current Agent management rights. Existing authorization verifies a present Runtime; authorization-generated HTTP errors never reach the missing-resource branch. If GetRuntime reports a structured Runtime-specific NotFound, scan all pages under the same deployment credentials, provider and region, with bounded pagination. Do not return resource/environment data or raw exceptions. Endpoint timeouts and unconfirmed errors return a safe explicit error. Cloud GetRuntime hiding a still-listed Runtime must not produce success. + +The client uses the existing requestSignal/apiFetch and existing confirmation UI. MPA-only catch handles TimeoutError, verifies the boolean result and resolves the original delete promise only on true. False/failed queries produce localized guidance to refresh/check later. Tests use fake deadlines and cloud responses, not live deletion. + +Files: `frontend/src/adk/client.ts`, paired ADK locale resources, `frontend/server/mpa_deletion_status.py`, route mount in `veadk/cli/cli_frontend.py`, frontend executable client tests, backend route/ownership/pagination tests; paired PRD/spec, frontend README and generated WebUI assets. No layout/CSS/icon changes; existing confirmation loading/error/retry/keyboard behavior is the visual baseline. + +## Tasks and acceptance + +- T-1 / FR-1 / AC-1: regression first for MPA 180 seconds versus general 30 seconds; general requests never call confirmation. +- T-2 / FR-2 / AC-2: implement authorized bounded status, cover structured/wrapped NotFound, paginated absence/presence, query failure, invalid pagination, cancellation and no mutation. +- T-3 / FR-3 / AC-3: verify confirmed completion, uncertain/present outcomes, malformed payload, permission and non-timeout failures; complete existing deletion/UI regression, build and isolated browser checks. + +## Review, authorization, risks and verification + +The user approved the proposed MPA-only timeout/confirmation fix with “改下” on 2026-10-13. `review-spec` is unavailable; direct review confirmed bilingual equivalence, no general-agent or cleanup-order change, bounded reads and fail-closed errors. No review blocker remains. Security review adds a bounded private confirmation context: remember only server-authorized MPA delete attempts, keyed by Studio owner/Runtime/region, with a hash of the current deployment credentials. At most 1024 contexts live for one hour; neither credentials nor their hash reach clients. Missing context, server restart or credential rotation produces an unconfirmed result, never success. Recheck credentials after cloud reads to detect mid-query account changes. This is not a persistent deletion job or new mutation protocol. No real cloud deletion, commit, push, deployment or Studio restart is authorized. + +Cloud listing is eventually consistent and cannot guarantee transaction-like cross-service cleanup. The read-only confirmation cannot infer details of resources deleted by external operators. Account changes/authorization failure cannot silently produce success. Known old-file static errors must be baseline-compared rather than hidden. Actual results are recorded below. Required gates: affected Python tests, Ruff/Pyright changed files, `npm --prefix frontend test`, build/i18n/assets, isolated browser and configured secret scan. No harness/process contract is affected. + +## Delivery review and verification (2026-10-13) + +T-1–T-3 / AC-1–AC-3 are implemented. Review confirmed MPA-only client gating, unchanged generic POST/deadline, no delete replay, structured-only absence checks, complete bounded pagination, credential/owner scoping and retained partial-cleanup behavior. Standard-library timeout is used on Python >=3.11 and the existing async-timeout dependency on older supported Python; no dependency was added. No creation, Profile, Runtime image, schema or deletion-order change was made. The new server module is included by the existing `frontend*` package discovery. + +Tested scope: this deletion fix on `71175c68636dc5b951e9804eb292d85402511e68`, alongside pre-existing local PG/name/OV changes which were preserved. Initial executable frontend regressions failed before the fix; backend tests initially failed collection because the new status module did not exist. Fake cloud operations and isolated browser responses are separate from live verification. + +| Check | Result | Evidence / limitations | +| --- | --- | --- | +| Python deletion/role regression | pass | `uv run --extra dev pytest tests/frontend/server/test_mpa_deletion_status.py tests/integrations/mpa_managed/test_deletion.py tests/cli/test_studio_rbac.py -q --no-cov`: 210 passed before final additional negative cases. | +| Final confirmation unit/route tests | pass | `uv run --extra dev pytest tests/frontend/server/test_mpa_deletion_status.py -q --no-cov`: 25 passed, including real Studio route mounting with simulated cloud deletion, actual-category general isolation, timeout, expiry/count bounds and wrapped provider errors. | +| Frontend client regressions | pass | `node --test frontend/tests/mpaDeletionTimeout.test.mjs`: 10 passed, including confirmation transport timeout and preserving non-timeout server diagnostics. | +| Frontend full regression | pass | `npm --prefix frontend test`: 1389 Node +84 React passed, including all 10 new client regression cases. | +| Build/i18n/assets | pass | `npm --prefix frontend run build`, `npm --prefix frontend run check:i18n`, `npm --prefix frontend run test:webui-assets`: synchronized release assets, 2 locales /21 namespaces, 113 files /350 references. Existing chunk-size warnings remain. | +| Browser | pass | Bundled Playwright with isolated headless Chrome and actual AgentWorkspace/client: normal success, timeout confirmed, still present, query failure, busy-disabled state, keyboard Enter/Escape, cancel/reopen, general deletion and 390×844 view. Mock fetch blocked real cloud calls; temporary server/fixtures removed. | +| Ruff / new-module Pyright | pass | Temporary `uvx` tools; Ruff on all 3 changed Python files and Pyright with `.venv/bin/python` on new module/test. No machine-global installation. | +| Legacy CLI Pyright | fail | 37 existing errors; comparison against HEAD has exactly the same diagnostic messages/rules, with no new diagnostics from the fix. Unrelated historical errors were not changed. | +| Documentation / whitespace / secrets | pass | Paired-language/identifier/link review, `git diff --check`, repository-configured redacted Gitleaks on changed sources/assets. | +| Live destructive E2E | not_run | No new deletion authorized or executed; earlier read-only diagnosis is not a live test of this fix. | +| Broad SDK/process/harness tests | not_applicable | No SDK, process or harness contracts changed; focused deletion, RBAC and frontend regression cover the changed path. | +| Commit/pre-commit | not_run | No commit authorized; branch synchronization and full pre-commit remain required before any later commit. | + +Restart Studio in the original credential-bearing terminal and refresh the page to load the backend and matching assets. No server restart, commit, push or deployment was performed. Remaining limits: contexts are process-local and expire; restart, a different worker process or credential rotation leaves the outcome unconfirmed. Runtime absence does not independently prove externally triggered related-resource cleanup. No new review blockers remain in the scoped fix. diff --git a/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.zh.md b/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.zh.md new file mode 100644 index 000000000..212240f22 --- /dev/null +++ b/prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.zh.md @@ -0,0 +1,61 @@ +# MPA 客户端超时后确认删除结果 + +[English](2026-10-13-confirm-delete-outcome.md) + +- Change ID:`mpa-delete-timeout` +- 创建/修订:2026-10-13 +- 状态:implemented +- 契约:[Studio MPA 控制面](../../../specs/studio-mpa-control-plane/README.zh.md),CON-30a + +## 证据、目标与范围 + +MPA 删除使用 `deleteRuntime`,沿用普通 `apiFetch` 的 30 秒超时。服务端复核会话和资源引用,先删除独占模板/Skill Space,再删 Runtime。浏览器超时不会取消这些后台副作用。一次报超时后,已确认 Runtime 返回 NotFound、Skill Space 不再存在;未独立查询模板。没有从日志恢复准确耗时/阶段。 + +FR-1:仅明确选择的 MPA 删除使用 180 秒请求超时。通用智能体删除保留 30 秒及既有行为。 +FR-2:TimeoutError 后,对同一 Runtime ID/地域执行一次只读、不缓存、限时 30 秒的确认,经过智能体管理授权 BFF。仅云端明确 Runtime NotFound 且完整 ListRuntimes 不存在时报告成功。授权产生的 404、权限拒绝、网络错误、格式错误、重复 token 或超出分页预算都不能视作删除成功。仅在 ListRuntimes 可见的 Runtime 仍然存在。 +FR-3:若确认仍存在或无法确认,保留本地化结果待确认提示及既有错误/重试 UI。不自动重复 DELETE。非超时删除失败保留原错误。 + +不修改创建、公共超时、异步任务体系、删除顺序、Profile 查询或通用智能体行为;不购买资源、迁移或修改镜像。Runtime 不存在只能确认目标 Runtime 结果,不等于独立核验外部操作导致的其他资源清理。 + +## 设计与受影响文件 + +增加小型只读后端模块和 `/web/mpa-runtime-deletion-status?runtimeId=...®ion=...`,返回 `{deleted: boolean}`,设置 `Cache-Control: no-store`。要求当前智能体管理权限。存在的 Runtime 使用既有授权核验;授权产生的 HTTP 错误不会进入资源缺失分支。若 GetRuntime 返回结构化 Runtime 特定 NotFound,则用同一部署凭据、提供商及地域完整扫描分页,设置分页上限。不返回资源/环境数据或原始异常。接口超时和无法确认均返回安全明确错误。云端 GetRuntime 隐藏但仍在列表的 Runtime 不能误判成功。 + +客户端复用 requestSignal/apiFetch 与既有确认 UI。仅 MPA 的 catch 处理 TimeoutError,核验布尔结果,仅 true 时完成原删除 promise。false/查询失败用本地化文案提示稍后刷新检查。测试使用模拟超时和云响应,不实际删除。 + +文件:`frontend/src/adk/client.ts`、双语 ADK 文案、`frontend/server/mpa_deletion_status.py`、`veadk/cli/cli_frontend.py` 路由挂载、前端可执行客户端测试、后端路由/归属/分页测试;双语 PRD/spec、frontend README 与 WebUI 构建资源。不改布局/CSS/图标;视觉基准为现有确认弹窗的加载/错误/重试/键盘行为。 + +## 任务与验收 + +- T-1 / FR-1 / AC-1:先写 MPA 180 秒、通用 30 秒回归;通用请求不调用结果确认。 +- T-2 / FR-2 / AC-2:实现授权、有界状态查询,覆盖结构化/包装 NotFound、分页缺失/存在、查询失败、错误分页、取消和无写操作。 +- T-3 / FR-3 / AC-3:核验确认完成、待确认/仍存在、错误 payload、权限和非超时失败;完成已有删除/UI 回归、构建与隔离浏览器检查。 + +## 审查、授权、风险与验证 + +用户于 2026-10-13 通过“改下”批准 MPA 专属超时/结果确认方案。`review-spec` 不可用,直接审查确认双语等价、通用智能体与清理顺序不变、有界读取及失败关闭行为,无审查阻塞。安全审查补充有界私有确认上下文:仅登记服务端已授权的 MPA 删除尝试,按 Studio 用户/Runtime/地域隔离,保存当前部署凭据的哈希。最多 1024 条,保留一小时;凭据及哈希均不返回客户端。上下文缺失、服务重启或凭据轮换只能返回待确认,不能成功。云查询后复核凭据,发现查询中途账号变化。这不是持久删除任务或新的写协议。未授权真实云删除、提交、推送、部署或重启 Studio。 + +云列表具有最终一致性,无法保证跨服务事务式清理。只读确认不能推断外部操作者删除资源的细节。账号改变/授权失败不能静默报告成功。旧文件静态错误需对照基线,不能隐藏。实际验证结果记录如下。必需检查:受影响 Python 测试、改动文件 Ruff/Pyright、`npm --prefix frontend test`、build/国际化/资源引用、隔离浏览器及仓库配置密钥扫描。不影响 harness/进程契约。 + +## 交付审查与验证(2026-10-13) + +T-1–T-3 / AC-1–AC-3 已实现。审查确认客户端仅 MPA 启用,通用 POST/超时不变、不重复删除、仅结构化缺失确认、完整有界分页、凭据/用户隔离及部分清理语义保留。Python >=3.11 使用标准库超时,较早支持版本使用现有 async-timeout 依赖,没有新增依赖。未修改创建、Profile、Runtime 镜像、schema 或删除顺序。现有 `frontend*` 包发现规则会包含新服务端模块。 + +验证范围:基于 `71175c68636dc5b951e9804eb292d85402511e68` 的本次删除修复,保留工作区已有 PG/名称/OV 改动。修复前前端可执行回归失败;后端测试最初因状态模块尚不存在而收集失败。模拟云操作及隔离浏览器响应与真实验证明确分开。 + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| Python 删除/角色回归 | pass | `uv run --extra dev pytest tests/frontend/server/test_mpa_deletion_status.py tests/integrations/mpa_managed/test_deletion.py tests/cli/test_studio_rbac.py -q --no-cov`:最终追加负例前 210 项通过。 | +| 最终确认单元/路由测试 | pass | `uv run --extra dev pytest tests/frontend/server/test_mpa_deletion_status.py -q --no-cov`:25 项通过,含真实 Studio 路由挂载下模拟云删除、服务端真实类别的通用隔离、超时、过期/数量上限与包装提供商错误。 | +| 前端客户端回归 | pass | `node --test frontend/tests/mpaDeletionTimeout.test.mjs`:10 项通过,含确认查询网络超时及保留非超时服务端诊断。 | +| 前端完整回归 | pass | `npm --prefix frontend test`:1389 项 Node +84 项 React 通过,包含全部 10 项新增客户端回归。 | +| 构建/国际化/资源 | pass | `npm --prefix frontend run build`、`npm --prefix frontend run check:i18n`、`npm --prefix frontend run test:webui-assets`:同步发布资源,2 个语言 /21 个命名空间,113 个文件 /350 个引用。仍有既有大 chunk 警告。 | +| 浏览器 | pass | 内置 Playwright、隔离无头 Chrome 及真实 AgentWorkspace/client:正常成功、超时确认、仍存在、查询失败、忙碌禁用、Enter/Escape、取消重开、通用删除及 390×844 视图。模拟 fetch 阻止真实云调用;已清理临时服务/夹具。 | +| Ruff / 新模块 Pyright | pass | 临时 `uvx` 工具;Ruff 覆盖 3 个改动 Python 文件,新模块/测试以 `.venv/bin/python` 跑 Pyright。无全局安装。 | +| 旧 CLI Pyright | fail | 37 条已有错误;与 HEAD 对比诊断消息/规则完全一致,本修复无新增诊断。未修改无关历史错误。 | +| 文档 / 空白 / 密钥 | pass | 双语/标识符/链接核对、`git diff --check`,对改动源码/资源使用仓库配置及脱敏输出 Gitleaks。 | +| 真实破坏性 E2E | not_run | 未授权或执行新删除;此前只读诊断不是本修复的真实验证。 | +| 广泛 SDK/进程/harness 测试 | not_applicable | 未修改 SDK、进程或 harness 契约;定向删除、RBAC 与前端回归覆盖改动路径。 | +| 提交/pre-commit | not_run | 未授权提交;后续提交前仍需同步分支并执行全量 pre-commit。 | + +请在保有原凭据的终端重启 Studio 并刷新页面,加载后端及配套资源。本次未重启服务、提交、推送或部署。剩余限制:确认上下文按进程保存并会到期;重启、切换服务进程或轮换凭据会导致结果无法确认。Runtime 缺失不能独立证明由外部操作触发的相关资源清理。本次范围内无新增审查阻塞。 diff --git a/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md b/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md new file mode 100644 index 000000000..f12d54da4 --- /dev/null +++ b/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md @@ -0,0 +1,45 @@ +# IAM transient failure recovery and diagnostics + +[中文版](2026-10-14-transient-errors.zh.md) + +Change ID: mpa-iam-retry. Date: 2026-10-14. Status: implemented; live mutation not performed. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-10 and CON-11. + +## Evidence, goals and scope + +IAM SDK errors are converted into IamError, preserving recognized codes only. Transport timeout/connection errors lose their category and immediately fail role preparation. A real overseas task failed with iamVerificationFailed while later read-only verification of the same role and credentials passed; its original error was not recorded, so the historical cause is unconfirmed. The user explicitly approved retaining safe operation/category/Request ID, bounded transient retry and distinct UI messages. The subsequent Worker CreateTool failure is a separate read-only investigation, not a reason to expand this fix. + +## Requirements and scenarios + +- FR-1: Preserve allowlisted IAM operation/category/code and a validated Request ID from structured SDK responses/errors. Never persist exception text, credentials, role/policy documents or arbitrary response data. +- FR-2: Reconcile timeout, connection, throttling and unavailable failures with at most four transient attempts and 1/2/4-second waits, inside the existing 120-second role deadline and task deadline. Permission, configuration/conflict, validation and unknown errors fail immediately. Permission is not retried. +- FR-3: Each retry restarts read-before-write reconciliation using the same fixed role/policy names. A lost create/attach response requires readback on the next cycle, preserving existing additive and collision handling. No parallel operation retries, rollback or permission expansion. Cancellation remains terminal; a SDK request already dispatched may finish, but no later reconciliation call is dispatched after cancellation. +- FR-4: Emit iamTemporaryFailure for exhausted transient requests/deadline; existing permanent error keys remain. Store operation/category/attempt/outcome and optional Request ID in bounded task diagnostics (100/task). Migrate the existing SQLite table additively; legacy four-field diagnostics remain valid. +- FR-5: Localized UI distinguishes temporary IAM/network failures from deployment permission failures. General agents, role permission sets, provider endpoints, OV and Worker behavior remain unchanged. + +## Design and tasks + +T-1: Add structured metadata to IamError; IamCloud extracts only safe fields using existing error classification. Capture HTTP status category when available and never parse unstructured text into user-visible messages. +T-2: Add the bounded recovery counter to ensure_runtime_role. Preserve get-or-create and Global policy readback; report safe diagnostics before retry/failure. +T-3: Extend diagnostics validator/report with optional requestId, allowlist IAM operations; tasks.py adds a request_id column with empty default, persists it and logs only validated metadata. No HTTP task schema change except the additional error enum key. +T-4: Add regression tests before code for transient recovery/exhaustion, permanent failure, unknown errors, cancellation/late response, lost create response, Request ID redaction and SQLite migration; update locale copy/docs/assets, run affected Python, Ruff/Pyright, frontend/build/browser and secret checks. + +## Review, risks and acceptance + +User approval: explicit '改下' accepting the three changes on 2026-10-14. Direct design review (review-spec unavailable): safe fields, finite retry/deadline, idempotent resource readback, cancellation and legacy diagnostic compatibility reviewed; bilingual pair matches. No blocker. + +- AC-1: Timeout/connection/429/5xx recover; four failures terminate with iamTemporaryFailure and recorded operation/category. Missing IAM permission remains iamPermissionDenied without retry. +- AC-2: Read-before-write prevents extra role/policy creation after a lost response; existing trust/policy documents and unrelated bindings are preserved; cancellation prevents subsequent SDK calls. +- AC-3: Structured Request ID survives persisted diagnostics, malicious/non-ID strings are omitted, old records migrate without losing data; raw secrets never appear in errors/log records. +- AC-4: UI strings, tests/build/assets and bilingual contracts match; record actual checks below. + +The original real failure cannot be proven retroactively. Real IAM writes and paid cloud creation are not authorized for this implementation; all tests use isolated fakes. Full verification pending. Commit/push are outside scope. Existing user changes stay intact. + + +## Verification (2026-10-14) + +Scope: uncommitted IAM changes on base `2ffe6e14`, preserving other local work. The first new regression run reproduced 13 failures. After implementation, IAM/tasks/Worker recovery targeted checks passed (68). The complete affected suite `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` passed 1,017 tests with four warnings. Subsequent HTTP-status extraction and thread-cancellation hardening passed all 18 IAM retry tests. Both requests with transport failures and structured 429/5xx/403 errors are covered. + +pass: Ruff 0.11.12 check/format and Pyright on iam.py, diagnostics.py, tasks.py and the two changed IAM tests (0 errors/warnings). pass: frontend test (1,389 Node + 97 React), production build, i18n (2 locales/21 namespaces), assets (113 files/350 references), paired design identifiers/links and whitespace. Browser Chromium loaded the actual dialog with isolated mocked APIs, checked explicit IAM temporary failure, same-request retry, personal/default UI, existing manual recovery, domestic display, Escape and narrow viewport. Temporary fixture/server removed after verification; no real resource creation. User lockfile hash is unchanged. + +not_run: full repository Python/all-files pre-commit because no commit requested and the affected MPA suite plus frontend gates cover this scope. not_applicable: Harness/Codex smoke and model/OV live integration because these contracts are unchanged. not_run: real IAM mutations, Worker CreateTool retry or cloud creation. The existing Worker failure remains provider_error with no original code/Request ID; read-only search confirms no same-name template, which does not identify the rejection reason. diff --git a/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md b/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md new file mode 100644 index 000000000..0c9ce9129 --- /dev/null +++ b/prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md @@ -0,0 +1,45 @@ +# IAM 临时失败恢复与诊断 + +[English](2026-10-14-transient-errors.md) + +变更 ID:mpa-iam-retry。日期:2026-10-14。状态:implemented;未执行真实云端变更。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-10 和 CON-11。 + +## 证据、目标与范围 + +IAM SDK 错误转换为 IamError 时仅保留已知错误码。传输超时/连接错误丢失类别,角色准备立即失败。真实海外任务返回 iamVerificationFailed,而相同角色和凭据后续只读核对通过;原始错误未记录,历史原因不能确定。用户明确批准保留安全的接口/类别/Request ID、有限临时错误重试及区分界面提示。之后的 Worker CreateTool 失败是独立只读调查,不扩大本修复范围。 + +## 要求与场景 + +- FR-1:保留 IAM 白名单接口/类别/错误码及从结构化 SDK 响应/错误中取得、经校验的 Request ID。不保存异常文字、凭据、角色/策略文档或任意响应内容。 +- FR-2:对超时、连接失败、限流和服务不可用执行最多四次临时错误尝试,等待 1/2/4 秒,受已有 120 秒角色期限及任务期限限制。权限、配置/冲突、参数及未知错误立即失败;缺权限不重试。 +- FR-3:每次重试使用相同固定角色/策略名称,从先读后写的协调开始。创建/绑定响应丢失后,下一轮必须先回读,保留已有增量绑定及冲突处理。不并行重试操作,不回滚或扩大权限。取消保持终态;已发送的 SDK 请求可能完成,但取消后不再发送后续协调调用。 +- FR-4:临时请求耗尽或截止期限时返回 iamTemporaryFailure,保留原永久错误 key。有限任务诊断(每任务 100 条)保存接口/类别/次数/结果及可选 Request ID。增量迁移 SQLite 表,兼容旧四字段诊断。 +- FR-5:界面区分临时 IAM/网络失败与部署权限不足。通用智能体、角色权限集合、服务端点、OV 和 Worker 行为不变。 + +## 设计与任务 + +T-1:为 IamError 增加结构化元数据;IamCloud 使用已有分类,仅提取安全字段。有 HTTP 状态时保留类别,不从非结构化文字产生可见消息。 +T-2:ensure_runtime_role 增加有限恢复计数,保留 get-or-create 和 Global 策略回读;重试/失败前记录安全诊断。 +T-3:diagnostics 校验器/report 增加可选 requestId、IAM 接口白名单;tasks.py 增加默认空值的 request_id 列,仅持久化/输出经过校验的元数据。HTTP 任务结构仅增加错误枚举 key。 +T-4:先写回归覆盖临时恢复/耗尽、永久/未知错误、取消/晚返回、创建响应丢失、Request ID 脱敏和 SQLite 迁移;更新双语界面/文档/产物,执行受影响 Python、Ruff/Pyright、前端/构建/浏览器及密钥检查。 + +## 评审、风险与验收 + +用户批准:2026-10-14 明确回复“改下”,接受这三项修改。直接设计评审(review-spec 不可用):已审查安全字段、有限重试/期限、资源回读幂等、取消及旧诊断兼容;双语对应一致,无阻塞。 + +- AC-1:超时/连接/429/5xx 可恢复;四次失败以 iamTemporaryFailure 结束并记录接口/类别。缺少 IAM 权限仍立即返回 iamPermissionDenied,不重试。 +- AC-2:创建响应丢失后先读后写,避免重复创建角色/策略;保留已有信任/策略文档及其他绑定;取消后不调用后续 SDK 接口。 +- AC-3:结构化 Request ID 保留在诊断中,恶意/非 ID 文字忽略;旧记录迁移不丢失,原始密钥不进入错误/日志。 +- AC-4:界面文案、测试/构建/产物及双语契约一致;下方记录实际检查。 + +无法追溯证明原真实失败原因。本实现未授权真实 IAM 写入或付费云创建;测试均使用隔离模拟。完整验证待执行。提交/推送不在范围内。保留已有用户修改。 + + +## 验证(2026-10-14) + +范围:基于 `2ffe6e14` 的未提交 IAM 改动,保留其他本地工作。新增回归首次运行复现 13 项失败。实施后 IAM/tasks/Worker 恢复定向检查 68 项通过。完整受影响套件 `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` 通过 1,017 项、4 项警告。之后 HTTP 状态提取及线程取消补强,全部 18 项 IAM 重试测试通过。覆盖传输异常及结构化 429/5xx/403 错误。 + +pass:iam.py、diagnostics.py、tasks.py 及两个修改的 IAM 测试的 Ruff 0.11.12 检查/格式与 Pyright(0 错误/警告)。pass:前端测试(1,389 项 Node + 97 项 React)、生产构建、国际化(2 个语言/21 个命名空间)、产物(113 文件/350 引用)、双语设计标识/链接及空白检查。真实 Chromium 加载实际弹窗,API 隔离模拟,检查明确 IAM 临时失败、同请求重试、个人版/default 界面、旧手动恢复、国内展示、Escape 和窄视口。验证后移除临时夹具及服务,未创建真实资源。用户 lockfile 哈希未变化。 + +not_run:全仓库 Python/all-files pre-commit,因为未要求提交,受影响 MPA 套件及前端门禁覆盖本范围。not_applicable:Harness/Codex smoke 和模型/OV 真实联调,因为契约未改变。not_run:真实 IAM 变更、Worker CreateTool 重试或云端创建。既有 Worker 失败仍为 provider_error,缺少原始错误码/Request ID;只读搜索确认没有同名模板,这不能确定被拒绝的具体原因。 diff --git a/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.md b/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.md new file mode 100644 index 000000000..16b5d793f --- /dev/null +++ b/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.md @@ -0,0 +1,40 @@ +# Preserve owned-resource name preflight on MPA retry + +[中文版](2026-10-14-owned-resource-metadata.zh.md) + +Change ID: mpa-name-retry. Date: 2026-10-14. Status: implemented. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-20; predecessor [name preflight](../../features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md), FR-3. + +## Evidence and scope + +Same-request retry after Runtime deployment receives runtimeNameTaken. Installed GetRuntimeResponse omits Tags, while ListRuntimes exposes them. Name checks require owner tags only from GetRuntime. Worker creation writes managed_by=mpa-deployment and mpa_agent_key=agent_suffix(account,region,agent_id), plus MPA_AGENT_ID in Envs; name preflight instead demands an MPA_AGENT_ID tag that creation never writes. Existing tests incorrectly emulate that tag and detailed Runtime tags. The observed Runtime Error/startup failure is a separate issue, not repaired here. + +Goal: restore the approved own-resource retry guarantee while rejecting foreign/ambiguous matches. No change to frontend, request identity, scope hashing, cloud payload, resource mutation, Runtime startup, account credentials or generic agents. User's current retry-defect report and previously approved same-request recovery requirement authorize this correction; the concrete metadata-based plan was stated before edits. + +## Requirements and design + +- FR-1: Combine ownership evidence from the same matching ListRuntimes item and GetRuntime detail. Detail MPA_AGENT_ID must match; owner and optional instance tag must match. Conflicting owner/instance evidence in either response fails closed. Missing all owner evidence never authorizes a fresh request; original intents require the private proof in the amendment. Preserve existing CLI behavior without a Studio owner. +- FR-2: Worker identity requires matching environment MPA_AGENT_ID and canonical managed_by/mpa_agent_key tags, using the same account/region/agent suffix as creation. An arbitrary legacy MPA_AGENT_ID tag alone is insufficient. Missing or foreign canonical ownership still blocks. +- FR-3: Keep query timeout/cancellation, failure keys, Workspace checks, pagination, local reservation, private task owner/account snapshot and immutable retry inputs unchanged. No name-check bypass solely because the request ID exists; fresh same-name requests still fail. + +T-1: Update unrealistic Worker fixture and write failing SDK-shaped Runtime/list-tag tests and foreign/conflicting/missing-tag cases in test_name_preflight.py. T-2: Fix names.py only using existing suffix/tags helpers. T-3: Run targeted name/worker/task/route tests, managed/startup regression, Ruff/Pyright and scoped repository secret/doc checks; perform separately identified read-only live preflight against the failed task if metadata can be verified. + +## Contract assessment, review and acceptance + +The maintained CON-20 already promises verified own-resource retry, so this repairs its implementation and test mapping without changing public contracts. Add only a bilingual verification/change link. review-spec unavailable; direct review confirms no weaker ownership requirement, no secret output, unchanged mutation boundary and equivalent languages. Existing default false positives are explained, not treated as permission to reuse unknown resources. No design blocker. + +AC-1: Actual SDK-shaped detail without Tags and a matching list item allows original-request ownership; contradictions or missing/foreign owner fail. +AC-2: Creation's real Worker tag shape permits reuse; foreign/missing tags and copied legacy tags reject. Domestic and BytePlus use the same invariant. +AC-3: Required gates pass; no frontend/build required (not_applicable), no real task replay, service restart, commit or push. Read-only preflight evidence does not prove Runtime startup recovery. + +## Verification and risks + +2026-10-14, base 2ffe6e14 with unrelated local work retained. not_run: implementation checks pending. not_applicable: frontend/browser/harness/Codex gates, no affected UI or protocol. not_run: all-files pre-commit because no commit requested; scoped gates required. Provider list metadata can be eventually consistent; ambiguous ownership continues to block safely. Runtime Error may still cause readiness failure after the name check is fixed. + +## Approved design amendment after live readback + +Raw GetRuntime and ListRuntimes for the failed BytePlus Runtime both returned empty Tags, so SDK shape correction alone cannot authorize recovery. FR-1 is refined: absent owner tags may be accepted only for a server-authenticated original creation intent with identical normalized stored payload, matching private provider/account/region snapshot and matching server-derived MPA_AGENT_ID environment. Explicit foreign/conflicting tags still reject. CreationTasks.name_scope_for_request reads owner/request-scoped SQLite and rejects changed fingerprints. POST runs it after normalizing secret-free payload, before cloud name checks; public request/response fields do not change. Name preflight verifies the stored account against STS. The child already receives expectedAccount from the validated task snapshot; pass that existing proof into its name check, retaining all account and resource checks. Initial requests without such a saved intent remain strict. Never trust a browser-supplied retry flag. Additional affected files: tasks.py, service.py, frontend/server/mpa_creation.py, and corresponding task/route tests. No runner protocol expansion, resource writes or frontend rebuild is needed. This is a necessary completion of previously approved same-request recovery, not permission to reuse foreign or ambiguous resources. Direct review confirms the stronger fingerprint/account guards and resolves the original missing-owner assumption. Real read-only verification remains required. + +2026-10-14 verification on local diff based on 2ffe6e14: pass, initial tests reproduced nine failures; private-proof amendment reproduced five failures before wiring. pass, name/routes targeted 37 tests; managed/startup regression 1,091 tests with two workers (four dependency warnings). pass, read-only actual BytePlus preflight: original stored inputs and derived agent identity/account matched, canonical Worker tags matched, original name accepted. No real task start, cloud mutation or restart was executed. This preflight does not repair the observed Runtime Error. Initial fixtures used an unsupported Profile.provider replacement and typed SDK constructor; corrected to values.cloud_provider and model_validate. Ruff/Pyright fixture imports/nullable assertions were corrected before final gates. Final static/secret/doc results recorded below. Frontend/build/browser/harness/Codex not_applicable: no UI/protocol change; supporting API regression is covered. All-files pre-commit/commit/push not_run: not requested. Unrelated local changes retained. + +Final gates: pass, Ruff check/format and Pyright on all six affected Python files (zero errors/warnings); final name/route regression 37 tests; repository-configured Gitleaks on isolated scope; paired IDs/relative links and diff whitespace. Existing secret-scan exclusions for tests/build are unchanged. Final review confirms no public retry-proof input and private matching happens before cloud checks and task acceptance. No outstanding in-scope blocker. diff --git a/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.zh.md b/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.zh.md new file mode 100644 index 000000000..483bad50d --- /dev/null +++ b/prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.zh.md @@ -0,0 +1,40 @@ +# 保留 MPA 重试时自有资源的名称预检 + +[English](2026-10-14-owned-resource-metadata.md) + +变更 ID:mpa-name-retry。日期:2026-10-14。状态:implemented。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-20;前置:[名称预检](../../features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md),FR-3。 + +## 证据与范围 + +Runtime 部署后,同一请求重试被 runtimeNameTaken 拦截。已安装 GetRuntimeResponse 不含 Tags,ListRuntimes 则包含;名称检查只从 GetRuntime 要求创建者标签。沙箱创建写入 managed_by=mpa-deployment、mpa_agent_key=agent_suffix(account,region,agent_id),并在 Envs 写 MPA_AGENT_ID;名称预检却要求创建过程未写入的 MPA_AGENT_ID 标签。现有测试错误模拟了此标签和 Runtime 详情标签。观测到的 Runtime Error/启动失败是另一问题,本次不修复。 + +目标:恢复已批准的自有资源重试保证,并继续拒绝外部/归属不明的同名资源。不改前端、请求身份、作用域哈希、云端载荷、资源变更、Runtime 启动、账号凭据或通用智能体。用户当前的重试缺陷报告以及此前批准的同请求恢复要求授权此次纠正;修改前已说明按真实元信息修复的具体方案。 + +## 需求与设计 + +- FR-1:组合对应 ListRuntimes 条目和 GetRuntime 详情的归属证据。详情 MPA_AGENT_ID 必须匹配;创建者与可选内部实例标签必须匹配。任一响应的创建者/内部实例证据冲突均安全拒绝。全部缺失创建者证据时新请求不允许复用;原意图须满足补充设计中的私有证明。不传 Studio owner 的已有 CLI 行为保持不变。 +- FR-2:Worker 身份要求环境变量 MPA_AGENT_ID 和真实 managed_by/mpa_agent_key 标签匹配,使用与创建过程相同的账号/地域/agent suffix。仅有任意旧 MPA_AGENT_ID 标签不足以证明归属。真实标签缺失或外部归属仍拦截。 +- FR-3:查询超时/取消、错误键、Workspace 检查、分页、本地名称保留、任务创建者/账号快照及不可变重试输入均不变。不因存在请求 ID 而直接跳过检查,新的同名请求仍失败。 + +T-1:修正错误 Worker 夹具,在 test_name_preflight.py 先写 SDK 形状的 Runtime/列表标签失败测试,以及外部/冲突/缺失标签场景。T-2:仅修复 names.py,复用已有 suffix/标签方法。T-3:运行目标名称/Worker/任务/路由测试、managed/startup 回归、Ruff/Pyright 及范围内仓库密钥/文档检查;能验证元信息时,对失败任务另行做只读真实预检。 + +## 契约评估、评审与验收 + +现有 CON-20 已要求验证自有资源后允许重试,本次修复实现及测试映射,不改变公开契约。仅补双语验证/变更链接。review-spec 不可用,直接评审确认归属要求不减弱、不输出密钥、写操作边界不变及双语等价。解释已有误报,不把误报当作允许接管未知资源的理由。无设计阻塞。 + +AC-1:真实 SDK 形状的详情缺少 Tags,但对应列表条目证明原请求归属时允许复用;冲突或缺失/外部创建者仍失败。 +AC-2:创建过程真实 Worker 标签形状允许复用;外部/缺失标签和仅复制旧标签仍拒绝。国内与 BytePlus 使用相同不变量。 +AC-3:必需检查通过;前端/构建为 not_applicable,不重放真实任务、不重启服务、不提交/推送。只读预检证据不证明 Runtime 启动已恢复。 + +## 验证与风险 + +2026-10-14,基于 2ffe6e14,保留无关本地工作。not_run:实现检查待执行。not_applicable:前端/浏览器/harness/Codex,UI 和协议不受影响。not_run:全部文件 pre-commit,未要求提交;须执行范围内检查。服务商列表元信息可能最终一致,归属不明仍安全拒绝。名称检查修复后,Runtime Error 仍可能导致就绪失败。 + +## 云端只读核对后的已批准设计补充 + +失败的 BytePlus Runtime 的原始 GetRuntime 和 ListRuntimes 均返回空 Tags,仅修正 SDK 形状无法允许恢复。FR-1 细化:仅在服务端认证的原创建意图中,标准化载荷与已存参数完全一致,私有 provider/account/region 快照匹配,且服务端派生的 MPA_AGENT_ID 环境变量匹配时,才允许缺失创建者标签。明确外部/冲突标签仍拒绝。CreationTasks.name_scope_for_request 按创建者/请求读取 SQLite 并拒绝改变指纹。POST 在标准化无密钥载荷后、云端名称检查前调用;公开请求/响应字段不变。名称预检将存储账号与 STS 核对。子进程已从验证的任务快照接收 expectedAccount,将此已有证明传入名称检查,保留全部账号及资源校验。无保存意图的新请求继续严格检查,绝不信任浏览器提供的重试标志。补充影响文件:tasks.py、service.py、frontend/server/mpa_creation.py 和对应任务/路由测试。无需扩展 runner 协议,不执行资源变更、不重建前端。这是此前批准的同请求恢复所必需的补齐,不授权复用外部或归属不明资源。直接评审确认更严格的指纹/账号保护,修正最初对缺失创建者标签的假设,仍须只读实测。 + +2026-10-14 验证,基于 2ffe6e14 的本地差异:pass,最初测试复现九项失败;补充私有证明连线前复现五项失败。pass,名称/路由目标 37 项;两个 worker 的 managed/startup 回归 1,091 项(四条依赖警告)。pass,实际 BytePlus 只读预检:原存储参数、派生 agent 身份/账号一致,真实 Worker 标签匹配,原名称允许恢复。未启动真实任务、未执行云端变更或服务重启,此预检不修复已观测到的 Runtime Error。最初夹具误用不支持的 Profile.provider 替换和有类型 SDK 构造参数,已改为 values.cloud_provider 和 model_validate。Ruff/Pyright 夹具导入/可空调用断言已在最终检查前修正。最终静态/密钥/文档结果见下方。前端/构建/浏览器/harness/Codex 为 not_applicable:UI 和协议未变,支持 API 有回归覆盖。全部文件 pre-commit/提交/推送为 not_run:未要求执行。保留无关本地工作。 + +最终检查:pass,六个受影响 Python 文件的 Ruff 检查/格式及 Pyright,零错误/警告;最终名称/路由回归 37 项;隔离范围按仓库配置的 Gitleaks;双语 ID/相对链接及 diff 空白。现有测试/构建密钥扫描排除规则未改变。最终评审确认不增加公开重试证明输入,私有匹配发生在云端检查及任务接受前。范围内无剩余阻塞。 diff --git a/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.md b/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.md new file mode 100644 index 000000000..c917eccce --- /dev/null +++ b/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.md @@ -0,0 +1,39 @@ +# Preserve OpenViking provider error diagnostics + +[中文版](2026-10-14-provider-errors.zh.md) + +Change ID: mpa-openviking-diagnostics. Date: 2026-10-14. Status: implemented; live reproduction not performed. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-10 and CON-18. + +## Evidence and scope + +A BytePlus creation failed at CreateOpenVikingCollection with provider_error. The task retained neither the structured provider code nor Request ID, and the uncertain-create guard subsequently reported openvikingCreateUnknown. A read-only account/region listing returned zero collections, but this cannot recover the original rejection. The user requested error logging after this diagnosis. This change preserves safe error metadata for both OV adapters; it does not change create parameters, model endpoints, error categories, retry eligibility, resource binding or uncertain-create recovery. Historical errors cannot be reconstructed. + +## Requirements and scenarios + +- FR-1: Structured OV response errors retain the interface operation, safe provider errorCode and Request ID in the existing diagnostic event. Structured HTTP/SDK exception bodies use the same extraction; malformed bodies and transport exceptions emit the existing category without raw text. +- FR-2: Permit only nonsecret bounded codes (1–128 characters, capitalized ASCII identifiers with dot/underscore separators) and existing hex/UUID Request IDs. Reject arbitrary text, credential-shaped values, URLs, multiline strings and oversized inputs. Never log provider Message, request/response bodies, model credentials, authorization headers or exception text. +- FR-3: Add optional errorCode to validated diagnostic events and an additive error_code SQLite column. Existing four-field and requestId events remain compatible, old records remain intact, retention remains 100 events per task, and the parent logs validated metadata with task/stage context. Public task responses remain unchanged. +- FR-4: Preserve domestic and BytePlus creation behavior, read retry limits, single create dispatch, cancellation and duplicate-create protection. OV errors remain enum-only user-visible messages. + +## Design and affected files + +T-1 (FR-1/FR-4): Add safe metadata extraction to managed/openviking.py using structured JSON bodies only; capture Request ID on malformed responses with a missing or invalid Result where available. Keep provider transports and create payloads unchanged. +T-2 (FR-2/FR-3): Extend managed/diagnostics.py validation/report and managed/tasks.py persistence/logging. Validate before data crosses the child/parent boundary. Existing IAM and Worker diagnostics continue to work. +T-3 (all requirements): Add tests/integrations/mpa_managed/test_openviking_diagnostics.py with mocked response errors for both providers, exceptions/transport errors, hostile metadata, interrupted create retry protection, persisted metadata and old-schema migration. Run these regressions before implementation, then affected MPA tests and static/secret checks. +T-4: Synchronize this bilingual design and CON-10/CON-18. No frontend assets or Runtime adaptation are needed because task HTTP fields and UI behavior do not change. + +## Review, risks and acceptance + +Approval: the user's 2026-10-14 request to add OV creation error logs accepts the previously proposed diagnostic capture. Direct review performed because review-spec is unavailable: structured-only extraction, secret exclusion, additive schema, legacy compatibility, bounded diagnostics and unchanged cloud side effects reviewed; paired documents are equivalent. No blocker. + +- AC-1: A simulated BytePlus or domestic provider rejection produces operation/category/errorCode/requestId sufficient for lookup, while provider text and credentials never reach logs/events/errors. +- AC-2: Invalid metadata is omitted, legacy events are accepted, new metadata persists after reopening an isolated task database, and migration preserves existing rows. +- AC-3: Transport failures, read retries and uncertain-create duplicate protection retain existing behavior. +- AC-4: Affected Python tests, Ruff/Pyright, whitespace, paired contracts and secret checks pass. Real cloud writes, service restart, resetting failed tasks, commit and push are outside this request. + +Live reproduction requires a later newly dispatched request after loading the change; the existing uncertain task does not automatically repeat its create. Code validation cannot prove overseas model endpoint availability. + +## Verification + +2026-10-14, local diff based on 2ffe6e14, preserving unrelated work. pass: the first regression reproduced 10 failures; after implementation the affected managed MPA/startup suite passed 1,040 tests with four dependency warnings (`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`, two workers). Two subsequent structured-SDK-body cases brought the targeted diagnostic suite to 20 passing tests (`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_openviking_diagnostics.py`). pass: Ruff 0.11.12 check/format and `uvx pyright --pythonpath .venv/bin/python` on all four changed Python files (zero errors/warnings). Initial Pyright without the repo interpreter could not resolve dependencies; the explicit interpreter resolved this without machine-global changes. pass: the repository Gitleaks hook on an isolated staged copy of the 11 in-scope files; no secrets. pass: paired document identifiers/links and diff whitespace. not_run: full-repository/all-files pre-commit because no commit was requested and the focused Python/static/secret gates cover this scope. not_applicable: frontend/browser/Codex/Harness checks because no UI, generated assets or execution contracts change. not_run: cloud creation and live error reproduction; no additional writes authorized. diff --git a/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.zh.md b/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.zh.md new file mode 100644 index 000000000..8561a0ff4 --- /dev/null +++ b/prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.zh.md @@ -0,0 +1,39 @@ +# 保留 OpenViking 云端错误诊断 + +[English](2026-10-14-provider-errors.md) + +变更 ID:mpa-openviking-diagnostics。日期:2026-10-14。状态:implemented;未进行真实复现。 +组件契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-10 和 CON-18。 + +## 证据与范围 + +一次 BytePlus 创建在 CreateOpenVikingCollection 返回 provider_error。任务未保留结构化云端错误码或 Request ID,随后不确定建库保护显示 openvikingCreateUnknown。只读账号/地域列表返回零个库,但无法据此恢复原始拒绝原因。用户在此诊断后要求补错误日志。本次为两个 OV 适配器保留安全错误元信息,不改变建库参数、模型接入点、错误分类、重试条件、资源绑定或不确定建库恢复。历史错误无法还原。 + +## 需求与场景 + +- FR-1:结构化 OV 响应错误在现有诊断事件中保留接口操作、安全云端 errorCode 和 Request ID。结构化 HTTP/SDK 异常响应体采用相同提取方式;格式错误的响应体及传输异常仅发送现有分类,不发送原始文本。 +- FR-2:仅允许非敏感、有界错误码(1–128 字符,以大写字母开头的 ASCII 标识符,可用点或下划线分隔)和现有十六进制/UUID Request ID。拒绝任意文本、凭证形式的值、URL、多行和超长输入。绝不记录云端 Message、请求/响应体、模型凭证、鉴权头或异常文本。 +- FR-3:诊断事件增加可选 errorCode,SQLite 追加 error_code 列。兼容旧四字段及 requestId 事件,保留旧记录,每个任务仍最多保留 100 条诊断;父进程结合任务/阶段记录已验证元信息。公开任务响应不变。 +- FR-4:保持国内和 BytePlus 建库行为、读取重试上限、单次建库提交、取消与防重复建库保护。OV 面向用户的错误仍为枚举文案。 + +## 设计与影响文件 + +T-1(FR-1/FR-4):在 managed/openviking.py 中仅从结构化 JSON 响应体提取安全元信息;成功响应缺少 Result 或 Result 格式不正确时,若存在 Request ID 则保留。云端传输与建库载荷不变。 +T-2(FR-2/FR-3):扩展 managed/diagnostics.py 的验证/报告及 managed/tasks.py 的持久化/日志;在子进程/父进程边界验证数据。现有 IAM、Worker 诊断继续兼容。 +T-3(全部需求):新增 tests/integrations/mpa_managed/test_openviking_diagnostics.py,使用模拟响应覆盖两个提供商的错误、异常/传输故障、恶意元信息、不确定建库防重复、诊断持久化及旧表迁移。先运行失败回归,再运行受影响 MPA 测试和静态/密钥检查。 +T-4:同步双语设计及 CON-10/CON-18。任务 HTTP 字段和 UI 行为不变,因此无需前端产物或 Runtime 改造。 + +## 评审、风险与验收 + +批准记录:用户在 2026-10-14 要求补 OV 创建错误日志,接受此前提出的诊断记录方案。review-spec 不可用,已直接评审:仅结构化提取、密钥排除、追加表结构、旧版本兼容、诊断上限及不变的云端副作用;双语文档语义一致,无阻塞项。 + +- AC-1:模拟 BytePlus 或国内云端拒绝时输出可用于定位的 operation/category/errorCode/requestId,云端文本和凭证不会进入日志、事件或错误文案。 +- AC-2:无效元信息被忽略,旧事件被接受,新字段在隔离任务库重开后仍存在,迁移保留旧记录。 +- AC-3:传输故障、读取重试及不确定建库防重复行为不变。 +- AC-4:受影响 Python 测试、Ruff/Pyright、空白、双语契约及密钥检查通过。真实云端写入、服务重启、重置失败任务、提交和推送均不在本次范围内。 + +真实复现需加载修改后再次提交新的请求;现有不确定任务不会自动重复建库。代码验证不能证明海外模型接入点可用。 + +## 验证 + +2026-10-14,基于 2ffe6e14 的本地差异,保留无关改动。pass:首次回归复现 10 个失败;实现后受影响 MPA/启动套件通过 1,040 项测试,含 4 条依赖警告(`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`,两个 worker)。随后补充两项结构化 SDK 响应体场景,日志专项套件共通过 20 项(`uv run --extra dev pytest -q tests/integrations/mpa_managed/test_openviking_diagnostics.py`)。pass:全部四个修改的 Python 文件通过 Ruff 0.11.12 检查/格式及 `uvx pyright --pythonpath .venv/bin/python`(零错误/警告)。首次 Pyright 未指定仓库解释器而无法解析依赖,显式指定后解决,未改变机器全局配置。pass:11 个范围内文件在隔离暂存副本中通过仓库 Gitleaks hook,无密钥。pass:双语文档标识/链接及差异空白检查。not_run:全仓/全文件 pre-commit,因为未要求提交,本次使用受影响 Python/静态/密钥检查覆盖范围。not_applicable:前端/浏览器/Codex/Harness 检查,因为未改 UI、产物或执行契约。not_run:云端建库及真实错误复现,未获额外写入授权。 diff --git a/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.md b/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.md new file mode 100644 index 000000000..43da97b85 --- /dev/null +++ b/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.md @@ -0,0 +1,39 @@ +# OpenViking model source and rejected-intent recovery + +[中文版](2026-10-13-model-source.zh.md) + +Date: 2026-10-13. Status: implemented; live acceptance pending. Base: `71175c68636dc5b951e9804eb292d85402511e68` plus the uncommitted automatic OV feature. + +## Background and scope +A user-created Beijing MPA reached OV after Worker preparation and was rejected by CreateOpenVikingCollection with InvalidParameter: unsupported model source empty. Cloud audit confirms an explicit rejection, not an uncertain create. Omitting Credentials is therefore insufficient. The reference library reports Source volcengine and versioned model identifiers even though its console custom-credential list is empty. Official create documentation requires Source and EndpointID for volcengine and conditionally ApiKey. +Goal: keep automatic Beijing OV, with explicit model source/identifiers and the already resolved deployment-account Ark key. Do not add UI inputs, create model endpoints, alter BytePlus/general agents, update existing OV credentials, or execute a paid cloud retry without separate user action/authorization. + +## Requirements and design +- FR-1: VLM Credentials uses Source `volcengine`, EndpointID `doubao-seed-2-0-lite-260428`; Embedding uses Source `volcengine`, EndpointID `doubao-embedding-vision-251215`. Keep the existing model names/versions. These identifiers come from the reference library; acceptance for a new API library remains subject to live verification. +- FR-2: The adapter receives the resolved Ark model key separately, validates it locally, and attaches ApiKey to a copied wire payload only. Nonsecret intents contain Source/EndpointID but no model key. Registry, task results, diagnostics and repr must exclude both Ark and OV keys. Fresh Studio uses its account-discovered key; explicitly opted-in CLI can use its configured model key, including template MODEL_AGENT_API_KEY. Missing/masked/invalid keys fail before dispatch with the existing configuration error. Registered-library retry reads OV key again without resending model credentials. +- FR-3: Upgrade the complete matching previous no-Credentials intent only when there is no OV ID, no pending Runtime operation, and openviking_create_requested is explicitly false. This is the durable state after a proven rejection. Unknown/in-flight creates, changed project/name/model/description and registered IDs remain fail-closed; do not erase bindings or reset flags to work around failures. A recovered request retains agent/library name and records the corrected nonsecret intent before dispatch. +- FR-4: Validate Source/EndpointID in Get results before reuse, excluding returned key values from storage. Keep lock, timeout, cancellation, one-shot create and readiness behavior. Create requests get at most one dispatch; no extra paid fallback. + +## Affected files and tasks +OpenViking adapter/provisioner, MPA service wiring, focused OV/service tests, bilingual creation contract and operator/design docs. No frontend or Runtime protocol change; the same four OV env vars are already supported. T-1 regression tests for wire credentials/no secret persistence; T-2 source validation and safe rejected-intent recovery; T-3 wire existing model key; T-4 run affected creation regression, Ruff/Pyright, secret scan and paired-document checks. + +## Acceptance, risks and review +AC-1 wire credentials are explicit and secret-free intent remains stable; AC-2 same failed agent can recover only after proven rejection; AC-3 changed/unknown/registered requests never create a duplicate; AC-4 BytePlus/manual/general paths unchanged and checks recorded. Endpoint aliases and model/key authorization still require live acceptance; default model access may require account enablement. No claim of successful cloud creation until confirmed. +Direct design review (review-spec unavailable) covers compatibility, secret lifetimes, copied payload, ownership, rejection vs uncertainty, cancellation/deadlines and bilingual equivalence. User requested the missing-source fix on 2026-10-13; the concrete plan reuses the existing Ark key and preserves the failed task identity. No commit, push or cloud retry authorized. + +## Verification +Test-first regression: 27 failed / 2 passed before implementation (new keyword and explicit Credentials were absent). After implementation, OV/service tests passed 192 cases. Final broad creation/RBAC regression passed 1,087 cases with two workers. Read-only Get of the reference library confirms the exact Source and both EndpointID values; this is not new-library creation acceptance. + +| Gate (2026-10-13, uncommitted correction) | Result | +| --- | --- | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed/test_openviking.py tests/integrations/mpa_managed/test_service.py` | pass: 192 | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py` | pass: 1,087 | +| `uvx ruff==0.11.12 check ` and `format --check` | pass | +| `uvx pyright --pythonpath .venv/bin/python ` | pass: 0 errors/warnings | +| `uv run --extra dev pre-commit run gitleaks --files ` | pass: source/tests/docs/built assets | +| Paired docs, links/identifiers and `git diff --check` | pass | +| Frontend rebuild/browser | not_applicable: correction has no frontend changes; initial auto-OV frontend gates remain recorded in the feature PRD | +| Corrected live create / key retrieval / Runtime readiness | not_run: user can retry the same failed task; no automatic cloud write performed | +| Full-repository pre-commit / commit / push | not_run: no commit requested | + +Review: wire payload is copied; credentials never enter the registry intent; source/endpoint readback excludes secret fields; registered/ambiguous/changed requests cannot be upgraded. AC-1–AC-4 implementation/offline checks complete; corrected cloud acceptance remains pending. Each retry starts a new runner process, so this child-process correction is loaded on retry without changing the existing browser request. diff --git a/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.zh.md b/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.zh.md new file mode 100644 index 000000000..80f284442 --- /dev/null +++ b/prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.zh.md @@ -0,0 +1,39 @@ +# OpenViking 模型来源及已拒绝意图恢复 + +[English](2026-10-13-model-source.md) + +日期:2026-10-13。状态:已实现;待真实验收。基础:`71175c68636dc5b951e9804eb292d85402511e68` 加未提交的自动 OV 功能。 + +## 背景与范围 +用户创建的北京 MPA 完成 Worker 准备后,CreateOpenVikingCollection 返回 InvalidParameter:模型来源为空。云审计确认明确拒绝,不是未知创建结果。因此不能省略 Credentials。参考库即便控制台显示自配凭证为空,接口仍返回 Source volcengine 与带版本模型标识。官方建库文档要求 volcengine 的 Source、EndpointID,并要求条件性的 ApiKey。 +目标:保留北京自动 OV,显式传入模型来源/标识及已经解析的部署账号方舟 Key。不新增页面输入、不创建模型接入点、不改 BytePlus/通用智能体、不更新现有 OV 凭证,也不在没有单独用户操作/授权时执行付费云重试。 + +## 要求与设计 +- FR-1:VLM Credentials 使用 Source `volcengine`、EndpointID `doubao-seed-2-0-lite-260428`;Embedding 使用 Source `volcengine`、EndpointID `doubao-embedding-vision-251215`。保留原模型名/版本。标识来自参考库,新 API 创建是否接受仍需真实验证。 +- FR-2:适配器单独接收已解析方舟模型 Key,本地校验后仅将 ApiKey 加入复制的网络请求。非秘密意图含 Source/EndpointID,但没有模型 Key。注册库、任务结果、诊断及 repr 不得出现方舟或 OV Key。新 Studio 使用账号自动发现的 Key;显式启用的 CLI 可使用配置模型 Key,包括模板 MODEL_AGENT_API_KEY。缺失/掩码/非法 Key 在发送前以现有配置错误拒绝。注册库重试仅重新取 OV Key,不重发模型凭证。 +- FR-3:仅当没有 OV ID、没有待完成 Runtime 操作、openviking_create_requested 明确为 false,才升级完全匹配的旧无 Credentials 意图。这是明确拒绝后的持久状态。未知/进行中创建、项目/名称/模型/描述改变及已注册 ID 继续安全拒绝,不删除绑定或重置标志来绕过失败。恢复保留智能体/库名,发送前登记修正的非秘密意图。 +- FR-4:复用前核验 Get 的 Source/EndpointID,不持久化返回的 Key。保留锁、超时、取消、单次创建与就绪语义。每次创建最多发送一次,不增加付费回退。 + +## 影响文件与任务 +OpenViking 适配器/资源准备、MPA 服务透传、目标 OV/service 测试、双语创建契约及使用/设计说明。没有前端或 Runtime 协议变化,仍使用已支持的四个 OV 环境变量。T-1 请求凭证/不持久化秘密回归;T-2 来源核验与明确拒绝意图恢复;T-3 透传现有模型 Key;T-4 受影响创建回归、Ruff/Pyright、秘密扫描及双语文档检查。 + +## 验收、风险与评审 +AC-1 网络凭证明确,非秘密意图稳定;AC-2 同一失败智能体仅在明确拒绝后可恢复;AC-3 改变/未知/已登记请求不重复建库;AC-4 BytePlus/手动/通用流程保持行为并记录检查。接入点别名、模型/Key 权限仍需真实验收,默认模型可能需要账号开通。确认前不声称云建库成功。 +review-spec 不可用,直接设计评审核验兼容、秘密生命周期、请求复制、归属、拒绝与未知结果、取消/期限及双语等价。用户于 2026-10-13 要求修复缺失来源,具体方案复用已有方舟 Key 并保留失败任务身份。未授权提交、推送或云重试。 + +## 验证 +测试先行回归:实现前 27 失败 / 2 通过(缺少新增关键字及显式 Credentials)。实现后 OV/service 192 项通过。最终广泛创建/RBAC 回归以两个 worker 执行,1,087 项通过。参考库只读 Get 核实了 Source 和两个 EndpointID 的准确值,这不等于新库创建验收。 + +| 检查(2026-10-13,未提交修正) | 结果 | +| --- | --- | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed/test_openviking.py tests/integrations/mpa_managed/test_service.py` | pass:192 | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py` | pass:1,087 | +| `uvx ruff==0.11.12 check ` 及 `format --check` | pass | +| `uvx pyright --pythonpath .venv/bin/python ` | pass:0 错误/警告 | +| `uv run --extra dev pre-commit run gitleaks --files ` | pass:源码/测试/文档/构建产物 | +| 双语文档、链接/标识及 `git diff --check` | pass | +| 前端重建/浏览器 | not_applicable:本修正未修改前端,初版 auto-OV 前端检查保留在功能 PRD 中 | +| 修正后真实创建 / 取 Key / Runtime 就绪 | not_run:用户可重试原失败任务,未自动执行云写操作 | +| 全仓库 pre-commit / commit / push | not_run:未要求提交 | + +评审:网络请求使用副本;凭证不进入注册意图;来源/接入点回读排除秘密字段;已登记/未知/改变请求不能升级。AC-1–AC-4 实现/离线检查完成,修正后真实云验收待完成。每次重试启动新的 runner 进程,所以该子进程修正在重试时加载,无需改变已有浏览器请求。 diff --git a/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.md b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.md new file mode 100644 index 000000000..7697cb08b --- /dev/null +++ b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.md @@ -0,0 +1,32 @@ +# Preserve MPA Runtime SDK failure codes + +[中文版](2026-10-14-sdk-error-codes.zh.md) + +Change ID: mpa-runtime-diagnostics. Date: 2026-10-14. Status: implemented; live retry pending. +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-10. + +## Evidence, scope and approval + +A BytePlus no-OV request initialized its business database and Skill Space, saved pending create intent, then failed without a Runtime ID. Its SDK error was reduced to provision/provider_error. AgentKit ApiError retains error_code, but the Runtime adapter does not record it. The user explicitly approves adding logs before retrying the same task. Direct review (review-spec unavailable) confirms bounded safe metadata, legacy diagnostic compatibility and unchanged side effects; no blocker. + +## Requirements, design and tasks + +- FR-1 / T-1: RuntimeCloud.call emits create_runtime/update_runtime failures using the existing diagnostic channel. These are also the requests that enable publishing; no separate release API is used in the current provisioning path. Preserve category, validated SDK errorCode and requestId when the SDK exposes one. Traverse at most eight exception/cause objects, reject cycles and use existing validators. Never parse exception text or emit request bodies, credentials, headers, provider Message or ClientToken. +- FR-2 / T-2: Reraise the same original exception; success, cancellation, request serialization, provider selection, timeout, call count and SDK retry behavior are unchanged. Neither saved inputs nor pending binding/token are modified. Skills/other operations keep their existing diagnostic behavior. Add only the two operation names to the allowlist; existing diagnostic persistence already supports these fields. +- FR-3 / T-3: Write failing isolated tests first for both providers, create/update, direct/wrapped/unsafe codes, missing Request ID, transport/cancellation, unchanged payload and successful results. Verify managed/startup tests, Ruff/Pyright, secret scan and paired docs. Update CON-10 and module READMEs. Frontend/general agents and cloud contracts do not change. + +## Acceptance and risk + +AC-1: Simulated Runtime SDK rejection reaches the persisted diagnostic channel with operation/category/errorCode and optional Request ID, without provider text or secrets. +AC-2: The same exception/payload and single dispatch are preserved, with bounded cycle-safe traversal, no logging on success/cancellation and no new retry/cleanup side effect. +AC-3: Affected checks pass with actual evidence. No commit/push, real API replay, server restart or cloud writes during implementation. + +Historical exceptions cannot be reconstructed. Current AgentKit SDK does not expose structured Request ID on every ApiError; do not invent one. The user must load the updated backend before retrying. Original ClientToken semantics and binding checks remain in force. Unknown real provider causes are not claimed as fixed by logging. + +## Verification + +2026-10-14, local diff on base 2ffe6e14; preserve unrelated work. not_run: implementation checks pending. Frontend/browser/Harness/Codex gates not_applicable because their behavior is unchanged. Live Runtime create/retry not_run; user-driven reproduction follows implementation. + +2026-10-14 verification: pass, the first isolated regression reproduced 11 failures before implementation. pass, Runtime/OV diagnostic targeted tests (32). pass, `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` (1,057 tests, four dependency warnings, two workers). pass, Ruff 0.11.12 check/format and Pyright with `--pythonpath .venv/bin/python` on the two changed modules and new test (zero errors/warnings). pass, repository Gitleaks hook on 10 isolated in-scope files; no secrets. pass, paired identifiers/links and diff whitespace. Full-repository/all-files pre-commit not_run because no commit was requested; affected regression/static/secret gates cover this scope. Real cloud create/replay and service restart not_run; the user will restart and retry the original task. + +Follow-up: non-200 SDK Exception(bytes) did not expose structured attributes. The original attribute-only limitation is addressed in [bounded JSON decoding](2026-10-14-sdk-json-and-restore-ov.md); this document retains the initial design and verification history. diff --git a/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.zh.md b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.zh.md new file mode 100644 index 000000000..b478e9e33 --- /dev/null +++ b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-error-codes.zh.md @@ -0,0 +1,32 @@ +# 保留 MPA Runtime SDK 失败错误码 + +[English](2026-10-14-sdk-error-codes.md) + +变更 ID:mpa-runtime-diagnostics。日期:2026-10-14。状态:implemented;等待真实重试。 +组件契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-10。 + +## 证据、范围与批准 + +一次 BytePlus 无 OV 请求初始化业务库和 Skill Space,保存 pending 创建意图后失败,没有 Runtime ID。SDK 错误被简化为 provision/provider_error。AgentKit ApiError 保留 error_code,但 Runtime 适配器未记录。用户明确批准先补日志,再重试同一任务。review-spec 不可用,已直接评审有界安全元信息、旧诊断兼容和不变副作用,无阻塞项。 + +## 需求、设计与任务 + +- FR-1 / T-1:RuntimeCloud.call 使用现有诊断通道记录 create_runtime/update_runtime 失败。这也是启用发布的请求,当前创建链路未调用单独 release API。保留分类、经过验证的 SDK errorCode,以及 SDK 暴露时的 requestId。最多遍历八个异常/cause,拒绝循环,复用现有验证器。不解析异常文本,不发送请求体、凭证、鉴权头、云端 Message 或 ClientToken。 +- FR-2 / T-2:重新抛出原异常;成功、取消、请求序列化、提供商选择、超时、调用次数和 SDK 重试行为不变。不修改已保存输入或 pending 绑定/token。Skills/其他操作保留现有诊断行为。操作白名单仅增加两个名称,现有诊断持久化已支持这些字段。 +- FR-3 / T-3:先编写隔离失败测试,覆盖两个提供商、创建/更新、直接/包装/不安全错误码、缺少 Request ID、传输/取消、载荷不变和成功结果。运行 MPA/启动测试、Ruff/Pyright、密钥扫描及双语检查,同步 CON-10 和模块 README。前端/通用智能体和云端契约不变。 + +## 验收与风险 + +AC-1:模拟 Runtime SDK 拒绝通过持久化诊断通道保留 operation/category/errorCode 和可选 Request ID,不含云端文本或密钥。 +AC-2:保留原异常/载荷及单次调用,遍历有界且防循环,成功/取消不记录失败,不增加重试/清理副作用。 +AC-3:受影响检查通过并记录真实证据。实现期间不提交/推送、不重放真实接口、不重启服务、不写云资源。 + +历史异常无法还原。当前 AgentKit SDK 的部分 ApiError 不暴露结构化 Request ID,不能伪造。用户需加载更新后的后端后重试。原 ClientToken 语义和绑定校验继续生效。补日志不代表已修复尚未确认的真实云端原因。 + +## 验证 + +2026-10-14,基于 2ffe6e14 的本地差异,保留无关工作。not_run:等待实现检查。前端/浏览器/Harness/Codex 检查 not_applicable,因为行为不变。真实 Runtime 创建/重试 not_run,实现后由用户复现。 + +2026-10-14 验证:pass,首次隔离回归在实现前复现 11 个失败。pass,Runtime/OV 诊断专项 32 项。pass,`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py`(1,057 项,4 条依赖警告,两个 worker)。pass,两个修改模块及新测试通过 Ruff 0.11.12 检查/格式和指定 `--pythonpath .venv/bin/python` 的 Pyright(零错误/警告)。pass,10 个范围内文件的隔离副本通过仓库 Gitleaks hook,无密钥。pass,双语标识/链接及差异空白。全仓/全文件 pre-commit not_run,因为未要求提交,使用受影响回归/静态/密钥检查覆盖范围。真实云端创建/重放及服务重启 not_run,由用户重启后重试原任务。 + +后续:SDK 对非 200 响应抛出的 Exception(bytes) 没有结构化属性。最初仅读取属性的限制由[有界 JSON 解码](2026-10-14-sdk-json-and-restore-ov.zh.md)补齐;本文保留最初设计与验证历史。 diff --git a/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md new file mode 100644 index 000000000..2bacc4009 --- /dev/null +++ b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md @@ -0,0 +1,42 @@ +# Decode Runtime SDK rejection metadata and restore BytePlus OV + +[中文版](2026-10-14-sdk-json-and-restore-ov.zh.md) + +Change ID: mpa-runtime-json-and-restore-ov. Date: 2026-10-14. Status: implemented; live cloud retry pending. +Predecessors: [Runtime diagnostics](2026-10-14-sdk-error-codes.md) and [temporary OV skip](../mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.md). +Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-10/CON-17/CON-18. + +## Evidence, goals and non-goals + +Live CreateRuntime failure retained only provider_error. Installed SDK Service.json raises Exception(bytes) for non-200 responses; its wrapper retains the cause without structured attributes. Existing Runtime diagnostics inspect only attributes. The user now reports BytePlus OV allowlisting and requests restoring automatic OV. Authorization covers these two fixes, not real cloud creates, restarting Studio, commits or pushes. General agents, domestic payloads, IAM, billing, model defaults, resource bindings and uncertain-create protection are outside scope. + +## Requirements and scenarios + +- FR-1: Given a direct or wrapped SDK rejection, extract validated errorCode/requestId from attributes, HTTP/SDK structured bodies, or a single bounded exception argument containing JSON or its SDK bytes representation. Traverse at most eight causes with cycle detection. Limit argument/body parsing to 65,536 bytes/characters; reject malformed, oversized, deeply nested and non-JSON text. Never evaluate code or log provider Message, body, credentials or ClientToken. Reuse existing OV metadata validators/decoder. +- FR-2: Reraise the same exception and preserve dispatch count, cancellation, payload, token, classification and retry behavior. No cloud replay is added. +- FR-3: Built-in BytePlus ap-southeast-1 new requests again advertise automatic OV. Remove temporary skip-only UI/locales and normalization. New/editable drafts select auto without manual fields; submitted no-OV/auto/manual tasks retain original intent across configuration refresh and retry. Domestic auto and manual fallback for unsupported profiles remain unchanged. +- FR-4: Keep existing BytePlus personal developer library creation, endpoint/key injection and durable binding reuse. No existing tasks or cloud resources are rewritten. Old uncertain creates remain guarded; operator allowlisting does not prove model credentials or service readiness. + +## Design and tasks + +T-1 (FR-1/FR-2): Add failing tests in test_runtime_diagnostics.py for wrapped bytes/JSON/string representations, HTTP/SDK bodies, malformed/unsafe/oversized/cyclic cases, exception identity and one dispatch; extend Runtime helper only. +T-2 (FR-3/FR-4): Change profile regression to require auto and add submitted no-OV recovery tests. Restore config.py supported-provider defaults and remove only temporary skip portions in MpaCreateDialog.tsx/locales. Retain submittedIntent race protection and all unrelated BytePlus features. +T-3: Synchronize bilingual component/module documentation and supersede historical skip design. Run targeted and managed/startup Python regression, Ruff/Pyright, frontend tests/build/i18n/assets, real browser using isolated mocked APIs, scoped secret scan and paired-link/whitespace checks. Preserve unrelated work including package-lock changes. + +## Review, risks and acceptance + +User approval: explicit 2026-10-14 request to complete logs and restore OV. Direct design review (review-spec unavailable) found no blocker after bounding parsing, retaining original exception and immutable submitted intents. Existing dialog/Foundation styles are reused without new visual components. Referenced frontend-design/ui-ux-pro-max skills are unavailable; apply repository SPEC directly. + +AC-1: Safe Runtime identifiers survive real SDK-shaped simulated exceptions; forbidden values/text never enter diagnostics; original exception/token and single dispatch survive. +AC-2: New BytePlus requests contain auto; previously submitted no-OV and auto requests preserve their identity/mode on retry and config reload; domestic behavior is unchanged. +AC-3: Required checks pass with actual evidence. No real cloud mutation or service restart. Live user-driven retry remains separate. + +Parser fallback cannot reconstruct historical errors or identify transport failures with no provider response. Already submitted no-OV tasks cannot gain OV on retry; create a new request for OV testing. Actual BytePlus OV allowlisting/model usability and Runtime rejection cause remain unverified. + +## Verification + +2026-10-14, local diff based on 2ffe6e14. not_run: implementation gates pending. not_run: real cloud creation/retry, no cloud writes authorized for implementation. not_applicable: harness/Codex smoke, protocols unchanged. All-files pre-commit not_run: no commit requested; scoped static and secret checks required. + +2026-10-14 results (local diff on 2ffe6e14): pass, pre-fix regressions reproduced 11 failures; Runtime/BytePlus/OV diagnostic targeted suite passed 73 tests, final Runtime-only suite 30. pass, managed/startup regression with two workers 1,075 tests (four dependency warnings). pass, npm --prefix frontend test: Node suite and 101 React tests; production build, i18n (2 locales/21 namespaces), asset validation (113 files/350 references). pass, Ruff 0.11.12 check/format and Pyright with repository interpreter on four Python files (zero errors/warnings). pass, actual in-app Chromium dialog with mocked APIs: new overseas auto submission, original no-OV retry identity/mode, domestic auto presentation, 420x760 viewport and Escape. Browser fixture initially used the wrong i18n import and was corrected before validation; it and the isolated Vite server were removed. One initial frontend regression incorrectly expected an unavailable reload button; corrected to verify recovery on configuration arrival. Initial Pyright fixture attribute errors were corrected with a typed SDK-shaped exception. Scope secret and paired-document checks pending below. not_run, real cloud creates, restart, all-files pre-commit/commit/push; no mutations performed. No new dependency or package-lock change in this fix. + +Final review: pass, paired requirement/contract IDs, relative links and git diff whitespace. pass, repository-configured Gitleaks hook on an isolated 106-file snapshot. Initial scan omitted .gitleaks.toml and flagged a generated MarkdownPromptEditor vendor expression using anchor.key as generic-api-key; verified as code, then reran with the unchanged repository configuration. Existing repository allowlist excludes tests and built WebUI; source changes were scanned under that policy, not a newly added bypass. No source credential was found. Browser artifacts/server were removed; existing package-lock remains its pre-existing 512-line deletion. All in-scope acceptance checks complete; live provider behavior is not claimed as verified. diff --git a/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md new file mode 100644 index 000000000..72e383c3a --- /dev/null +++ b/prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md @@ -0,0 +1,42 @@ +# 解码 Runtime SDK 拒绝元信息并恢复 BytePlus OV + +[English](2026-10-14-sdk-json-and-restore-ov.md) + +变更 ID:mpa-runtime-json-and-restore-ov。日期:2026-10-14。状态:implemented;真实云端重试待验证。 +前置:[Runtime 诊断](2026-10-14-sdk-error-codes.zh.md)和[临时跳过 OV](../mpa-byteplus-without-openviking/2026-10-14-skip-new-requests.zh.md)。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-10/CON-17/CON-18。 + +## 证据、目标与非目标 + +实际 CreateRuntime 失败仍只留下 provider_error。已安装 SDK 的 Service.json 对非 200 响应抛出 Exception(bytes),外层包装保留 cause,但没有结构化属性;现有 Runtime 诊断只读取属性。用户现在说明 BytePlus OV 已开白,要求恢复自动 OV。本次授权包含这两项修复,不包含实际云端创建、重启 Studio、提交或推送。通用智能体、国内载荷、IAM、计费、模型默认值、资源绑定和不确定建库保护不在修改范围。 + +## 需求与场景 + +- FR-1:直接或包装后的 SDK 拒绝,从属性、HTTP/SDK 结构化响应体,或单个包含 JSON/SDK 字节串表示的有界异常参数提取已验证 errorCode/requestId。最多遍历八个 cause 并防循环;参数/响应体解析上限 65,536 字节/字符。拒绝格式错误、超长、过深及非 JSON 文本;不执行代码,不记录云端 Message、响应体、凭证或 ClientToken。复用 OV 元信息校验/解码方法。 +- FR-2:重新抛出同一异常,保留调用次数、取消、载荷、token、分类与重试行为,不增加云端重放。 +- FR-3:内置 BytePlus ap-southeast-1 新请求重新声明自动 OV。移除临时跳过专用 UI/文案和清空逻辑。新请求/可编辑草稿选择 auto 且无需手填;已提交的无 OV/自动/手动任务在配置刷新及重试时保留原意图。国内自动流程和不支持自动模式的配置所用手动路径不变。 +- FR-4:保留已有 BytePlus 个人版 developer 建库、端点/Key 注入及持久绑定复用。不改写已有任务或云资源。不确定建库继续受保护;账号开白不代表模型凭证及服务一定可用。 + +## 设计与任务 + +T-1(FR-1/FR-2):先在 test_runtime_diagnostics.py 增加失败测试,覆盖包装的 bytes/JSON/字符串表示、HTTP/SDK 响应体、格式错误/危险值/超长/循环、异常身份和单次调用,仅扩展 Runtime 提取方法。 +T-2(FR-3/FR-4):配置回归改为要求 auto,增加已提交无 OV 恢复测试。恢复 config.py 支持提供方的自动默认,仅删除 MpaCreateDialog.tsx/文案中的临时跳过部分,保留 submittedIntent 竞态保护和无关 BytePlus 能力。 +T-3:同步双语组件/模块文档,将历史跳过设计标记为被替代。执行目标及 managed/startup Python 回归、Ruff/Pyright、前端测试/构建/国际化/产物、隔离模拟接口的真实浏览器检查、范围内密钥扫描及双语链接/空白检查。保留包括 package-lock 在内的无关改动。 + +## 评审、风险与验收 + +用户批准:2026-10-14 明确要求补完整日志及恢复 OV。review-spec 不可用,直接设计评审在限制解析边界、保留原异常和已提交意图后无阻塞。复用现有弹窗/Foundation 样式,不新增视觉组件。引用的 frontend-design/ui-ux-pro-max 技能不可用,直接遵循仓库 SPEC。 + +AC-1:模拟真实 SDK 形状的异常保留安全 Runtime 标识;禁止的值/文本不进入诊断;原异常/token 和单次调用不变。 +AC-2:BytePlus 新请求包含 auto;已提交无 OV 和自动请求在重试/配置刷新时保留身份和模式;国内行为不变。 +AC-3:必需检查有实际通过证据,不执行云端变更或服务重启。真实重试由用户另行验证。 + +解析补充不能恢复历史错误,也不能解释无云端响应的传输错误。已提交无 OV 任务无法通过重试获得 OV,测试 OV 应新建请求。BytePlus 实际开白/模型可用性及 Runtime 拒绝原因仍未验证。 + +## 验证 + +2026-10-14,基于 2ffe6e14 的本地差异。not_run:实现检查待执行。not_run:真实云端创建/重试,本次实现不执行云端写操作。not_applicable:harness/Codex smoke,协议未变。全部文件 pre-commit 为 not_run:未要求提交,须执行范围内静态及密钥检查。 + +2026-10-14 结果(基于 2ffe6e14 的本地差异):pass,修复前回归复现 11 项失败;Runtime/BytePlus/OV 诊断目标套件 73 项通过,最终 Runtime 单独套件 30 项通过。pass,两个 worker 的 managed/startup 回归 1,075 项(四条依赖警告)。pass,npm --prefix frontend test:Node 套件和 101 项 React 测试;生产构建、国际化(2 种语言/21 个 namespace)、产物(113 个文件/350 个引用)。pass,四个 Python 文件的 Ruff 0.11.12 检查/格式及使用仓库解释器的 Pyright,零错误/警告。pass,内置 Chromium 中用模拟接口验证海外新请求自动提交、原无 OV 重试身份/模式、国内自动展示、420x760 窄窗口及 Escape。浏览器夹具起初使用错误 i18n 导入,验证前已修正;夹具和隔离 Vite 服务已移除。最初一项前端回归误用不存在的刷新按钮,已修正为验证配置加载后的恢复。最初 Pyright 夹具属性错误已通过有类型的 SDK 异常类修正。范围内密钥及双语文档检查待下方补充。not_run:真实云端创建、重启、全部文件 pre-commit/提交/推送,未执行变更。本次修复不增加依赖,也未改动 package-lock。 + +最终评审:pass,双语需求/契约 ID、相对链接及 git diff 空白检查。pass,在隔离的 106 文件快照上按仓库配置执行 Gitleaks hook。最初扫描遗漏 .gitleaks.toml,将生成的 MarkdownPromptEditor 第三方 anchor.key 代码表达式误报为 generic-api-key;核实为代码后,使用未修改的仓库配置重新检查。现有仓库白名单排除 tests 和编译 WebUI,本次按既有策略扫描源码,未新增绕过规则。未发现源码凭证。浏览器夹具/服务已移除;package-lock 仍保留原有 512 行删除。范围内验收完成,不宣称真实服务商行为已验证。 diff --git a/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.md b/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.md new file mode 100644 index 000000000..bb6a67452 --- /dev/null +++ b/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.md @@ -0,0 +1,52 @@ +# MPA upstream PR startup and lock-file readiness + +[中文版](2026-10-13-startup-and-lockfile.zh.md) + +- Change ID: `mpa-upstream-readiness`; date: 2026-10-13; status: implemented. +- Scope: the four MPA lifecycle commits rebased onto official `b8038fb1`. +- Contracts: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md); [previous lock-file restoration](../frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.md). + +## Evidence, requirements and scope + +Full offline regression on `ea949fee` returned 7,184 passed, 2 failed, 53 skipped and 4 xfailed. Official `b8038fb1` in an isolated source snapshot passes the Studio startup test but reproduces the artifact-writer MIME test failure under the same local Python 3.10/macOS environment. The branch's new OV adapter eagerly imports `veadk.utils.volcengine_sign`, violating the existing lazy Studio startup contract. The deleted 512 lock-file lines also cause npm 10.9.2 (the frontend CI runtime family) to reject esbuild entries, despite npm 11 accepting them. + +FR-1: Registering MPA routes/configuration must preserve the existing lazy startup boundary. Load the signing helper only when an OV API request runs. Preserve wire parameters, retry/error/cancellation behavior and provider boundaries. +FR-2: Restore the complete official frontend lock file. Package dependency declarations match official main; only test-script selection differs. Do not change dependency ranges or unrelated artifact-writer logic. + +## Design, tasks and acceptance + +T-1 / AC-1: Use the already failing isolated Studio startup test as the regression. Move the signing import into the existing request closure; point two adapter mock patches at the helper's owning module. Update the paired maintained OV startup contract. +T-2 / AC-2: Restore generated `frontend/package-lock.json` from `upstream/main` and repeat an isolated npm 10.9.2 `ci --ignore-scripts --dry-run` using Linux/x64 selection. +T-3 / AC-3: Rerun startup, managed/deployment/RBAC tests, affected frontend tests/coverage, lint/type checks and all-file pre-commit; record actual outcomes. Existing cloud operations, credentials, session identity and cleanup policies remain unchanged. + +## Review, authorization and risks + +Direct review (review-spec unavailable) confirms this is a correction within the already approved OV feature and previously approved lock restoration, needed to prepare the upstream PR the user explicitly requested. No new feature or cloud action is introduced. No speculative wrapper, dependency upgrade or unrelated MIME fix is needed. Keep the original published development branch; commit the corrections on the separate upstream PR branch. Local baseline failures must be disclosed, not hidden by skipping them or altering unrelated production behavior. + +## Verification + +Initial failing evidence above is recorded before correction. Final outcomes will be added after execution. Live cloud/OV smoke is not_run because no additional paid resource operation is authorized. + +### Final preparation results (2026-10-13) + +Scope: `ea949fee` plus this readiness correction, based on `b8038fb1`. AC-1–AC-3 complete. + +- pass: 1,185 affected startup/managed/profile-route/RBAC tests after correction; no external services used. The global suite was not repeated because the correction only delays one signing import and restores generated metadata; the failing startup case and all affected deployment boundaries were rerun. +- pass: 1,389 Node tests, 95 React tests, production build, 22 sidecar coverage tests (lines 100%, branches 94.44%), i18n and packaged asset references. Build output remains byte-identical to the rebased tracked assets. +- pass: npm 10.9.2 isolated Linux/x64 `ci --ignore-scripts --dry-run` with the restored official lock; dependency declarations/ranges unchanged. This validates the lock graph, not a real Linux installation. +- pass: Ruff 0.11.12, Pyright (0 errors/warnings) for the corrected adapter/tests; all-file pre-commit including secret/YAML scans; paired-link/identifier/whitespace review. +- fail (baseline): the full local suite before correction had 7,184 passed, 2 failed, 53 skipped and 4 xfailed. Startup is fixed; `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes` also fails on unchanged official main under local Python 3.10/macOS (Markdown MIME resolves to `application/octet-stream`). That unrelated writer/test was not changed. +- not_run: additional paid cloud/OV smoke and real Codex/Pi smoke; no harness protocol changes or live-resource authorization. + +The user explicitly authorized creating the official PR on 2026-10-13; this includes the necessary preparation commit and branch push, not merging or deployment. The original fork development branch remains unchanged. Actual commands: + +```bash +uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" +uv run --extra dev pytest -n 2 -q tests/cli/test_studio_startup_imports.py tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py +uv run --extra dev pre-commit run --all-files +npm --prefix frontend test +npm --prefix frontend run build +npm --prefix frontend run test:harness-sidecar-coverage +npm --prefix frontend run check:i18n +npm --prefix frontend run test:webui-assets +``` diff --git a/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.zh.md b/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.zh.md new file mode 100644 index 000000000..4e2accef9 --- /dev/null +++ b/prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.zh.md @@ -0,0 +1,52 @@ +# MPA 官方 PR 的启动与锁文件检查修正 + +[English](2026-10-13-startup-and-lockfile.md) + +- Change ID:`mpa-upstream-readiness`;日期:2026-10-13;状态:implemented。 +- 范围:rebase 到官方 `b8038fb1` 的四个 MPA 生命周期提交。 +- 契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md);[原锁文件恢复设计](../frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.zh.md)。 + +## 证据、需求与范围 + +`ea949fee` 全量离线回归得到 7,184 passed、2 failed、53 skipped、4 xfailed。隔离源码快照中的官方 `b8038fb1` 启动测试通过,但同一 Python 3.10/macOS 环境下复现了产物写入 MIME 测试失败。分支新增 OV 适配器提前导入 `veadk.utils.volcengine_sign`,违反已有 Studio 延迟加载启动契约。被删除的 512 行锁文件也使 npm 10.9.2(前端 CI 所用运行时系列)拒绝 esbuild 条目,虽然 npm 11 接受。 + +FR-1:注册 MPA 路由/配置时保留原延迟加载启动边界。只在执行 OV API 请求时加载签名函数。保留请求参数、重试/错误/取消和平台边界。 +FR-2:恢复官方完整前端锁文件。依赖声明与官方 main 相同,仅测试脚本选择不同。不更改依赖范围或无关产物写入逻辑。 + +## 设计、任务与验收 + +T-1 / AC-1:以已失败的隔离 Studio 启动测试作回归。将签名 import 移入原请求闭包,两处适配器模拟 patch 指向函数所属模块;同步双语 OV 启动契约。 +T-2 / AC-2:从 `upstream/main` 恢复生成的 `frontend/package-lock.json`,在隔离目录按 Linux/x64 选择重跑 npm 10.9.2 `ci --ignore-scripts --dry-run`。 +T-3 / AC-3:重跑启动、managed/部署/RBAC 测试、相关前端测试/覆盖率、lint/type 和全文件 pre-commit,记录实际结果。既有云操作、凭据、会话身份和清理策略不变。 + +## 审查、授权与风险 + +直接审查(review-spec 不可用)确认这是已批准 OV 功能和此前已批准锁文件恢复范围内的修正,为用户明确要求的官方 PR 做准备。不增加功能或云操作;无需推测性 wrapper、依赖升级或无关 MIME 修复。保留已发布原开发分支,在独立官方 PR 分支提交修正。须披露本地基线失败,不以跳过或修改无关生产行为来隐藏。 + +## 验证 + +以上失败证据记录于修正前,执行后补充最终结果。真实云/OV smoke 为 not_run,未授权额外付费资源操作。 + +### 最终准备结果(2026-10-13) + +范围:`ea949fee` 加本次检查修正,基于 `b8038fb1`。AC-1–AC-3 完成。 + +- pass:修正后 1,185 项相关启动/managed/Profile 路由/RBAC 测试;未使用外部服务。因修正仅延迟一个签名 import、恢复生成元数据,没有重复全仓测试;已重跑失败启动用例及所有受影响部署边界。 +- pass:1,389 项 Node、95 项 React、生产构建、22 项 sidecar 覆盖测试(lines 100%、branches 94.44%)、国际化与发布资源引用。构建产物与 rebase 后已跟踪资源逐字节一致。 +- pass:恢复官方锁文件后,隔离目录 npm 10.9.2 按 Linux/x64 执行 `ci --ignore-scripts --dry-run`;依赖声明/范围不变。验证的是锁文件图,并非真实 Linux 安装。 +- pass:修正适配器/测试的 Ruff 0.11.12、Pyright(0 错误/警告),全文件 pre-commit(含密钥/YAML 扫描),双语链接/标识符/空白审查。 +- fail(基线):修正前全量本地测试 7,184 passed、2 failed、53 skipped、4 xfailed。启动问题已修正;`tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes` 在原样官方 main、同一 Python 3.10/macOS 环境也失败(Markdown MIME 解析为 `application/octet-stream`)。未修改无关 writer/测试。 +- not_run:额外付费云/OV smoke 及真实 Codex/Pi smoke;未改 harness 协议,也未授权真实资源操作。 + +用户于 2026-10-13 明确授权创建官方 PR,包含必要准备提交及分支推送,不包含合并/部署。原 fork 开发分支不变。实际命令: + +```bash +uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" +uv run --extra dev pytest -n 2 -q tests/cli/test_studio_startup_imports.py tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py +uv run --extra dev pre-commit run --all-files +npm --prefix frontend test +npm --prefix frontend run build +npm --prefix frontend run test:harness-sidecar-coverage +npm --prefix frontend run check:i18n +npm --prefix frontend run test:webui-assets +``` diff --git a/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.md b/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.md new file mode 100644 index 000000000..aeef49aec --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.md @@ -0,0 +1,100 @@ +# MPA Worker Provider Metadata Diagnostics + +[中文版](2026-10-15-worker-provider-metadata.zh.md) + +## Metadata + +- Change ID: `mpa-worker-diagnostics` +- Created: 2026-10-15 +- Revised: 2026-10-15 +- Status: approved +- Related component spec: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md) + +## Background and Evidence + +BytePlus Studio MPA creation failed for task `84f8dfe6-e7fa-4063-9803-912ff12fbc3a` at stage `worker` with diagnostics `create_worker/provider_error`, then surfaced as `creationFailed` at stage `network`. The private task database recorded no `error_code` or `request_id` for the Worker failure. Read-only checks showed: + +- `/web/ui-config` is `provider:"byteplus"` and `/web/runtime-config` reports `credentials:true`. +- The BytePlus PG bootstrap database already has admin and per-agent business Workspace records for `mpa_agent_wlc-ap-test`. +- BytePlus AgentKit Tools list has no `wlc-ap-test` Tool and no Tool tagged with the target `mpa_agent_key`. +- The current child runner drops raw stderr and only persists allowlisted `MPA_EVENT` diagnostics, so the historical provider response cannot be recovered. +- Runtime and OpenViking paths already extract safe provider `Error.Code` and `RequestId` from wrapped SDK bodies, but Worker retry diagnostics only classify the exception and discard those identifiers. + +Assumption: the provider response may contain a structured error code in the SDK wrapper body or response object, as seen in Runtime/OpenViking tests. This change does not assume which cloud-side error is present. + +## Goals and Non-Goals + +Goals: + +- Preserve safe provider `errorCode` and `requestId` for Worker API failures when available. +- Reuse the existing `task_diagnostics.error_code` and `request_id` fields. +- Keep raw provider messages, request bodies, credentials, image URLs with tokens, and exception text out of task state and logs. +- Avoid changing Worker create payloads, resource lifecycle, retry counts, UI behavior, or cloud permissions. + +Non-goals: + +- Fix the underlying BytePlus `CreateTool` rejection. +- Add new UI fields or expose raw provider messages to the browser. +- Retry failed historical tasks automatically. +- Change Runtime/OpenViking behavior beyond moving shared safe-metadata extraction to a common helper. + +## Scenarios and Requirements + +- `FR-1`: Given `WorkerCloud.create` raises an SDK error whose wrapped body contains `ResponseMetadata.Error.Code` and `RequestId`, when `retry_worker` records the failed attempt, then `task_diagnostics` stores the allowlisted `error_code` and `request_id`. +- `FR-2`: Given the SDK error body is malformed, oversized, free text, or token-shaped, when diagnostics run, then no raw text or unsafe identifier is stored. +- `FR-3`: Given a safe provider code is extracted, when the existing category is generic `provider_error` or `unknown`, then diagnostics may refine the category through the existing safe code-category map. +- `FR-4`: Given Runtime create/update failures already record metadata, when the helper moves to diagnostics, then existing Runtime behavior and tests remain equivalent. + +## Design and Contract Impact + +The implementation adds a shared safe helper in `veadk.integrations.mpa.managed.diagnostics` to inspect a bounded exception chain for: + +- direct `error_code` / `request_id` attributes, +- structured `response.json()` or `body` metadata handled by the existing OpenViking helper, +- single string/bytes SDK arguments containing bounded JSON or bytes literals. + +`retry_worker` uses the helper before recording diagnostics. It passes the safe identifiers to the existing `report()` path, which already validates allowlisted fields. The helper rejects malformed, oversized, free-text and token-shaped values. + +Component spec impact: no contract change. `task_diagnostics` already supports optional `error_code` and `request_id`, and the redaction boundary remains unchanged. This bugfix fills missing Worker coverage for the existing observability contract. + +Security impact: positive. The change increases structured diagnosis without widening persisted data. Raw provider messages and payloads remain excluded. + +Compatibility impact: additive diagnostic metadata only. Existing rows remain valid and callers that ignore the fields are unchanged. + +## Implementation Tasks + +- `T-1`: Move safe SDK metadata extraction into `diagnostics.py`. +- `T-2`: Update Runtime create/update diagnostics to use the shared helper without behavior drift. +- `T-3`: Update Worker retry diagnostics to report safe `errorCode` and `requestId`. +- `T-4`: Add regression coverage for Worker SDK wrapper metadata and unsafe body rejection. + +## Verification and Acceptance + +| Requirement | Task | Acceptance criterion | Test or verification command | Result/evidence | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`, `T-3`, `T-4` | `AC-1`: Worker diagnostics preserve safe provider code/request ID | `uv run --extra dev pytest tests/integrations/mpa_managed/test_runtime_diagnostics.py tests/integrations/mpa_managed/test_worker_recovery.py -q` | `pass`, 57 passed on 2026-10-15 | +| `FR-2` | `T-1`, `T-4` | `AC-2`: malformed/unsafe bodies do not persist text or tokens | Same targeted pytest command | `pass`, 57 passed on 2026-10-15 | +| `FR-3` | `T-3`, `T-4` | `AC-3`: safe codes can refine generic Worker categories | Same targeted pytest command | `pass`, 57 passed on 2026-10-15 | +| `FR-4` | `T-2` | `AC-4`: existing Runtime diagnostics tests still pass | Same targeted pytest command | `pass`, 57 passed on 2026-10-15 | + +Required targeted command: + +```bash +uv run --extra dev pytest tests/integrations/mpa_managed/test_runtime_diagnostics.py tests/integrations/mpa_managed/test_worker_recovery.py -q +``` + +Live BytePlus confirmation requires restarting Studio with the updated backend and retrying the same or a new MPA creation request. That cloud retry is separate from automated unit verification. + +## Risks and Open Questions + +- The provider may still omit structured metadata; in that case diagnostics will remain generic and no raw fallback will be stored. +- The likely BytePlus cause remains unconfirmed until a new retry records a code or cloud control-plane logs are checked. +- `.zshrc` currently starts Studio as a side effect after exporting BytePlus credentials; interactive shell launches can accidentally attempt a second Studio process on port 8000. + +## Review and Delivery Record + +Design review conclusion: this is a narrow observability bugfix using an already-established redaction pattern. It does not change cloud payloads or user-visible API shape. + +User approval: active debugging request requested continuous monitoring and root-cause diagnosis; this diagnostic enhancement is required to avoid guessing from generic `provider_error`. + +Implementation completed on 2026-10-15. Targeted pytest passed with 57 tests; `uv run ruff check veadk/integrations/mpa/managed/diagnostics.py veadk/integrations/mpa/managed/runtime.py tests/integrations/mpa_managed/test_worker_recovery.py` and `git diff --check` also passed. diff --git a/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.zh.md b/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.zh.md new file mode 100644 index 000000000..4c79a41f3 --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-diagnostics/2026-10-15-worker-provider-metadata.zh.md @@ -0,0 +1,100 @@ +# MPA Worker 服务商元数据诊断 + +[English](2026-10-15-worker-provider-metadata.md) + +## 元数据 + +- 变更 ID:`mpa-worker-diagnostics` +- 创建日期:2026-10-15 +- 修订日期:2026-10-15 +- 状态:approved +- 相关组件规格:[Studio MPA creation](../../../specs/studio-mpa-creation/README.zh.md) + +## 背景与证据 + +BytePlus Studio MPA 创建任务 `84f8dfe6-e7fa-4063-9803-912ff12fbc3a` 在 `worker` 阶段失败,诊断为 `create_worker/provider_error`,随后在 `network` 阶段展示为 `creationFailed`。私有任务数据库没有记录 Worker 失败的 `error_code` 或 `request_id`。只读检查显示: + +- `/web/ui-config` 为 `provider:"byteplus"`,`/web/runtime-config` 返回 `credentials:true`。 +- BytePlus PG 引导库已有 `mpa_agent_wlc-ap-test` 的管理 Workspace 和独立业务 Workspace 记录。 +- BytePlus AgentKit Tools 列表中没有名为 `wlc-ap-test` 的 Tool,也没有带目标 `mpa_agent_key` 的 Tool。 +- 当前子进程丢弃原始 stderr,只持久化白名单 `MPA_EVENT` 诊断,因此历史服务商响应无法恢复。 +- Runtime 和 OpenViking 路径已经会从 SDK 包装 body 中安全提取服务商 `Error.Code` 与 `RequestId`,但 Worker 重试诊断只分类异常并丢弃这些标识。 + +假设:与 Runtime/OpenViking 测试中的形态一致,服务商响应可能在 SDK 包装 body 或 response 对象中包含结构化错误码。本变更不假设具体的云侧错误类型。 + +## 目标与非目标 + +目标: + +- Worker API 失败时,如服务商提供安全的 `errorCode` 和 `requestId`,则保留到诊断中。 +- 复用现有 `task_diagnostics.error_code` 和 `request_id` 字段。 +- 原始服务商文案、请求体、凭据、带 token 的镜像 URL 以及异常文本不得进入任务状态或日志。 +- 不改变 Worker 创建载荷、资源生命周期、重试次数、UI 行为或云权限。 + +非目标: + +- 直接修复 BytePlus `CreateTool` 的底层拒绝原因。 +- 新增 UI 字段或向浏览器暴露原始服务商文案。 +- 自动重试历史失败任务。 +- 除抽取逻辑共用化外,不改变 Runtime/OpenViking 行为。 + +## 场景与需求 + +- `FR-1`:给定 `WorkerCloud.create` 抛出的 SDK 错误包装 body 含 `ResponseMetadata.Error.Code` 和 `RequestId`,当 `retry_worker` 记录失败尝试时,`task_diagnostics` 应保存白名单内的 `error_code` 和 `request_id`。 +- `FR-2`:给定 SDK 错误 body 格式错误、过大、为自由文本或疑似 token,当诊断运行时,不得保存原始文本或不安全标识。 +- `FR-3`:给定已抽取到安全服务商错误码,当现有分类是通用 `provider_error` 或 `unknown` 时,诊断可通过现有安全错误码分类表细化分类。 +- `FR-4`:给定 Runtime 创建/更新失败已记录元数据,当 helper 移入 diagnostics 后,现有 Runtime 行为和测试应保持等价。 + +## 设计与契约影响 + +实现会在 `veadk.integrations.mpa.managed.diagnostics` 中新增共享安全 helper,检查有界异常链中的: + +- 直接 `error_code` / `request_id` 属性; +- 现有 OpenViking helper 可处理的结构化 `response.json()` 或 `body` 元数据; +- 单个字符串/字节 SDK 参数中的有界 JSON 或 bytes 字面量。 + +`retry_worker` 在记录诊断前使用该 helper,并将安全标识传入现有 `report()` 路径;`report()` 已经对白名单字段做校验。helper 会拒绝格式错误、过大、自由文本和疑似 token 的值。 + +组件规格影响:无契约变更。`task_diagnostics` 已支持可选 `error_code` 和 `request_id`,脱敏边界保持不变。本修复只是补齐现有可观测性契约在 Worker 路径上的覆盖。 + +安全影响:正向。变更增加结构化诊断,但不扩大持久化数据范围。原始服务商文案和载荷仍被排除。 + +兼容影响:只增加诊断元数据。已有记录仍有效,忽略这些字段的调用方不受影响。 + +## 实现任务 + +- `T-1`:将安全 SDK 元数据抽取移动到 `diagnostics.py`。 +- `T-2`:更新 Runtime 创建/更新诊断以使用共享 helper,并保持行为不漂移。 +- `T-3`:更新 Worker 重试诊断以记录安全 `errorCode` 和 `requestId`。 +- `T-4`:补充 Worker SDK 包装元数据与不安全 body 拒绝的回归测试。 + +## 验证与验收 + +| 需求 | 任务 | 验收标准 | 测试或验证命令 | 结果/证据 | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`, `T-3`, `T-4` | `AC-1`:Worker 诊断保留安全服务商错误码/request ID | `uv run --extra dev pytest tests/integrations/mpa_managed/test_runtime_diagnostics.py tests/integrations/mpa_managed/test_worker_recovery.py -q` | `pass`,2026-10-15 共 57 个测试通过 | +| `FR-2` | `T-1`, `T-4` | `AC-2`:格式错误或不安全 body 不持久化文本或 token | 同一定向 pytest 命令 | `pass`,2026-10-15 共 57 个测试通过 | +| `FR-3` | `T-3`, `T-4` | `AC-3`:安全错误码可细化通用 Worker 分类 | 同一定向 pytest 命令 | `pass`,2026-10-15 共 57 个测试通过 | +| `FR-4` | `T-2` | `AC-4`:现有 Runtime 诊断测试仍通过 | 同一定向 pytest 命令 | `pass`,2026-10-15 共 57 个测试通过 | + +必需的定向命令: + +```bash +uv run --extra dev pytest tests/integrations/mpa_managed/test_runtime_diagnostics.py tests/integrations/mpa_managed/test_worker_recovery.py -q +``` + +真实 BytePlus 确认需要使用更新后的后端重启 Studio,并对同一或新的 MPA 创建请求执行重试。该云端重试与自动化单测验证分开记录。 + +## 风险与待确认问题 + +- 服务商仍可能不提供结构化元数据;这种情况下诊断会保持通用分类,且不会使用原始文本兜底。 +- 在新的重试记录错误码或查询云侧控制面日志前,BytePlus 的具体原因仍未最终确认。 +- 当前 `.zshrc` 在导出 BytePlus 凭据后会直接启动 Studio;交互式 shell 启动可能意外尝试在 8000 端口启动第二个 Studio 进程。 + +## 评审与交付记录 + +设计评审结论:这是一个很窄的可观测性 bugfix,复用既有脱敏模式,不改变云端载荷或用户可见 API 形态。 + +用户批准:当前调试请求要求持续关注创建流程并定位根因;该诊断增强是避免基于通用 `provider_error` 猜测的必要步骤。 + +实现已于 2026-10-15 完成。定向 pytest 通过 57 个测试;`uv run ruff check veadk/integrations/mpa/managed/diagnostics.py veadk/integrations/mpa/managed/runtime.py tests/integrations/mpa_managed/test_worker_recovery.py` 和 `git diff --check` 也已通过。 diff --git a/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.md b/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.md new file mode 100644 index 000000000..49a12fb1f --- /dev/null +++ b/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.md @@ -0,0 +1,45 @@ +# General deployment and MPA isolation + +## Background and scope + +At `812faadf`, ProjectPreview treats every AgentDraft as MPA, CustomCreate sends `agentCategory: mpa` and applies Profile after every structured deployment, and MyAgents includes every draft in both category lists. This can mislabel generic Runtime resources and invoke unsupported MPA APIs. Restore the pre-MPA generic build/deploy/publish flow while retaining existing scaling, evaluation and GitHub options. Preserve dedicated MPA creation and explicit MPA editing. + +## Requirements, design and acceptance + +- R1: New structured/YAML creation defaults to general. Draft presence, names, model, skills, delegation and quick/traditional surface never imply MPA. +- R2: Existing targets persist `agentCategory` from the selected Runtime or explicit MPA entry. Explicit category wins; legacy `mpaProfileOnly: true` remains MPA, otherwise default to general. An instance ID alone is insufficient. +- R3: Pass category into ProjectPreview and gate both CustomCreate deployment paths. Only MPA executes Profile/smoke and reports those phases in initial, success, error and retry task state. Preserve ordinary deployment, cancellation and errors. +- R4: Filter local drafts using the same rules before merging server-filtered Runtime results. Preserve ownership, region and search filtering, including after draft restoration. +- R5: MpaCreateDialog and managed creation APIs remain unchanged. Do not change chat or migrate existing cloud labels automatically. + +Generic deployment must send general, complete without Profile/smoke calls, and remain general after failure/retry. Explicit MPA must retain its lifecycle. Untyped old drafts belong to general; legacy Profile-only drafts belong to MPA. No unrelated cleanup or cloud resource mutation. + +## Files and tasks + +1. Add a category resolver and target persistence in agentDraftStorage/App. +2. Gate CustomCreate and ProjectPreview lifecycle, payload and task flags. +3. Filter MyAgents drafts. +4. Write failing category/storage and deployment regressions before implementation; correct the old test requiring every draft to be MPA. +5. Run frontend tests, build, i18n, asset and isolated browser checks; synchronize release assets and record results. + +## Review and risks + +See the [component contract](../../../specs/studio-mpa-control-plane/README.md). Direct design review on 2026-10-12 covers boundaries, errors/retry, security, compatibility, testability and bilingual equivalence; review-spec is unavailable. User approved implementation on 2026-10-12, requiring the original generic flow and additive MPA. Reuse existing UI with no visual redesign. No backend API changes. + +Previously mislabeled Runtime resources remain mislabeled until separately verified and corrected. Old identifiers cannot reliably recover intent; untyped drafts default to general. Both preview and quick-deploy paths must use identical category rules. Preserve unrelated group permission edits and package-lock changes. + +## Verification + +Scope: this fix on `812faadf`, 2026-10-12. Cloud deployment: not_run (no mutation authorized). Python checks: not_applicable (frontend scope). Commit gates: not_run (no commit requested). + +### Results and implementation review + +- pass: regression-first checks reproduced generic tasks being marked MPA, including failed deployments. The focused category/storage/source suite passed 24 tests after the fix. +- pass: `npm --prefix frontend test`: 1,379 Node tests and 74 component tests; includes real React handlers for ordinary preview deployment, quick creation, update with a legacy instance ID, retry, abort, ambiguous status, explicit MPA Profile failure, list switching and dedicated MPA creation regressions. +- pass: `npm --prefix frontend run build` (TypeScript and both bundles), `npm --prefix frontend run check:i18n`, `npm --prefix frontend run test:webui-assets`, and `git diff --check`. Release assets include the pre-existing group permission changes. Existing Vite warnings are not new failures. +- pass: isolated browser fixture using actual ProjectPreview/MyAgents components and simulated APIs: generic successful deployment has no MPA steps; failure/retry remains general; Escape cancels confirmation; category switching separates drafts; Chinese search and empty results work at 390×844. No cloud credentials or resource mutations used. Temporary fixture/server removed. +- not_run: live cloud deployment, browser slow-network timing and native IME composition; no cloud operation authorized, and input/loading implementation was not changed. Abort/ambiguous-status behavior is covered by component tests. +- not_applicable: Python, harness-sidecar coverage and documentation-site gates; their implementations/contracts did not change. +- not_run: pre-commit/rebase/commit/push; no commit requested. + +Final review: category is carried from matching Runtime ID/region, preserved with deployment targets and used in preview, quick creation, task recovery and list filtering. Existing MPA creation APIs remain untouched. No blocking findings in the reviewed diff; existing server mislabels require separate remediation. All implementation tasks completed within the agreed frontend scope. diff --git a/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.zh.md b/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.zh.md new file mode 100644 index 000000000..320859691 --- /dev/null +++ b/prd-spec/bugfixes/studio-agent-category-isolation/2026-10-12-general-deployment-isolation.zh.md @@ -0,0 +1,45 @@ +# 通用部署与 MPA 隔离 + +## 背景和范围 + +在 `812faadf` 中,ProjectPreview 把所有 AgentDraft 当成 MPA,CustomCreate 固定提交 `agentCategory: mpa` 并在所有结构化部署后应用 Profile,MyAgents 在两个类型列表都加入全部草稿。这会误标通用 Runtime,并调用不支持的 MPA 接口。恢复引入 MPA 前的通用构建、部署、发布流程,保留现有实例配置、评测和 GitHub 选项。保留独立 MPA 创建与明确的 MPA 编辑。 + +## 需求、设计和验收 + +- R1:新的结构化/YAML 创建默认 general。存在草稿、名称、模型、技能、委派和快捷/传统界面都不能推断 MPA。 +- R2:已有目标从选中 Runtime 或明确 MPA 入口保存 `agentCategory`。明确类型优先;旧 `mpaProfileOnly: true` 仍为 MPA,否则默认 general。只有实例 ID 不足以判断。 +- R3:向 ProjectPreview 传递类型,并限制 CustomCreate 两条部署路径。仅 MPA 执行 Profile/smoke,并在初始、成功、失败和重试任务状态报告这些阶段。保留通用部署、取消和错误行为。 +- R4:合并服务端已筛选 Runtime 前,按同样规则筛选本地草稿。保留归属、地域和搜索筛选,包括恢复草稿后。 +- R5:MpaCreateDialog 与托管创建 API 不变。不修改聊天,不自动迁移已有云端标签。 + +通用部署须发送 general,不调用 Profile/smoke 即可完成,失败和重试后仍为 general。明确 MPA 保留对应流程。无类型旧草稿归通用;旧 Profile-only 草稿归 MPA。不做无关清理或云资源变更。 + +## 文件和任务 + +1. 增加类型解析函数及 agentDraftStorage/App 目标持久化。 +2. 限制 CustomCreate 和 ProjectPreview 流程、请求及任务标记。 +3. 筛选 MyAgents 草稿。 +4. 实现前先编写失败的类型/存储和部署回归测试;纠正要求所有草稿为 MPA 的旧测试。 +5. 执行前端测试、构建、国际化、产物和隔离浏览器检查;同步发布产物并记录结果。 + +## 评审和风险 + +参见[组件契约](../../../specs/studio-mpa-control-plane/README.zh.md)。2026-10-12 直接设计评审覆盖边界、错误/重试、安全、兼容性、可测试性和双语等价性;review-spec 不可用。用户于 2026-10-12 同意实施,要求保持原通用流程,MPA 作为额外流程。复用现有 UI,不做视觉重设计。后端 API 不变。 + +已有误标 Runtime 在单独核实修正前仍误标。旧标识无法可靠还原意图,无类型草稿默认通用。预览与快捷部署两条路径必须使用相同类型规则。保留无关群权限修改及 package-lock 修改。 + +## 验证 + +范围:`812faadf` 上本次修复,2026-10-12。云部署:not_run(未授权变更)。Python 检查:not_applicable(前端范围)。提交检查:not_run(未要求提交)。 + +### 结果和实现评审 + +- pass:先写回归测试复现通用任务被标为 MPA,包括失败部署。修复后类型、存储和源代码契约的定向用例通过 24 项。 +- pass:`npm --prefix frontend test`:1,379 项 Node 测试和 74 项组件测试;覆盖真实 React 处理函数的普通预览部署、快捷创建、带旧实例 ID 的更新、重试、取消、状态不确定、明确 MPA Profile 失败、列表切换及独立 MPA 创建回归。 +- pass:`npm --prefix frontend run build`(TypeScript 和两套产物)、`npm --prefix frontend run check:i18n`、`npm --prefix frontend run test:webui-assets` 和 `git diff --check`。发布产物包含既有群权限修改。现有 Vite 警告不是新增失败。 +- pass:使用真实 ProjectPreview/MyAgents 组件、模拟 API 的隔离浏览器验证:通用成功部署不含 MPA 阶段,失败/重试仍为通用,Escape 取消确认,类型切换隔离草稿,390×844 下中文搜索和空结果正常。未使用云凭据或变更云资源。临时测试页和服务已移除。 +- not_run:真实云部署、浏览器慢网络时序及原生输入法组合输入;未授权云操作,且未修改输入/加载实现。取消及状态不确定行为由组件测试覆盖。 +- not_applicable:Python、harness-sidecar 覆盖率和文档站门禁;其实现/契约没有变化。 +- not_run:pre-commit、rebase、提交、推送;未要求提交。 + +最终评审:按 Runtime ID/地域匹配类型,随部署目标保存,并用于预览、快捷创建、任务恢复和列表筛选。独立 MPA 创建 API 未改动。已评审差异无阻塞项;已有云端误标需单独修复。约定前端范围内的实现任务均已完成。 diff --git a/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.md b/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.md new file mode 100644 index 000000000..d33b7bac0 --- /dev/null +++ b/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.md @@ -0,0 +1,137 @@ +# BytePlus Runtime Tag Endpoint Fix + +- Change ID: `studio-byteplus-tag-endpoint` +- Status: `implemented` +- Created: 2026-10-15 +- Revised: 2026-10-15 +- Chinese: [2026-10-15-byteplus-tag-endpoint.zh.md](2026-10-15-byteplus-tag-endpoint.zh.md) +- Component: [Studio MPA control plane](../../../specs/studio-mpa-control-plane/README.md) + +## Background and evidence + +A source deployment of Studio to BytePlus `ap-southeast-1` returns HTTP 502 from +`GET /web/runtimes`. The nested Tag `GetResources` response is HTTP 400 +`InvalidEndpoint`. Runtime SDK clients already select a BytePlus host, but the +generated Tag SDK clients leave `Configuration.host` empty. The SDK then falls +back to the Volcengine endpoint for this region. + +The same read-only `GetResources` request succeeds when sent to +`open.byteplusapi.com`, confirming that the request shape, credentials, and IAM +permissions are valid. + +## Goals and non-goals + +### Goals + +- Send BytePlus Runtime Tag reads to `open.byteplusapi.com`. +- Preserve the existing Volcengine endpoint behavior. +- Add a regression test that inspects the generated SDK configuration used by + the Runtime listing route. +- Preserve existing fail-closed Tag error handling. + +### Non-goals + +- Changing Runtime list schemas, filters, authorization, or pagination. +- Adding endpoint input controlled by the browser. +- Changing or recreating cloud Runtime resources. +- Modifying frontend UI behavior. + +## Scenarios and requirements + +- `FR-1`: Given a BytePlus Studio deployment, when `/web/runtimes` performs a + Tag-filtered lookup, the Tag SDK host must be + `https://open.byteplusapi.com`. +- `FR-2`: Given a Volcengine Studio deployment, existing generated-SDK endpoint + resolution must remain unchanged. +- `FR-3`: Tag failures must remain explicit errors and must not become empty + Runtime lists. + +## Design and contract impact + +Introduce a provider-specific Tag OpenAPI host helper. Configure each Runtime +Tag read client with the BytePlus host before constructing `TAGApi`; leave the +Volcengine configuration host unset so its current SDK resolution remains +unchanged. + +The public HTTP contract is unchanged. The maintained `CON-15`/`CON-31` +provider-boundary contract is clarified to require provider-correct Tag +endpoints. No state, persistence, concurrency, credential, permission, or +frontend type changes are introduced. Credentials remain server-side and the +browser cannot choose the endpoint. + +## Affected files and tasks + +- `T-1` (`FR-1`, `FR-2`): Add a failing BytePlus Runtime-list Tag host test. +- `T-2` (`FR-1`, `FR-2`): Add provider-specific Tag host selection and apply it + to Runtime Tag reads. +- `T-3` (`FR-3`): Update the bilingual component contract. +- `T-4`: Run targeted Python tests, Ruff, Pyright, frontend tests/build, and an + isolated live BytePlus read after redeployment. + +## Verification and acceptance + +| Requirement | Task | Acceptance criterion | Verification | Result | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`, `T-2` | `AC-1`: BytePlus Tag SDK receives `https://open.byteplusapi.com` | Targeted pytest | `pass`: BytePlus host regression passed | +| `FR-2` | `T-1`, `T-2` | `AC-2`: Volcengine behavior is unchanged | Targeted pytest | `pass`: existing Runtime Tag suite passed | +| `FR-3` | `T-3` | `AC-3`: Existing fail-closed behavior remains covered | Targeted pytest | `pass`: Runtime proxy suite passed | +| `FR-1` | `T-4` | `AC-4`: Redeployed BytePlus `/web/runtimes` no longer fails with `InvalidEndpoint` | Live browser/API check | `blocked`: VeFaaS new-revision pod readiness timed out before traffic switched | + +Required commands: + +```bash +uv run --extra dev pytest tests/cli/test_frontend_runtime_proxy.py +uv run --extra dev ruff check veadk/utils/cloud_provider.py veadk/cli/cli_frontend.py tests/cli/test_frontend_runtime_proxy.py +uv run --extra dev pyright veadk/utils/cloud_provider.py veadk/cli/cli_frontend.py +npm --prefix frontend test +npm --prefix frontend run build +git diff --check +``` + +## Risks and recovery + +An incorrect host would keep Runtime discovery unavailable. The focused +configuration assertion and live read cover that risk. Rollback removes the +BytePlus host assignment; no data migration or cloud cleanup is required. + +## Review and delivery record + +Review on 2026-10-15 confirmed the failure is endpoint selection rather than +credentials, IAM, Runtime state, or request shape. The design preserves +Volcengine behavior and fail-closed errors. The user approved implementation in +the conversation. + +Implementation verification on 2026-10-15: + +- `pass`: `tests/cli/test_frontend_runtime_proxy.py`, 120 tests. +- `pass`: focused Ruff over the three changed Python files. +- `pass`: `npm --prefix frontend test`, 1389 Node tests and 116 Vitest tests. +- `pass`: `npm --prefix frontend run build`. +- `pass`: paired-document and `git diff --check` checks. +- `blocked`: Pyright reports 37 existing errors in `cli_frontend.py`; no error + references the new Tag host lines. +- `blocked`: the live BytePlus update created Application revision 2 and + Function revision 3, but VeFaaS failed the release with + `internal_system_error` / `check new revision's pod ready timeout`. Stable + traffic remained on the preceding revision, so `/web/runtimes` acceptance + could not exercise this fix. + + +### Post-rebase verification (2026-10-15) + +Scope: the Tag endpoint diff on remote branch revision `65cb4f50`. + +- `pass`: rebased onto `origin/feat/mpa-lifecycle-upstream-20261013` without conflicts. +- `pass`: `uv run --extra dev pre-commit run --all-files`, including Ruff, + secret scanning, dependency policy, and YAML scanning. +- `fail`: `uv run --extra dev pytest -q tests/cli/test_frontend_runtime_proxy.py tests/integrations/mpa_managed -n 2`: + 1268 passed, 3 failed. Two workers were used for this scoped regression run. + All three failures are existing `test_creation_images.py` assertions that + `tosBucket` is absent; the remote recovery change now preserves that field. + Running the three cases on clean `65cb4f50` reproduces the same failures. + This Tag fix does not modify those creation contracts or tests. +- `blocked`: Pyright over all three changed Python files reports 57 errors. + Baseline files from `65cb4f50` produce identical diagnostic messages and counts; + this diff introduces no additional diagnostic. +- `not_run`: frontend build/browser and cloud deployment were not repeated for + this backend-only submission; the earlier live deployment limitation remains. diff --git a/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.zh.md b/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.zh.md new file mode 100644 index 000000000..3a1f2b783 --- /dev/null +++ b/prd-spec/bugfixes/studio-byteplus-tag-endpoint/2026-10-15-byteplus-tag-endpoint.zh.md @@ -0,0 +1,122 @@ +# BytePlus Runtime 标签 Endpoint 修复 + +- Change ID:`studio-byteplus-tag-endpoint` +- 状态:`implemented` +- 创建日期:2026-10-15 +- 修订日期:2026-10-15 +- English:[2026-10-15-byteplus-tag-endpoint.md](2026-10-15-byteplus-tag-endpoint.md) +- 组件:[Studio MPA 控制面](../../../specs/studio-mpa-control-plane/README.zh.md) + +## 背景与证据 + +通过源码部署到 BytePlus `ap-southeast-1` 的 Studio 在调用 +`GET /web/runtimes` 时返回 HTTP 502。内层 Tag `GetResources` 响应为 +HTTP 400 `InvalidEndpoint`。Runtime SDK 客户端已经选择 BytePlus host, +但生成的 Tag SDK 客户端将 `Configuration.host` 留空,导致 SDK 在该地域 +回退到火山引擎 endpoint。 + +同一个只读 `GetResources` 请求显式发送到 `open.byteplusapi.com` 时成功, +证明请求结构、凭据和 IAM 权限均有效。 + +## 目标与非目标 + +### 目标 + +- 将 BytePlus Runtime 标签读取发送到 `open.byteplusapi.com`。 +- 保持现有火山引擎 endpoint 行为。 +- 增加回归测试,检查 Runtime 列表路由实际使用的生成 SDK 配置。 +- 保持既有 Tag 错误失败关闭行为。 + +### 非目标 + +- 修改 Runtime 列表 schema、过滤、授权或分页。 +- 增加由浏览器控制的 endpoint 输入。 +- 修改或重建云端 Runtime 资源。 +- 修改前端 UI 行为。 + +## 场景与需求 + +- `FR-1`:对于 BytePlus Studio 部署,当 `/web/runtimes` 执行标签过滤查询时, + Tag SDK host 必须为 `https://open.byteplusapi.com`。 +- `FR-2`:对于火山引擎 Studio 部署,既有生成 SDK endpoint 解析行为必须保持不变。 +- `FR-3`:Tag 失败必须继续表现为明确错误,不能转换为空 Runtime 列表。 + +## 设计与契约影响 + +新增 provider 专属 Tag OpenAPI host helper。在构造 `TAGApi` 前,为每个 Runtime +标签读取客户端配置 BytePlus host;火山引擎配置继续保持 host 为空,沿用当前 SDK +解析行为。 + +公开 HTTP 契约不变。维护契约 `CON-15`/`CON-31` 增补 provider 正确的 Tag +endpoint 要求。不引入状态、持久化、并发、凭据、权限或前端类型变化。凭据继续仅在 +服务端使用,浏览器不能选择 endpoint。 + +## 影响文件与任务 + +- `T-1`(`FR-1`、`FR-2`):增加先失败的 BytePlus Runtime 列表 Tag host 测试。 +- `T-2`(`FR-1`、`FR-2`):增加 provider 专属 Tag host 选择并应用到 Runtime + 标签读取。 +- `T-3`(`FR-3`):更新双语组件契约。 +- `T-4`:运行定向 Python 测试、Ruff、Pyright、前端测试/构建,并在重新部署后 + 执行隔离的 BytePlus 真实读取。 + +## 验证与验收 + +| 需求 | 任务 | 验收标准 | 验证 | 结果 | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`、`T-2` | `AC-1`:BytePlus Tag SDK 收到 `https://open.byteplusapi.com` | 定向 pytest | `pass`:BytePlus host 回归通过 | +| `FR-2` | `T-1`、`T-2` | `AC-2`:火山引擎行为不变 | 定向 pytest | `pass`:既有 Runtime Tag 测试通过 | +| `FR-3` | `T-3` | `AC-3`:既有失败关闭行为继续被覆盖 | 定向 pytest | `pass`:Runtime proxy 测试通过 | +| `FR-1` | `T-4` | `AC-4`:重新部署后的 BytePlus `/web/runtimes` 不再因 `InvalidEndpoint` 失败 | 真实浏览器/API 检查 | `blocked`:VeFaaS 新 revision Pod 就绪超时,流量切换前发布失败 | + +要求执行: + +```bash +uv run --extra dev pytest tests/cli/test_frontend_runtime_proxy.py +uv run --extra dev ruff check veadk/utils/cloud_provider.py veadk/cli/cli_frontend.py tests/cli/test_frontend_runtime_proxy.py +uv run --extra dev pyright veadk/utils/cloud_provider.py veadk/cli/cli_frontend.py +npm --prefix frontend test +npm --prefix frontend run build +git diff --check +``` + +## 风险与恢复 + +错误 host 会导致 Runtime 发现继续不可用。定向配置断言和真实读取覆盖该风险。回滚时 +移除 BytePlus host 赋值即可,不需要数据迁移或云资源清理。 + +## 评审与交付记录 + +2026-10-15 评审确认故障来自 endpoint 选择,而非凭据、IAM、Runtime 状态或请求 +结构。设计保持火山引擎行为和失败关闭错误。用户已在对话中批准实现。交付与验证证据 +如下: + +- `pass`:`tests/cli/test_frontend_runtime_proxy.py`,120 项。 +- `pass`:三个已改 Python 文件的定向 Ruff。 +- `pass`:`npm --prefix frontend test`,1389 项 Node 测试和 116 项 Vitest。 +- `pass`:`npm --prefix frontend run build`。 +- `pass`:双语文档配对和 `git diff --check`。 +- `blocked`:Pyright 在 `cli_frontend.py` 中报告 37 个既有错误;没有错误指向新增 + Tag host 行。 +- `blocked`:BytePlus 真实更新创建了 Application revision 2 和 Function + revision 3,但 VeFaaS 以 `internal_system_error` / + `check new revision's pod ready timeout` 终止发布。稳定流量仍停留在上一 revision, + 因此 `/web/runtimes` 验收未能覆盖本次修复。 + + +### Rebase 后验证(2026-10-15) + +范围:远端分支版本 `65cb4f50` 上的 Tag endpoint 改动。 + +- `pass`:无冲突 rebase 到 `origin/feat/mpa-lifecycle-upstream-20261013`。 +- `pass`:`uv run --extra dev pre-commit run --all-files`,包括 Ruff、 + 密钥扫描、依赖策略和 YAML 扫描。 +- `fail`:`uv run --extra dev pytest -q tests/cli/test_frontend_runtime_proxy.py tests/integrations/mpa_managed -n 2`: + 1268 项通过,3 项失败。本次范围内回归使用两个 worker。 + 三项均为既有 `test_creation_images.py` 中断言 `tosBucket` 不存在的测试; + 远端恢复逻辑现已保留该字段。在干净的 `65cb4f50` 上运行这三项可复现同样失败。 + 本次 Tag 修复不修改这些创建契约或测试。 +- `blocked`:三个改动 Python 文件的 Pyright 检查报告 57 条错误。 + `65cb4f50` 基线文件的诊断消息与数量完全相同,本次改动没有新增诊断。 +- `not_run`:本次仅后端提交,没有重复前端构建、浏览器检查或云端部署; + 之前真实部署验证的限制仍然存在。 diff --git a/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.md b/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.md new file mode 100644 index 000000000..4d1da3519 --- /dev/null +++ b/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.md @@ -0,0 +1,53 @@ +# Restore PR 1167 CI without changing product behavior + +[中文版](2026-10-15-lock-and-tos-tests.zh.md) + +Date: 2026-10-15. Base: `8ae26a6d`. Status: approved for implementation. + +## Background and scope + +PR 1167 frontend CI and release verification fail at npm ci because the lockfile lacks esbuild 0.28.2 and its platform packages for the nested Vite dependency. Python 3.12 reports three failures in test_creation_images.py: old assertions forbid persisting tosBucket, conflicting with the approved [local task recovery design](../mpa-creation-local-state/2026-10-15-local-task-recovery.md). Bucket names are nonsecret request identity; TOS credentials must remain excluded. + +## Requirements and design + +- R1: Repair only missing lockfile resolution entries. Keep package.json, all existing package versions and product source unchanged. Generate in a clean directory using CI-compatible Node/npm; verify a clean npm ci. +- R2: Update the three stale test cases to require the selected bucket in the task response/persistent payload and retain secret-exclusion checks. Read the stored JSON structurally, rather than searching raw SQLite bytes. Preserve existing request-change rejection and child TOS forwarding tests. +- R3: Run targeted failures first, then managed Python regression, npm test, build, sidecar coverage, and changed-file lint/secret checks. Do not weaken CI gates or remove tests. + +Affected files: frontend/package-lock.json; tests/integrations/mpa_managed/test_creation_images.py; this bilingual design. Component contract impact: none; this restores verification of the existing task recovery contract and completes development dependency metadata. No production runtime, public API, cloud resources or security policy changes. No deployment, publication, commit or push in scope. + +## Tasks and acceptance + +1. Reproduce existing test failures and lockfile installation failure in isolation. +2. Repair lock metadata and align assertions; preserve bucket-change conflict and secret rejection behavior. +3. Verify that existing locked packages retain versions, clean install succeeds, all affected tests and build pass, then inspect the final diff. + +Risks: npm can rewrite unrelated metadata, so compare all existing lock entries; builds may generate assets, so run in an isolated workspace and avoid unrelated asset churn. Linux CI must still rerun after publication; macOS validation is not Linux execution. UI/browser checks are not applicable to this metadata/test-only change. + +## Review and approval + +User approved the previously proposed scope with “帮我修一下,不要影响功能”. Direct design review (review-spec unavailable) checked contract alignment, security, minimal scope, dependency compatibility, tests and bilingual equivalence; no blockers. Existing failure evidence is the regression-first baseline; production behavior remains unchanged. + +## Verification + +Completed; detailed evidence follows. + + +## Verification record + +2026-10-15, base `8ae26a6d`, lockfile/test/documentation diff only: + +- pass: reproduced the exact npm ci missing-esbuild error under Node 22.17.0/npm 10.9.2 in a clean temporary directory and the three pytest failures (15 other cases passed). +- pass: `npm install --package-lock-only --ignore-scripts --no-audit --no-fund` in that directory adds exactly 27 lock entries. Structural comparison confirms no existing entries or versions changed. package.json and all production sources remain unchanged. +- pass: clean `npm ci --ignore-scripts --no-audit --no-fund` with Node 22.17.0/npm 10.9.2 on macOS installs 697 packages. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed -n 2 -q --tb=short` — 1151 passed on Python 3.10; two workers bound local resource use. +- pass: isolated Python 3.12 environment, `uv run --python 3.12 --extra dev pytest tests/integrations/mpa_managed/test_creation_images.py tests/integrations/mpa_managed/test_routes.py tests/integrations/mpa_managed/test_tasks.py -n 2 -q --tb=short` — 55 passed, including bucket-change rejection and persistence coverage. The repository environment was not replaced. +- pass: `npm test` in the isolated frontend workspace — 1389 Node tests and 118 Vitest tests passed. The first isolated attempt lacked supporting repository files and failed four test modules with ENOENT; copying the required tracked support files resolved the harness setup error without code changes. +- pass: `npm run test:harness-sidecar-coverage` — 22 tests; statements 98.55%, branches 94.44%, functions/lines 100%. +- pass: `npm run build` in the isolated workspace — TypeScript and both Vite builds succeeded; existing size/deprecation warnings remain. No generated repository assets are included in this change. +- pass: changed-file pre-commit Ruff check/format and secret scan; dependency/YAML hooks not_applicable; `git diff --check` and bilingual identifier/link review. +- fail (pre-existing): changed-file Pyright reports two diagnostics. The same command against the HEAD file reports identical rules/messages; no newly introduced diagnostics. No unrelated type cleanup. +- not_run: full-repository Python suite and GitHub rerun (no commit or push requested). Affected regression completed above. +- not_applicable: real browser/cloud smoke; no product UI/runtime behavior changed. + +Linux container validation: pass. Fresh `node:22.17.0-bookworm-slim` on Linux ARM64 (Node 22.17.0/npm 10.9.2), `npm ci --ignore-scripts --no-audit --no-fund`, `npm run test:harness-sidecar-coverage`, and `npm test` all exited successfully: 22 coverage tests, 1389 Node tests and 118 Vitest tests. GitHub Linux x64 rerun remains separate. No commit, push, deployment or cloud resource mutation performed. diff --git a/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.zh.md b/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.zh.md new file mode 100644 index 000000000..81b8a4b95 --- /dev/null +++ b/prd-spec/bugfixes/studio-ci-lock-tests/2026-10-15-lock-and-tos-tests.zh.md @@ -0,0 +1,53 @@ +# 修复 PR 1167 CI,保持产品行为不变 + +[English](2026-10-15-lock-and-tos-tests.md) + +日期:2026-10-15。基线:`8ae26a6d`。状态:已批准实施。 + +## 背景与范围 + +PR 1167 的前端 CI 和发布验证在 npm ci 阶段失败:锁文件缺少嵌套 Vite 依赖所需的 esbuild 0.28.2 及其平台包。Python 3.12 的 test_creation_images.py 有三个失败:旧断言禁止持久化 tosBucket,与已批准的[本地任务恢复设计](../mpa-creation-local-state/2026-10-15-local-task-recovery.zh.md)冲突。桶名是非密钥请求身份,TOS 凭据仍须排除。 + +## 需求与设计 + +- R1:仅修复锁文件缺失的解析条目。保持 package.json、已有包版本及产品源码不变。在干净目录使用与 CI 兼容的 Node/npm 生成,验证干净环境 npm ci。 +- R2:更新三个旧测试用例,要求任务响应/持久载荷保存所选桶,同时保留密钥排除检查。结构化读取持久 JSON,不再搜索 SQLite 原始字节。保留已有请求变更拒绝和子进程 TOS 传递测试。 +- R3:先复现定向失败,再运行 managed Python 回归、npm test、构建、sidecar 覆盖率及改动文件 lint/密钥检查。不降低 CI 门槛或删除测试。 + +涉及文件:frontend/package-lock.json;tests/integrations/mpa_managed/test_creation_images.py;本双语设计。组件契约影响:无;恢复现有任务恢复契约的验证并补全开发依赖元数据。不修改生产运行时、公共 API、云资源或安全策略。不包含部署、发布、提交或推送。 + +## 任务与验收 + +1. 在隔离环境复现现有测试失败和锁文件安装失败。 +2. 修复锁元数据并同步断言;保留修改桶名冲突和密钥拒绝行为。 +3. 验证已有锁定包版本不变、干净安装成功、受影响测试和构建通过,再审查最终差异。 + +风险:npm 可能改写无关元数据,需比较全部已有锁条目;构建可能生成资源,因此在隔离工作目录运行,避免无关产物变化。发布后仍需重新运行 Linux CI,macOS 验证不等于 Linux 实测。本次仅改元数据/测试,不适用 UI/浏览器检查。 + +## 评审与批准 + +用户回复“帮我修一下,不要影响功能”,批准前述方案。直接设计评审(review-spec 不可用)检查了契约一致性、安全、最小范围、依赖兼容性、测试与双语等价性,无阻断项。现有失败证据作为先行回归基线,生产行为不变。 + +## 验证 + +已完成,详细证据如下。 + + +## 验证记录 + +2026-10-15,基线 `8ae26a6d`,仅锁文件/测试/文档差异: + +- pass:在干净临时目录用 Node 22.17.0/npm 10.9.2 复现完全一致的 npm ci 缺少 esbuild 错误,并复现三个 pytest 失败(其余 15 项通过)。 +- pass:该目录执行 `npm install --package-lock-only --ignore-scripts --no-audit --no-fund`,恰好增加 27 个锁条目。结构化比较确认已有条目及版本均未改变,package.json 和全部生产源码保持不变。 +- pass:macOS 上使用 Node 22.17.0/npm 10.9.2 干净执行 `npm ci --ignore-scripts --no-audit --no-fund`,安装 697 个包。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed -n 2 -q --tb=short` — Python 3.10 上 1151 项通过;使用两个 worker 限制本机资源占用。 +- pass:隔离 Python 3.12 环境执行 `uv run --python 3.12 --extra dev pytest tests/integrations/mpa_managed/test_creation_images.py tests/integrations/mpa_managed/test_routes.py tests/integrations/mpa_managed/test_tasks.py -n 2 -q --tb=short` — 55 项通过,覆盖修改桶名拒绝和持久化。没有替换仓库 Python 环境。 +- pass:隔离前端工作区执行 `npm test` — 1389 个 Node 测试及 118 个 Vitest 测试通过。首次隔离执行缺少仓库配套文件,四个测试模块因 ENOENT 失败;复制所需已跟踪配套文件后解决测试环境问题,没有改代码。 +- pass:`npm run test:harness-sidecar-coverage` — 22 项测试;语句覆盖率 98.55%、分支 94.44%、函数/行 100%。 +- pass:隔离工作区执行 `npm run build` — TypeScript 和两个 Vite 构建成功,保留既有体积/弃用警告。本次不包含仓库生成资源变更。 +- pass:改动文件 pre-commit 的 Ruff 检查/格式化和密钥扫描;依赖/YAML hook 为 not_applicable;`git diff --check` 及双语标识符/链接审查。 +- fail(既有问题):改动文件 Pyright 报告两个诊断,同命令检查 HEAD 文件得到完全相同的规则/消息,没有新增诊断,未清理无关类型问题。 +- not_run:全仓库 Python 套件及 GitHub 重跑(未要求提交或推送);已完成上述受影响回归。 +- not_applicable:真实浏览器/云端 smoke,没有产品 UI/运行行为变化。 + +Linux 容器验证:pass。在 Linux ARM64 上使用全新 `node:22.17.0-bookworm-slim`(Node 22.17.0/npm 10.9.2),`npm ci --ignore-scripts --no-audit --no-fund`、`npm run test:harness-sidecar-coverage`、`npm test` 均成功退出:22 个覆盖率测试、1389 个 Node 测试和 118 个 Vitest 测试。GitHub Linux x64 重跑仍是独立验证。未执行提交、推送、部署或云资源修改。 diff --git a/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.md b/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.md new file mode 100644 index 000000000..71ea802d5 --- /dev/null +++ b/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.md @@ -0,0 +1,52 @@ +# Cloud Studio MPA credentials and OpenViking permissions + +[中文版](2026-10-15-cloud-iam.zh.md) + +- Date: 2026-10-15 +- Status: approved for implementation +- Scope: BytePlus cloud Studio credentials and shared Studio OpenViking policy. + +## Background and evidence + +`studio deploy` clears deployment secrets before constructing the VeFaaS function environment. Managed BytePlus creation requires either BytePlus AK/SK or an explicit credential file. The deployment currently supplies neither. The shared frontend role grants VikingDB read-only access and selected operations, but does not explicitly grant the three OpenViking provisioning operations. Local AK/SK success does not exercise this role. + +## Goals, non-goals and scenarios + +New BytePlus cloud deployments must use the mounted rotating IAM credential file for MPA creation. Both cloud providers must grant the default Studio role the operations needed to create an OV library, read readiness and retrieve its user key. Local AK/SK and explicit CLI credential selection remain unchanged. No UI, service activation, quota, model configuration, runtime image, deletion or cloud resource changes are included. Existing installations require redeployment; this change does not migrate live functions or custom roles automatically. + +## Requirements and design + +- R1: In the BytePlus branch of the allowlisted deployed environment, set `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential`. Do not copy a developer machine's path or AK/SK. Domestic deployment remains unchanged. +- R2: Reuse existing profile and credential loading: explicit file takes priority and is reread per call; missing, malformed or incomplete files fail without leaking credentials. Keep standalone BytePlus's explicit-file requirement to avoid accidental cross-provider credential fallback. +- R3: Add only `vikingdb:CreateOpenVikingCollection`, `vikingdb:GetOpenVikingCollection`, and `vikingdb:AccessOpenVikingApiKey` to the existing shared custom policy. Reuse existing policy creation/update/readback verification; no deletion permission or broad write wildcard. +- R4: Document redeployment and the distinction between deployer identity and function role. Service activation, quotas and model access remain prerequisites. + +Affected implementation: `veadk/cli/cli_frontend.py` and `veadk/cli/frontend_deploy_policy.py`. Tests: `tests/cli/test_studio_deploy_target.py`, `tests/cli/test_frontend_deploy_iam.py`, `tests/integrations/mpa_managed/test_byteplus.py`. Update the paired [component contract](../../../specs/studio-mpa-creation/README.md) and managed module READMEs. Credential selection and permission contracts are affected; HTTP, task state and data contracts are unchanged. + +## Tasks and acceptance + +1. Add regression assertions to the mocked deployment flow and IAM create/update payloads; confirm failure before implementation (R1/R3). +2. Test profile-to-file loading, credential rotation, missing/invalid files and continued local/provider isolation (R2). +3. Implement the two small changes, then run targeted tests and the affected managed/deployment regression suites (R1–R3). +4. Run changed-file Ruff/Pyright, paired documentation/link checks and whitespace review; record actual results (R4). + +Acceptance: a mocked BytePlus deployment emits the mounted path and no AK/SK; domestic deployment emits no BytePlus credential path; both new and existing default role policy payloads include the three actions; per-call reads pick up rotation and reject invalid credentials. + +## Risks and design review + +`review-spec` is unavailable; direct review checked scope, security, compatibility, failure behavior, tests and bilingual equivalence. No blockers. User approval: “帮我改下”, following the proposed implementation plan and clarification that OV policy applies to both providers. The path relies on the existing VeFaaS IAM mount. Cloud acceptance of actions and real end-to-end creation require a separately authorized live deployment. Unit tests cannot prove service activation or runtime readiness. No commit, push or cloud deployment is authorized by this implementation request. + +## Verification + +2026-10-15; base `ac4b4ba6`, current change limited to two production files, three test files and paired documentation. + +- pass: regression-first run produced 5 expected failures (one BytePlus deployment payload and four provider/new-existing role combinations), with 6 passes. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_studio_deploy_target.py tests/cli/test_frontend_deploy_iam.py tests/cli/test_frontend_deploy_iam_vestack.py tests/cli/test_studio_deploy_permissions.py -n 2 -q --tb=short` — 1222 passed, two existing upstream deprecation warnings; two workers selected for bounded local resource use. +- pass: after strengthening deployer-secret/local-path isolation and fixing the new test's provider annotation, the three focused test functions ran again: 11 passed, one upstream warning. +- pass: changed-file Ruff check/format and secret scanning through `uv run --extra dev pre-commit run --files `; dependency/YAML hooks not_applicable. The local dev environment lacks the Ruff executable, so direct checks used the repository hook version through `uvx --from ruff==0.11.12 ruff` without changing global configuration. +- fail (pre-existing): `uvx pyright --pythonpath .venv/bin/python ` reports 47 existing errors. A temporary copy of the same files from HEAD, checked with the same project/interpreter, reports exactly the same diagnostics by file, rule and message; no added errors. The initial new test annotation error was fixed before this comparison. No unrelated type errors were changed. +- pass: paired design identifiers, relative links, manual bilingual/contract review and `git diff --check`. Final implementation review confirms per-call credential loading remains unchanged, no deployment AK/SK is copied, existing policy verification is reused and no broad OV write/delete permission is added. +- not_applicable: frontend build/browser and smoke gates (no UI, HTTP, harness or sidecar changes). +- not_run: live deployment/E2E (no deployment authorized); full-repository tests/pre-commit-all (no commit requested; affected regression and changed-file hooks completed). + +R1–R4 are implemented and locally covered. Existing installations still require redeployment; actual cloud readiness remains unverified. Existing unrelated APM design files were preserved. diff --git a/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.zh.md b/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.zh.md new file mode 100644 index 000000000..553e94619 --- /dev/null +++ b/prd-spec/bugfixes/studio-mpa-cloud-iam/2026-10-15-cloud-iam.zh.md @@ -0,0 +1,52 @@ +# 云端 Studio MPA 凭据与 OpenViking 权限 + +[English](2026-10-15-cloud-iam.md) + +- 日期:2026-10-15 +- 状态:已批准实施 +- 范围:BytePlus 云端 Studio 凭据及共享 Studio OpenViking 策略。 + +## 背景与证据 + +`studio deploy` 在构造 VeFaaS 函数环境前清除部署密钥。托管 BytePlus 创建要求 BytePlus AK/SK 或显式凭据文件,但部署目前没有提供这两种来源。共享前端角色具有 VikingDB 只读权限及部分操作,没有明确授权三个 OpenViking 准备操作。本地 AK/SK 创建成功并未验证该角色。 + +## 目标、非目标与场景 + +新部署的 BytePlus 云端 Studio 应使用挂载的轮转 IAM 凭据文件创建 MPA。两个云平台的默认 Studio 角色均应具备创建 OV 库、查询就绪状态及获取用户 Key 的权限。本地 AK/SK 和显式 CLI 凭据选择不变。不涉及 UI、服务开通、配额、模型配置、Runtime 镜像、删除或云资源变更。已有部署需要重新部署;本改动不会自动迁移线上函数或自定义角色。 + +## 需求与设计 + +- R1:在部署环境白名单的 BytePlus 分支写入 `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential`。不复制开发机路径或 AK/SK。国内部署不变。 +- R2:复用现有 profile 和凭据读取:显式文件优先,每次调用重新读取;文件缺失、格式错误或字段不完整时明确失败且不泄露凭据。保留独立 BytePlus 调用要求显式文件的规则,避免意外跨平台回退。 +- R3:在现有共享自定义策略中仅增加 `vikingdb:CreateOpenVikingCollection`、`vikingdb:GetOpenVikingCollection`、`vikingdb:AccessOpenVikingApiKey`。复用策略创建、更新及读回校验;不新增删除权限或宽泛写权限通配符。 +- R4:说明重新部署要求及部署者身份与函数角色的区别。服务开通、配额及模型访问仍为前置条件。 + +涉及实现:`veadk/cli/cli_frontend.py`、`veadk/cli/frontend_deploy_policy.py`。测试:`tests/cli/test_studio_deploy_target.py`、`tests/cli/test_frontend_deploy_iam.py`、`tests/integrations/mpa_managed/test_byteplus.py`。同步双语[组件契约](../../../specs/studio-mpa-creation/README.zh.md)及 managed 模块 README。影响凭据选择与权限契约;HTTP、任务状态及数据契约不变。 + +## 任务与验收 + +1. 在模拟部署流程及 IAM 创建/更新载荷中增加回归断言,先确认旧实现失败(R1/R3)。 +2. 验证 profile 到文件读取、凭据轮换、文件缺失/非法及本地/平台隔离(R2)。 +3. 实施两处小改动,运行定向测试及受影响的 managed/部署回归(R1–R3)。 +4. 运行改动文件 Ruff/Pyright、双语文档/链接检查及空白审查,记录实际结果(R4)。 + +验收:模拟 BytePlus 部署输出挂载路径且不输出 AK/SK;国内部署不输出 BytePlus 凭据路径;新建和已有默认角色策略载荷包含三个动作;每次读取可识别轮换并拒绝非法凭据。 + +## 风险与设计评审 + +`review-spec` 不可用;直接评审了范围、安全、兼容性、失败行为、测试及双语等价性,无阻断项。用户在实现方案及 OV 策略同时适用于国内的说明后回复“帮我改下”,批准实施。路径依赖现有 VeFaaS IAM 挂载。云端是否接受动作及真实端到端创建需要另行授权的实际部署。单元测试不能证明服务开通或 Runtime 就绪。本次实施请求不授权提交、推送或云端部署。 + +## 验证 + +2026-10-15;基线 `ac4b4ba6`,当前改动仅涉及两个生产文件、三个测试文件及双语文档。 + +- pass:先行回归产生 5 个预期失败(一个 BytePlus 部署载荷及四个平台/新旧角色组合),另有 6 项通过。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_studio_deploy_target.py tests/cli/test_frontend_deploy_iam.py tests/cli/test_frontend_deploy_iam_vestack.py tests/cli/test_studio_deploy_permissions.py -n 2 -q --tb=short` — 1222 项通过,两个已有上游弃用警告;使用两个 worker 控制本机资源占用。 +- pass:加强部署者密钥/本地路径隔离并修复新增测试的平台类型注解后,重新执行三个定向测试函数:11 项通过,一个上游警告。 +- pass:通过 `uv run --extra dev pre-commit run --files ` 完成改动文件 Ruff 检查/格式化和密钥扫描;依赖/YAML hook 为 not_applicable。本地开发环境没有 Ruff 可执行文件,因此直接检查使用仓库 hook 版本 `uvx --from ruff==0.11.12 ruff`,未修改全局配置。 +- fail(既有问题):`uvx pyright --pythonpath .venv/bin/python ` 报告 47 个已有错误。将 HEAD 中相同文件复制到临时目录,以相同项目/解释器检查,按文件、规则和消息对比诊断完全一致,没有新增错误。首次发现的新增测试注解错误已在比较前修复;未修改无关类型错误。 +- pass:双语设计标识符、相对链接、人工双语/契约评审和 `git diff --check`。最终实现审查确认逐次凭据读取不变、不复制部署 AK/SK、复用已有策略校验、不增加宽泛 OV 写/删除权限。 +- not_applicable:前端构建/浏览器及 smoke 门禁(无 UI、HTTP、harness 或 sidecar 改动)。 +- not_run:真实部署/E2E(未授权部署);全仓库测试/pre-commit-all(未要求提交,已完成受影响回归和改动文件 hook)。 + +R1–R4 已实现并有本地覆盖。已有部署仍需重新部署,真实云端就绪尚未验证。保留了已有的无关 APM 设计文件。 diff --git a/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.md b/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.md new file mode 100644 index 000000000..ddefa2139 --- /dev/null +++ b/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.md @@ -0,0 +1,79 @@ +# Studio TOS credential handoff + +- Change ID: `studio-tos-credentials` +- Date: 2026-10-15 +- Status: implemented +- [中文](2026-10-15-tos-credentials.zh.md) +- Contract: [Studio creation](../../../specs/studio-mpa-creation/README.md) + +## Evidence and scope + +DeploymentResourceService receives resolved credentials, but its TOSService +constructor discards them and independently resolves credentials. Cloud BytePlus +resource listing can therefore fail before making a TOS request. CR already +consumes these credentials. No frontend, Runtime image, database, dependency, +permission or cloud-resource changes are required. + +## Requirements and design + +- FR-1: With explicit complete AK/SK, resolve the provider/region TOS endpoint + through VolcConfiguration and construct TosClientV2 with that AK/SK and session + token. Adapt its bucket response through the existing client/actual_region + shape; do not patch SDK globals or mutate process environment. +- FR-2: Without complete explicit credentials, retain the existing TOSService + resolution path. Both Volcengine and BytePlus retain endpoint resolution, + regional filtering, pagination and resource validation. +- FR-3: Route invocations resolve credentials and construct a service per request; + rotated credentials take effect on the next request. No cross-request client + cache or new retry/cancellation policy is introduced. +- FR-4: Errors remain HTTP 400/502 as appropriate; credential values are redacted + by the existing route handler. No secret persistence or response fields added. + +## Tasks and acceptance + +1. T-1: Add failing explicit-credential, rotation and redaction tests in + tests/frontend/server/test_deployment_resources.py (FR-1/3/4). +2. T-2: Adapt frontend/server/deployment_resources.py and preserve fallback; + cover both providers and existing bucket validation (FR-1/2). +3. T-3: Update paired contract and run targeted pytest, Ruff, Pyright and diff + checks. No UI changes, so frontend build/browser gates are not applicable. + +Acceptance: mocked TOS calls receive current credentials including token; +no-credential callers retain SDK fallback; existing list/validation tests pass; +SDK errors cannot expose supplied credentials. Live cloud deployment is separate +and not authorized by this code-fix request. + +## Risks and review + +The raw TOS response differs from the wrapper response: reuse _tos_buckets to +normalize it and test list/validation consumers. Keep endpoint resolution in the +SDK rather than hardcoding hosts. One request keeps one credential snapshot; +rotation during a request is not retried automatically. Rollback is code-only. + +The user approved the proposed scope with “改改”. Direct design review (review-spec +skill unavailable) confirmed scoped changes, provider compatibility, secret +handling, testability and paired-language equivalence; no blockers. Verification +is pending. No production code or tests were modified before this review. + + +## Verification (2026-10-15) + +Scope: local TOS credential handoff diff based on `8ae26a6d`. +- `pass`: regression first reproduced five failures; two fallback cases passed. +- `pass`: `uv run --extra dev pytest -q tests/frontend/server/test_deployment_resources.py` + — 38 passed, one upstream Starlette deprecation warning. All cloud calls were mocked. +- `pass`: Ruff 0.11.12 check and format on both changed Python files. +- `pass`: `uv tool run pyright --pythonpath .venv/bin/python frontend/server/deployment_resources.py tests/frontend/server/test_deployment_resources.py` + — zero errors/warnings. +- `not_applicable`: frontend assets/build/browser; no UI or HTTP shape changes. +- `not_run`: live cloud acceptance and deployment; requires running the updated + Studio service with its IAM credentials. No cloud resources were changed. + +Implementation review confirmed the existing bucket normalization and regional +validation are reused; the fallback remains unchanged. No credentials are added +to logs, persistent state or browser output. Credential refresh is covered for +successive resource-list requests, not automatic mid-request recovery. + +Submission verification on 2026-10-15: fetched origin and rebased onto the +unchanged tracking branch at `8ae26a6d`; `uv run --extra dev pre-commit run +--all-files` passed all hooks, and the targeted suite passed all 38 tests again. diff --git a/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.zh.md b/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.zh.md new file mode 100644 index 000000000..0b7960dea --- /dev/null +++ b/prd-spec/bugfixes/studio-tos-credentials/2026-10-15-tos-credentials.zh.md @@ -0,0 +1,70 @@ +# Studio TOS 凭据传递 + +- Change ID:`studio-tos-credentials` +- 日期:2026-10-15 +- 状态:implemented +- [English](2026-10-15-tos-credentials.md) +- 契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md) + +## 证据与范围 + +DeploymentResourceService 收到已解析的凭据,但 TOSService 构造时没有使用, +而是独立解析凭据,导致云端 BytePlus 资源查询可能在请求 TOS 前失败。 +CR 已使用这些凭据。不修改前端、Runtime 镜像、数据库、依赖、权限或云资源。 + +## 需求与设计 + +- FR-1:显式 AK/SK 完整时,通过 VolcConfiguration 解析 provider/region 对应 + 的 TOS endpoint,以该 AK/SK 和 session token 构造 TosClientV2。 + 适配为既有 client/actual_region 结构读取桶响应,不修改 SDK 全局状态或进程环境。 +- FR-2:没有完整显式凭据时,保留既有 TOSService 解析路径。 + 火山和 BytePlus 均保留 endpoint 解析、地域过滤、分页及资源验证。 +- FR-3:每次路由请求重新解析凭据并创建 service,轮换后的凭据在下一次请求生效。 + 不增加跨请求客户端缓存,不改变重试或取消策略。 +- FR-4:错误继续按类型返回 HTTP 400/502;既有路由处理器脱敏凭据值。 + 不增加密钥持久化或响应字段。 + +## 任务与验收 + +1. T-1:在 tests/frontend/server/test_deployment_resources.py 增加先失败的 + 显式凭据、轮换、脱敏测试(FR-1/3/4)。 +2. T-2:适配 frontend/server/deployment_resources.py 并保留回退路径,覆盖 + 两个 provider 和已有桶验证(FR-1/2)。 +3. T-3:更新双语契约,执行定向 pytest、Ruff、Pyright 和 diff 检查。 + 无 UI 改动,前端构建和浏览器检查不适用。 + +验收:模拟 TOS 调用收到当前凭据及 token;无凭据调用保留 SDK 回退; +已有列表及验证测试通过;SDK 错误不暴露传入凭据。 +真实云端部署单独验证,本次代码修复请求不授权部署。 + +## 风险与评审 + +原生 TOS 响应与封装响应不同:复用 _tos_buckets 归一化,并测试列表和验证调用方。 +endpoint 继续由 SDK 解析,不写死域名。单次请求使用一个凭据快照,不自动重试 +请求期间的凭据轮换。回滚仅涉及代码。 + +用户以“改改”批准方案。因无 review-spec 技能,直接评审确认范围、provider 兼容、 +密钥处理、可测试性及双语等价,无阻塞项。验证待执行。 +评审前未修改生产代码或测试。 + + +## 验证(2026-10-15) + +范围:基于 `8ae26a6d` 的本地 TOS 凭据传递改动。 +- `pass`:回归测试先复现五项失败,两项回退测试通过。 +- `pass`:`uv run --extra dev pytest -q tests/frontend/server/test_deployment_resources.py` + — 38 项通过,一条上游 Starlette 弃用警告。所有云调用均使用模拟。 +- `pass`:两个改动 Python 文件的 Ruff 0.11.12 check 和 format。 +- `pass`:`uv tool run pyright --pythonpath .venv/bin/python frontend/server/deployment_resources.py tests/frontend/server/test_deployment_resources.py` + — 零错误、零警告。 +- `not_applicable`:前端产物、构建和浏览器;未修改 UI 或 HTTP 结构。 +- `not_run`:真实云端验收及部署,需使用 IAM 凭据运行更新后的 Studio。 + 未修改任何云资源。 + +实现评审确认复用既有桶归一化与地域验证,回退路径不变。 +不向日志、持久化状态或浏览器输出新增凭据。 +凭据刷新覆盖连续资源列表请求,不包含请求中途自动恢复。 + +2026-10-15 提交前验证:fetch origin 并 rebase 到未变化的跟踪分支 +`8ae26a6d`;`uv run --extra dev pre-commit run --all-files` 全部钩子通过, +定向测试再次全部通过(38 项)。 diff --git a/prd-spec/features/lark-binding/2026-10-15-lark-binding.md b/prd-spec/features/lark-binding/2026-10-15-lark-binding.md new file mode 100644 index 000000000..8f61939ff --- /dev/null +++ b/prd-spec/features/lark-binding/2026-10-15-lark-binding.md @@ -0,0 +1,60 @@ +# Lark channel binding and delivery + +[中文](2026-10-15-lark-binding.zh.md) + +Date: 2026-10-15. Status: implemented; local verification complete; live rollout not performed. +User approval: implement the reviewed Studio/Runtime Lark plan without changing domestic Feishu. + +## Background and evidence +Studio exposes Feishu only; Runtime registration starts on Feishu and message clients use Feishu hosts. The IM Channel Gateway design section 3.3.2 explicitly registers Lark with adapter=lark and adapter_config.domain=https://open.larksuite.com. Its tables contradict examples on bot_name and incoming platform; preserve Feishu payload and verify Lark live before claiming release readiness. The old plugin provides domain-aware registration, not proof of deployed Gateway compatibility. + +## Goals, scope and non-goals +Enable BytePlus Lark QR/manual binding, durable retries, account management and inbound/reply delivery. Preserve existing Feishu defaults and records. No database migration, Worker protocol change, deployment, cloud resource creation or commit is authorized by this implementation task. Lark CLI user authorization inside Worker is outside the messaging binding contract. + +## Requirements and design +FR-1: Studio adds a Lark tab for BytePlus. Runtime must advertise feishuDomains containing lark and multiBotChannels containing feishu before setup is enabled. Old images display the existing upgrade error. Reuse canonical /feishu management APIs with domain=lark on new binding/manual requests; default/missing domain remains feishu. Filter account lists by persisted config.domain (missing means feishu). Always address operations by appId; preserve admin checks, no browser credential persistence, cancellation and late-response protection. +FR-2: Runtime validates domain against feishu/lark, starts and polls the selected registration host, persists domain with the durable session, rejects conflicting tenant brands for Lark authorization (domestic Feishu retains legacy tenant metadata handling) and exposes only safe brand metadata. Same-app cross-brand rebinding is rejected before provider mutations. Existing credential-equivalent registration reuse remains idempotent. +FR-3: Register Lark using adapter=lark with fixed domain=https://open.larksuite.com plus app_id/app_secret. Feishu registration payload is unchanged. Routing uses existing agent_id, Upstream and APIG. Unknown registration results retain existing uncertain/reconcile behavior, never blind retries. +FR-4: Keep storage channel=feishu for compatibility, with domain=lark as account brand. Accept lark and legacy feishu event envelopes for bound Lark bots; validate bot ownership before mapping Lark into shared Feishu execution semantics. Raw envelope/request IDs remain intact for durable dedupe and Gateway replies. Reject lark events addressed to domestic Feishu bots. Account identity, permissions and sessions stay scoped by appId/bot UUID. +FR-5: All direct message client constructors use the trusted account domain, including token, replies, cards, images/media, bot info, history and scheduled delivery. Lark uses only fixed Lark hosts; domestic read-host configuration remains unchanged. Never derive API hosts from user-supplied arbitrary URLs. + +## Affected files and tasks +T-1: Runtime schemas, binding/studio/config/messages/delivery services, message/registration clients and account-specific client consumers; regression tests. +T-2: Studio RuntimeChannels, FeishuAccounts, account reader, capabilities types, localized strings, automation provider propagation and UI tests; rebuild web assets. +T-3: Update maintained channel contracts, run affected checks and review both language versions. Runtime CHANGELOG records delivery status. + +## Design review +Direct review (review-spec unavailable): additive interfaces and backward defaults; no schema migration; fixed hosts; secrets excluded from public results; existing admin and Gateway auth retained; cross-brand rebinding fails closed; QR expiry/cancellation/uncertainty use existing lifecycle. User-approved plan covers these refinements. No design blockers for local implementation; live Gateway behavior remains an explicit verification prerequisite. + +## Tests and acceptance +AC-1/FR-1: UI tests cover BP Lark, domestic tabs, unsupported Runtime, account filtering, request payloads, cancellation and retry. +AC-2/FR-2/FR-3: Mocked registration and real SQLite store tests verify domain persistence after recreation, tenant mismatch, idempotent registration, unchanged Feishu payload and cross-brand protection. +AC-3/FR-4/FR-5: Test Gateway Lark ingress, bot validation, reply addressing, direct-client host selection and domestic regression. +Run frontend tests/build/i18n/assets and real browser simulated flows; Runtime targeted tests then make lint/make test. Record outcomes and any baseline failures. Live QR/private/group/stream/unbind smoke requires a newly deployed Runtime image and authorized test bots; simulated checks cannot prove that deployed Gateway supports Lark. + +## Risks and evidence +Gateway design tables disagree with examples; do not change domestic adapter or add undocumented required fields. Canonical storage requires consistent account-domain propagation. Release order: Runtime image then Studio. No real provider mutations; verification results follow. + +## Implementation review and verification (2026-10-15) +Scope: uncommitted Lark changes on Studio `d5f9d485` and Runtime `1aa57dc`. T-1/T-2/T-3 are implemented. Direct review checked fixed provider hosts, canonical channel compatibility, per-account identity, durable recovery, cancellation/late responses, secret handling and bilingual equivalence. Only Lark authorization adds tenant-brand rejection; domestic tenant metadata behavior is preserved. + +| Check | Outcome | Evidence | +| --- | --- | --- | +| Studio `npm --prefix frontend test` | pass | 1,389 Node tests and 116 React tests; final focused UI/account run: 85 passed. | +| Studio build, `check:i18n`, `test:webui-assets` | pass | Production assets rebuilt; 2 locales/21 namespaces; 113 files/350 asset references checked. | +| Studio proxy policy tests | pass | `uv run --extra dev pytest -q tests/test_mpa_channel_proxy_policy.py`: 6 passed. | +| Real browser with isolated fake API | pass | QR pending/success, manual binding, error/retry, old-image gating, account filtering, loading/cancellation, keyboard and 390-pixel layout; no real Bot requests. | +| Runtime targeted regression | pass | 304 channel/client/media/delivery tests; final domestic binding/service/Lark run: 82 passed. | +| New Lark regression against original Runtime HEAD | pass | Expected red baseline: 13 failures and 1 pass; current new suite: 14 passed. | +| Runtime `make lint` and complete `make test` | pass | 8,846 passed, 188 skipped, 431 warnings, 0 failed (419 seconds). Run through isolated `npm exec --yes --package @openai/codex@0.155.1 -- sh -c 'make lint && make test'`; no global installation/configuration change. | +| Runtime static checks | pass / fail (baseline) | F821/F811/F401 and new-test Ruff pass. Full changed-file Ruff has 39 findings versus baseline 40; Pyright has the same 27 baseline errors, with no new diagnostic categories/locations introduced. Full static gates are not clean. | +| Secret scan and whitespace | pass | Studio pre-commit gitleaks, Runtime working-diff gitleaks, separate untracked-source scan and `git diff --check`; no real credentials added. | +| Live Lark/Gateway E2E, PostgreSQL coverage, formal CI | not_run | Requires authorized test resources/new Runtime deployment or CI infrastructure; SQLite/fake API checks do not prove these. | +| Commit pre-commit/rebase gate | pass | User subsequently authorized local commits. Fetched remotes; Studio rebase on `upstream/main` and Runtime rebase on `origin/master` were already up to date. Studio `uv run --extra dev pre-commit run --all-files` passes all five hooks. Unrelated local lockfile deletions are excluded. No push authorized. | + +The initial full Runtime run found three domestic tenant-brand regressions and one local Codex version mismatch. The domestic guard was narrowed and its regressions passed. The repository requires Codex 0.155.1; the app binary is 0.162.0-alpha.17.2, so the final full run uses an isolated pinned tool. Skipped tests are not counted as verified behavior. Frontend-design/ui-ux-pro-max and review-spec skills were unavailable; existing UI patterns and direct design/browser review were used. Remaining release prerequisite: build/deploy the new Runtime image, then verify Lark QR/manual authorization, private/group delivery, streaming and unbind against the actual Gateway. This change does not deploy resources. + +### Subsequent live observation +The user reported “link expired” on the Lark authorization page. Runtime capabilities advertise Lark, but no completed Lark binding was observed. The failing authorization URL/session was not available for diagnosis; root cause remains unconfirmed. This local commit does not claim live QR/Gateway acceptance or resolve that report. + +Post-sync commit checks: Studio full frontend tests (1,389 Node + 116 React) and 6 proxy policy tests pass; Runtime `make lint` and 372 targeted channel/client/media/delivery tests pass. The earlier 8,846-test full Runtime result applies to the unchanged production diff. diff --git a/prd-spec/features/lark-binding/2026-10-15-lark-binding.zh.md b/prd-spec/features/lark-binding/2026-10-15-lark-binding.zh.md new file mode 100644 index 000000000..efc390558 --- /dev/null +++ b/prd-spec/features/lark-binding/2026-10-15-lark-binding.zh.md @@ -0,0 +1,60 @@ +# Lark 渠道绑定与消息投递 + +[English](2026-10-15-lark-binding.md) + +日期:2026-10-15。状态:已实现,本地验证完成,未执行线上发布。 +用户批准:按已审阅方案同时适配 Studio/Runtime,不改变国内飞书。 + +## 背景与证据 +Studio 只有飞书入口;Runtime 注册固定从飞书开始,消息客户端使用飞书域名。IM Channel Gateway 设计 3.3.2 明确要求 Lark 使用 adapter=lark、adapter_config.domain=https://open.larksuite.com。参数表与示例在 bot_name、入站 platform 上不一致;保留飞书请求,真实联调后才能判定可发布。旧插件支持域名切换,但不能证明已部署网关版本兼容。 + +## 目标、范围及非目标 +支持 BytePlus Lark 扫码/手动绑定、持久化重试、账号管理和入站/回复。保留飞书默认值和已有记录。本任务不授权数据库迁移、Worker 协议调整、部署、云资源创建或提交。Worker 内 Lark CLI 用户授权不属于消息绑定契约。 + +## 要求与设计 +FR-1:Studio 在 BytePlus 增加 Lark 页签。仅当 Runtime 声明 feishuDomains 包含 lark 且 multiBotChannels 包含 feishu 时开放配置。旧镜像使用现有升级提示。复用 /feishu 管理接口,新扫码/手动请求带 domain=lark;缺省仍为 feishu。按 config.domain 过滤列表,缺失按 feishu。操作始终携带 appId;保留管理员校验、不在浏览器持久化凭据、取消和迟到响应保护。 +FR-2:Runtime 限定 domain 为 feishu/lark,使用对应注册域名发起及轮询,持久化品牌,Lark 授权返回不匹配的租户品牌时拒绝绑定,国内飞书保留原有租户元数据处理,只公开安全品牌元数据。同 App 跨品牌重绑在外部操作前拒绝。同凭据重试保留幂等复用。 +FR-3:Lark 注册用 adapter=lark,固定 domain=https://open.larksuite.com,加 app_id/app_secret。飞书请求保持不变。沿用 agent_id、Upstream 和 APIG 路由。注册结果未知沿用 uncertain/核对流程,不盲目重试。 +FR-4:兼容保留存储 channel=feishu,以 domain=lark 区分品牌。已绑定 Lark Bot 接受 lark 及旧 feishu 事件格式;核验 Bot 后映射到共用飞书执行语义。保留原始事件/request ID 用于持久化去重和网关回复。国内 Bot 拒绝 lark 事件。账号、权限和会话仍由 appId/Bot UUID 隔离。 +FR-5:直接消息客户端始终使用已绑定账号品牌,包括 Token、回复、卡片、图片/媒体、Bot 信息、历史和定时投递。Lark 仅用固定 Lark 域名;国内读域名配置不变。不接受用户任意 URL 作为 API 域名。 + +## 文件与任务 +T-1:Runtime schema、binding/studio/config/messages/delivery、消息/注册客户端及账号客户端调用点和回归测试。 +T-2:Studio RuntimeChannels、FeishuAccounts、账号读取、能力类型、本地化、自动化入口云提供方透传及 UI 测试;重建发布资源。 +T-3:更新渠道契约,执行检查并核对双语。Runtime CHANGELOG 记录交付状态。 + +## 设计审查 +直接审查(review-spec 不可用):接口增量及兼容默认值;无迁移;固定域名;公开结果不含密钥;保留管理和网关鉴权;跨品牌拒绝;二维码过期/取消/未知结果沿用生命周期。细化内容在用户已批准范围内。本地实施无设计阻塞,网关实测仍是发布验证前提。 + +## 测试与验收 +AC-1/FR-1:UI 测试覆盖 BP Lark、国内页签、旧 Runtime、账号过滤、请求、取消及重试。 +AC-2/FR-2/FR-3:模拟注册及真实 SQLite 验证重建服务后的品牌持久化、租户不匹配、注册幂等、飞书请求不变及跨品牌保护。 +AC-3/FR-4/FR-5:验证 Lark 入站、Bot 校验、回复寻址、客户端域名及国内回归。 +执行前端测试/构建/i18n/发布资源与真实浏览器模拟;Runtime 定向测试后 make lint/make test。记录结果和基线失败。真实扫码/私聊/群聊/流式/解绑需发布新镜像及获授权测试 Bot;模拟结果不证明线上网关支持 Lark。 + +## 风险与证据 +网关表格与示例冲突,不改国内 adapter 或添加未经核实的必填字段。共用存储要求完整透传品牌。发布顺序:Runtime 镜像后 Studio。未执行真实云端写操作;验证结果如下。 + +## 实施审查与验证(2026-10-15) +范围:Studio `d5f9d485` 和 Runtime `1aa57dc` 之上的未提交 Lark 改动。T-1/T-2/T-3 已实现。直接审查覆盖固定服务域名、规范渠道兼容性、账号身份、持久化恢复、取消/迟到响应、密钥处理和双语一致性。仅 Lark 授权新增租户品牌拒绝规则,国内租户元数据行为保留。 + +| 检查 | 结果 | 证据 | +| --- | --- | --- | +| Studio `npm --prefix frontend test` | pass | 1,389 项 Node 测试和 116 项 React 测试;最终定向 UI/账号回归 85 passed。 | +| Studio build、`check:i18n`、`test:webui-assets` | pass | 已重建发布资源;2 种语言/21 个命名空间;核验 113 个文件/350 个资源引用。 | +| Studio 代理策略测试 | pass | `uv run --extra dev pytest -q tests/test_mpa_channel_proxy_policy.py`:6 passed。 | +| 真实浏览器配合隔离模拟 API | pass | 扫码等待/成功、手动绑定、失败/重试、旧镜像门控、账号过滤、加载/取消、键盘和 390 像素布局;未请求真实 Bot。 | +| Runtime 定向回归 | pass | 渠道/客户端/媒体/投递 304 项通过;最终国内绑定/服务/Lark 回归 82 passed。 | +| 新 Lark 回归对原始 Runtime HEAD | pass | 预期红灯基线:13 failed、1 passed;当前新增套件 14 passed。 | +| Runtime `make lint` 和完整 `make test` | pass | 8,846 passed、188 skipped、431 warnings、0 failed(419 秒)。使用隔离命令 `npm exec --yes --package @openai/codex@0.155.1 -- sh -c 'make lint && make test'`;未修改全局安装/配置。 | +| Runtime 静态检查 | pass / fail(基线) | F821/F811/F401 和新增测试 Ruff 通过。改动文件完整 Ruff 为 39 项、基线 40 项;Pyright 与基线同为 27 项错误,没有新增诊断类别/位置。完整静态门禁不是全绿。 | +| 密钥扫描与空白检查 | pass | Studio pre-commit gitleaks、Runtime 工作区差异 gitleaks、独立新增源码扫描和 `git diff --check`;未加入真实凭据。 | +| 真实 Lark/网关 E2E、PostgreSQL coverage、正式 CI | not_run | 需要获授权测试资源/新 Runtime 部署或 CI 环境;SQLite/模拟 API 检查不证明这些行为。 | +| 提交前 pre-commit/rebase 门禁 | pass | 用户随后授权本地提交。已 fetch 远端;Studio rebase 到 `upstream/main`、Runtime rebase 到 `origin/master` 均已是最新。Studio `uv run --extra dev pre-commit run --all-files` 五项钩子全部通过。无关的本地锁文件删除不纳入提交。未授权推送。 | + +首次完整 Runtime 回归发现三项国内租户品牌回归和一项本机 Codex 版本不匹配。已收窄国内校验并通过相关回归。仓库要求 Codex 0.155.1,应用自带版本为 0.162.0-alpha.17.2,最终全量使用隔离的固定版本。跳过项不视为已验证。frontend-design/ui-ux-pro-max 和 review-spec 技能不可用,采用现有 UI 模式及直接设计/浏览器审查。发布前仍需:构建部署新 Runtime 镜像,再针对实际网关验证 Lark 扫码/手动授权、私聊/群聊投递、流式和解绑。本次未部署资源。 + +### 后续线上观察 +用户反馈 Lark 授权页提示“链接已失效”。Runtime 能力已声明支持 Lark,但未观察到完成的 Lark 绑定。尚未取得失败授权链接/会话用于诊断,根因未确认。本次本地提交不宣称通过真实扫码/网关验收,也未解决该反馈。 + +同步后的提交检查:Studio 完整前端测试(1,389 项 Node + 116 项 React)及 6 项代理策略测试通过;Runtime `make lint` 和 372 项渠道/客户端/媒体/投递定向测试通过。生产差异未变,之前 8,846 项完整 Runtime 回归结果仍适用。 diff --git a/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.md b/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.md new file mode 100644 index 000000000..79dae5522 --- /dev/null +++ b/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.md @@ -0,0 +1,73 @@ +# Independent business PostgreSQL Workspace per new MPA + +[中文版](2026-10-13-independent-business-workspace.zh.md) + +- Change ID: `mpa-agent-pg-workspace` +- Created/revised: 2026-10-13 +- Status: implemented +- Component: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-19 +- Predecessor: [shared PG preparation](../mpa-space-scoped-resources/2026-09-23-auto-pg-workspaces.md) + +## Background and evidence + +`managed/pg_bootstrap.py` scopes both Workspaces by verified account, region and project. `service.py` pins their IDs and the business endpoint in each deployment record. Thus independent databases currently share compute and maintenance credentials. `deletion.py` reads the registry connection from the Runtime; it does not require a shared business Workspace. The MPA image consumes its injected PG connection independently of the provisioning layout. + +## Goals and non-goals + +New Studio MPA requests use one business Workspace per agent while retaining `mpa_admin_workspace/mpa_admin_db` and account/region network/APIG reuse. Existing agents and submitted tasks keep their database bindings. No migration, business-schema initialization, PG deletion, credential redesign, general-agent changes, image change, or cloud mutation belongs to this implementation. + +## Scenarios and requirements + +- FR-1: Two new agents share management resources but have distinct business Workspaces, endpoints and `mpa_agent_` databases. Both providers use their existing AIDAP adapter. +- FR-2: Retry, cancellation, uncertain creation and restart reuse the agent-scoped bootstrap identity. Do not blindly repeat uncertain purchases; retain current terminal-failure recovery. +- FR-3: Missing `businessWorkspaceMode` means the old shared request contract. New Studio requests explicitly persist `per-agent`. A submitted draft is never upgraded automatically. +- FR-4: Before a per-agent purchase, inspect existing deployment bindings in the prepared management DB. Registered shared agents retain their shared Workspace; recorded per-agent agents reuse theirs. Conflicts fail closed. Do not migrate, overwrite or delete business data. +- FR-5: Inject only that agent's business credentials into its PG settings; keep shared registry injection unchanged. Retain Workspace IDs and layout in the deployment record without secrets. +- FR-6: Keep the three-step wizard, update the database explanation, preserve manual/shared profiles and all generic-agent flows. Deletion continues retaining business PG resources. + +## Design and contract impact + +Add `managed.postgres.business-workspace-mode: shared|per-agent`, default `shared`, allowed only with automatic provisioning for public input; reject an explicitly configured business Workspace ID for per-agent mode. Add optional request/config `businessWorkspaceMode`. The built-in Studio configuration advertises `per-agent` as a capability without changing execution defaults for old requests; new forms explicitly submit it. Existing explicit CLI/YAML configuration may opt in. + +Pass stable internal `agent_id` to PG preparation. Keep management scope unchanged. Per-agent business scope hashes account/region/project plus agent ID; name is `mpa_agent_`, respecting AIDAP name limits. Reuse the bootstrap store, ownership validation, locks and readiness timeout. Prepare management DB first for per-agent mode and read registered binding under the existing registry lock; an old record without a layout marker is shared. Registered identities must match bootstrap state, scope and endpoints. Never infer ownership merely from name or accept conflicting tags. Registry/connection errors stop before purchasing a business Workspace. Management and business preparation remain under the existing bounded account bootstrap lock; no new cross-host lock guarantee is claimed. + +The existing business database provisioner receives the new maintenance URL, so database naming, markers and schema ownership remain unchanged. `bind_postgres_workspaces` pins the resolved layout as well as IDs. Runtime/session/skill/Feishu code and sibling `agentkit-mpa-agent` need no changes. Missing `openviking_users` is a separate image/schema issue. + +Security: use refreshed provider credentials; never persist PG passwords or model/OV keys in bootstrap, registry, request or docs. Existing Runtime registry credentials are unchanged, not redesigned. PG resources remain billable after cancellation/deletion until separately released by an operator. + +## Tasks and affected files + +- T-1 / FR-1,2,4: failing fake-cloud tests, `config.py`, `pg_bootstrap.py`, `service.py`, existing PG tests. +- T-2 / FR-3,5: request validation, task forwarding, config capability and frontend types/form tests; retain request fingerprints. +- T-3 / FR-6: locale copy, paired component spec/module docs, generated assets; inspect deletion without changing its scope. +- T-4: targeted/broader Python, Ruff/Pyright, frontend tests/build/i18n/assets, isolated browser checks and bilingual review. + +## Acceptance and verification + +| Requirement | Task | Acceptance | Verification | Result | +| --- | --- | --- | --- | --- | +| FR-1,2,4,5 | T-1 | AC-1: distinct new business Workspaces; same-agent retry stable; old binding retained; uncertainty never duplicates | `uv run --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py tests/integrations/mpa_managed/test_service.py` | pass | +| FR-3 | T-2 | AC-2: request mode persists through BFF/task/runner; legacy omission stays shared; resumed form does not upgrade | targeted config/routes/tasks and frontend tests | pass | +| FR-6 | T-3,4 | AC-3: compatible three-step UI, general-agent/deletion regression, synchronized docs/assets | broader managed Python, `npm --prefix frontend test`, build, i18n/assets and browser | pass | + +Tested scope: current working diff on `71175c68`, including pre-existing uncommitted OV work; date 2026-10-13. Live allocation: not_run (no isolated cloud creation authorized). Codex process smoke and harness coverage: not_applicable (contracts unchanged). Commit/push/pre-commit synchronization: not_run (not requested). + +## Risks and recovery + +Additional Workspaces increase cloud resource count and potential minimum compute cost. No migration is performed. Shared admin PG remains a control-plane failure domain. Bootstrap files/locks are local; unknown cross-host creates retain existing fail-closed recovery limitations. Independent Workspaces do not replace MPA business schema initialization. API limits and permissions remain those of the existing PG adapter. + +## Review and approval + +`review-spec` is unavailable; direct review covered boundaries, retry/cancellation, registered bindings, ownership, secrets, compatibility, testability and paired-language equivalence. No design blockers. User approved one Workspace per new MPA with “那帮我改吧” on 2026-10-13, then requested confirmation of other repository impacts. That approval covers creation/request/binding/UI adaptations; no migration or PG deletion is included. No commit, push or deployment is authorized. + +## Final implementation review and verification (2026-10-13) + +All T-1 through T-4 and AC-1 through AC-3 are complete for the isolated implementation scope. Reviewed the request-to-runner mapping, registered legacy binding preservation, agent-scoped naming/ownership, metadata uncertainty, timeouts, registry closure and retained PG deletion behavior. No blocking code/contract findings remain. + +- Regression-first: 11 new Python cases and the new frontend layout case failed before their respective implementation; final new PG suite has 15 passing tests. +- pass: `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov` — 951 passed, two workers. The full unrelated SDK suite is not_run; changes are isolated to managed MPA creation. +- pass: `npm --prefix frontend test` — 1,379 Node tests and 81 React tests; `npm --prefix frontend run build`, `npm --prefix frontend run check:i18n`, `npm --prefix frontend run test:webui-assets` (113 files, 350 references). +- pass: pinned Ruff 0.11.12 and Pyright over all 14 changed/new Python files, including preceding OV work. The local environment lacks Ruff/Pyright executables; used `uvx --from ruff==0.11.12 ruff check ` and `uvx pyright --pythonpath .venv/bin/python `, no machine-global configuration changes. +- pass: real browser with the actual React dialog and isolated simulated API, new request/legacy request mode, failure and retry, cancellation confirmation, loading/error/empty input states, keyboard Next, 390×844 window and screenshot inspection. Fixture/server/tab removed; no cloud resource created. Existing automated IME/general-agent tests remain passing; no input handlers changed. +- pass: paired-language and relative-link review, `git diff --check`, configured repository Gitleaks over the 94 changed/new files. A separate default-rule scan of generated bundles flagged a minified editor expression (`p.anchor.key`), reviewed as a vendor-code false positive; repository policy already excludes generated vendor bundles. No scan policy or hook was weakened. +- not_run: live AIDAP allocation/Runtime deployment, data migration, commit/push and pre-commit synchronization — not authorized/requested. Generated Runtime PG payloads and both cloud-provider branches were verified offline. Shared control PG and retained Workspace billing are the stated operational limitations. diff --git a/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.zh.md b/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.zh.md new file mode 100644 index 000000000..ef1a9945d --- /dev/null +++ b/prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.zh.md @@ -0,0 +1,73 @@ +# 新建 MPA 使用独立业务 PostgreSQL Workspace + +[English](2026-10-13-independent-business-workspace.md) + +- Change ID:`mpa-agent-pg-workspace` +- 创建/修订:2026-10-13 +- 状态:implemented +- 组件:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-19 +- 前置设计:[共享 PG 准备](../mpa-space-scoped-resources/2026-09-23-auto-pg-workspaces.zh.md) + +## 背景与证据 + +`managed/pg_bootstrap.py` 使用核验后的账号、地域和项目给两个 Workspace 划定范围。`service.py` 将它们的 ID 和业务连接端点固定到部署记录。独立业务库因此仍共享计算资源和维护凭据。`deletion.py` 从 Runtime 获取管理库连接,不要求业务 Workspace 共享。MPA 镜像使用注入的 PG 连接,不依赖编排布局。 + +## 目标与非目标 + +新 Studio MPA 请求每个智能体使用一个业务 Workspace,保留 `mpa_admin_workspace/mpa_admin_db` 和账号/地域级网络、APIG 复用。已有智能体和已提交任务保持数据库绑定。本次不迁移数据、不初始化业务表、不删除 PG、不重新设计凭据、不改通用智能体、不更换镜像、不执行云资源变更。 + +## 场景与需求 + +- FR-1:两个新智能体共享管理资源,但拥有不同业务 Workspace、端点和 `mpa_agent_` 数据库。两个提供商使用原有 AIDAP 适配器。 +- FR-2:重试、取消、创建结果未知和重启复用智能体范围内的引导身份。未知结果不盲目重复购买,保留现有确定终态失败恢复机制。 +- FR-3:缺少 `businessWorkspaceMode` 表示旧共享请求契约。新 Studio 请求显式持久化 `per-agent`。已提交草稿不自动升级。 +- FR-4:购买独立业务 Workspace 前,读取已准备好的管理库中的部署绑定。已有共享智能体保留共享 Workspace,已有独立智能体复用原 Workspace。冲突明确失败,不迁移、覆盖或删除业务数据。 +- FR-5:PG 设置注入该智能体自己的业务凭据,共享注册库注入保持不变。部署记录保留 Workspace ID 和布局,不记录密钥。 +- FR-6:保留三步向导,更新数据库说明,兼容手动/共享配置及通用智能体流程。删除继续保留业务 PG 资源。 + +## 设计与契约影响 + +增加 `managed.postgres.business-workspace-mode: shared|per-agent`,默认 `shared`;公开输入仅允许自动准备使用独立布局,不接受该布局下显式配置业务 Workspace ID。请求/配置增加可选 `businessWorkspaceMode`。内置 Studio 配置声明 `per-agent` 能力,但不改变旧请求的执行默认值;新表单显式提交。CLI/YAML 可显式启用。 + +向 PG 准备传入稳定内部 `agent_id`。管理范围保持不变。独立业务范围由账号/地域/项目及智能体 ID 的哈希确定,名称为 `mpa_agent_`,满足 AIDAP 名称限制。复用引导存储、归属校验、锁和就绪超时。独立模式先准备管理库,在原有注册库锁下读取已有绑定;无布局标记的旧记录视为共享。登记身份必须与引导状态、范围、端点一致。不仅凭名称判断归属,不接受冲突标签。注册库/连接错误在购买业务 Workspace 前停止。管理和业务准备仍位于有超时限制的原账号引导锁中,不宣称新增跨主机锁保证。 + +现有业务库准备器接收新的维护连接,数据库名称、标记和表结构归属不变。`bind_postgres_workspaces` 固定实际布局和 ID。Runtime/会话/技能/飞书及兄弟仓库 `agentkit-mpa-agent` 不需要修改。`openviking_users` 缺表是独立镜像/初始化问题。 + +安全:使用刷新后的提供商凭据,不向引导文件、注册记录、请求或文档写入 PG 密码及模型/OV Key。现有 Runtime 注册库凭据保持不变,本次不重构。取消/删除后 PG 仍计费,需管理员单独释放。 + +## 任务与受影响文件 + +- T-1 / FR-1,2,4:先写失败的模拟云测试,再改 `config.py`、`pg_bootstrap.py`、`service.py` 及 PG 测试。 +- T-2 / FR-3,5:请求校验、任务透传、配置能力、前端类型/表单测试;保留请求指纹。 +- T-3 / FR-6:国际化文案、双语组件契约/模块说明、构建产物;核对删除,不扩展删除范围。 +- T-4:定向/更广 Python、Ruff/Pyright、前端测试/构建/国际化/资源检查、隔离浏览器验证和双语审查。 + +## 验收与验证 + +| 需求 | 任务 | 验收 | 验证 | 结果 | +| --- | --- | --- | --- | --- | +| FR-1,2,4,5 | T-1 | AC-1:新业务 Workspace 不同;同智能体重试稳定;旧绑定保留;未知结果不重复创建 | `uv run --extra dev pytest tests/integrations/mpa_managed/test_auto_pg.py tests/integrations/mpa_managed/test_service.py` | pass | +| FR-3 | T-2 | AC-2:模式经 BFF/任务/runner 持久化;旧请求缺省为共享;恢复表单不升级 | 定向配置/路由/任务与前端测试 | pass | +| FR-6 | T-3,4 | AC-3:三步 UI 兼容、通用智能体/删除回归、文档/资源同步 | 更广 managed Python,`npm --prefix frontend test`、构建、国际化/资源及浏览器 | pass | + +验证范围:`71175c68` 上的当前工作区差异,包含先前未提交 OV 改动;日期 2026-10-13。真实云创建:not_run(未授权隔离云创建)。Codex 进程 smoke 和 harness 覆盖:not_applicable(契约未变)。提交/推送/提交前同步:not_run(未请求)。 + +## 风险与恢复 + +更多 Workspace 增加云资源数量和可能的最低计算费用。不迁移数据。共享管理 PG 仍是控制面故障域。引导文件/锁位于本地,跨主机未知创建仍遵循现有明确失败的恢复限制。独立 Workspace 不能代替 MPA 业务表初始化。API 限制和权限沿用现有 PG 适配器。 + +## 审查与批准 + +`review-spec` 不可用,已直接审查边界、重试/取消、已有绑定、归属、密钥、兼容性、可测试性和双语一致性,无设计阻塞。用户于 2026-10-13 通过“那帮我改吧”批准新 MPA 独立 Workspace,随后要求确认仓库其他影响。批准包括创建/请求/绑定/UI 适配,不包括迁移或 PG 删除。未授权提交、推送或部署。 + +## 最终实现审查与验证(2026-10-13) + +隔离实现范围内 T-1 至 T-4、AC-1 至 AC-3 已完成。已审查请求到 runner 的透传、旧登记绑定保留、智能体范围名称/归属、元数据未知状态、超时、注册库关闭及 PG 保留删除行为,无阻塞代码/契约问题。 + +- 先写回归:11 项新 Python 用例和新前端布局用例在对应实现前失败;最终新 PG 测试集 15 项通过。 +- pass:`uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov`,951 项通过,两个 worker。无关完整 SDK 测试集为 not_run,改动限定受管 MPA 创建。 +- pass:`npm --prefix frontend test`,1,379 项 Node 测试和 81 项 React 测试;`npm --prefix frontend run build`、`npm --prefix frontend run check:i18n`、`npm --prefix frontend run test:webui-assets`(113 文件、350 引用)。 +- pass:固定 Ruff 0.11.12 及 Pyright 检查所有 14 个改动/新增 Python 文件,包括前置 OV 改动。本地环境缺少 Ruff/Pyright 可执行文件,使用 `uvx --from ruff==0.11.12 ruff check ` 和 `uvx pyright --pythonpath .venv/bin/python `,未修改机器全局配置。 +- pass:实际 React 弹窗配隔离模拟 API 的真实浏览器验证,包括新/旧请求模式、失败重试、取消确认、加载/错误/空输入状态、键盘下一步、390×844 窗口及截图检查。已移除临时页面/服务/浏览器标签,没有创建云资源。原有 IME/通用智能体自动测试保持通过,未改输入处理器。 +- pass:双语及相对链接审查、`git diff --check`,按仓库 Gitleaks 配置检查 94 个改动/新增文件。额外默认规则扫描构建包命中一段压缩编辑器表达式(`p.anchor.key`),已确认为供应商代码误报;仓库策略原本排除生成的供应商包。未弱化扫描策略或 hook。 +- not_run:实际 AIDAP 分配/Runtime 部署、数据迁移、提交/推送和提交前同步,未授权/未请求。Runtime PG 部署参数及两个提供商分支已离线验证。共享控制 PG 和保留 Workspace 的费用仍是明确的运行限制。 diff --git a/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.md b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.md new file mode 100644 index 000000000..114cb38a7 --- /dev/null +++ b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.md @@ -0,0 +1,118 @@ +# BytePlus OpenViking preparation for MPA creation + +[中文版](2026-10-14-automatic-creation.zh.md) + +Change ID: `mpa-byteplus-openviking`. Created/revised: 2026-10-14. Status: implemented; live acceptance pending. + +Related contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md). +Predecessor: [Beijing automatic OV](../mpa-openviking-auto/2026-10-13-default-model-creation.md). + +## Background and evidence + +The user requests automatic OV preparation in this VeADK repository for BytePlus MPA creation. Current `managed/openviking.py`, configuration validation and service orchestration explicitly reject automatic OV outside Volcengine Beijing. The Studio dialog additionally restricts automatic mode to Volcengine. BytePlus manual URL, resource ID and API Key injection already exists. + +The supplied overseas SOP describes a personal library created with a Coding Plan model credential and the data-plane URL `https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking`. It contains a Python attachment for collection management. Attachment retrieval on 2026-10-14 was rejected for missing `drive:file:download` scope. The local path mentioned in the SOP does not contain that script. The overseas control-plane host, signing region, model identifiers, credential Source/EndpointID semantics and enterprise availability have therefore not been verified. Do not infer these from the data-plane URL or domestic settings. + +Current local `agentkit-mpa-agent` code separately uses Beijing OV administration for per-user registration/key lookup. Creating an overseas collection in VeADK alone does not prove that Runtime memory works. That repository requires its own adaptation and deployment verification. + +## Goals and non-goals + +Prepare and bind an overseas library before Runtime deployment, wait for readiness, obtain its data-plane key, and inject the existing four OV environment variables. Preserve Volcengine Beijing behavior and submitted manual requests. Initial candidate scope is BytePlus `ap-southeast-1`, subject to provider verification. + +Exclude automatic changes to `agentkit-mpa-agent`, cloud deployment, paid resource creation during development, credential publication, unrelated local changes, general-agent creation and OV deletion. Do not silently replace per-user isolation with a shared default identity. + +## Requirements and scenarios + +- FR-1: Advertise automatic OV only for explicitly verified provider/region combinations. Configuration, API, orchestration and UI must agree. An unsupported region fails before resource mutation. +- FR-2: Use deployment-account BytePlus credentials, including refreshed STS credentials where applicable, to sign verified control-plane calls. Never reuse a domestic account credential or derive a control-plane hostname by guessing. +- FR-3: Verify library edition and model credential requirements before selecting defaults. Coding Plan credentials, ordinary model inference credentials and the resulting library API Key are distinct. A missing prerequisite produces an actionable, redacted error before creating resources; no undocumented fallback is allowed. +- FR-4: Reuse existing deployment locking and durable nonsecret intent/resource bindings. Persist a returned ResourceID immediately. A later failure reuses that ID after ownership/configuration validation. A create timeout with unknown outcome does not trigger blind duplicate creation. Cancellation retains the binding and prevents subsequent steps. +- FR-5: Poll using a bounded deadline and verified provider status values. After readiness, obtain the default-user library Key and inject `OPENVIKING_URL`, `OPENVIKING_RESOURCE_ID`, `OPENVIKING_API_KEY`, and `OPENVIKING_USER`. The URL is provider-specific. Keys stay out of registry records, logs, UI responses and browser persistence. +- FR-6: New eligible Studio requests use automatic mode. Existing submitted manual tasks retain their original mode and inputs on retries. Use the existing three-step dialog and localized status/error presentation. Explain required model credentials and resource retention where applicable. +- FR-7: Domestic requests, general agents and other existing BytePlus dependencies retain their contracts. Runtime per-user memory is a separate acceptance boundary and must not be claimed as verified by collection-creation tests. + +## Proposed design and contract impact + +Add explicit provider/region endpoint and model configuration selection to the existing OV adapter after confirming provider contracts. Keep the Beijing request semantics stable. Reuse the signing helper, deployment-account source, registry lock, safe errors and progress stages. Verify the overseas Create/Get/Access response shape rather than assuming it matches Beijing. + +Extend the existing automatic availability flag and checks consistently through profile loading, request validation, service execution and the dialog. Persist each request's chosen mode. Resolve model credentials on the server with an explicit supported source; the final selection requires the overseas reference script. Any new secret setting must have validation, redaction and restart/retry semantics before implementation. + +Update the bilingual Studio MPA creation contract with the verified provider matrix, model requirements and retained-resource semantics. Existing Runtime OV variable names remain unchanged. No component spec currently promises overseas automatic creation; do not mark a proposed capability active prematurely. + +## Tasks and affected files + +1. T-1 / FR-2–3: Read the SOP attachment or equivalent authoritative overseas contract. Resolve the blocking questions below. Finalize and review this bilingual design and component contract. +2. T-2 / FR-1–5: Add failing provider/configuration/adapter/retry tests; implement in `veadk/integrations/mpa/managed/openviking.py`, `config.py`, `service.py` and related profile/credential code only as needed. +3. T-3 / FR-1,6: Update `frontend/src/ui/mpa-create/MpaCreateDialog.tsx`, corresponding API/task handling and locales if required. Add UI regressions for new versus resumed requests and unavailable prerequisites. +4. T-4 / FR-7: Run domestic and overseas offline regressions, inspect browser behavior and regenerate release assets. Reconcile operator documentation and both design/spec languages. + +## Acceptance and verification + +- AC-1: An eligible new BytePlus request reaches the verified overseas control plane, obtains a bound library, and injects the four variables. No real credential enters test fixtures. +- AC-2: Timeout, cancellation, permission rejection, readiness failure, missing model credentials and same-request retry have explicit tested outcomes, without duplicate libraries or silent success. +- AC-3: Domestic wire payloads and existing manual retry semantics remain unchanged. General-agent creation is unaffected. +- AC-4: UI eligibility matches backend behavior; errors, loading, retry, keyboard and narrow-window states remain usable. Generated frontend assets match source. +- AC-5: Documentation distinguishes offline collection provisioning from live cloud acceptance and Runtime memory integration. + +Planned commands: `uv run --extra dev pytest -n 2 tests/integrations/mpa_managed`; affected Studio server route/task tests; Ruff and Pyright on changed Python files; `npm --prefix frontend test`; `npm --prefix frontend run build`; `npm --prefix frontend run check:i18n`; `npm --prefix frontend run test:webui-assets`; scoped secret scanning. Use isolated mock services for tests. A real paid creation/read-memory smoke requires separate authorization and an explicit retention/cleanup decision. + +## Risks and blocking questions + +- What are the supported overseas control-plane host, signing region, API version and request/response fields? +- Does the overseas edition support MPA per-user registration and key retrieval? The SOP's personal-library OpenClaw example does not establish this. +- Which VLM/Embedding identifiers and credential sources are accepted? Can the existing resolved model key be used, or is a separate Coding Plan credential required? +- Which ready/failure statuses and billing/retention constraints apply? Do not copy domestic billing claims into overseas UI without evidence. +- Runtime readiness alone does not establish functional OV memory; an adapted Runtime image is required for the separate per-user path. + +## Review, approval and verification record + +The user requested this repository's implementation on 2026-10-14. Scope is authorized; unresolved provider details prevent design clearance and production/test edits. Direct review identifies edition compatibility, credential selection and provider endpoint verification as blockers. No `review-spec` skill is available; record a full direct review after resolving them. + +2026-10-14, base `2ffe6e14` plus pre-existing uncommitted changes: source inspection completed; attachment access blocked (missing `drive:file:download`); cloud validation and runtime tests `not_run` (no implementation or cloud authorization); production changes `not_run` (provider contract unverified). Existing contract relocation, OpenSpec deletion and lockfile changes are outside this task and are preserved. + + +## Supplied-script review (2026-10-14) + +The user supplied the attachment directly. It was inspected as source, not executed or copied into the repository. Confirmed script parameters: + +- Control host `vikingdb.ap-southeast-1.byteplusapi.com`, signing region `ap-southeast-1`, service `vikingdb`, version `2025-06-09`, POST path `/api/openviking/{Action}`; headers `X-Top-Service` and `X-Top-Region` plus optional STS `X-Security-Token`. +- Collection `Version=developer`. Top-level `Source=codeplan` with Coding Plan credentials; model `seed-2-0-lite` and `skylark-embedding-vision`, no `ModelVersion` or `EndpointID` in coding mode. Endpoint mode instead uses `Source=volcengine` and separately supplied endpoints for each model. +- Create returns `ResourceID`; poll Get for `READY`/`FAILED`; Access key body contains `ResourceID` only (no `UserID`); default is the returned user. Response parsing accepts `Result` or `result`. +- The script explicitly states that developer libraries reject user registration. Data calls require `Authorization: Bearer` and `x-tt-env: pre`. Current Runtime code does not implement that contract. + +This resolves the script-access and control-plane parameter blockers, but introduces a material edition/isolation decision: implement developer-library provisioning for later Runtime adaptation, or preserve enterprise per-user isolation and obtain a supported overseas enterprise contract first. The user was asked to choose; no default-identity fallback is authorized. Implementation and production tests remain pending that decision. Neither script inspection nor a successful collection create proves Runtime compatibility. + +## Approved implementation decision + +On 2026-10-14 the user approved developer-library provisioning in this repository and separate Runtime adaptation before live memory integration. This supersedes the pending edition decision above. Implement BytePlus ap-southeast-1 only, Source=codeplan and the supplied model names; obtain its dedicated Coding Plan key from server environment `OV_MODEL_API_KEY`, never from the ordinary MPA model key. Missing/invalid keys fail before any cloud resource mutation. New BytePlus Studio requests advertise auto mode; submitted manual requests remain manual. Reuse all current intent, ownership, timeout and cancellation guarantees. Default-user key access omits UserID. Preserve the four existing Runtime variables; do not invent unsupported Runtime settings. The UI explains personal edition/default user, the server credential prerequisite and the separate Runtime integration requirement. Do not claim overseas billing specifics. Retain libraries after cancellation/deletion. + +Implement the exact reference signing headers/path in a BytePlus-only helper, without changing the shared signing utility or Beijing adapter. Cover canonical signing and STS with deterministic offline tests. Validate readback fields required by the selected request; BytePlus does not require ModelVersion or EndpointID, while Beijing still does. Accept the reference's Result/result envelopes for BytePlus only, and reject explicit failure/invalid resource IDs. No automatic retry of uncertain Create responses. + +Direct design review: provider boundary, credential separation, personal-edition isolation, existing manual recovery, secret handling, startup lazy imports, error propagation, tests and bilingual parity reviewed. Blocking decisions resolved; status approved. No cloud operation, commit or push is authorized by this design. + +## Implementation and verification (2026-10-14) + +Implemented the approved developer-only scope. The adapter uses a separate lazy-imported BytePlus signing transport, the reference request path/headers and model names; Beijing still uses the existing signer and request schema. Profile capability and the existing dialog now support new BytePlus automatic requests. Model keys resolve only from the server environment, before cloud construction in direct provisioning and before task submission in Studio validation. No new browser secret field or shared-identity Runtime fallback was introduced. The four existing variables are prepared for the separately adapted Runtime. + +Tested diff: this feature on `2ffe6e14`, preserving pre-existing local contracts relocation, OpenSpec deletion and lockfile edits. Review covered provider scope, exact canonical signing with/without STS, lowercase response envelopes, no explicit UserID for personal libraries, explicit failure handling, secret exclusion, ownership/readback, ambiguous create outcomes, cancellation/retry and old manual tasks. The underlying cloud calls were mocked throughout. + +| Check | Result | Scope | +| --- | --- | --- | +| Test-first Python | pass | Seven new regressions failed before implementation; BytePlus adapter/config/retry. | +| Targeted Python | pass | 12 tests, including later-added STS signing, cancellation and no-mutation missing-key checks. | +| Managed creation + startup regression | pass | 987 tests with two workers. | +| Studio API/RBAC regression | pass | 205 tests: Runtime profile routes and Studio RBAC; two workers. | +| Frontend tests | pass | 1,389 Node tests and 96 React tests. The first UI attempt used the wrong working directory; the subsequent repository npm command passed all cases. The new automatic-mode case failed before the UI fix. | +| Ruff 0.11.12 check/format and Pyright | pass | Six changed Python source/test files; Pyright 0 errors/warnings. | +| Build, i18n and release references | pass | Both frontend targets built; 2 locales/21 namespaces; 113 packaged files/350 references. | +| Browser | pass | Actual dialog and mocked HTTP: overseas automatic mode, no manual fields, visible missing-key error, same-request retry, narrow viewport, Escape, old manual recovery and Beijing copy. Temporary fixture files/server removed. | +| Wheel | pass | Built locally; exact new adapter bytes present in wheel. No publication. | +| Scoped secret scan | pass | Changed/new source, docs, tests and generated assets; no findings. | +| Real cloud / Runtime OV memory | not_run | No paid resource creation authorized. Personal default-user/Bearer/pre routing remains another repository's work. | +| Full repository pytest/pre-commit | not_run | No commit requested. Targeted integration and full frontend gates cover this provider extension; no unrelated source changes. | +| Harness/sidecar smoke | not_applicable | No harness, worker or sidecar protocol changes. | + +AC-1–AC-5 have offline implementation evidence; live collection response details, account entitlement and memory remain unverified. User accepted Runtime adaptation as separate scope. No commit or push performed. + + +Credential decision superseded by [API Key + endpoints](2026-10-14-inference-endpoints.md). diff --git a/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.zh.md b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.zh.md new file mode 100644 index 000000000..8aee3f2ad --- /dev/null +++ b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.zh.md @@ -0,0 +1,118 @@ +# BytePlus MPA 创建中的 OpenViking 自动准备 + +[English](2026-10-14-automatic-creation.md) + +变更 ID:`mpa-byteplus-openviking`。创建/修订:2026-10-14。状态:implemented;云端验收待进行。 + +相关契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md)。 +前置设计:[北京自动 OV](../mpa-openviking-auto/2026-10-13-default-model-creation.zh.md)。 + +## 背景与证据 + +用户要求在本 VeADK 仓库为 BytePlus MPA 创建补齐自动准备 OV。目前 `managed/openviking.py`、配置校验和服务编排都明确拒绝火山北京以外的自动 OV。Studio 弹窗也将自动模式限定为火山。BytePlus 已支持手动注入 URL、资源 ID 和 API Key。 + +用户提供的海外 SOP 描述了使用 Coding Plan 模型凭据创建个人版库,数据面地址为 `https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking`。文档附有库管理 Python 脚本。2026-10-14 下载附件因缺少 `drive:file:download` 权限被拒绝;文档所述本地路径没有该脚本。因此海外控制面地址、签名地域、模型标识、凭据 Source/EndpointID 语义及企业版可用性尚未确认,不能根据数据面地址或国内配置推断。 + +本地 `agentkit-mpa-agent` 代码的用户注册和取 Key 仍使用北京 OV 管理接口。仅在 VeADK 中创建海外库不能证明 Runtime 记忆可用;该仓库需要单独适配和部署验证。 + +## 目标与非目标 + +在部署 Runtime 前创建并绑定海外库,等待就绪、获取数据面 Key,注入已有的四个 OV 环境变量。保留火山北京行为和已提交的手动请求。首期候选范围为 BytePlus `ap-southeast-1`,须以接口核实结果为准。 + +不包含自动修改 `agentkit-mpa-agent`、云端部署、开发过程中的付费资源创建、凭据发布、无关本地改动、通用智能体创建及 OV 删除。不得静默将按用户隔离替换成共享 default 身份。 + +## 需求与场景 + +- FR-1:仅向明确验证过的云厂商/地域组合开放自动 OV;配置、API、编排及 UI 必须一致。不支持的地域在资源变更前报错。 +- FR-2:使用部署账号的 BytePlus 凭据签名已核实的控制面调用,适用时刷新 STS。不得复用国内账号凭据或猜测控制面域名。 +- FR-3:选择默认值前核实库版本及模型凭据要求。Coding Plan 凭据、普通模型推理凭据和建库返回的库 API Key 是不同类型。缺少前置条件时,在创建资源前给出可操作、脱敏的错误,不采用未经文档确认的回退。 +- FR-4:复用部署锁及持久化的非敏感意图/资源绑定。返回 ResourceID 后立即保存。后续失败重试先校验归属和配置,再复用原 ID。创建超时、结果不确定时不盲目重复建库。取消保留绑定并阻止后续步骤。 +- FR-5:按已核实的状态值和有界截止时间轮询。就绪后取得 default 用户的库 Key,注入 `OPENVIKING_URL`、`OPENVIKING_RESOURCE_ID`、`OPENVIKING_API_KEY`、`OPENVIKING_USER`。URL 按云厂商区分。Key 不进入注册库、日志、UI 响应或浏览器持久化存储。 +- FR-6:新的符合条件的 Studio 请求使用自动模式;已提交的手动任务重试保留原模式及输入。沿用三步弹窗及本地化状态/错误展示,适用时说明模型凭据前置要求及资源保留行为。 +- FR-7:国内请求、通用智能体及其他已有 BytePlus 依赖保持契约。Runtime 按用户使用记忆是独立验收边界,不得通过建库测试声称其已验证。 + +## 拟议设计与契约影响 + +确认接口契约后,在现有 OV 适配器增加显式的云厂商/地域端点及模型配置选择,保持北京请求语义。复用签名辅助函数、部署账号凭据来源、注册库锁、安全错误和进度阶段。核实海外 Create/Get/Access 响应结构,不假定与北京一致。 + +统一扩展配置加载、请求校验、服务执行和弹窗的自动可用性标识及检查,并持久化每次请求选择的模式。模型凭据在服务端按明确支持的来源解析,最终选取方式需参考海外脚本;如增加密钥配置,实施前必须明确校验、脱敏、重启及重试语义。 + +更新 Studio MPA 创建双语契约,记录已核实的云厂商支持矩阵、模型要求及资源保留语义。现有 Runtime OV 环境变量名称保持不变。当前组件规格没有承诺海外自动创建,不得提前将拟议能力标为已生效。 + +## 任务与涉及文件 + +1. T-1 / FR-2–3:读取 SOP 附件或等效的权威海外契约,解决以下阻塞问题,完成并评审双语设计和组件契约。 +2. T-2 / FR-1–5:先补失败的云厂商/配置/适配器/重试测试,再修改 `veadk/integrations/mpa/managed/openviking.py`、`config.py`、`service.py`,按需调整配置及凭据代码。 +3. T-3 / FR-1,6:修改 `frontend/src/ui/mpa-create/MpaCreateDialog.tsx`,按需更新 API/任务处理和本地化文案,覆盖新请求、恢复请求和缺少前置条件的 UI 回归。 +4. T-4 / FR-7:执行国内与海外离线回归、浏览器检查并重新构建发布产物,同步操作文档和双语设计/规格。 + +## 验收与验证 + +- AC-1:符合条件的新 BytePlus 请求调用已核实的海外控制面,取得绑定库并注入四个变量;测试数据不含真实凭据。 +- AC-2:超时、取消、权限拒绝、就绪失败、缺少模型凭据和同请求重试均有明确测试结果,不重复建库、不静默成功。 +- AC-3:国内线上请求体和已有手动重试语义保持不变,不影响通用智能体创建。 +- AC-4:UI 可用性与后端一致;错误、加载、重试、键盘和窄窗口可用;前端产物与源码一致。 +- AC-5:文档明确区分离线建库编排、云端实测和 Runtime 记忆集成。 + +计划命令:`uv run --extra dev pytest -n 2 tests/integrations/mpa_managed`;受影响的 Studio 服务端路由/任务测试;修改 Python 文件的 Ruff 和 Pyright;`npm --prefix frontend test`;`npm --prefix frontend run build`;`npm --prefix frontend run check:i18n`;`npm --prefix frontend run test:webui-assets`;限定范围密钥扫描。测试使用隔离的模拟服务。真实付费建库/读取记忆冒烟需要单独授权,并明确资源保留或清理方式。 + +## 风险与阻塞问题 + +- 海外支持的控制面地址、签名地域、API 版本及请求/响应字段是什么? +- 海外库版本是否支持 MPA 按用户注册和取 Key?SOP 中个人库的 OpenClaw 示例不能证明这一点。 +- VLM/Embedding 接受哪些标识及凭据来源?已有模型 Key 能否复用,还是必须单独提供 Coding Plan 凭据? +- 就绪/失败状态及计费、保留约束是什么?未经核实不得将国内计费说明直接用于海外 UI。 +- Runtime 就绪不等于 OV 记忆可用;独立的按用户路径需要适配后的 Runtime 镜像。 + +## 评审、授权与验证记录 + +用户在 2026-10-14 要求实施本仓库适配,范围已授权;未解决的接口细节阻止设计通过及生产代码/测试修改。直接评审认定库版本兼容性、凭据选择和云端端点核实为阻塞项。没有可用的 `review-spec` 技能,解决后记录完整直接评审。 + +2026-10-14,基于 `2ffe6e14` 及原有未提交修改:源码检查完成;附件读取 blocked(缺少 `drive:file:download`);云端验证与运行测试 `not_run`(尚未实施、未授权云操作);生产代码修改 `not_run`(云端契约未核实)。已有 contracts 迁移、OpenSpec 删除和 lockfile 修改属于其他任务,予以保留。 + + +## 用户提供脚本的评审(2026-10-14) + +用户直接提供了附件,已按源码阅读,没有执行或复制进仓库。脚本确认的参数如下: + +- 控制面域名 `vikingdb.ap-southeast-1.byteplusapi.com`、签名地域 `ap-southeast-1`、服务 `vikingdb`、版本 `2025-06-09`、POST 路径 `/api/openviking/{Action}`;头包含 `X-Top-Service`、`X-Top-Region`,以及可选 STS `X-Security-Token`。 +- 库为 `Version=developer`。Coding Plan 凭据使用顶层 `Source=codeplan`;模型为 `seed-2-0-lite` 和 `skylark-embedding-vision`,coding 模式不带 `ModelVersion` 或 `EndpointID`。endpoint 模式改用 `Source=volcengine`,分别指定两个模型的接入点。 +- Create 返回 `ResourceID`;Get 轮询 `READY`/`FAILED`;取 Key 请求体只有 `ResourceID`(不带 `UserID`),返回 default 用户;响应兼容 `Result` 和 `result`。 +- 脚本明确说明个人版拒绝用户注册;数据面要求 `Authorization: Bearer` 和 `x-tt-env: pre`。当前 Runtime 代码没有实现此契约。 + +脚本读取及控制面参数阻塞已解除,但出现影响隔离方式的版本决策:先实施个人库准备、后续适配 Runtime,还是保留企业版按用户隔离、先取得支持的海外企业版契约。已请用户选择,尚未授权回退到 default 共享身份。实现和生产测试等待该决策。阅读脚本或建库成功均不证明 Runtime 兼容性。 + +## 已批准的实施决定 + +2026-10-14 用户批准本仓库接入个人版自动建库,Runtime 单独适配后再联调。本节替代前文待定的版本决策。仅实施 BytePlus ap-southeast-1,Source=codeplan 并使用脚本给出的模型名;专用 Coding Plan Key 从服务端环境变量 `OV_MODEL_API_KEY` 读取,不使用普通 MPA 模型 Key。缺少或无效时在任何云资源变更前失败。新的 BytePlus Studio 请求开放 auto,已提交的手动请求保持手动。复用现有意图、归属、超时及取消保证。取 default Key 不传 UserID。保留四个已有 Runtime 变量,不添加没有消费者的 Runtime 配置。UI 说明个人版/default 用户、服务端凭据前置条件和 Runtime 独立联调要求,不声称未经确认的海外计费细节。取消/删除后保留库。 + +BytePlus 专用辅助模块按参考脚本的签名头和路径实现,不修改共享签名工具或北京适配器。用确定性离线测试覆盖规范签名及 STS。按选定请求校验回读字段:BytePlus 不要求 ModelVersion/EndpointID,北京仍要求。仅 BytePlus 接受参考的 Result/result 响应结构,拒绝显式失败及无效资源 ID。Create 结果不确定时不自动重试。 + +直接设计评审已检查云厂商边界、凭据分离、个人版隔离限制、已有手动恢复、密钥处理、启动延迟导入、错误传播、测试及双语一致性。阻塞决策已解决,状态 approved。本设计不授权云操作、提交或推送。 + +## 实施与验证(2026-10-14) + +已实现批准的仅个人版范围。适配器使用独立且延迟导入的 BytePlus 签名传输、脚本给出的路径/请求头及模型名;北京继续使用现有签名函数和请求结构。配置能力和已有弹窗支持新的 BytePlus 自动请求。模型 Key 仅从服务端环境解析,直接部署在构造云客户端前检查,Studio 则在任务提交前校验。没有增加浏览器密钥字段,也没有让 Runtime 回退到共享身份。四个已有变量供另行适配后的 Runtime 使用。 + +验证范围:基于 `2ffe6e14` 的本次功能,保留原有 contracts 迁移、OpenSpec 删除及 lockfile 修改。评审覆盖云厂商范围、带/不带 STS 的精确规范签名、小写响应结构、个人库不显式传 UserID、显式失败处理、密钥排除、归属/回读、创建结果不确定、取消重试及旧手动任务。云端调用全部使用模拟。 + +| 检查 | 结果 | 范围 | +| --- | --- | --- | +| Python 测试先行 | pass | 实施前 7 个新回归失败,覆盖 BytePlus 适配器/配置/重试。 | +| Python 定向测试 | pass | 12 项,包含后续新增的 STS 签名、取消及缺少 Key 不变更资源检查。 | +| 托管创建及启动回归 | pass | 双 worker,987 项。 | +| Studio API/RBAC 回归 | pass | 双 worker,Runtime Profile 路由与 Studio RBAC 共 205 项。 | +| 前端测试 | pass | 1,389 项 Node、96 项 React。首次 UI 命令工作目录错误,随后使用仓库 npm 命令全部通过;新的自动模式用例在修复 UI 前失败。 | +| Ruff 0.11.12 检查/格式及 Pyright | pass | 6 个修改的 Python 源码/测试文件;Pyright 0 错误/警告。 | +| 构建、国际化及发布引用 | pass | 两个前端目标完成构建;2 语言/21 命名空间;113 个打包文件/350 个引用。 | +| 浏览器 | pass | 真实弹窗、模拟 HTTP:海外自动模式、无手动字段、缺少 Key 错误可见、同请求重试、窄屏、Escape、旧手动恢复及北京文案。已移除临时文件及服务器。 | +| Wheel | pass | 本地构建,包含与源码字节一致的新适配器,没有发布。 | +| 限定范围密钥扫描 | pass | 修改/新增的源码、文档、测试及产物,无发现。 | +| 真实云端/Runtime OV 记忆 | not_run | 未授权创建付费资源,个人版 default 用户/Bearer/pre 路由仍属于另一仓库的工作。 | +| 全仓 pytest/pre-commit | not_run | 未要求提交;本次云厂商扩展由定向集成及完整前端检查覆盖,没有修改无关源码。 | +| Harness/sidecar 冒烟 | not_applicable | 未改变 harness、worker 或 sidecar 协议。 | + +AC-1–AC-5 已有离线实现证据,真实库响应细节、账号权益和记忆功能仍未验证。用户同意 Runtime 适配作为独立范围。未提交或推送。 + + +凭据决策已由以下设计替代:[API Key + endpoints](2026-10-14-inference-endpoints.zh.md). diff --git a/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.md b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.md new file mode 100644 index 000000000..22980a769 --- /dev/null +++ b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.md @@ -0,0 +1,57 @@ +# BytePlus OV inference credentials + +[中文版](2026-10-14-inference-endpoints.zh.md) + +Change ID: `mpa-byteplus-ov-inference-endpoints`. Date: 2026-10-14. Status: implemented; live acceptance pending. +Predecessor: [automatic creation](2026-10-14-automatic-creation.md). +Contract: [CON-18](../../../specs/studio-mpa-creation/README.md). + +## Background and approved scope + +The supplied overseas script supports ordinary inference credentials with `Source=volcengine`, `ApiKey`, and an `EndpointID` for each model. The initial local integration implemented only Coding Plan. The user explicitly requests removing Coding Plan and using ordinary API Key plus inference endpoints; the user also requests trying the domestic endpoint identifiers as overseas defaults. This approval replaces the predecessor's credential decision, not its personal-edition or separate Runtime-adaptation scope. + +## Goals, scenarios and requirements + +- FR-1: BytePlus automatic creation reuses the ordinary model key resolved by the existing MPA creation pipeline, including deployment-credential discovery. Do not read `OV_MODEL_API_KEY`, add a browser secret, or fall back to Coding Plan/AgentPlan. +- FR-2: Create a developer library with top-level and per-model `Source=volcengine`. Keep overseas model names `seed-2-0-lite` and `skylark-embedding-vision`; omit ModelVersion. Default EndpointID values are `doubao-seed-2-0-lite-260428` and `doubao-embedding-vision-251215`, explicitly requested for trial, not verified overseas. Server `OV_VLM_ENDPOINT_ID` and `OV_EMBEDDING_ENDPOINT_ID` override them. Each must be 1–128 ASCII letters, digits, hyphens, underscores or periods, starting with a letter/digit. Explicit blank or invalid values fail before cloud mutation, without echoing the value. +- FR-3: Save nonsecret Source/EndpointID in the existing OV intent. Retries with changed endpoints or a prior Coding Plan intent fail as configuration conflicts without creating or altering another library. Previously missing-key failures without an OV intent can retry. Unknown create outcomes, cancellation, retention, locking and readback validation remain unchanged. +- FR-4: Keep domestic model parameters, submitted manual requests, normal agents and four OV Runtime variables unchanged. Do not create model endpoints or change Runtime memory code. +- FR-5: Update localized UI and bilingual instructions to explain reuse of inference credentials and configurable endpoints, removing the Coding Plan prerequisite. Preserve layout and interactions. + +## Design, affected files and tasks + +T-1 (FR-1/2): Replace the dedicated key resolver in managed/openviking.py with a nonsecret endpoint resolver; config.py validates endpoints, service.py captures them before mutation and passes them to ensure_openviking, which uses the existing resolved model key. Optional keyword arguments preserve domestic callers. +T-2 (FR-3/4): Retain intent comparison and strict Get readback. Do not migrate existing Coding Plan libraries; their source cannot be silently changed. Only current-process endpoint choices are captured; a restart with changed configuration fails safely against a recorded intent. +T-3 (FR-5): Update locale strings, managed README pair, frontend README, CON-18 pair and generated web assets. +T-4: Test first, run managed/startup and UI regressions, Ruff/Pyright, build/i18n/assets checks, browser verification and secret scanning. No live cloud side effects during tests. + +## Review and acceptance + +User approval: explicit request to replace Coding Plan and follow domestic endpoint defaults, 2026-10-14. Direct design review (review-spec unavailable): scope, script schema, credential separation, safe failures, retry compatibility and bilingual equivalence reviewed; no design blockers. Resource IDs, secrets and account entitlements are not inferred. + +- AC-1: With no OV_MODEL_API_KEY, default BytePlus auto configuration succeeds; the created request contains the resolved ordinary key and both endpoints. Existing domestic regression remains passing. +- AC-2: Override, blank/malformed endpoints, changed endpoint retry, prior Coding Plan intent, remote endpoint mismatch, cancellation and ambiguous creation are covered; errors and registry never contain model keys. +- AC-3: UI no longer asks for Coding Plan; tests/build and focused browser verification pass. No new inputs, IME or keyboard behavior changes. +- AC-4: Both document languages, contract and generated assets agree; record actual checks and unverified live scope below. + +## Risks and verification record + +The requested default endpoint identifiers may not exist or be callable with the overseas account's key. Provider rejection must remain an explicit error; operators can set actual endpoints and retry only when no conflicting library was created. This implementation does not prove Runtime personal-user or overseas data-plane support. Live provisioning/memory tests are not_run: no cloud creation authorized for this code change and Runtime adaptation is separate. Commit/push are outside this request. + +2026-10-14: implementation checks pending; scope is the current uncommitted BytePlus OV diff on this branch. Existing unrelated contract relocation, OpenSpec deletion and lockfile edits are preserved. + +## Verification results (2026-10-14) + +Tested scope: current uncommitted BytePlus OV change based on `2ffe6e14`; no commit, push or cloud deployment. + +- pass: test-first OV regression reproduced 14 failures before implementation; after implementation OV-targeted tests passed (52). +- pass: `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` — 1,004 passed, 4 warnings. Two workers match repository guidance. The initial added service test used an incorrect Profile constructor and domestic network fixtures; corrected those test fixtures, then reran the complete affected suite successfully. +- pass: `npm --prefix frontend test` — 1,389 Node and 96 React tests. +- pass: Ruff 0.11.12 check/format on five changed Python files; Pyright with `.venv/bin/python` — 0 errors/warnings. +- pass: `npm --prefix frontend run build`, `run check:i18n` (2 locales/21 namespaces), `run test:webui-assets` (113 files/350 references), `git diff --check`. +- pass: real Chromium using the actual dialog and mocked API responses: ordinary-key wording, no Coding Plan prerequisite, no manual secret fields, explicit endpoint error, same-request retry, manual recovery, domestic copy, Escape, and 390px viewport. The first temporary fixture omitted component theme imports; corrected the fixture and repeated the browser check. Temporary pages and their isolated Vite server are removed after checking. +- pass: bilingual requirement identifiers/local links; existing unrelated lockfile hash unchanged. +- not_run: full repository Python suite and all-files pre-commit because scope is the MPA integration and locale copy, no commit requested; affected regression and full frontend gates run instead. Harness/Codex smoke not_applicable: runtime/sidecar contracts unchanged. +- not_run: live overseas endpoint invocation, paid library creation and Runtime memory integration. Do not infer overseas validity of the requested default EndpointIDs from offline success. + +- pass: `uv run --extra dev pre-commit run gitleaks --files ` — source, tests, documents and built assets; no secrets detected. diff --git a/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.zh.md b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.zh.md new file mode 100644 index 000000000..9afc5db43 --- /dev/null +++ b/prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.zh.md @@ -0,0 +1,57 @@ +# BytePlus OV 推理凭据 + +[English](2026-10-14-inference-endpoints.md) + +变更 ID:`mpa-byteplus-ov-inference-endpoints`。日期:2026-10-14。状态:implemented;真实联调待验证。 +前置设计:[自动创建](2026-10-14-automatic-creation.zh.md)。 +契约:[CON-18](../../../specs/studio-mpa-creation/README.zh.md)。 + +## 背景与批准范围 + +用户提供的海外脚本支持普通推理凭据,每个模型传 `Source=volcengine`、`ApiKey` 和 `EndpointID`。初次本地接入只实现 Coding Plan。用户明确要求取消 Coding Plan,改用普通 API Key 加推理接入点,并要求先使用国内接入点标识作为海外默认值尝试。本次批准替代前置设计的凭据决策,个人版及 Runtime 单独适配范围不变。 + +## 目标、场景与要求 + +- FR-1:BytePlus 自动创建复用已有 MPA 创建流程解析的普通模型 Key,包括通过部署凭据发现。不读取 `OV_MODEL_API_KEY`,不新增浏览器密钥,不回退到 Coding Plan/AgentPlan。 +- FR-2:创建个人版库,顶层及模型凭据均使用 `Source=volcengine`。保留海外模型名 `seed-2-0-lite` 和 `skylark-embedding-vision`,不传 ModelVersion。EndpointID 默认值为 `doubao-seed-2-0-lite-260428` 和 `doubao-embedding-vision-251215`;这是用户指定的试用值,尚未在海外验证。服务端 `OV_VLM_ENDPOINT_ID` 和 `OV_EMBEDDING_ENDPOINT_ID` 可覆盖。每项须为 1–128 位 ASCII 字母、数字、连字符、下划线或点,且以字母或数字开头。显式空值或非法值在云资源变更前失败,错误不回显输入值。 +- FR-3:在现有 OV 意图中保存非密钥 Source/EndpointID。重试时接入点改变或已有 Coding Plan 意图,按配置冲突失败,不另建或修改库。此前仅缺少 Key、尚未记录 OV 意图的失败可以重试。创建结果未知、取消、保留资源、锁和回读校验保持不变。 +- FR-4:国内模型参数、已提交手动任务、通用智能体及四个 OV Runtime 变量保持不变。不创建模型接入点,不修改 Runtime 记忆代码。 +- FR-5:更新本地化界面和双语说明,解释复用推理凭据与可配置接入点,移除 Coding Plan 前置要求。布局和交互不变。 + +## 设计、影响文件与任务 + +T-1(FR-1/2):managed/openviking.py 的专用 Key 解析替换为非密钥接入点解析;config.py 校验接入点,service.py 在变更资源前捕获并传入 ensure_openviking,使用已有流程取得的普通模型 Key。新增可选关键字参数兼容国内调用方。 +T-2(FR-3/4):保留意图比较和严格 Get 回读。不迁移已有 Coding Plan 库,其来源不能静默修改。仅捕获当前进程的接入点选择;重启后配置改变,与已记录意图不一致时安全失败。 +T-3(FR-5):更新语言包、managed README 双语、frontend README、CON-18 双语及生成的网页产物。 +T-4:先测试,再运行 managed/startup 和前端回归、Ruff/Pyright、构建/国际化/产物检查、浏览器验证和密钥扫描。测试不产生真实云端副作用。 + +## 评审与验收 + +用户批准:2026-10-14 明确要求取消 Coding Plan 并沿用国内接入点默认值。直接设计评审(review-spec 不可用):已审查范围、脚本参数、凭据区分、安全失败、重试兼容及双语一致性,无设计阻塞。不推测资源 ID、密钥或账号权限。 + +- AC-1:没有 OV_MODEL_API_KEY 时,默认 BytePlus auto 配置成功;创建请求包含解析后的普通 Key 及两个接入点。国内既有回归保持通过。 +- AC-2:覆盖覆盖值、空/非法接入点、改变接入点后的重试、旧 Coding Plan 意图、远端接入点不符、取消及创建结果未知;错误及注册库不含模型 Key。 +- AC-3:界面不再要求 Coding Plan;测试/构建及定向浏览器验证通过。无新增输入项,不改变 IME 或键盘行为。 +- AC-4:双语文档、契约及生成产物一致;在下方记录实际检查及未验证的云端范围。 + +## 风险与验证记录 + +用户指定的默认接入点可能在海外账号不存在或该 Key 无权调用。服务端拒绝须明确报错;管理员可配置实际接入点,并仅在未创建冲突库时重试。本实现不证明 Runtime 支持个人用户和海外数据面。真实建库/记忆测试为 not_run:本次代码变更未授权云端创建,Runtime 适配是独立任务。提交/推送不在本次范围内。 + +2026-10-14:实现检查待执行;范围为当前分支未提交的 BytePlus OV 改动。保留无关的 contracts 迁移、OpenSpec 删除及 lockfile 修改。 + +## 验证结果(2026-10-14) + +验证范围:基于 `2ffe6e14` 的当前未提交 BytePlus OV 修改;未提交、推送或部署云资源。 + +- pass:先写 OV 回归,实施前复现 14 项失败;实施后 OV 定向测试 52 项通过。 +- pass:`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/cli/test_studio_startup_imports.py` — 1,004 项通过、4 项警告。按仓库建议使用两个 worker。新增 service 测试最初使用了错误的 Profile 构造方式和国内网络夹具;修正测试夹具后,完整受影响套件重跑通过。 +- pass:`npm --prefix frontend test` — 1,389 项 Node 与 96 项 React 测试。 +- pass:五个改动 Python 文件的 Ruff 0.11.12 检查/格式,以及使用 `.venv/bin/python` 的 Pyright — 0 错误/警告。 +- pass:`npm --prefix frontend run build`、`run check:i18n`(2 个语言/21 个命名空间)、`run test:webui-assets`(113 个文件/350 个引用)、`git diff --check`。 +- pass:真实 Chromium 加载实际弹窗,API 响应为模拟:普通 Key 文案、无 Coding Plan 要求、无手填密钥字段、接入点错误、同请求重试、旧手动恢复、国内文案、Escape 和 390px 视口。首次临时夹具漏导入组件主题;补齐夹具后重新执行浏览器检查。检查后移除临时页面及独立 Vite 服务。 +- pass:双语需求标识/相对链接检查;已有无关 lockfile 哈希未变化。 +- not_run:全仓库 Python 及 all-files pre-commit,因为范围是 MPA 集成及文案、没有提交请求;执行了受影响回归及完整前端门禁。Harness/Codex smoke 为 not_applicable:未改变 runtime/sidecar 契约。 +- not_run:真实海外接入点调用、付费库创建及 Runtime 记忆联调。离线通过不能证明用户指定的默认 EndpointID 在海外有效。 + +- pass:`uv run --extra dev pre-commit run gitleaks --files ` — 覆盖源码、测试、文档及构建产物,未检测到密钥。 diff --git a/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.md b/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.md new file mode 100644 index 000000000..df716aadb --- /dev/null +++ b/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.md @@ -0,0 +1,70 @@ +# MPA creation maximum instances and highlighted errors + +[中文版](2026-10-13-max-instance-input.zh.md) + +- Change ID: `mpa-create-scaling` +- Created/revised: 2026-10-13 +- Status: implemented +- Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-21 + +## Evidence and scope + +The basic information step exposes name/description only. Managed Runtime settings already support `max_instance` and map it to AgentKit `MaxInstance`; the built-in profile currently selects 1. Request/task/runner inputs have no per-creation maximum. Name availability errors render as ordinary body paragraphs, so they lack the existing red error-container emphasis. + +FR-1: Highlight the existing name-conflict message using the same danger/soft Alert as Studio confirmations; preserve the exact localized message and alert semantics. Reuse the component through public props, without a separate CSS/icon system. +FR-2: Add an editable numeric “Maximum instances” field in basic information. Fresh forms and new editable drafts default to 20, accept positive safe integers, and preserve edits while navigating/loading config. Reject empty, zero, negative and fractional input before Next/submission. Server validation rejects invalid integer types, including booleans/string numbers/floats, and values below configured minimum instances. The minimum and concurrency fields are not changed. A maximum of 20 is a scaling limit, not a request to start 20 instances. +FR-3: Carry explicit `maxInstance` through browser draft, POST, SQLite request identity and runner stdin; apply it to managed Runtime settings before preparing deployment, using the existing `MaxInstance` mapping and Runtime template snapshot. Submitted requests cannot edit the field; new-request action resets to 20. Changed values on retry conflict with the original request fingerprint. Omitted/null fields are not added to old fingerprints and preserve old profile behavior; submitted legacy drafts are not upgraded or shown a fictitious 20. + +No modification of existing deployed Runtimes, generic-agent creation, minimum instances, per-instance concurrency, images, resource cleanup or provider adapters is included. No real cloud creation/scale change is authorized. + +## Design, files and contract assessment + +Reuse current numeric-field layout in the creation dialog and the danger/soft Alert already used by StudioConfirmDialog. Keep a text editing buffer for an empty/in-progress numeric input while recording a numeric canonical draft value. Optional API field `maxInstance` is a strict positive integer. Add a small scaling profile helper used by both the BFF (pre-task validation) and runner (actual deployment); the existing YAML/CLI Runtime default remains unchanged. Task persistence pins the value, and stdin passes it only when present. Preserve cancellation/late-response locks, existing step navigation and old saved inputs. + +Files: MpaCreateDialog/API types/locales, authorized creation request, managed config/tasks/runner, targeted frontend and Python regression tests, paired PRD/spec/frontend documentation and packaged WebUI. Existing service/runtime mapping is reused; test emitted CreateRuntime/update settings rather than adding another mapping. Both domestic and BytePlus MPA use the same input, while generic agents use their existing separate flow. No database schema migration is required. + +## Tasks, tests and acceptance + +- T-1 / FR-1 / AC-1: failing React test for visible danger/soft name-conflict Alert; real browser confirms red emphasis and accessible text. +- T-2 / FR-2 / AC-2: fresh 20, editable integer, invalid numeric cases, navigation/config response, restored draft and old submitted request tests. +- T-3 / FR-3 / AC-3: BFF validation, task idempotency/stdin, runner and actual Runtime payload assertions; preserve old request fingerprint and configured defaults. +- T-4 / AC-4: targeted then managed deployment regression, Ruff/Pyright changed Python, full frontend tests/build/i18n/assets, browser normal/error/retry/keyboard/narrow cases, redacted secret and paired-document checks. + +## Review, risks and authorization + +`review-spec` is unavailable; direct review confirms ownership, reusable UI baseline, optional-field compatibility and separation from generic agents. The user approved this concrete plan with “按此方案实施(推荐)” on 2026-10-13. Direct review is complete and no design blockers remain; implementation and regression tests are authorized within this scope. Provider quotas/maximum limits remain enforced by AgentKit; no undocumented quota guarantee is introduced. Existing task snapshots prevent a retry from silently changing the scaling limit. Pre-implementation results were not_run; no commit, push, restart, deployment or cloud mutation is authorized. + +## Implementation and verification — 2026-10-13 + +Scope: working diff based on `0dd3907d`, limited to FR-1–FR-3, their tests/documents and generated WebUI. T-1–T-4 and AC-1–AC-4 are complete. Direct implementation review confirmed numeric transmission to actual CreateRuntime/update payloads, independent profile copies, immutable task identity, strict server validation and unchanged general-agent routes. No blockers remain. + +Regression-first evidence: before production changes, the targeted Python suite had 13 failed / 6 passed; React creation tests had 7 failed / 47 passed. The failures covered the missing UI/API/scaling behavior. Final results: + +| Check | Result | Evidence / limitations | +| --- | --- | --- | +| Targeted Python | pass | 20 tests; strict types, configured minimum, omitted/null compatibility, subprocess stdin, idempotent retries, runner and emitted Runtime payloads. | +| Managed/deployment integration regression | pass | 998 tests using two workers; external services mocked, smoke markers excluded. | +| Frontend suite | pass | 1,389 Node tests and 95 React tests, including 57 MPA creation cases; existing category, deletion and cancellation coverage stays green. | +| Build / i18n / asset references | pass | Both app and integration widget rebuilt; 2 locales / 21 namespaces consistent; 113 packaged files / 350 references verified. Existing chunk-size/dependency warnings are non-blocking. | +| Changed Python Ruff / format / Pyright | pass | Five files; Ruff uses the repository pre-commit version 0.11.12. Pyright reports 0 errors / 0 warnings using the repository Python. Temporary `uvx` tools were used because these tools are not installed locally; no global configuration changed. | +| Real Chromium UI | pass | Real React dialog in an isolated temporary fixture; simulated APIs only. Checked desktop/narrow 390×844, default 20, numeric validation, keyboard increment, navigation preservation, numeric submission, read-only failed request, new request reset, BytePlus manual OV, legacy omission and both preflight/task-level duplicate alerts. Full Chinese alert text wraps without horizontal overflow. | +| Secret scan / documents / whitespace | pass | Changed-file scan with repository Gitleaks rules and redacted output; paired identifiers/numeric limits/commands/relative links reviewed; `git diff --check`. | +| Live cloud / Codex smoke / sidecar coverage | not_applicable | No cloud operations or harness/sidecar behavior changed; no live provisioning authorization. Actual provider quota/scale behavior was not exercised. | +| Commit / pre-commit / push / restart | not_run | Not requested or authorized. Before a future commit, synchronize the intended base and run required pre-commit/unit gates. | + +An exploratory unpinned `uvx ruff check` selected Ruff 0.17.0 and failed with 17 findings under its expanded rules. It is not the configured repository gate; the pinned 0.11.12 check and format check both passed. No unrelated rules or production code were changed to hide this result. + +Commands executed: + +```bash +uv run --extra dev pytest tests/integrations/mpa_managed/test_creation_scaling.py -q --no-cov +uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov +uvx --from ruff==0.11.12 ruff check frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +uvx --from ruff==0.11.12 ruff format --check frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +uvx pyright --pythonpath .venv/bin/python frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +npm --prefix frontend test +npm --prefix frontend run build +npm --prefix frontend run check:i18n +npm --prefix frontend run test:webui-assets +git diff --check +``` diff --git a/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.zh.md b/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.zh.md new file mode 100644 index 000000000..127df87d7 --- /dev/null +++ b/prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.zh.md @@ -0,0 +1,70 @@ +# MPA 创建最大实例数与错误高亮 + +[English](2026-10-13-max-instance-input.md) + +- Change ID:`mpa-create-scaling` +- 创建/修订:2026-10-13 +- 状态:implemented +- 契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-21 + +## 证据与范围 + +基本信息步骤目前仅有名称/描述。受管 Runtime 已支持 `max_instance` 并映射为 AgentKit `MaxInstance`,内置配置当前为 1。请求/task/runner 尚无本次创建最大实例数。名称可用性错误以普通正文段落展示,缺少现有红色错误容器强调。 + +FR-1:用 Studio 确认弹窗同款 danger/soft Alert 高亮现有重名提示,保留原本地化文案及 alert 语义。仅使用组件公开属性,不增加独立 CSS/图标体系。 +FR-2:基本信息增加可编辑数字字段“最大实例数”。新表单及新的可编辑草稿默认 20,接受正安全整数,步骤切换/配置加载期间保留编辑。下一步/提交前拒绝空、0、负数和小数。服务端拒绝无效整数类型,含布尔、数字字符串、小数,以及小于配置最小实例数的值。不改变最小实例数/单实例并发字段。最大值 20 是扩容上限,不代表启动 20 个实例。 +FR-3:显式 `maxInstance` 贯穿浏览器草稿、POST、SQLite 请求身份及 runner stdin,在准备部署前应用到受管 Runtime 配置,复用现有 `MaxInstance` 映射及 Runtime 模板快照。已提交任务不能修改;新建另一请求重置为 20。重试改变数值须与原指纹冲突。省略/null 不加入旧指纹,保留旧配置行为;已提交旧草稿不升级,也不显示虚构的 20。 + +不修改已部署 Runtime、通用创建、最小实例数、单实例并发、镜像、资源清理或提供商适配。不授权真实云创建/扩容。 + +## 设计、文件与契约评估 + +复用创建弹窗现有数字字段排布及 StudioConfirmDialog 使用的 danger/soft Alert。数字输入保留文本编辑缓冲,允许空/输入过程,同时以数字保存规范草稿值。可选 API 字段 `maxInstance` 为严格正整数。新增小型 scaling 配置函数,由 BFF(受理前校验)及 runner(实际部署)共同使用;已有 YAML/CLI Runtime 默认值不变。任务持久化固定数值,仅存在时传入 stdin。保留取消/过期响应锁、原步骤导航及旧保存输入。 + +文件:MpaCreateDialog/API 类型/文案、授权创建请求、managed config/tasks/runner、定向前端/Python 回归、双语 PRD/spec/frontend 文档及 WebUI 发布资源。复用 service/runtime 映射,测试真正发出的 CreateRuntime/update 设置,不增加第二套映射。国内及 BytePlus MPA 共用该输入,通用智能体仍走原独立流程。无需数据库 schema 迁移。 + +## 任务、测试与验收 + +- T-1 / FR-1 / AC-1:先写 React 重名 danger/soft Alert 可见性失败测试;真实浏览器确认红色高亮及可访问文字。 +- T-2 / FR-2 / AC-2:新建 20、可编辑整数、无效数值、步骤/配置响应、恢复草稿及旧已提交请求测试。 +- T-3 / FR-3 / AC-3:BFF 校验、任务幂等/stdin、runner 及真实 Runtime Payload 断言;保留旧请求指纹和配置默认。 +- T-4 / AC-4:先定向再 managed 部署回归、改动 Python Ruff/Pyright、前端全测/build/国际化/资源、浏览器正常/错误/重试/键盘/窄屏、脱敏密钥扫描及双语文档检查。 + +## 审查、风险与授权 + +`review-spec` 不可用,直接审查确认职责、可复用 UI 基准、可选字段兼容及通用流程隔离。用户于 2026-10-13 通过“按此方案实施(推荐)”批准具体方案。直接审查完成,无设计阻塞,可在该范围实现和编写回归测试。提供商额度/最大限制仍由 AgentKit 校验,不新增未文档化配额保证。任务快照防止重试静默更换扩容上限。实现前验证为 not_run;不授权提交、推送、重启、部署或云修改。 + +## 实现与验证 — 2026-10-13 + +范围:基于 `0dd3907d` 的工作区差异,仅含 FR-1–FR-3、对应测试/文档和 WebUI 产物。T-1–T-4 与 AC-1–AC-4 已完成。直接实现审查确认数值传到实际 CreateRuntime/update Payload、配置副本独立、任务身份不可变、服务端严格校验,且通用创建路由未改变。无遗留阻塞。 + +先回归后实现的证据:修改生产代码前,定向 Python 为 13 failed / 6 passed;React 创建测试为 7 failed / 47 passed。失败覆盖当时缺失的 UI/API/实例数行为。最终结果: + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| 定向 Python | pass | 20 项;严格类型、配置最小值、省略/null 兼容、子进程 stdin、幂等重试、runner 与实际 Runtime Payload。 | +| Managed/部署集成回归 | pass | 两个 worker 共 998 项;外部服务使用模拟,排除 smoke 标记。 | +| 前端测试 | pass | 1,389 项 Node、95 项 React,其中 MPA 创建 57 项;已有类型区分、删除、取消覆盖仍通过。 | +| Build / 国际化 / 资源引用 | pass | 应用与集成 widget 均重建;2 个语言 / 21 个 namespace 一致;113 个发布文件 / 350 个引用核验。现有分包大小/依赖警告不阻塞。 | +| 改动 Python Ruff / 格式 / Pyright | pass | 五个文件;Ruff 使用本仓库 pre-commit 的 0.11.12 版本。Pyright 使用本仓库 Python,0 错误 / 0 警告。因本地未安装检查工具,使用临时 `uvx`,未改全局配置。 | +| 真实 Chromium UI | pass | 隔离临时页面中的真实 React 弹窗,API 全为模拟。检查桌面/390×844 窄屏、默认 20、数字校验、键盘增量、步骤保留、数字提交、失败请求只读、新请求重置、BytePlus 手动 OV、旧字段省略,以及预检查/任务阶段重名高亮。完整中文错误可换行,无横向溢出。 | +| 密钥扫描 / 文档 / 空白 | pass | 按本仓库 Gitleaks 规则扫描变更文件并脱敏输出;审查双语标识符/数值限制/命令/相对链接;`git diff --check`。 | +| 真实云 / Codex smoke / sidecar coverage | not_applicable | 未改变云操作或 harness/sidecar 行为,未授权真实创建。未实测提供商额度/扩容。 | +| 提交 / pre-commit / 推送 / 重启 | not_run | 未请求或授权。未来提交前须同步目标基线并执行要求的 pre-commit/单元测试。 | + +探索性未固定版本的 `uvx ruff check` 使用了 Ruff 0.17.0,在其扩展规则下 fail(17 项)。这不是仓库配置的检查版本;固定 0.11.12 的 check/format 均通过。未修改无关规则或生产代码来隐藏结果。 + +已执行命令: + +```bash +uv run --extra dev pytest tests/integrations/mpa_managed/test_creation_scaling.py -q --no-cov +uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov +uvx --from ruff==0.11.12 ruff check frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +uvx --from ruff==0.11.12 ruff format --check frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +uvx pyright --pythonpath .venv/bin/python frontend/server/mpa_creation.py veadk/integrations/mpa/managed/config.py veadk/integrations/mpa/managed/runner.py veadk/integrations/mpa/managed/tasks.py tests/integrations/mpa_managed/test_creation_scaling.py +npm --prefix frontend test +npm --prefix frontend run build +npm --prefix frontend run check:i18n +npm --prefix frontend run test:webui-assets +git diff --check +``` diff --git a/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md b/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md new file mode 100644 index 000000000..c5f9552ce --- /dev/null +++ b/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md @@ -0,0 +1,74 @@ +# MPA name preflight and readable business Workspace names + +[中文版](2026-10-13-runtime-name-and-workspace-labels.zh.md) + +- Change ID: `mpa-name-preflight` +- Created/revised: 2026-10-13 +- Status: implemented +- Owner contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-20 +- Predecessor: [independent business Workspace](../mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.md) + +## Background and evidence + +The form validates Runtime name characters/length but does not query cloud availability. Service preparation reaches PG/network before `ensure_worker` discovers foreign same-name templates. `RuntimeCloud.list_runtimes` expands every Runtime detail for deletion; reusing it for typing preflight would be unnecessarily expensive. A lightweight paginated name lookup is needed. New per-agent PG names currently use a hash, making console lookup difficult. + +[AIDAP CreateWorkspace](https://docs.volcengine.com/docs/87275/2105881) documents names of 2–128 characters, beginning with a letter or Chinese character. Runtime names allow 4–64 ASCII letters, digits, underscores and hyphens. Proposed `mpa_agent_` is at most 74 characters and safely starts with a letter. New dedicated business databases use `aidb`; existing database names remain pinned. + +## Goals, scenarios and requirements + +- FR-1: Check the selected deployment provider/account/region before starting a fresh MPA task. A foreign same-name Runtime, worker template or target business Workspace blocks creation with an explicit localized name-conflict message. Do not return cloud credentials or foreign resource details. +- FR-2: The first wizard Next action checks name availability; final POST and provisioning enforce checks independently of the frontend. Query errors fail closed with a retryable check error, not an available/empty result. Pagination, timeout, cancellation, IME and stale-response behavior must be covered. +- FR-3: Same-request retry may reuse its own resources when identity/binding is proven; foreign or ambiguous ownership fails closed. Existing pending/registered resources retain their bindings and names. Current owner authentication and provider selection remain server-owned. +- FR-4: New independent business Workspaces use `mpa_agent_`. The business database is `aidb` for new dedicated requests; existing requests retain their recorded name. Persist/preserve selected Workspace name with bootstrap/registry identity; never rename an existing Workspace or switch a business endpoint during retry. Explicit/manual/shared profiles remain compatible. +- FR-5: Generic-agent creation, shared admin PG/network/APIG, Runtime business schemas, OV provisioning and resource deletion behavior are unchanged. + +## Design and contract assessment + +Add a Studio-authorized read-only name check and lightweight Runtime pagination that retrieves details only for matching candidates when ownership requires verification. Reuse `WorkerCloud.find` and AIDAP `find`; never use PostgreSQL connection preparation as a read-only preflight because it may change endpoint settings. Check current in-flight local creation requests as well as cloud names and recheck before purchase. Retain platform uniqueness as the final concurrent-creation boundary; a read-then-create check alone cannot provide atomic exclusion across independent Studio hosts. Any additional shared reservation protocol needs a reviewed contract before implementation. + +MPA inputs retain existing validation, while prefixed Workspace naming accommodates digit-leading Runtime names. Same-name foreign retained PG resources block automatic reuse after Runtime deletion; explain the conflict rather than silently sharing them. Registered Workspace IDs, ownership tags, endpoint checks and stable internal identity remain authoritative. Existing hashed per-agent Workspaces use the stored bootstrap name or a verified registered name, not a newly derived name. Private secrets remain server-only. + +Affected files: managed Runtime/worker lookup consumers, name-check helper, PG bootstrap/config/service and runner error mapping; BFF creation endpoints/tasks, frontend API types/dialog/locales, targeted Python/React tests, bilingual maintained specs/docs and generated WebUI assets. The sibling MPA repository needs no change. + +## Tasks and acceptance + +- T-1 / FR-1,2,3 / AC-1: write failing tests for foreign collisions, valid ownership retry, pagination, unavailable checks and stale/cancelled UI responses; implement the read-only endpoint and early server enforcement. +- T-2 / FR-4 / AC-2: naming tests for digits/case/64-character names, existing hashed bootstrap/registry bindings, restart and uncertain purchase; use `aidb` only in verified dedicated Workspaces and avoid existing resource rebinding. +- T-3 / FR-5 / AC-3: generic-agent/deletion regression, paired docs/assets and review. No cloud resources created by tests. + +Run targeted tests via `uv run --extra dev pytest`, then the existing managed/deployment regression with two workers, Ruff/Pyright for changed Python, `npm --prefix frontend test`, build/i18n/asset checks, and an isolated real browser. No live purchase, commit, push or deployment is authorized. Results are recorded below after implementation. + +## Risks and review record + +Cloud listing is eventually consistent; preflight cannot guarantee cross-host atomicity. Fail clearly on a late platform name collision. Additional discovery requires the deployment credentials' existing Runtime/tool/AIDAP read permissions. Retained old Workspace names and failed-task resources must not be silently renamed/adopted. `review-spec` is unavailable; direct review has confirmed ownership boundaries and proposed compatibility requirements. User approval is recorded in the amendment below; final implementation review is recorded at delivery. The user requested pre-creation duplicate detection and asked to replace the Workspace hash with the MPA name on 2026-10-13; a concrete scope/naming question has been presented as required by AGENTS.md. Implementation follows the approved amendment below. + +## Approved aidb and request compatibility amendment + +User approved all three changes with “改成aidb吧 … 这个也一起改了?” on 2026-10-13. Direct design review replaces the unavailable review-spec skill; no design blockers remain. New config/forms explicitly carry `businessDatabaseName: aidb`, requiring `businessWorkspaceMode: per-agent`. Omission preserves the preceding hashed database/Workspace contract and saved request fingerprints. CLI/YAML opt in with `managed.postgres.business-database-name: aidb`. Named Workspaces persist layout in bootstrap intent and name/database choices in registry metadata. Existing two-element bootstrap configurations and old registered hashed names retain their original layout even on a new-form retry. + +AIDAP precreates `aidb`. Before marking it as this agent's database, verify dedicated Workspace identity, DB owner, empty non-system/non-extension relations, no prior Runtime/ready binding, and a transaction advisory lock. A mismatched marker, nonempty initial database or missing registered database fails closed. Persist initialization intent before marking; matching markers make retry idempotent. Runtime validation, PGDATABASE, token/meta seeding and readiness all use the same selected database. Shared admin DB remains mpa_admin_db. + +The BFF checks names before creating a task and uses a private task name-scope snapshot (verified provider/account/region) to reject same-host concurrent same-name requests in the SQLite transaction; legacy scope-less active requests are conservatively checked within their provider/region. No failed-task reservation blocks later tasks. The runner verifies the snapshotted deployment account before new-layout side effects and checks names again. Read-only checks are bounded and return only availability/error codes. General-agent APIs remain unchanged. Cross-host read/create races still use cloud enforcement and ownership validation; no distributed reservation guarantee is claimed. + +Implementation follows this approved scope; actual verification is recorded below. No cloud purchase, commit, push or deployment is authorized. + +## Implementation review and verification (2026-10-13) + +T-1–T-3 and AC-1–AC-3 are implemented. Direct review confirmed fail-closed ownership checks, database marker/empty-data guards, retry compatibility and provider/account boundaries. New-layout web requests must use the server-derived owner/request identity; a supplied different agent ID is rejected before task acceptance. This prevents claiming another request's partial Workspace by copying its internal ID. Legacy requests retain their existing explicit-ID contract. + +Tested scope: the working diff on `71175c68636dc5b951e9804eb292d85402511e68`, including earlier independent PG and automatic OV work already in this workspace. Regression-first checks initially failed (12 Python and 2 React cases); subsequent implementation passes the affected checks. No unrelated user changes were reverted. + +| Check | Result | Evidence / limits | +| --- | --- | --- | +| Managed/deployment Python regression | pass | `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov`: 978 passed; two workers selected for local resources. | +| Changed Python static checks | pass | Ruff 0.11.12 and Pyright against `.venv/bin/python`, all changed Python files. Repository-local tools were unavailable; temporary `uvx` tools were used without global installation. | +| Frontend tests | pass | `npm --prefix frontend test`: Node and React suites, including duplicate Next/POST, pending-check cancellation and late-result suppression, existing generic-agent/deletion tests. | +| Frontend build | pass | `npm --prefix frontend run build`; generated WebUI assets synchronized. | +| Localized strings and asset references | pass | `npm --prefix frontend run check:i18n` and `npm --prefix frontend run test:webui-assets`: 2 locales / 21 namespaces and 113 assets / 350 references. | +| Browser flow | pass | Actual React dialog with isolated fake HTTP responses: occupied/free name, unavailable query, late POST conflict with editable name, old shared request recovery, BytePlus manual OV and 390×844 layout. No cloud operation dispatched; temporary fixture/server removed. | +| Secret scanning / diff whitespace | pass | Repository-configured Gitleaks over changed files, redacted output; `git diff --check`. | +| Live cloud creation and real PostgreSQL integration | not_run | Not authorized for this task. Provider purchase, DB claim SQL and readiness still require an isolated live acceptance run. | +| Harness/process smoke gates | not_applicable | No harness/sidecar or process contract changed. | +| Commit / pre-commit gate | not_run | No commit authorized; pre-commit and branch synchronization remain required before a later commit. | + +No remaining local review blockers. Cross-host listing/purchase races remain bounded by cloud enforcement and ownership validation; no distributed lock guarantee is claimed. Existing data is not migrated. Restart Studio and start a fresh request to use the new layout. diff --git a/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md b/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md new file mode 100644 index 000000000..ff137bbb7 --- /dev/null +++ b/prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md @@ -0,0 +1,74 @@ +# MPA 名称预检查与可读业务 Workspace 名称 + +[English](2026-10-13-runtime-name-and-workspace-labels.md) + +- Change ID:`mpa-name-preflight` +- 创建/修订:2026-10-13 +- 状态:implemented +- 归属契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-20 +- 前置设计:[独立业务 Workspace](../mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.zh.md) + +## 背景与证据 + +表单校验 Runtime 名称字符和长度,但未查询云端是否可用。创建流程准备 PG/网络后,`ensure_worker` 才发现其他资源占用同名模板。`RuntimeCloud.list_runtimes` 为删除检查逐个展开全部 Runtime 详情,不适合输入时查重,应增加轻量分页名称查询。新独立 PG 当前以哈希命名,在控制台不便查找。 + +[AIDAP CreateWorkspace](https://docs.volcengine.com/docs/87275/2105881)规定名称为 2–128 字符,以字母或中文开头。Runtime 名称允许 4–64 位 ASCII 字母、数字、下划线和连字符。建议的 `mpa_agent_` 最长 74 字符,且以字母开头。新独立业务库使用 `aidb`;已有数据库名称保持固定。 + +## 目标、场景与需求 + +- FR-1:启动新 MPA 任务前检查所选部署提供商/账号/地域。其他智能体占用同名 Runtime、沙箱模板或目标业务 Workspace 时,明确以本地化重名消息阻止创建,不返回云凭据及其他资源详情。 +- FR-2:向导首次“下一步”检查名称,最终 POST 和后台编排独立校验,不依赖前端。查询失败明确阻止并允许重新检查,不伪装成名称可用/空数据。覆盖分页、超时、取消、IME 和过期响应。 +- FR-3:相同请求重试在身份/绑定可证明时复用自己的资源;其他归属或不明确归属明确失败。已有任务/登记资源保留原绑定和名称。用户认证和提供商选择仍由服务端控制。 +- FR-4:新独立业务 Workspace 使用 `mpa_agent_<手填 Runtime 名称>`。新独立请求业务库为 `aidb`,已有请求保留登记的名称。引导/登记身份保存并保持已选 Workspace 名称,不重命名已有 Workspace,不在重试中切换端点。兼容显式/手动/共享配置。 +- FR-5:不改通用智能体创建、共享管理 PG/网络/APIG、Runtime 业务表、OV 创建及资源删除行为。 + +## 设计与契约评估 + +增加 Studio 授权的只读名称检查和轻量 Runtime 分页,仅在同名候选需要验证归属时读取详情。复用 `WorkerCloud.find` 和 AIDAP `find`;PG 连接准备可能修改端点设置,不能用作只读预检查。同时检查本地进行中的创建请求与云资源名称,在购买前复核。平台唯一性仍是并发创建的最终边界,先读后创建不能保证独立 Studio 主机间原子互斥;额外共享占位协议需先审查契约再实现。 + +MPA 输入沿用原校验,Workspace 加前缀兼容数字开头的 Runtime 名称。删除 Runtime 后若同名旧 PG 被其他归属占用,应明确冲突,不自动共享。Workspace ID、归属标签、端点校验和内部稳定 ID 仍是权威绑定。已有哈希 Workspace 使用引导文件保存名称或已核验登记名称,不改用新推导名称。密钥仅留在服务端。 + +受影响文件:受管 Runtime/worker 查询调用、名称检查模块、PG 引导/配置/service 与 runner 错误映射;BFF 创建接口/tasks、前端 API 类型/弹窗/文案、定向 Python/React 测试、双语维护契约/说明和 WebUI 构建资源。兄弟 MPA 仓库不需修改。 + +## 任务与验收 + +- T-1 / FR-1,2,3 / AC-1:先写其他归属重名、合法重试、分页、检查失败与过期/取消响应的失败测试,再实现只读接口和服务端提前拦截。 +- T-2 / FR-4 / AC-2:覆盖数字开头/大小写/64 字符名称、旧哈希引导/登记绑定、重启和购买结果未知;仅在已核验独立 Workspace 使用 `aidb`,不切换已有资源绑定。 +- T-3 / FR-5 / AC-3:通用智能体/删除回归,双语文档/资源及审查。测试不创建云资源。 + +通过 `uv run --extra dev pytest` 执行定向测试,再使用两个 worker 执行已有 managed/部署回归;对改动 Python 跑 Ruff/Pyright;执行 `npm --prefix frontend test`、构建、国际化、资源引用检查及隔离真实浏览器验证。不授权真实购买、提交、推送或部署。实现后的结果在下方记录。 + +## 风险与审查记录 + +云列表存在最终一致性,预检查不能保证跨主机原子性;后续平台重名拒绝须明确展示。新增查询依赖部署凭据现有 Runtime/tool/AIDAP 读取权限。旧 Workspace 名称和失败任务资源不能静默重命名/接管。`review-spec` 不可用,已直接核对归属边界及拟定兼容要求;用户批准见下方补充,最终实现审查在交付时记录。用户于 2026-10-13 要求创建前查重,并询问用 MPA 名称替代 Workspace 哈希;已按 AGENTS.md 提交具体范围/命名确认。实现按下方已批准补充执行。 + +## 已批准的 aidb 与请求兼容补充 + +用户于 2026-10-13 通过“改成aidb吧 … 这个也一起改了?”批准三项修改。直接设计审查替代不可用的 review-spec,无设计阻塞。新配置/表单显式携带 `businessDatabaseName: aidb`,要求 `businessWorkspaceMode: per-agent`。省略时保留前一版哈希库名/Workspace 契约及已保存请求指纹。CLI/YAML 可通过 `managed.postgres.business-database-name: aidb` 启用。名称化 Workspace 的引导意图保留布局标记,注册元数据保留 Workspace 名和数据库选择。旧二元素引导配置及已登记哈希名称,即使用新表单重试也保持原布局。 + +AIDAP 默认预建 `aidb`。标记为该智能体业务库前,核验独立 Workspace 身份、数据库属主、无非系统/非扩展关系对象、无已有 Runtime/ready 绑定,并持有事务 advisory lock。标记不匹配、初始库非空或登记库缺失均明确失败。写标记前保存初始化意图,匹配标记使重试幂等。Runtime 校验、PGDATABASE、token/meta 初始化及就绪检查统一使用已选数据库。共享管理库仍为 mpa_admin_db。 + +BFF 在创建任务前查重,通过私有任务名称范围快照(已核验提供商/账号/地域)在 SQLite 事务中阻止本主机并发同名请求;旧无范围的活跃请求按其提供商/地域保守检查。失败任务占位不会阻塞后续任务。Runner 在新布局副作用前核验快照部署账号,并再次查重。只读检查有超时,只返回是否可用/错误码。通用智能体 API 不变。跨主机先查后创建仍依赖云端约束与归属校验,不宣称分布式占位保证。 + +实现遵循已批准范围;实际验证记录如下。不授权云购买、提交、推送或部署。 + +## 实现审查与验证(2026-10-13) + +T-1–T-3 与 AC-1–AC-3 已实现。直接审查确认了归属检查的失败关闭行为、数据库标记/空库保护、重试兼容性及提供商/账号边界。新布局 Web 请求必须使用服务端按用户/请求生成的内部身份;传入不同 agent ID 会在受理任务前拒绝,防止复制其他请求的内部 ID 接管其部分创建的 Workspace。旧请求保留原显式 ID 契约。 + +验证范围:基于 `71175c68636dc5b951e9804eb292d85402511e68` 的工作区差异,包括工作区此前已有的独立 PG 和自动 OV 改动。先写回归测试时有 12 项 Python、2 项 React 失败,随后实现通过受影响检查。没有撤回无关用户改动。 + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| Managed/部署 Python 回归 | pass | `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/integrations/test_mpa_tool.py tests/integrations/test_mpa_skill_space.py tests/integrations/test_ve_faas_deploy_image_key_auth.py -q --no-cov`:978 项通过;根据本地资源选择两个 worker。 | +| 改动 Python 静态检查 | pass | Ruff 0.11.12 和使用 `.venv/bin/python` 的 Pyright,覆盖所有改动 Python 文件。仓库本地工具不可用,使用临时 `uvx` 工具,无全局安装。 | +| 前端测试 | pass | `npm --prefix frontend test`:Node 和 React 测试,含下一步/POST 重名、进行中检查取消和过期结果抑制、已有通用智能体/删除测试。 | +| 前端构建 | pass | `npm --prefix frontend run build`;同步 WebUI 构建产物。 | +| 国际化与资源引用 | pass | `npm --prefix frontend run check:i18n` 与 `npm --prefix frontend run test:webui-assets`:2 个语言 / 21 个命名空间,113 个资源 / 350 个引用。 | +| 浏览器流程 | pass | 真实 React 弹窗配隔离模拟 HTTP:重名/可用名称、查询不可用、POST 后置冲突后可编辑、旧共享请求恢复、BytePlus 手动 OV,以及 390×844 布局。没有发送云操作;已移除临时夹具/服务。 | +| 密钥扫描 / 差异空白 | pass | 使用仓库配置对改动文件执行 Gitleaks,输出脱敏;`git diff --check`。 | +| 真实云创建与 PostgreSQL 集成 | not_run | 本次未授权。提供商购买、数据库接管 SQL 和就绪仍需独立真实验收。 | +| Harness/进程 smoke 门禁 | not_applicable | 未修改 harness/sidecar 或进程契约。 | +| 提交 / pre-commit 门禁 | not_run | 未授权提交;后续提交前仍须执行 pre-commit 和分支同步。 | + +本地审查无剩余阻塞。跨主机查询/购买竞态仍依赖云端约束及归属校验,不宣称分布式锁保证。已有数据不迁移。重启 Studio 并开启新请求后使用新布局。 diff --git a/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.md b/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.md new file mode 100644 index 000000000..d63e876ef --- /dev/null +++ b/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.md @@ -0,0 +1,62 @@ +# Automatic OpenViking preparation for Studio MPA + +[中文版](2026-10-13-default-model-creation.zh.md) + +Change ID: `mpa-openviking-auto`. Date: 2026-10-13. Status: implemented; live acceptance pending. +Contracts: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). + +## Evidence, goals and non-goals +Studio currently collects an optional OV URL/resource ID/API Key. The MPA image already registers per-user OV identities using its runtime STS role. A read-only reference inspection shows enterprise READY, model identities/versions but no model API Key/Key ID; the console reports no custom model credentials and enabled limited-time content understanding. This does not prove a new API-created library can use default models. Official Create/Get/Access documentation defines async INIT/READY/FAILED and default-user key retrieval. +Goal: new Beijing Studio MPA requests prepare an independent enterprise OV library without manual connection inputs, using default VLM/Embedding configuration first. BytePlus, general agents, existing tasks, manual CLI configuration and existing Runtimes keep their behavior. No Ark endpoint/key creation, default-key copying, data migration or OV deletion is included. New OV is a retained paid resource; no live creation is implied by implementation approval. + +## Requirements and scenarios +- FR-1: Beijing built-in configuration advertises automatic OV. New UI requests persist `openvikingMode: auto`; absence/manual preserves old request semantics. Reject auto outside Volcengine Beijing and combinations of auto/manual connection values before mutation. CLI remains opt-in via managed configuration. +- FR-2: Under the existing authorized deployment lock create one enterprise library using legal hash-derived Name and scoped Description, default project, VLM `doubao-seed-2.0-lite`/`260428`, Embedding `doubao-embedding-vision`/`251215`, and explicit Source/EndpointID Credentials; the resolved Ark key is attached only to the copied wire request. Persist nonsecret intent before dispatch and ResourceID immediately after response. Registered IDs require matching name/description/project/version/models before reuse; deleting/deleted agents cannot create. +- FR-3: Poll INIT to READY within a bounded deadline, fail explicitly on FAILED/invalid status/missing ID/permissions. Obtain default-user key through AccessOpenVikingApiKey, inject URL/resource ID/key/user into Runtime before deployment. No key enters SQLite, registry, results, logs or fixtures. Runtime per-user registration remains the MPA image responsibility. +- FR-4: A failed later deployment reuses the registered library. A proven rejected create permits same-intent retry. Ambiguous create outcome remains blocked rather than blindly creating another library; operator reconciliation of the registered ResourceID is required. Cancellation retains known/unknown resources and stops subsequent operations. Key reads retry only transient failures; creates never automatically retry. +- FR-5: Third step shows automatic preparation and enterprise billing information; no manual fields for new auto requests. Old submitted manual tasks and BytePlus retain fields/validation. Safe localized errors/stages remain visible and retry uses the original mode/identity. Existing layout, TOS controls, keyboard/IME, cancellation and focus behavior are preserved. + +## Design and affected files +Add OpenViking options, a signed control-plane adapter and locked resource preparation. Reuse current refreshed account-verified deployment credentials, existing signing helper and diagnostic sink. Only documented CreateOpenVikingCollection/GetOpenVikingCollection/AccessOpenVikingApiKey are used; no undocumented name-discovery API or idempotency token is assumed. Collection and Runtime key lifetimes remain independent. Default model acceptance is an explicitly unverified provider capability; rejection must not silently provision paid Ark endpoints or omit OV. +Affected: managed config/profile/service/runner/tasks/diagnostics; new openviking module; Studio request/client/dialog/locales; focused tests, existing frontend release assets and operator docs. No general generation/chat/deletion or MPA image modification. +The Studio profile advertises availability separately from the execution mode: reading config or calling provision directly does not opt an old request into OV. Only an explicit new request mode or explicit CLI managed setting enables creation. Runtime provisioning keeps its existing environment, ownership and request-hash contracts; the four OV variables are already supported, so no separate Runtime contract change is required. +Deployment credentials require vikingdb CreateOpenVikingCollection/GetOpenVikingCollection/AccessOpenVikingApiKey. Runtime role already includes VikingdbFullAccess for per-user management. Only credentials of the verified deployment account may provision OV. Library bindings remain in mpa_admin_db; no library or memory cleanup is added to Agent deletion. + +## Tasks, verification and acceptance +| Requirement | Task | Acceptance | Verification | +| --- | --- | --- | --- | +| FR-1/5 | T-1 mode propagation and UI | AC-1 new auto requests, old/manual/BytePlus unchanged | config/route/task and React tests, browser | +| FR-2/4 | T-2 locked intent and binding | AC-2 same-agent reuse, conflict/unknown/cancel safe | offline adapter/provisioner tests | +| FR-3 | T-3 readiness/key injection | AC-3 four env values, no secret persistence, explicit failures | service/runner/security tests | +| All | T-4 reconcile | AC-4 paired docs, build and required gates | affected Python regression, frontend test/build, Ruff/Pyright, i18n/assets, secret scan | +Actual verification is recorded below. Live smoke requires a separately authorized isolated library and cleanup decision; without it report default-model creation availability as unverified. + +## Risks, review and approval +The optional-model-credential API behavior and default-model entitlement may differ from an old console-created library; default-path rejection remains an actionable failure. Enterprise hourly billing starts when ready; provider resources are retained after failure/cancellation/deletion. No published discovery/idempotency contract is available for recovering a lost create response, so safety takes priority over blind retry. External registry/resource edits cannot be transactionally serialized with cloud calls. +Direct review performed because review-spec is unavailable: assessed boundaries, credentials, ownership, timeout/cancellation, ambiguous outcomes, compatibility, testability and language equivalence. User approved default-model-first Beijing implementation on 2026-10-13; BytePlus preservation was explicitly confirmed. No further scope expansion is authorized. The two frontend skills referenced by SPEC were not found at their paths or local skill roots; reuse existing ModalLayout/fields and directly verify Foundation S1-S8 instead of inventing a new design system. + +## Implementation review and verification (2026-10-13) + +Tested scope: uncommitted OV change on `71175c68636dc5b951e9804eb292d85402511e68`; no user state or cloud resource mutation. Test-first evidence: missing adapter module failed collection; auto-mode UI regression failed while manual fields were present. The implementation now covers mode propagation, account/region rejection, registry locking and ownership, INIT/READY/FAILED, cancellation, create ambiguity, safe errors, secret exclusion, and pre-Runtime environment injection. Review found and corrected two compatibility issues: account verification must precede constructing the OV adapter, and capability advertising must not enable OV for legacy/direct requests. + +| Gate | Outcome | Evidence / scope | +| --- | --- | --- | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py` | pass | 1,074 passed; two workers chosen for local resources. | +| `npm --prefix frontend test` | pass | 1,379 Node tests and 79 Vitest tests. | +| `npm --prefix frontend run build` | pass | Matching main/widget release assets regenerated. | +| `npm --prefix frontend run check:i18n` | pass | 2 locales / 21 namespaces. | +| `npm --prefix frontend run test:webui-assets` | pass | 113 packaged files / 350 references. | +| `uvx ruff==0.11.12 check ` and `format --check` | pass | All 12 changed production/test Python files; pinned repository hook version. | +| `uvx pyright --pythonpath .venv/bin/python ` | pass | All 12 changed Python files, 0 errors/warnings. | +| `uv run --extra dev pre-commit run gitleaks --files ` | pass | Changed source, tests, docs and built assets; no credential findings. | +| Browser fixture | pass | Actual dialog, simulated server only: three steps, no auto OV inputs, localized model rejection, same-request retry, BytePlus manual fields, legacy submitted manual recovery, Escape/focus return, 390×844 layout. Temporary fixture removed; no cloud create calls. Existing interaction tests cover loading/keyboard/IME and terminal-state behavior. | +| Isolated `test_runner_scope_covers_async_worker_events` | fail (pre-existing) | When run alone, existing `.env` initialization logs enter captured stdout and break the test JSON parsing. Reproduced the identical failure against a temporary read-only HEAD source snapshot. Broad suite passes; no unrelated logging/test changes made. | +| Real OV create/key/readiness smoke | not_run | Needs separately authorized paid isolated resource. Old-library reads are not proof of new-library default-model entitlement. | +| Codex/sidecar smoke and coverage gates | not_applicable | No worker/image/harness protocol change. | +| Full repository pre-commit / commit / push | not_run | No commit requested; affected lint, type, secret and runtime-independent checks executed. | + +AC-1–AC-4 implementation and offline verification complete. Cloud acceptance remains explicitly pending: if default models are rejected, the task reports an actionable error without creating Ark endpoints or silently omitting OV. Enterprise OV is retained after failure, cancellation or MPA deletion. + +### Live finding and source correction + +The first user-triggered live request was explicitly rejected with InvalidParameter because its model source was empty. This disproves that omitting Credentials is sufficient. The [approved source correction](../../../prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.md) adds Source/EndpointID and uses the existing resolved Ark key only in the wire payload, with safe recovery for the matching rejected intent. Earlier offline results remain evidence of the initial implementation; current verification is recorded in the correction. No successful corrected live creation has yet been claimed. diff --git a/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.zh.md b/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.zh.md new file mode 100644 index 000000000..a600c8124 --- /dev/null +++ b/prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.zh.md @@ -0,0 +1,62 @@ +# Studio MPA 自动准备 OpenViking + +[English](2026-10-13-default-model-creation.md) + +变更 ID:`mpa-openviking-auto`。日期:2026-10-13。状态:已实现;待真实验收。 +契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md)、[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。 + +## 证据、目标与非目标 +Studio 目前收集可选的 OV 地址/资源 ID/API Key。MPA 镜像已使用运行角色 STS 注册 OV 用户身份。参考库只读核对为企业版 READY,返回模型名/版本但没有模型 API Key/Key ID;控制台显示自配凭证为零、内容理解限时免费已启用。这不证明新 API 创建的库可以使用默认模型。官方 Create/Get/Access 文档定义异步 INIT/READY/FAILED 以及默认用户取 Key。 +目标:北京 Studio 的新 MPA 请求自动准备独立企业版 OV,无需手填连接参数,先尝试默认 VLM/Embedding 配置。BytePlus、通用智能体、已有任务、手动 CLI 配置和已有 Runtime 保持行为。不包含创建方舟接入点/Key、复制旧 Key、数据迁移或删除 OV。新 OV 是保留的付费资源,实现批准不等于授权真实建库。 + +## 要求与场景 +- FR-1:北京内置配置提供自动 OV 能力。新 UI 请求持久化 `openvikingMode: auto`;缺省/manual 保留旧请求语义。非火山北京的 auto、auto 与手动连接参数混用均在写操作前拒绝。CLI 通过 managed 配置显式启用。 +- FR-2:在已有授权部署锁内,以合法哈希 Name、作用域 Description、默认项目创建独立企业库;VLM 为 `doubao-seed-2.0-lite`/`260428`,Embedding 为 `doubao-embedding-vision`/`251215`,显式提供 Source/EndpointID Credentials,已解析方舟 Key 仅加入复制的网络请求。发送前保存非秘密意图,响应后立即保存 ResourceID。复用注册 ID 前核验名称/描述/项目/版本/模型;deleting/deleted 智能体不能创建。 +- FR-3:在有界期限内轮询 INIT 至 READY,FAILED/非法状态/缺失 ID/权限失败均明确报错。通过 AccessOpenVikingApiKey 取得 default 用户 Key,部署前注入地址/资源 ID/Key/用户。Key 不进入 SQLite、注册库、结果、日志或夹具。Runtime 用户注册继续由 MPA 镜像负责。 +- FR-4:后续部署失败复用注册库。明确拒绝的创建允许重试相同意图;结果不确定时阻塞,不能盲目新建,由管理员核实并补齐注册 ResourceID。取消保留已知/未知资源并停止后续调用。仅取 Key 等读取操作重试瞬时错误,创建不自动重试。 +- FR-5:第三步显示自动准备及企业版计费信息;新 auto 请求没有手动输入框。已提交手动任务和 BytePlus 保留字段/校验。安全本地化错误和阶段可见,重试保留原模式/身份。沿用现有布局、TOS 控件、键盘/IME、取消和焦点行为。 + +## 设计与影响文件 +新增 OpenViking 配置、签名控制面适配器及持锁资源准备。复用刷新且核验账号的部署凭据、已有签名函数及诊断接收器。仅使用已公开的 CreateOpenVikingCollection/GetOpenVikingCollection/AccessOpenVikingApiKey;不假设未公开的名称发现接口或幂等 token。库与 Runtime Key 生命周期独立。默认模型接受情况是明确未验证的平台能力;拒绝时不能静默新建付费方舟接入点或省略 OV。 +影响:managed config/profile/service/runner/tasks/diagnostics;新增 openviking 模块;Studio 请求/client/dialog/locales;目标测试、既有前端发布产物和使用说明。不修改通用创建/聊天/删除及 MPA 镜像。 +Studio 配置将能力展示与执行模式分开:读取配置或直接调用 provision 不会为旧请求自动开启 OV。只有新请求显式模式或 CLI 显式 managed 设置才启用创建。Runtime 部署保留现有环境、归属及请求哈希契约;四个 OV 变量已受支持,因此不需要单独修改 Runtime 契约。 +部署凭据需要 vikingdb CreateOpenVikingCollection/GetOpenVikingCollection/AccessOpenVikingApiKey 权限。Runtime 角色已有 VikingdbFullAccess 用于用户管理。仅已核验部署账号的凭据能建 OV。库绑定保存在 mpa_admin_db;智能体删除不新增 OV 库或记忆清理。 + +## 任务、验证与验收 +| 要求 | 任务 | 验收 | 验证 | +| --- | --- | --- | --- | +| FR-1/5 | T-1 模式透传与 UI | AC-1 新 auto 请求,旧/手动/BytePlus 不变 | config/route/task、React 测试及浏览器 | +| FR-2/4 | T-2 持锁意图与绑定 | AC-2 同智能体复用,冲突/未知/取消安全 | 离线适配器/资源准备测试 | +| FR-3 | T-3 就绪/Key 注入 | AC-3 四个环境变量、无秘密持久化、明确错误 | service/runner/安全测试 | +| 全部 | T-4 同步 | AC-4 双语文档、构建及必需检查 | 受影响 Python 回归、前端 test/build、Ruff/Pyright、i18n/assets、秘密扫描 | +实际验证记录见下文。真实验证需要另行批准的隔离库和清理决定;没有实测时,默认模型新建可用性标记未验证。 + +## 风险、评审与批准 +API 的可选模型凭证行为及默认模型权益可能与旧控制台库不同,默认路径拒绝时明确报错。企业版就绪即按小时计费,失败/取消/删除后保留云资源。未找到公开的名称发现/幂等契约用于恢复创建丢失响应,优先安全阻塞而非盲目重试。外部修改注册库/云资源无法与云调用组成事务。 +review-spec 不可用,已直接评审边界、凭据、归属、超时/取消、未知结果、兼容、可测试性及双语等价。用户在 2026-10-13 批准默认模型优先的北京实现,并明确确认 BytePlus 不变;未授权扩大范围。SPEC 引用的两个前端 skill 在目标路径及本地 skill 根均未找到,复用现有 ModalLayout/字段并直接核验 Foundation S1-S8,不另建设计系统。 + +## 实现评审与验证(2026-10-13) + +测试范围:基于 `71175c68636dc5b951e9804eb292d85402511e68` 的未提交 OV 改动;未修改用户状态或云资源。测试先行证据:适配器模块缺失时收集失败;auto UI 回归在仍显示手动字段时失败。实现覆盖模式透传、账号/地域拒绝、注册锁与归属、INIT/READY/FAILED、取消、未知创建结果、安全错误、秘密排除以及 Runtime 部署前环境注入。评审发现并修正两项兼容问题:必须先核验账号再构造 OV 适配器,能力展示不能替旧请求/直接调用开启 OV。 + +| 检查 | 结果 | 证据 / 范围 | +| --- | --- | --- | +| `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/cli/test_studio_rbac.py` | pass | 1,074 通过;根据本地资源使用两个 worker。 | +| `npm --prefix frontend test` | pass | 1,379 项 Node、79 项 Vitest 测试。 | +| `npm --prefix frontend run build` | pass | 同步生成 main/widget 发布产物。 | +| `npm --prefix frontend run check:i18n` | pass | 2 个语言 / 21 个 namespace。 | +| `npm --prefix frontend run test:webui-assets` | pass | 113 个发布文件 / 350 个引用。 | +| `uvx ruff==0.11.12 check ` 与 `format --check` | pass | 全部 12 个变更生产/测试 Python 文件;使用仓库 hook 固定版本。 | +| `uvx pyright --pythonpath .venv/bin/python ` | pass | 全部 12 个变更 Python 文件,0 错误/警告。 | +| `uv run --extra dev pre-commit run gitleaks --files ` | pass | 变更源码、测试、文档及构建产物,无凭据发现。 | +| 浏览器夹具 | pass | 实际弹窗,仅模拟服务:三步流程、auto 无 OV 输入、本地化模型拒绝、同请求重试、BytePlus 手动字段、已提交旧手动任务恢复、Escape/焦点恢复、390×844 布局。临时夹具已移除,未调用云创建。现有交互测试覆盖加载/键盘/IME 及终态行为。 | +| 单独运行 `test_runner_scope_covers_async_worker_events` | fail(历史问题) | 单独运行时,现有 `.env` 初始化日志进入捕获 stdout,导致测试 JSON 解析失败。以临时只读 HEAD 源码快照复现相同失败。广泛套件通过;未修改无关日志/测试。 | +| 真实 OV 创建/Key/就绪验证 | not_run | 需要另行授权的付费隔离资源。读取旧库不证明新库默认模型权益可用。 | +| Codex/sidecar smoke 与覆盖率检查 | not_applicable | 未修改 worker/镜像/harness 协议。 | +| 全仓库 pre-commit / commit / push | not_run | 本次未要求提交;已执行受影响 lint、类型、秘密及独立于真实 Runtime 的检查。 | + +AC-1–AC-4 实现及离线验证完成。真实云验收明确待完成:默认模型被拒绝时任务返回可处理错误,不创建方舟接入点、不静默省略 OV。企业版 OV 在失败、取消或 MPA 删除后保留。 + +### 真实发现及来源修正 + +首次用户触发的真实请求因模型来源为空明确返回 InvalidParameter,证明不能完全省略 Credentials。[已批准的来源修正](../../../prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.zh.md) 补齐 Source/EndpointID,仅在网络请求中使用现有已解析方舟 Key,并安全恢复完全匹配的已拒绝意图。上面的离线结果仍是初版实现证据,当前验证记录在修正文档中。尚未声称修正后真实建库成功。 diff --git a/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.md b/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.md new file mode 100644 index 000000000..cd3c3ce24 --- /dev/null +++ b/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.md @@ -0,0 +1,56 @@ +# MPA owned-resource deletion + +[中文版](2026-10-12-owned-resource-deletion.zh.md) + +Change ID: `mpa-owned-resource-deletion`. Date: 2026-10-12. Status: implemented. +Contracts: [Studio MPA](../../../specs/studio-mpa-control-plane/README.md), [provisioning](../../../specs/mpa-runtime-provisioning/README.md). + +## Evidence and scope +MPA delete preview queries Profile before sessions. A Profile authentication failure prevents confirmation; the detail page hides the sidebar containing the error. The current delete handler cleans sessions and Runtime only. Managed deployment records already persist worker/Skill Space IDs and ownership flags, with matching cloud ownership tags. + +## Goals, scenarios, and requirements +- FR-1: General Runtime deletion remains unchanged. MPA deletion must not query Profile. Active lifecycle operations and active sessions still block deletion; failed operations are terminal and do not block by themselves. Session-query failures remain errors, never zero-session success. +- FR-2: Delete only managed, exclusively owned worker templates and Skill Spaces. Verify the deployment Runtime binding, managed flags, account/region/project, ownership tags, and absence of other deployment/Runtime references. Preserve shared, imported, or unproven resources and explain preservation in preview. Discovery/ownership conflicts fail safely. +- FR-3: Cleanup order is idle sessions, worker template, Skill Space, Runtime. Persist resource cleanup intent/completion under the existing account/region advisory lock. Missing resources during cleanup support retry; other errors preserve Runtime for retry. Keep database, Workspace, network, APIG, identity, storage and all unrelated data. +- FR-4: Open confirmation immediately with a loading state. Surface preview/execution errors inside the dialog and allow preview retry. Cancel/unmount aborts preview; late responses cannot reopen or overwrite dialogs. Confirmation revalidates server-side authorization, sessions and resource ownership. + +## Design and affected files +Use the authorized Runtime's server-side registry URL and current provider credentials; do not resolve creation configuration or provision new prerequisites. Add a managed deletion service and resource-plan callback to the existing preview route. Runtime/Tool/Skills SDK calls respect provider and region. Missing registry URL/record preserves associated resources. A registered deployment mismatch blocks cleanup. Record deletion state so provisioning cannot recreate resources while cleanup is pending or complete. Extend preview additively with retained resources and resource IDs; `profile` stays null for compatibility. The existing confirmation component is the UI baseline. +Affected: managed deletion/database/cloud helpers; Studio BFF and cli_frontend; AgentWorkspace/client/i18n; focused Python and React tests; release assets; bilingual component contracts and frontend README. + +## Tasks and acceptance +| Requirement | Task | Acceptance | Verification | +| --- | --- | --- | --- | +| FR-1 | T-1 remove Profile dependence | AC-1 no Profile calls; general unchanged; active work protected | BFF and Studio RBAC regressions | +| FR-2/FR-3 | T-2 owned cleanup | AC-2 exclusive resources removed; shared/unproven resources preserved; partial retry safe | Offline managed deletion tests | +| FR-4 | T-3 visible states | AC-3 loading/error/retry/cancel/late events work | React tests and browser fixture | +| All | T-4 reconcile and verify | AC-4 localized release build and required checks | frontend test/build, targeted pytest, Ruff, Pyright, i18n/assets | + +## Risks and boundaries +External actors can change references outside the advisory lock; perform fresh cloud reads immediately before cleanup. Cloud APIs may reject deletion while references exist; propagate this failure and retain Runtime rather than report success. Session visibility remains limited to the authenticated Runtime API; no global-session claim. Removing Profile lookup does not bypass session authentication. Live deletion of user resources is not part of verification; use isolated mocks/browser fixtures. Existing independent provisioning/operation stores do not provide a cross-system transaction. + +## Review and approval +Direct design review performed because review-spec skill is unavailable: checked ownership, provider isolation, partial failure, concurrency, secrets, compatibility, bilingual equivalence and tests. User explicitly approved this approach on 2026-10-12. No unresolved design blockers. Commit/push/deployment are not authorized by design approval. + +## Verification record +Scope: local changes on d6065d6e, 2026-10-12; no commit or push. + +- pass: reproduced failures first (missing cleanup module, Profile dependency, invisible dialog errors), then implemented; offline and React cases for AC-1 through AC-3 pass. +- pass: `uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/cli/test_studio_rbac.py`: 1004 passed, using 2 workers. +- pass: subsequent ownership review, provider SDK requests and changed references: complete resource-cleanup file 17 passed; final focused deletion selection 21 passed. Covers ordering, shared retention, imported/legacy resources, ownership conflicts, discovery failure, partial retries, NotFound, cancellation intent, domestic/international requests, forged client IDs and resource preview plans. +- pass: `npm --prefix frontend test`: 1379 Node + 78 Vitest = 1457 passed; `npm --prefix frontend run build`, `check:i18n`, `test:webui-assets` (113 files, 350 references), and `git diff --check`. +- pass: real-browser isolated simulated verification: error, preview retry, cleanup failure, successful retry, loading, Escape cancellation/focus return, ignored late results, original general confirmation and 390×844 layout. No live cloud resources are changed by the fixture. +- pass: Ruff 0.11.12 matching `.pre-commit-config.yaml`, via `uvx --from ruff==0.11.12 ruff check --config pyproject.toml `; new/affected managed modules have 0 Pyright errors; `uvx pre-commit run gitleaks --files ` passes. +- fail (existing baseline): `uvx pyright --pythonpath .venv/bin/python frontend/server/mpa/routes.py veadk/cli/cli_frontend.py` reports 49 pre-existing diagnostics; comparison with the two HEAD files shows no added diagnostic. Historical cleanup is outside scope. +- not_run: live cloud deletion (user resources are not verification fixtures); all repository Python tests (all managed MPA and affected Studio authorization/control-plane tests selected); full pre-commit (no commit requested). +- not_applicable: native IME (no text inputs changed). Ruff/Pyright were unavailable locally; temporary tools were used without global configuration changes. AC-4 release assets, documentation and targeted checks are complete, with the verified existing full-file Pyright limitation retained. + +Remaining boundaries: removing Profile does not bypass session authentication; session API failure still blocks deletion and shows its cause. Live cloud cleanup is unverified. External reference edits do not honor registry locks; cloud deletion and registry writes cannot provide a cross-system transaction. + +## Session identity correction (2026-10-12) + +User verification found `x-user-id header is required` (HTTP 422) in preview. Session transport previously sent only Bearer authorization and omitted caller identity. Within approved FR-1/FR-4 scope, session listing/cleanup in preview and execution must forward Studio's server-authenticated `owner_id`, matching chat/scheduled-task identity; browser-supplied `x-user-id` is not trusted. Add optional `user_id` to Runtime client methods, preserving existing calls without it and general deletion. Review covers identity, compatibility and error propagation; add client header and BFF/execution anti-spoofing regressions. Verification: reproduced 2 failing regressions before fixing; 22 focused deletion cases pass; `uv run --extra dev pytest -n 2 -q tests/frontend/server/mpa tests/cli/test_studio_rbac.py` reports 242 passed. Ruff, Runtime client Pyright (0 errors), Gitleaks and diff whitespace pass. General deletion does not enter MPA session calls. Live cloud deletion: not_run; no frontend code changed in this correction, so the matching assets do not require rebuilding. + +## Preview latency correction (2026-10-12) + +User verification remained in checking state; the current Studio root returned HTTP 200 in 0.003 seconds, confirming responsiveness. Verified code bottlenecks are sequential Runtime detail reads and repeated STS verification on each SDK call; step logs have not yet established the slowest call in this specific request. Within approved FR-2/FR-4, preserve complete reference checks and batch detail reads with at most 4 concurrent requests. Only deletion contexts opt into request-local identity caching for unchanged credentials; credential rotation re-verifies identity and account changes remain rejected. Creation retains per-call verification by default. Limit the whole preview to 25 seconds (before the frontend 30-second deadline), returning structured `mpa_delete_preview_timeout` (HTTP 504) for retry; offload the preview’s synchronous authorization read to avoid blocking the event loop. Add timeout, concurrency, default compatibility, credential rotation/account-change regressions and directly review boundaries and bilingual equivalence. Live resource deletion remains outside verification. Verification (2026-10-12, local diff on d6065d6e): pass — `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_deletion.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/integrations/mpa_managed/test_runtime_deployment_edges.py tests/integrations/mpa_managed/test_byteplus.py` (106 passed); `uv run --extra dev pytest -q tests/cli/test_studio_rbac.py -k 'delete'` (7 passed). Python 3.10 timeout cancellation is covered. Pass — pinned Ruff; `uvx pyright --pythonpath .venv/bin/python` on runtime/deletion (0 errors); Gitleaks; diff whitespace. Full routes/CLI Pyright: fail with the same 49 baseline errors, 0 added diagnostics. Not applicable — frontend rebuild/browser fixture rerun, since this correction changes no frontend source or payload shape. Not run — live cloud deletion, measured live preview timing after restart, all-repository tests and full pre-commit (no commit requested). Existing browser state/error/retry verification remains applicable. Cancellation cannot terminate an already-running synchronous SDK thread; such preview work is read-only and no deletion is performed by preview. diff --git a/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.zh.md b/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.zh.md new file mode 100644 index 000000000..208a8c3e9 --- /dev/null +++ b/prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.zh.md @@ -0,0 +1,56 @@ +# MPA 独占资源删除 + +[English](2026-10-12-owned-resource-deletion.md) + +变更 ID:`mpa-owned-resource-deletion`。日期:2026-10-12。状态:implemented。 +契约:[Studio MPA](../../../specs/studio-mpa-control-plane/README.zh.md)、[创建流程](../../../specs/mpa-runtime-provisioning/README.zh.md)。 + +## 证据和范围 +MPA 删除预览先查询 Profile,再查询会话。Profile 鉴权失败导致无法确认;详情页隐藏了包含错误的侧栏。当前删除只清理会话和 Runtime。管理部署记录已有 Worker/Skill Space ID、归属标记及对应云资源标签。 + +## 目标、场景和需求 +- FR-1:通用 Runtime 删除不变。MPA 删除不查询 Profile。运行中的生命周期操作和会话仍阻止删除;失败操作为终止状态,本身不再阻止删除。会话查询失败必须返回错误,不得当作零会话成功。 +- FR-2:仅删除受管且独占的沙箱模板和 Skill Space。核验部署 Runtime 绑定、受管标记、账号/地域/项目、归属标签,以及其他部署/Runtime 是否引用。共享、导入或无法证明归属的资源保留,并在预览中解释。发现查询失败或归属冲突时安全失败。 +- FR-3:按空闲会话、沙箱模板、Skill Space、Runtime 顺序清理。在现有账号/地域 advisory lock 下持久保存清理意图和完成状态。清理时资源已不存在允许重试;其他错误保留 Runtime 供重试。数据库、Workspace、网络、APIG、身份、存储及无关数据保留。 +- FR-4:立即打开确认弹窗并显示加载状态。预览和执行错误在弹窗内显示,支持重试预览。取消/卸载终止预览;晚到结果不得重开或覆盖弹窗。执行时重新检查服务端授权、会话和资源归属。 + +## 设计和影响文件 +使用已授权 Runtime 的服务端注册库 URL 和当前 Provider 凭据,不解析创建配置,也不创建前置资源。增加受管删除服务,给现有预览路由接入资源计划回调。Runtime/Tool/Skills SDK 调用遵循 Provider 和地域。缺少注册库 URL/记录时保留相关资源;部署记录不匹配时阻止清理。记录删除状态,防止创建流程在清理进行中或完成后重建资源。预览以兼容方式增加保留资源及资源 ID;`profile` 保持 null。UI 沿用现有确认弹窗。 +影响文件:managed 删除/数据库/云适配器;Studio BFF、cli_frontend;AgentWorkspace/client/i18n;定向 Python 和 React 测试;发布产物;双语组件契约与 frontend README。 + +## 任务和验收 +| 需求 | 任务 | 验收 | 验证 | +| --- | --- | --- | --- | +| FR-1 | T-1 移除 Profile 依赖 | AC-1 不调用 Profile;通用不变;保护运行任务 | BFF 与 Studio RBAC 回归 | +| FR-2/FR-3 | T-2 独占清理 | AC-2 删除独占资源;保留共享/归属不明资源;安全重试部分失败 | managed 删除离线测试 | +| FR-4 | T-3 可见状态 | AC-3 加载/错误/重试/取消/晚到事件正确 | React 测试及浏览器 fixture | +| 全部 | T-4 同步与验证 | AC-4 本地化发布构建及必要检查 | frontend test/build、定向 pytest、Ruff、Pyright、i18n/assets | + +## 风险和边界 +外部操作者可能绕过 advisory lock 修改引用;清理前重新读取云端状态。云接口可能拒绝删除被引用资源;应返回错误并保留 Runtime,不能报告成功。会话可见范围仍由已认证 Runtime API 决定,不能宣称全局会话已检查。取消 Profile 查询不绕过会话鉴权。验证使用隔离模拟及浏览器 fixture,不删除用户云资源。现有创建/操作存储之间没有跨系统事务。 + +## 评审和批准 +review-spec skill 不可用,已直接评审归属、Provider 隔离、部分失败、并发、密钥、兼容性、双语等价及测试。用户于 2026-10-12 明确批准本方案。无设计阻断项。设计批准不授权提交、推送或部署。 + +## 验证记录 +范围:d6065d6e 上的本地改动,2026-10-12;未提交或推送。 + +- pass:先复现失败(资源模块未实现、Profile 依赖、弹窗错误不可见),再实现;AC-1 至 AC-3 的离线和 React 用例通过。 +- pass:`uv run --extra dev pytest -n 2 -q tests/integrations/mpa_managed tests/frontend/server/mpa/test_runtime_profile_routes.py tests/frontend/server/mpa/test_runtime_profile_client.py tests/cli/test_studio_rbac.py`,1004 passed,使用 2 个 worker。 +- pass:后续归属复核、Provider SDK 请求和引用变化补充验证:完整资源清理文件 17 passed;最后删除相关定向选择 21 passed。覆盖执行顺序、共享保留、导入/旧资源、归属冲突、发现失败、部分重试、NotFound、取消意图、国内/海外请求、伪造客户端 ID 以及预览资源计划。 +- pass:`npm --prefix frontend test`,1379 Node + 78 Vitest = 1457 passed;`npm --prefix frontend run build`、`check:i18n`、`test:webui-assets`(113 文件、350 引用)和 `git diff --check`。 +- pass:真实浏览器中的隔离模拟验证:错误、重新检查、清理失败、重试成功、加载、Escape 取消/焦点返回、晚到结果不重开、通用原确认、390×844 窄窗口。浏览器不操作真实云资源。 +- pass:按仓库 `.pre-commit-config.yaml` 的 Ruff 0.11.12,使用 `uvx --from ruff==0.11.12 ruff check --config pyproject.toml `;新增/受影响 managed 模块 Pyright 为 0 errors;`uvx pre-commit run gitleaks --files ` 通过。 +- fail(既有基线):`uvx pyright --pythonpath .venv/bin/python frontend/server/mpa/routes.py veadk/cli/cli_frontend.py` 有 49 条既有诊断;与 HEAD 两文件基线逐项比较,没有新增诊断。未扩大范围清理历史问题。 +- not_run:真实云删除(不使用用户资源验证);仓库全部 Python 测试(本次选择所有 MPA managed 和受影响 Studio 权限/控制面测试);完整 pre-commit(未请求提交)。 +- not_applicable:原生 IME(无输入框改动)。本地未安装 Ruff/Pyright,通过临时工具环境验证,未修改全局配置。AC-4 的发布产物、文档和针对性检查完成;全文件 Pyright 保留已确认的历史基线限制。 + +剩余边界:移除 Profile 查询不会绕过会话鉴权;会话接口失败仍阻止删除并显示原因。云端实际清理行为尚未做实时验证。外部引用修改不受注册库锁约束;云删除与注册库保存之间无法提供跨系统事务。 + +## 会话身份补正(2026-10-12) + +用户实测预览返回 `x-user-id header is required`(HTTP 422)。之前会话 transport 只传 Bearer,遗漏用户身份。沿用已批准 FR-1/FR-4 范围:预览和实际删除的会话查询/清理必须传 Studio 服务端已认证的 `owner_id`,与聊天/定时任务一致;不采信浏览器伪造的 `x-user-id`。Runtime client 增加可选 `user_id` 参数,未提供时保持原调用兼容,通用删除不变。评审已核对调用身份、兼容性和错误传播;增加 client 请求头及 BFF/删除执行的反伪造回归测试。验证:先复现 2 条失败回归后修复;删除定向 22 passed;`uv run --extra dev pytest -n 2 -q tests/frontend/server/mpa tests/cli/test_studio_rbac.py` 为 242 passed;Ruff、Runtime client Pyright(0 errors)、Gitleaks 和 diff whitespace 均 pass。通用删除未进入 MPA 会话调用。真实云删除 not_run;本轮无前端代码改动,因此无需重建已匹配的前端产物。 + +## 预览耗时补正(2026-10-12) + +用户实测停在检查状态;当前服务根页面在 0.003 秒内返回 HTTP 200,表明服务仍响应。已确认的代码瓶颈是 Runtime 详情串行读取,以及每次 SDK 调用重复核验 STS;尚未通过逐步骤日志证明本次最慢的具体调用。沿用已批准 FR-2/FR-4,保持完整引用核验,详情分批最多 4 个并发。仅删除上下文可启用同一凭据的请求内身份缓存;凭据变化时重新核验且账号变化继续拒绝,创建流程默认逐次核验不变。预览整体限时 25 秒(早于前端 30 秒),超时返回结构化 `mpa_delete_preview_timeout`(HTTP 504)供重试;删除预览的同步授权读取移入线程,避免阻塞事件循环。补充限时、并发、默认兼容、凭据轮换/账号变化回归,并直接评审边界和中英文等价性。未增加真实云资源删除验证。验证(2026-10-12,d6065d6e 上的本地差异):pass — `uv run --extra dev pytest -q tests/integrations/mpa_managed/test_deletion.py tests/frontend/server/mpa/test_runtime_profile_routes.py tests/integrations/mpa_managed/test_runtime_deployment_edges.py tests/integrations/mpa_managed/test_byteplus.py`(106 项通过);`uv run --extra dev pytest -q tests/cli/test_studio_rbac.py -k 'delete'`(7 项通过)。覆盖 Python 3.10 超时取消。pass — 固定版本 Ruff;runtime/deletion 的 `uvx pyright --pythonpath .venv/bin/python`(0 错误);Gitleaks;差异空白检查。完整 routes/CLI Pyright:fail,仍为基线 49 条错误,新增 0 条诊断。not_applicable — 重新构建前端/重跑浏览器夹具,本次补正没有修改前端源码或响应结构。not_run — 真实云资源删除、重启后的真实预览耗时、全仓测试和完整 pre-commit(未要求提交)。已有浏览器状态、错误和重试验证仍适用。取消无法终止已经运行的同步 SDK 线程;此类预览工作仅为只读,预览不会执行删除。 diff --git a/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.md b/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.md index beccd087f..3c0ef4e0e 100644 --- a/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.md +++ b/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.md @@ -233,7 +233,7 @@ Commands/files marked "to add" below are deliverables of the corresponding slice ### VC-19: compatibility, regression, and performance - Preconditions: S1 through S5 implementation and non-live Cases are complete, but `VC-21` has not run; M0 has recorded both SHAs/image digest/protocol versions. Run the compatibility preflight first, then VC-21, then rerun this Case's full regression/performance section as the final gate. -- Command: `scripts/verify-mpa-p0-contract.sh --manifest --matrix contracts/mpa-p0/compatibility-matrix.json`, followed by Runtime `make test && make coverage && make test-postgres`, VeADK `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" && npm --prefix frontend test && npm --prefix frontend run build && uv run --extra dev pre-commit run --all-files`. Performance runner: `scripts/benchmark-mpa-p0.py --warmup 5 --requests 100 --concurrency 10 --list-size 20`. +- Command: `scripts/verify-mpa-p0-contract.sh --manifest --matrix frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json`, followed by Runtime `make test && make coverage && make test-postgres`, VeADK `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" && npm --prefix frontend test && npm --prefix frontend run build && uv run --extra dev pre-commit run --all-files`. Performance runner: `scripts/benchmark-mpa-p0.py --warmup 5 --requests 100 --concurrency 10 --list-size 20`. - Input: every PRD compatibility combination and fixed fixtures. - Expected: matrix results match; MPA update/release/rollback write routes reject incompatible manifests before mutation; Runtime coverage >=95%; no regressions; performance report includes p50/p95/max/error rate. - Raw local evidence: ignored `evidence/contract//VC-19.json` and test/build/coverage/benchmark output. diff --git a/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.zh.md b/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.zh.md index bffec5119..0ff0d7dd4 100644 --- a/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.zh.md +++ b/prd-spec/features/mpa-p0-productionization/2026-09-15-functional-validation-cases.zh.md @@ -233,7 +233,7 @@ ### VC-19:兼容、回归与性能 - 前置:S1~S5 的实现和非 live Case 已完成,但 `VC-21` 尚未执行;M0 已写入双方 SHA/image digest/协议版本。先以兼容矩阵 runner 完成发布前 preflight,再执行 VC-21;VC-21 后重跑本 Case 的全量回归/性能部分作为最终门禁。 -- 命令:`scripts/verify-mpa-p0-contract.sh --manifest --matrix contracts/mpa-p0/compatibility-matrix.json`,随后 Runtime `make test && make coverage && make test-postgres`,VeADK `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" && npm --prefix frontend test && npm --prefix frontend run build && uv run --extra dev pre-commit run --all-files`。性能 runner 为 `scripts/benchmark-mpa-p0.py --warmup 5 --requests 100 --concurrency 10 --list-size 20`。 +- 命令:`scripts/verify-mpa-p0-contract.sh --manifest --matrix frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json`,随后 Runtime `make test && make coverage && make test-postgres`,VeADK `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke" && npm --prefix frontend test && npm --prefix frontend run build && uv run --extra dev pre-commit run --all-files`。性能 runner 为 `scripts/benchmark-mpa-p0.py --warmup 5 --requests 100 --concurrency 10 --list-size 20`。 - 输入:PRD 全部兼容组合和固定 fixtures。 - 预期:矩阵结果吻合;MPA update/release/rollback 写路由在副作用前拒绝不兼容 manifest;Runtime coverage ≥95%;无回归;性能报告含 p50/p95/max/error rate。 - 原始本地证据:被忽略的 `evidence/contract//VC-19.json`、测试/build/coverage/benchmark 输出。 diff --git a/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.md b/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.md index 6774c08da..9b3b586e8 100644 --- a/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.md +++ b/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.md @@ -294,7 +294,7 @@ M0 replaces `` and `` with actual artifac The Worker has no independent capability-discovery/version endpoint today. M0's static compatibility baseline is the `codex` query plus `/health`, `/ready`, session-create, turn-start, and event-stream contracts above. Any change to that set first requires Worker capability/version negotiation and separate review; P0 does not modify the Worker. -The shared compatibility preflight implementation is `veadk.cli.mpa_p0_contract`. The shell runner `scripts/verify-mpa-p0-contract.sh` calls the same code path, and Studio calls it before MPA Runtime writes. The accepted manifest is a redacted JSON object containing `veadkRevision`, `runtimeRevision`, `runtimeImageDigest`, Profile/config schema versions, AgentKit SDK version, Runtime execution capability, Worker protocol, and required Worker endpoints. The check never echoes the manifest body back to the browser. If a supplied manifest is malformed or not listed in `contracts/mpa-p0/compatibility-matrix.json`, Studio returns `409` with `code=mpa_compatibility_preflight_failed` and does not call AgentKit SDK or GitHub mutation helpers. +The shared compatibility preflight implementation is `veadk.cli.mpa_p0_contract`. The shell runner `scripts/verify-mpa-p0-contract.sh` calls the same code path, and Studio calls it before MPA Runtime writes. The accepted manifest is a redacted JSON object containing `veadkRevision`, `runtimeRevision`, `runtimeImageDigest`, Profile/config schema versions, AgentKit SDK version, Runtime execution capability, Worker protocol, and required Worker endpoints. The check never echoes the manifest body back to the browser. If a supplied manifest is malformed or not listed in `frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json`, Studio returns `409` with `code=mpa_compatibility_preflight_failed` and does not call AgentKit SDK or GitHub mutation helpers. For local Studio write-path protection, when the UI identifies the target as `agentCategory=mpa` but no explicit manifest is supplied, the BFF constructs a minimal P0 manifest from the current VeADK git revision plus `VEADK_MPA_RUNTIME_REVISION` and `VEADK_MPA_RUNTIME_IMAGE_DIGEST` when available; absent runtime artifact values are represented by syntactically valid zero placeholders. This only proves that the requested operation is still inside the approved P0 protocol shape. It is not release evidence. `S5-10/VC-19` must still run with pinned real VeADK SHA, Runtime SHA, Runtime image digest, and protocol versions before the final release gate. diff --git a/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.zh.md b/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.zh.md index 76035722b..628f01e60 100644 --- a/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.zh.md +++ b/prd-spec/features/mpa-p0-productionization/2026-09-15-mpa-p0-productionization-design.zh.md @@ -294,7 +294,7 @@ M0、S1 至 S5 严格串行通过各自门禁,但允许拆成独立合入和 当前 Worker 没有独立 capability discovery/version endpoint;M0 的静态兼容基线就是上述 `codex` query、`/health`、`/ready`、session/create、turn/start、event stream 接口集合。若任一接口契约变化,必须先增加 Worker capability/version 协商并单独评审;本 P0 不修改 Worker。 -共享兼容性 preflight 实现在 `veadk.cli.mpa_p0_contract`。shell runner `scripts/verify-mpa-p0-contract.sh` 调用同一代码路径,Studio 在 MPA Runtime 写操作前也调用它。接受的 manifest 是脱敏 JSON 对象,包含 `veadkRevision`、`runtimeRevision`、`runtimeImageDigest`、Profile/config schema version、AgentKit SDK version、Runtime execution capability、Worker protocol 和必需 Worker endpoints。检查失败时不会把 manifest 正文回显给浏览器。若传入 manifest 格式非法,或未命中 `contracts/mpa-p0/compatibility-matrix.json`,Studio 返回 `409`,`code=mpa_compatibility_preflight_failed`,且不会调用 AgentKit SDK 或 GitHub mutation helper。 +共享兼容性 preflight 实现在 `veadk.cli.mpa_p0_contract`。shell runner `scripts/verify-mpa-p0-contract.sh` 调用同一代码路径,Studio 在 MPA Runtime 写操作前也调用它。接受的 manifest 是脱敏 JSON 对象,包含 `veadkRevision`、`runtimeRevision`、`runtimeImageDigest`、Profile/config schema version、AgentKit SDK version、Runtime execution capability、Worker protocol 和必需 Worker endpoints。检查失败时不会把 manifest 正文回显给浏览器。若传入 manifest 格式非法,或未命中 `frontend/server/mpa/contracts/mpa-p0/compatibility-matrix.json`,Studio 返回 `409`,`code=mpa_compatibility_preflight_failed`,且不会调用 AgentKit SDK 或 GitHub mutation helper。 本地 Studio 写路径防护中,如果 UI 标记目标为 `agentCategory=mpa` 但未显式提交 manifest,BFF 会使用当前 VeADK git revision,以及可用时的 `VEADK_MPA_RUNTIME_REVISION`、`VEADK_MPA_RUNTIME_IMAGE_DIGEST` 生成最小 P0 manifest;缺失的 runtime artifact 值使用语法合法的全 0 占位。这个默认 manifest 只证明当前操作仍处于已批准的 P0 协议形态内,不作为发布证据。最终 release gate 仍必须由 `S5-10/VC-19` 使用真实固定的 VeADK SHA、Runtime SHA、Runtime image digest 和协议版本执行。 diff --git a/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.md b/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.md new file mode 100644 index 000000000..26b2c7b9a --- /dev/null +++ b/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.md @@ -0,0 +1,313 @@ +# Studio MPA TOS IAM mount + +[中文版](2026-10-12-bucket-only.zh.md) + +- Change ID: `studio-mpa-tos-iam` +- Date: 2026-10-12 +- Status: implemented; upstream targeted checks verified; historical V42 live evidence retained; upstream port not deployed; baseline-wide gates blocked +- Base: official `origin/main`, `812faadf`; initial implementation/verification base: `superops/main`, `035387d1` +- Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), session output storage. + +## Lifecycle integration plan (2026-10-14) + +The user approved an independent branch targeting +`superops-team/veadk-python:feat/mpa-lifecycle-upstream-20261013` at `2ffe6e14`. +Replace fork PR #25 only after the replacement exists; preserve the shared +source branch and official PR #1163 unchanged. Resolve the request/API/dialog +conflicts by retaining automatic OpenViking, per-agent PostgreSQL, dedicated +`aidb` name preflight/reservations and maximum-instance selection, while using +bucket-only IAM Role TOS configuration. Preserve both README release notes and +regenerate packaged WebUI assets with the normal build. No new interface +semantics, cloud deployment or existing-resource migration are intended. + +Manual design review confirms the combination preserves each branch's approved +behavior, name reservations, request identity and transient TOS configuration. +No component semantics change beyond the existing Role design. Remove the +ported TOS section's conflicting CON-17 label; retain the target's BytePlus +CON-17 and all other lifecycle identifiers. + +Verification on 2026-10-14 (base `2ffe6e14`, integration working diff): + +- Added four combined lifecycle/TOS cases (two Python, two Vitest). Python + request-module tests pass 18/18; dialog tests pass 67/67. The manual-mode test's + initial incorrect expectation was corrected to the existing omitted-field + contract; automatic mode retains `openvikingMode=auto`. No independent defect + was confirmed. +- Managed MPA/Tool/resource-list pytest passes 1,038/1,038. Coverage run passes + the same cases. Executable diff coverage against the target is 100%: Python + 102/102 and TypeScript 10/10, using utree with coverage.py XML / Clover XML + and the user's 95% threshold (not an invented CI rule). +- Full frontend passes 1,389 Node tests and 105 Vitest cases; build, + packaged-asset checks, i18n and all-file pre-commit pass. Python is 3.12.12. +- Full Python regression: 7,150 passed, 16 failed, 2 collection errors, + 59 skipped, 4 xfailed and 6 subtests passed (469.04 s, two workers). + The target's clean archive reproduces all 16 failures / 2 errors + (99 other cases pass): missing optional llama_index, openai_codex and anthropic + dependencies. Changed-source Pyright reports the same 15 SDK constructor + errors reproduced on target `mpa_tool.py`. These gates remain blocked/failing; + no smoke execution or Python 3.10 result is claimed. +- Isolated local browser verifies combined automatic-OV/dedicated-PG/bucket + submission without TOS keys, normal/empty/loading/error/retry states, + keyboard bucket selection, task cancellation/retry, step navigation and a + 390px viewport. The wording-only change is visibly verified. APIs are mocked; + this does not prove real cloud creation. Temporary harness files were removed. + +This integration is implemented and targeted checks verified, not deployed. +Historical V42 cloud evidence below does not validate this new integration. + +The user requested a wording-only amendment on 2026-10-14: the Studio hint now +states that without a selected bucket files remain in the sandbox's local +directory. Translate the hint consistently; the built-in no-mount default and +CLI/profile compatibility remain unchanged. + +## Background and scope + +Studio currently requires `tosAccessKey`, `tosSecretKey`, and `tosBucket` together. +`mpa_tool.build_tos_mount_config` always emits access-key authentication. The +AgentKit SDK supports `TOS_CREDENTIAL_TYPE_IAM_ROLE` without Credentials. The +existing managed IAM reconciler preserves extra bindings and rejects conflicting +policy documents. Its platform TOS policy does not grant business-bucket writes. + +The user approved bucket-only Studio creation and automatic, additive bucket +authorization on 2026-10-12. This changes TOS mount authentication, not Studio +login, Runtime KeyAuth/JWT, or the Worker protocol. The initial implementation +scope excluded publication. The subsequent user request on 2026-10-12 authorizes +commit/push, updating the existing cloud Studio and creating a test MPA. Bucket +creation/public-policy changes and existing-Session migration remain out of scope. + +## Requirements and scenarios + +### Approved prefix amendment + +On 2026-10-12 the user narrowed Studio selection to bucket names beginning with +`agentkit-platform-`. The selector requests an optional `namePrefix` on the +existing deployment-resource API; apply exact, case-sensitive prefix filtering +before search, counts and pagination. Unfiltered/general deployment queries keep +their behavior. Studio creation rejects other buckets, including stale drafts, +before cloud calls; standalone CLI/Worker bucket validation remains unchanged. +No role policies, public-bucket policies or Session paths are changed by this +amendment. Test allowed/excluded/lookalike names, empty selection, stale drafts, +query transport and pagination. Manual design review confirms these boundaries. +The earlier version was deployed as V41 with unchanged environment and matching +frontend asset hash. No MPA was submitted or bucket policy attached before the +user requested this amendment; cloud creation/E2E is on hold. + +Prefix amendment verification: added 8 Python cases and 3 Vitest cases. The +related Python suite passes 754/754; dialog tests pass 46/46; full frontend tests +pass 1,377 Node tests plus 73 Vitest cases. Build, packaged assets (113 files/350 +references), i18n, Ruff, changed-file Pyright and pre-commit pass. Executable diff +coverage for the four scoped files against HEAD is 100% (Python 22/22, frontend +10/10), parsed with utree using coverage.py XML and Istanbul Clover XML. The +initial tests failed on missing prefix behavior; related Studio fixtures were +updated without relaxing authorization ordering/failure assertions. Full Python +regression ran again: 6,495 passed, 6 failed, 2 collection errors, 19 skipped, +2 xfailed and 6 subtests passed. The failing Harness cases and missing optional +dependencies are the previously reproduced baseline blockers. The local browser +shows only matching buckets using simulated responses; temporary harness files +and Vite were removed. No existing defect was reported: this is an approved scope +change. This is the pre-publication evidence snapshot; the subsequent authorized +publication and live Role mount verification are pending and will be recorded +separately from these local results. + +- FR-1: Show one optional bucket selector using the existing resource-list hook + and DeploymentSelect; retain loading/error/empty/search/pagination/retry, + disabled state, keyboard behavior, and cancellation. No TOS AK/SK input. +- FR-2: A nonempty Studio bucket chooses IAM Role using the actual Worker Tool + role. Reject malformed names and legacy nonempty credential submissions safely. + Remove credentials from recovered browser drafts. Empty selection retains the + server profile (the built-in profile has no mount). CLI/YAML access-key mode remains compatible; + explicit `tos-credential-type: iam_role` enables bucket-only managed profiles. +- FR-3: Before workload-identity/database/network mutations, verify the selected bucket belongs + to the deployment account and region, then ensure one stable bucket-specific + custom policy and its Global binding on the Worker role. Verify account/trust, + policy content, and readback. Preserve unrelated policies/trust. Reject + conflicts; recover missing-policy/create/attach races with a bounded timeout. +- FR-4: Grant `tos:HeadBucket` and `tos:ListBucket` only on the selected bucket; + grant `tos:GetObject`, `tos:PutObject`, `tos:AbortMultipartUpload`, and + `tos:DeleteObject` only on its `sandbox-session/*` objects. No other buckets, + CreateBucket, bucket-policy/ACL changes, KMS grants, or wildcard object scope. +- FR-5: Emit IAM Role Tool mount without Credentials. Keep `/data/output`, the + canonical per-session TOS path, and nonsecret Runtime mount flag/bucket. + Reuse validation must reject authentication-mode/role mismatches, not just + matching mount paths. Existing Tools and Sessions are never silently mutated. +- FR-6: Permission, ownership, configuration, and policy conflicts stop creation + at the IAM stage with safe localized errors. Cancellation keeps durable IAM + objects for retry. Cloud operations use fresh verified deployment credentials. + +## Design and compatibility + +Add an optional managed Worker credential mode while retaining the historical +access-key default for CLI. Studio's request contains only `tosBucket` and its +fixed runner applies IAM Role. Existing task identity/locking/cancellation remain +unchanged. Reuse existing IAM SDK boundary, canonical document comparison, and +error allowlist for an independently named bucket policy; do not edit +`VeADKMPARuntimeAccessV1`. Stable policy names avoid read/merge/write races +between different buckets. Identical concurrent operations converge. + +The policy exposes bucket metadata through ListBucket but object access is +restricted to session outputs. The shared role grants all of its consumers that +same prefix access: per-session directories are not tenant authorization. +SSE-KMS buckets require separately approved key permissions. Old Studio clients +sending credential fields must refresh; they receive a safe validation error. +Legacy CLI access-key requests and general-agent deployment remain unchanged. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | Evidence | +| --- | --- | --- | --- | +| FR-1, FR-2 | T-1: UI/API/config | AC-1: bucket-only payload, stale-secret stripping, selection states | config/routes tests and 43 dialog cases pass; isolated browser pass | +| FR-3, FR-4, FR-6 | T-2: IAM ensure and service wiring | AC-2: exact scoped policy, repeated/concurrent retry, failure/cancel boundaries | IAM/service tests pass | +| FR-5 | T-3: Tool payload/reuse checks | AC-3: no Credentials and strict mode/role validation; legacy mode unchanged | Tool/worker tests pass | +| All | T-4: docs/assets/gates | AC-4: targeted/full tests, build/assets, browser states, executable diff coverage >95% | targeted/build/assets/browser/coverage pass; full regression and Pyright have reproduced baseline blockers | + +Run affected pytest modules first; then +`uv run --extra dev pytest -n 2 -m 'not codex_smoke and not piagent_smoke'`, +`npm --prefix frontend test`, build, asset verification, changed-file +Ruff/Pyright, i18n, secret scan, and diff whitespace. Coverage is executable +changed lines, not whole-module coverage. Browser checks use isolated mocked +provider responses; real IAM/mount E2E is not_run without separate authorization. + +## Review and delivery + +Manual design review substitutes for the unavailable review-spec skill. It +confirmed role ownership, additive policy scope, legacy CLI compatibility, +retry/cancel behavior, localization, and bilingual equivalence. The unavailable +ui-ux-pro-max skill is replaced by the repository SPEC/Foundation and existing +selector behavior. Test-skill production-edit restrictions do not apply to the +user's explicitly authorized feature implementation; tests retain strict +expected-behavior assertions. + +## Verification and change record — 2026-10-12 + +Changed the Studio request/dialog, managed Worker configuration, IAM reconciliation, +service ordering and Tool metadata validation; updated both component specs and +operator guides. No MPA Agent/Worker source changes are needed: existing Session +mount paths remain unchanged. Reused resource selectors and their existing stylesheet +instead of creating a new UI system. Temporary browser harness/source files were +deleted and its local Vite process stopped; production assets were rebuilt. + +- **pass:** Python 3.12.12, `tests/integrations/mpa_managed` plus + `tests/integrations/test_mpa_tool.py`: 719/719, including 42 net-new cases versus + the 677-case baseline. Initial contract tests failed before implementation. + With coverage enabled, Pydantic lazy import fails during collection in the + plugin environment; explicitly importing `pydantic.RootModel` before + `pytest.main([...])` enables the same 719 tests with coverage, without product + or dependency changes. The baseline's service collection reproduces this + coverage import error too. Python 3.13 was not used as final verification. +- **pass:** executable changed-line coverage 100%: Python 97/97 from + `utree coverage parse` using diff hunks and coverage XML; frontend 9/9 using + Istanbul statement-start locations intersected with changed lines. Unchanged + source, type-only lines, tests, docs and generated bundles are excluded. This + is incremental line coverage, not whole-file or branch coverage. +- **pass:** `npm --prefix frontend test`: 1,377 Node tests and 70 Vitest cases; + `npm --prefix frontend run build`, `check:i18n`, `test:webui-assets` (113 files, + 350 internal references), Ruff, pre-commit all files and `git diff --check`. + Vite reports its existing large-chunk warning. +- **pass:** real local browser with simulated API responses: normal selection, + no TOS key inputs, loading, empty, error/retry, search, pagination, keyboard + selection, Chinese search input, close and 390px viewport. This is not live + cloud IAM/mount verification or a real OS IME composition test. +- **fail, baseline reproduced:** full parallel regression: 6,485 passed, + 6 failed, 2 collection errors, 19 skipped, 2 xfailed, 6 subtests passed. The + exact six Harness cases and two self-host Sandbox collection errors recur in + an isolated archive of `035387d1` using the same interpreter (60 passed); + optional `llama_index`/`anthropic` dependencies are absent. These unrelated + dependencies/implementations were not changed or installed to mask the gate. +- **fail, baseline reproduced:** Pyright with `.venv/bin/python`: 15 SDK + call-signature errors in unchanged legacy `mpa_tool.py` calls. A temporary + copy of the exact baseline file reports the same 15 errors and was deleted. + The other changed production Python files have no Pyright diagnostics. +- **not_run:** cloud IAM writes, live Role-mounted Session E2E, deployment, + image publication, commit and push. Existing Tools/Sessions remain untouched. + Shared-role access, existing denies, public bucket policy and KMS restrictions + remain operator-visible limitations; a granted policy is not proof of cloud + filesystem access. + +Implementation review covered fixed bucket-derived names, account/region/trust +verification, exact resource prefixes, additive idempotency/races, safe failures, +timeouts/cancellation and legacy CLI compatibility. No existing-policy rewrite or +global object permission was introduced. Full-suite/typing gates cannot be called +passing; live acceptance remains separate from this local implementation. + +### Authorized publication and live acceptance + +On 2026-10-12, rebased against unchanged `superops/main` and pushed implementation +commit `267705ef` to `polaris/czh/studio-mpa-tos-iam-role`. After synchronization, +754 related Python cases and 1,377 Node plus 73 Vitest cases passed again; +pre-commit, i18n and packaged assets also passed. The baseline-wide blockers +recorded above remain unchanged. + +Updated only the existing Studio code bundle to V42, preserving its environment +hash and branding. The packaged wheel's seven production source files and all +WebUI assets matched the checkout; remote entry JS/CSS/logo hashes matched the +local package. Wheel SHA256: +`023bf085371cdc7c285b5e60bfcb2dd08e390c1935b7a995475c82c47b925a14`. +No new Runtime/Worker image was built for this Studio-only publication. + +Remote Studio showed four platform-prefix buckets instead of eighteen unfiltered +buckets and rejected the old `agentkit-demo` draft. Created the test MPA +`role-tos-e2e-20261012-a` using `agentkit-platform-2112682748`, with no TOS AK/SK. +Runtime `r-yex3bbopvkwqejues1lc` became Ready and `/readiness` returned 200. +Worker `t-yex3bb51xcwqejuen9oc` was Ready with Role +`IDRoleForArkClawShareAgent`, `TOS_CREDENTIAL_TYPE_IAM_ROLE`, no Credentials, +read/write `/data/output`, and the expected base mount path. IAM readback confirmed +the exact bucket/session-prefix custom policy was attached. The role already had +the platform-bucket system policy; additive reconciliation does not narrow those +pre-existing permissions. The selected bucket had no public bucket policy. + +Two conversations submitted through remote Studio executed actual Sandbox +commands. GetSession readback confirmed separate +`/sandbox-session/tool-{tool_id}/session-{user_session_id}/` mounts. Both wrote +`role-tos-e2e.txt` with different A/B markers; the second initially found no file. +Independent owner-side TOS reads (no owner-side writes) verified both objects and +that A remained unchanged after B. A's Sandbox result, TOS object and browser +download shared SHA256 +`e762fa20c53dd7394b3f89af8e084e42d486a8e241fa37d68acbd695a17b82a7`; +B's Sandbox result and TOS object shared SHA256 +`0d797e5173d581880100a21f25a7e00f4990d82b440c4f01f01d78e8776b1e6e`. +The browser download event waiter expired after 45 seconds, but the download +subsequently completed and its local bytes were verified; this was not an +endpoint failure. The image does not expose `/ready?scope=execution` (404), so +execution proof comes from commands and object reads, not that readiness route. + +The test MPA and its two output objects are retained for inspection. Existing +Tools/Sessions were not mutated. No repository exploration files remain. This +acceptance does not test role permission subtraction, KMS-encrypted buckets, +explicit Deny policies, independent principals or real business-channel delivery. + +### Official upstream PR preparation + +The user subsequently requested a PR to `volcengine/veadk-python:main`. The fork +branch's merge-base would include unrelated history, so the two feature/evidence +commits were transferred onto official main `812faadf` in a separate branch, +`czh/studio-mpa-tos-iam-role-upstream`. The sole production-source conflict was an +import: preserve official `resolve_model_key` together with the TOS IAM ensure. +Generated WebUI conflicts were resolved by rebuilding from the upstream source, +not by choosing either old asset set. No unrelated fork commits were imported. + +The two TOS ordering cases initially failed because their fake cloud did not +provide official main's new Ark key discovery dependency. Only these cases were +updated to mock that dependency, assert it was awaited with the correct profile +and cloud, and retain all grant-before-identity/error propagation assertions. +Both cases then passed. No production logic was changed to accommodate the tests. + +Upstream verification with Python 3.12.12: 872 related Python tests passed; +1,377 Node tests and 75 Vitest cases passed; frontend build, i18n, assets, +Ruff 0.11.12 (repository-pinned version) and pre-commit passed. Incremental +executable-line coverage against official main was 100% (Python 102/102, TS +10/10), parsed with coverage.py XML and Istanbul Clover XML. The focused test +repair followed bits-unit-test-gen Steps 1-7; TOS orchestration coverage was 5/5 +changed executable lines and utree flush completed. + +Full upstream regression completed: 6,950 passed, 16 failed, 2 collection errors, +59 skipped, 4 xfailed, 6 subtests passed. Six Harness failures and two self-host +collection errors were reproduced on an isolated official-main archive with the +same interpreter (64 passed): missing optional `llama_index`/`anthropic`. +The ten Codex runtime failures were also reproduced on that archive: missing +optional `openai_codex`. The 15 legacy SDK call-signature Pyright errors were +reproduced from official main's original `mpa_tool.py`. These gates are not green. + +The V42 cloud evidence above belongs to the original fork implementation. The +official-base port was not redeployed or browser/cloud E2E-tested in this PR +preparation task; its official model-key behavior is retained, not inferred to +have run in V42. The original fork PR and cloud resources remain unchanged. diff --git a/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.zh.md b/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.zh.md new file mode 100644 index 000000000..297ae58dd --- /dev/null +++ b/prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.zh.md @@ -0,0 +1,246 @@ +# Studio MPA TOS IAM 挂载 + +## Lifecycle 合入方案(2026-10-14) + +用户确认从 `superops-team/veadk-python:feat/mpa-lifecycle-upstream-20261013` +(`2ffe6e14`)新建独立分支,创建替代 PR 后关闭 #25,保留共享源分支和官方 +PR #1163 不变。解决请求模型、API 和表单冲突时,同时保留自动 OpenViking、 +独立 PostgreSQL Workspace、`aidb` 名称预检/占用和最大实例数配置,TOS 则使用 +仅选桶的 IAM Role 配置。README 保留双方说明,WebUI 生成文件按正常构建刷新。 +不新增接口语义,不部署云端,不迁移已有资源。 + +手工设计评审确认:组合保留双方已批准行为、名称占用、请求身份以及 TOS 临时 +配置;除现有 Role 设计外不改变组件语义。去掉移植 TOS 段落与目标分支冲突的 +CON-17 标号,保留目标的 BytePlus CON-17 和其他 lifecycle 标识。 + +2026-10-14 验证结果(基线 `2ffe6e14`,本次合入工作区 diff): + +- 新增 4 个 lifecycle/TOS 组合用例(Python、Vitest 各 2 个)。创建请求模块 + 18/18 通过,表单 67/67 通过。手动模式测试首次预期错误,已按既有省略字段 + 契约修正;自动模式保留 `openvikingMode=auto`。未确认独立业务缺陷。 +- 托管 MPA/Tool/资源列表 pytest 1,038/1,038 通过,覆盖率运行同样通过。 + 相对目标分支的增量可执行行覆盖率 100%:Python 102/102、TypeScript 10/10, + utree 解析 coverage.py XML / Clover XML,按用户要求的 95% 阈值检查 + (不冒充 CI 规则)。 +- 全量前端 1,389 个 Node 测试、105 个 Vitest 用例通过;构建、打包资源、 + i18n、全文件 pre-commit 通过。Python 版本为 3.12.12。 +- 全量 Python:7,150 通过、16 失败、2 收集错误、59 跳过、4 xfailed、 + 6 个 subtest 通过(双 worker,469.04 秒)。目标分支干净源码同样复现 + 16 失败/2 错误(其他 99 个用例通过),缺少可选 llama_index、openai_codex、 + anthropic 依赖。变更源码 Pyright 有 15 个 SDK 构造参数错误,目标分支 + `mpa_tool.py` 同样复现。这两项门禁仍失败/受阻;未声明 smoke 或 Python 3.10 + 已验证。 +- 隔离的本地浏览器验证:自动 OV/独立 PG/所选桶组合提交且没有 TOS 密钥, + 正常/空列表/加载/错误/重试状态、键盘选桶、任务取消/重试、步骤导航及 + 390px 窄屏。新提示文案已可见验证。接口为模拟,不证明真实云端创建。 + 临时验证文件已删除。 + +本次合入代码已实现、定向检查已验证,尚未部署;下文历史 V42 云端证据不验证 +这次新合入版本。 + +用户于 2026-10-14 要求仅调整提示文案:未选桶时文件保存在沙箱本地目录。 +同步中英文提示;内置配置默认不挂载 TOS、CLI/profile 兼容行为均不变。 + +[English](2026-10-12-bucket-only.md) + +- 变更 ID:`studio-mpa-tos-iam` +- 日期:2026-10-12 +- 状态:implemented;官方分支定向检查 verified;保留历史 V42 云端证据;官方迁移版未部署;基线全量门禁 blocked +- 基线:官方 `origin/main`,`812faadf`;初始实现及验证基线:`superops/main`,`035387d1` +- 契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),会话输出存储。 + +## 背景与范围 + +Studio 目前要求同时提供 `tosAccessKey`、`tosSecretKey`、`tosBucket`。 +`mpa_tool.build_tos_mount_config` 固定输出 AK/SK 鉴权;AgentKit SDK 支持 +不带 Credentials 的 `TOS_CREDENTIAL_TYPE_IAM_ROLE`。已有 managed IAM +协调器保留额外绑定、拒绝冲突策略,但平台 TOS 策略没有业务桶写权限。 + +用户于 2026-10-12 确认 Studio 只选桶,并自动增量补齐桶授权。本次只修改 +TOS 挂载鉴权,不改 Studio 登录、Runtime KeyAuth/JWT 或 Worker 协议。 +最初实现范围不含发布。用户于 2026-10-12 随后明确授权提交推送、更新现有云端 +Studio 并创建测试 MPA;创建桶、修改公开策略或迁移已有会话仍不在范围内。 + +## 需求与场景 + +### 已批准的桶前缀调整 + +2026-10-12 用户将 Studio 可选桶收窄为桶名以 `agentkit-platform-` 开头。 +选择器在已有资源接口传入可选 `namePrefix`,按大小写敏感的精确前缀匹配,并在 +搜索、计数和分页之前过滤。不传前缀的通用部署查询保持原行为。Studio 创建拒绝 +其他桶及其恢复草稿,且在云调用前失败;独立 CLI/Worker 桶名校验保持不变。 +本调整不修改角色已有策略、桶公开策略或会话路径。测试允许/排除/伪相似桶名、 +空选择、旧草稿、参数传输及分页;人工设计复核确认这些边界。 +此前版本已部署为 V41,环境变量未变,前端文件哈希匹配。用户提出本调整前, +尚未提交 MPA 或绑定桶策略;云端创建及全链路验证暂缓。 + +前缀调整验证:新增 8 个 Python 用例和 3 个 Vitest 用例。相关 Python 754/754, +创建窗口 46/46,完整前端 1,377 个 Node 测试及 73 个 Vitest 用例通过。构建、 +前端产物(113 文件/350 引用)、i18n、Ruff、改动文件 Pyright 和 pre-commit 通过。 +本轮四个目标文件相对 HEAD 的可执行增量行覆盖率为 100%(Python 22/22、前端 +10/10),utree 使用 coverage.py XML 和 Istanbul Clover XML 统计。先确认缺少前缀 +逻辑时测试失败,再同步相关 Studio fixture,没有放宽授权顺序或失败传播断言。 +全量 Python 再跑:6,495 通过、6 失败、2 收集错误、19 跳过、2 xfailed、6 subtests +通过;失败的 Harness 用例和可选依赖缺失均为此前已复现的基线阻塞。 +本地浏览器通过模拟响应确认仅展示匹配桶,临时验证页和 Vite 已清理。未报告存量 +缺陷,这是已批准的范围变更。以上为发布前证据快照;后续已授权的发布和云端 +Role 挂载验证仍待执行,将与本地验证结果分开记录。 + +- FR-1:只展示一个可选桶选择器,复用资源列表 hook 与 DeploymentSelect; + 保留加载、错误、空列表、搜索、分页、重试、禁用、键盘和取消行为。不展示 TOS AK/SK。 +- FR-2:Studio 提供桶时使用实际 Worker Tool 角色的 IAM Role 鉴权;安全拒绝 + 非法桶名和旧客户端非空凭据提交,清除浏览器恢复草稿中的旧凭据。未选桶保留 + 服务端 profile(内置 profile 默认不挂载)。CLI/YAML AK/SK 模式保持兼容;显式 `tos-credential-type: iam_role` + 支持仅配置桶的 managed profile。 +- FR-3:在工作负载身份、数据库、网络写操作前,核验桶属于部署账号且地域匹配,再协调稳定的 + 桶专属自定义策略与 Worker 角色的 Global 绑定。验证账号、信任、策略内容和回读; + 保留额外策略及信任。冲突即失败;策略缺失、并发创建/绑定用有界超时恢复。 +- FR-4:只在所选桶授予 `tos:HeadBucket`、`tos:ListBucket`;只对其 + `sandbox-session/*` 对象授予 `tos:GetObject`、`tos:PutObject`、 + `tos:AbortMultipartUpload`、`tos:DeleteObject`。不涉及其他桶、CreateBucket、 + 桶策略/ACL、KMS 授权或全对象通配范围。 +- FR-5:Tool 挂载使用 IAM Role 且不带 Credentials;保持 `/data/output`、 + 规范的逐会话路径和 Runtime 非敏感挂载开关/桶名。复用核验同时检查鉴权模式 + 与角色,不能只检查路径。不得隐式修改已有 Tool 和 Session。 +- FR-6:权限、归属、配置和策略冲突在 IAM 阶段安全失败,返回本地化错误。 + 取消保留 IAM 资源供重试;云调用使用新读取并核验账号的部署凭据。 + +## 设计与兼容 + +为 managed Worker 增加可选鉴权模式,CLI 历史默认仍为 AK/SK。Studio 请求仅 +包含 `tosBucket`,固定 runner 应用 IAM Role。任务身份、锁定、取消契约保持不变。 +复用已有 IAM SDK 边界、规范策略比较与错误白名单,增加独立命名的桶策略, +不改 `VeADKMPARuntimeAccessV1`。桶专属稳定策略名避免不同桶之间读改写竞争, +同一请求的并发操作可收敛。 + +ListBucket 暴露该桶元数据,但对象访问只允许会话输出前缀。共享角色的所有 +使用者都会获得这个前缀权限,逐会话目录不是租户授权。SSE-KMS 桶需要另行 +批准密钥权限。旧 Studio 客户端提交凭据字段会得到安全校验错误,需要刷新。 +旧 CLI AK/SK 请求和普通智能体部署不变。 + +## 任务与验收 + +| 需求 | 任务 | 验收 | 证据 | +| --- | --- | --- | --- | +| FR-1、FR-2 | T-1:UI/API/config | AC-1:仅桶请求、清除旧密钥、选择器状态 | config/routes 和 43 个窗口用例通过;隔离浏览器通过 | +| FR-3、FR-4、FR-6 | T-2:IAM ensure 与编排接线 | AC-2:精确权限范围、重复/并发重试、失败/取消边界 | IAM/service 测试通过 | +| FR-5 | T-3:Tool 参数与复用核验 | AC-3:无 Credentials,严格核验模式/角色,旧模式不变 | Tool/worker 测试通过 | +| 全部 | T-4:文档/产物/门禁 | AC-4:定向/全量测试、构建/产物、浏览器状态、可执行增量覆盖率 >95% | 定向/构建/产物/浏览器/覆盖率通过;全量回归和 Pyright 存在已复现的基线阻塞 | + +先执行相关 pytest,再执行 +`uv run --extra dev pytest -n 2 -m 'not codex_smoke and not piagent_smoke'`、 +`npm --prefix frontend test`、构建、产物核验、改动 Python 文件 Ruff/Pyright、 +i18n、密钥扫描与 diff 空白检查。覆盖率统计可执行改动行,不以整文件替代。 +浏览器检查使用隔离的模拟云响应;未单独授权的真实 IAM/挂载 E2E 标记 not_run。 + +## 评审与交付 + +review-spec 技能不可用,以人工设计评审替代,检查角色归属、增量策略范围、旧 CLI +兼容、重试/取消、本地化和双语一致性。ui-ux-pro-max 不可用,采用仓库 SPEC、 +Foundation 和已有选择器行为。用户明确授权业务功能实现,单测技能的业务编辑 +限制不覆盖此授权;测试仍严格断言正确行为。 + +## 验证与变更记录 — 2026-10-12 + +修改 Studio 请求/窗口、managed Worker 配置、IAM 协调、服务编排和 Tool 元数据 +核验,同步双语组件契约与操作指南。无需修改 MPA Agent/Worker 源码,已有会话 +挂载路径不变。复用资源选择器及其已有样式,没有新建 UI 系统。已删除临时浏览器 +验证页源码并停止隔离的 Vite 服务,重新生成正式前端产物。 + +- **pass:**Python 3.12.12,`tests/integrations/mpa_managed` 和 + `tests/integrations/test_mpa_tool.py` 共 719/719;相比基线 677 个净新增 42 个。 + 契约测试在实现前确实失败。覆盖率插件环境下,Pydantic 延迟导入导致收集失败; + 在 `pytest.main([...])` 前显式导入 `pydantic.RootModel` 后,同样 719 个测试可以 + 正常统计覆盖率,未修改业务代码或依赖。基线 service 收集也复现了该覆盖率 + 导入错误。最终验证未采用 Python 3.13。 +- **pass:**可执行增量行覆盖率 100%:Python 97/97,由 `utree coverage parse` + 对 diff hunks 和 coverage XML 统计;前端 9/9,由 Istanbul statement 起始行与 + 改动行求交。排除未改动代码、纯类型、测试、文档及生成包;不是整文件或分支覆盖率。 +- **pass:**`npm --prefix frontend test`:1,377 个 Node 测试及 70 个 Vitest 用例; + `npm --prefix frontend run build`、`check:i18n`、`test:webui-assets`(113 文件、 + 350 内部引用)、Ruff、pre-commit 全文件和 `git diff --check`。Vite 保留已有大包警告。 +- **pass:**真实本地浏览器、模拟 API 响应:正常选择、无 TOS 密钥输入、加载、 + 空列表、错误/重试、搜索、分页、键盘选择、中文搜索输入、关闭、390px 窄窗口。 + 这不是云端 IAM/挂载验证,也不是操作系统真实 IME composition 测试。 +- **fail,已复现基线:**全量并行回归:6,485 通过、6 失败、2 收集错误、19 跳过、 + 2 xfailed、6 subtests 通过。使用相同解释器,在隔离的 `035387d1` 归档中复测 + 对应六个 Harness 用例和两个 self-host Sandbox 收集错误,完全一致(60 通过)。 + 原因是缺少可选 `llama_index`/`anthropic` 依赖,未修改无关业务或安装依赖来掩盖门禁。 +- **fail,已复现基线:**Pyright 使用 `.venv/bin/python`,在 `mpa_tool.py` 未改动的 + 历史 SDK 调用中报 15 个签名错误;临时复制的原始基线文件也报相同 15 个错误, + 已删除临时文件。其他改动的生产 Python 文件无 Pyright 诊断。 +- **not_run:**真实 IAM 写入、云端 Role 挂载会话 E2E、部署、镜像发布、提交或推送。 + 既有 Tool/Session 未变更。共享角色权限、已有 Deny、桶公开策略和 KMS 限制仍需 + 操作方知悉;策略成功绑定不代表已证明云端文件读写成功。 + +实现评审检查稳定桶策略名、账号/地域/信任核验、精确对象前缀、增量幂等/并发、 +安全失败、超时/取消及旧 CLI 兼容。未引入已有策略覆盖或全对象权限。全量/类型 +门禁不能表述为通过,云端验收与本地实现仍然独立。 + +### 已授权的发布与云端验收 + +2026-10-12 对齐未变化的 `superops/main`,实现提交 `267705ef` 已推送到 +`polaris/czh/studio-mpa-tos-iam-role`。同步后再次通过相关 Python 754 个用例、 +Node 1,377 个及 Vitest 73 个用例;pre-commit、i18n 和前端产物检查通过。 +前述全量基线阻塞仍然存在。 + +仅更新现有 Studio 代码包至 V42,环境变量哈希和品牌配置保持不变。wheel 中七个 +生产源码文件及全部 WebUI 产物与工作区匹配,远程入口 JS/CSS/logo 哈希与本地 +产物匹配。wheel SHA256: +`023bf085371cdc7c285b5e60bfcb2dd08e390c1935b7a995475c82c47b925a14`。 +本次仅发布 Studio,未重新构建 Runtime/Worker 镜像。 + +远程 Studio 可选桶由未过滤的 18 个收窄为 4 个平台前缀桶,并拒绝旧草稿的 +`agentkit-demo`。选 `agentkit-platform-2112682748` 创建测试 MPA +`role-tos-e2e-20261012-a`,未填写 TOS AK/SK。 +Runtime `r-yex3bbopvkwqejues1lc` 达到 Ready,`/readiness` 返回 200。 +Worker `t-yex3bb51xcwqejuen9oc` 达到 Ready,实际 Role 为 +`IDRoleForArkClawShareAgent`,挂载模式为 `TOS_CREDENTIAL_TYPE_IAM_ROLE`, +没有 Credentials,读写目录为 `/data/output`,基础挂载路径符合预期。 +IAM 回读确认精确桶/会话对象前缀的自定义策略已绑定。角色原本已有平台桶系统 +策略,增量协调不会收窄既有权限。所选桶没有公开桶策略。 + +从远程 Studio 提交两段会话,均实际调用沙箱执行命令。GetSession 回读确认分别 +挂载到 `/sandbox-session/tool-{tool_id}/session-{user_session_id}/`。 +两段会话各写入同名 `role-tos-e2e.txt`,内容为不同 A/B 标记;第二段起初没有该 +文件。账号侧独立 TOS 读取(没有账号侧写入)确认两个对象均持久化,B 写入后 +A 内容未变。A 的沙箱结果、TOS 对象和浏览器下载文件 SHA256 均为 +`e762fa20c53dd7394b3f89af8e084e42d486a8e241fa37d68acbd695a17b82a7`; +B 的沙箱结果和 TOS 对象 SHA256 均为 +`0d797e5173d581880100a21f25a7e00f4990d82b440c4f01f01d78e8776b1e6e`。 +浏览器下载事件等待在 45 秒后超时,但下载随后完成,已核验本地字节;不是接口 +失败。该镜像的 `/ready?scope=execution` 返回 404,执行证明来自实际命令和对象 +读取,不来自这个就绪接口。 + +测试 MPA 和两个输出对象保留供查看,既有 Tool/Session 未修改,仓库中没有残留 +探索文件。此次验收不覆盖收窄角色既有权限、KMS 加密桶、显式 Deny、独立身份 +或真实业务渠道消息交付。 + +### 官方上游 PR 准备 + +用户随后要求向 `volcengine/veadk-python:main` 提 PR。原 fork 分支的共同祖先会让 +PR 夹带无关历史,因此将两个功能/证据提交迁移到官方 `main` 的 `812faadf`,使用 +独立分支 `czh/studio-mpa-tos-iam-role-upstream`。唯一业务源码冲突是导入语句: +同时保留官方 `resolve_model_key` 和 TOS IAM ensure。前端生成物冲突通过官方 +基线源码重新构建解决,没有选择任一旧产物,也没有迁入无关 fork 提交。 + +两个 TOS 授权顺序用例最初失败,是因为模拟云没有提供官方新增的 Ark Key 发现 +依赖。仅在这两个用例中隔离该依赖,并断言它以正确 profile/cloud 被 await; +保留授权先于 identity、错误传播等全部断言,随后 2/2 通过。未为测试修改生产逻辑。 + +官方基线验证使用 Python 3.12.12:相关 Python 872 个用例通过,Node 1,377 个及 +Vitest 75 个用例通过;前端构建、i18n、产物、仓库固定版本 Ruff 0.11.12 和 +pre-commit 通过。相对官方 main 的可执行增量行覆盖率为 100%(Python 102/102、 +TS 10/10),使用 coverage.py XML 和 Istanbul Clover XML 解析。聚焦单测修复 +遵循 bits-unit-test-gen Step1–7;TOS 编排覆盖新增可执行行 5/5,utree flush 已执行。 + +官方全量回归已完成:6,950 通过、16 失败、2 收集错误、59 跳过、4 xfailed、 +6 subtests 通过。使用相同解释器,在隔离的官方 main 归档复现六个 Harness +失败和两个 self-host 收集错误(64 通过),原因是缺少可选 `llama_index`/ +`anthropic`。十个 Codex runtime 失败也在该归档复现,缺少可选 `openai_codex`。 +15 个历史 SDK 签名 Pyright 错误在官方 main 原始 `mpa_tool.py` 上同样复现。 +这些门禁不能表述为全绿。 + +上文 V42 云端证据属于原 fork 实现。本次官方基线迁移没有重新部署或运行浏览器/ +云端 E2E;保留官方模型 Key 行为,不据此推断该行为已在 V42 执行。 +原 fork PR 和云资源均保持不变。 diff --git a/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.md b/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.md new file mode 100644 index 000000000..5f4b38d9a --- /dev/null +++ b/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.md @@ -0,0 +1,61 @@ +# Relocate MPA compatibility resources under Studio + +[中文版](2026-10-14-studio-owned-resources.zh.md) + +- Change ID: `mpa-contract-location`; date: 2026-10-14; status: implemented. +- Contract: [Studio MPA control plane](../../../specs/studio-mpa-control-plane/README.md). + +## Evidence, requirements and non-goals + +The root `contracts/mpa-p0` contains only `compatibility-matrix.json` and `benchmark-report.schema.json`. Studio and CLI share the evaluator in `veadk.cli.mpa_p0_contract`; its default loader uses the root matrix when present and otherwise the identical embedded rules. Integration tests and documented `--matrix` examples reference the root file. The benchmark schema has no discovered runtime caller. Studio release staging copies the frontend Python tree, but setuptools currently has no package-data declaration for the new JSON path. Existing unrelated `frontend/package-lock.json` edits must remain byte-identical. + +FR-1: Move both JSON files unchanged to `frontend/server/mpa/contracts/mpa-p0/` and remove the empty root directory. Do not change rule/schema values, decision outcomes, MPA/general-agent behavior or OpenViking behavior. +FR-2: Update `default_matrix_path()` and integration tests/documented commands. Keep public function signatures, the required custom `--matrix` argument and embedded fallback unchanged. Missing packaged files still use embedded rules; malformed present JSON continues to fail visibly. Existing callers explicitly using the old root file path must use the new path. +FR-3: Include both JSON resources in the Python wheel and Studio source staging; access them by sibling filesystem paths without importing the heavy frontend composition package. Verify source and an isolated extracted wheel resolve the same rules. + +Non-goals: moving evaluator ownership, changing SDK/version rules, removing compatibility preflight, deleting OpenSpec/PRD/spec directories, changing UI or cloud resources. No commit, push or deployment is requested. + +## Design, files and tasks + +Retain `mpa-p0` nesting. Compute the default path from the evaluator's installed source root to frontend/server/mpa; add the precise existing-resource package-data glob to `frontend.server` in pyproject.toml. Studio's copytree staging already includes that directory and needs no production change. Update bilingual current design/validation examples and append a relocation note to the maintained control-plane contract. + +T-1 / AC-1: Write a failing path/source-loading regression first and exercise normal compatibility, invalid manifest and rejection before writes. Move both resources byte-for-byte and update the path. +T-2 / AC-2: Test missing fallback and malformed-file failure; update CLI examples/tests without changing explicit custom-file behavior. +T-3 / AC-3: Add a real source-staging assertion for both resources; build a local wheel and inspect/extract it to verify JSON presence and default-loader resolution. No publication occurs. +T-4 / AC-4: Targeted compatibility/CLI/release checks, changed Python Ruff/Pyright, paired documents/links, whitespace and secret checks. Record actual evidence and preserve unrelated local changes. + +## Review, risks and authorization + +Direct review replaces unavailable review-spec: requirements, ownership, consumer paths, filesystem/wheel behavior, error semantics, no-new-import boundary and paired languages are consistent. The user approved the exact whole-directory migration on 2026-10-14 with “按此方案迁移(推荐)”. Changing the file location is intentional; custom CLI argument semantics stay stable. No runtime concurrency, authorization, credential or cloud API changes occur. Both language versions and the maintained contract must be updated together. Main risk is omitted package data; wheel extraction is the acceptance check. Implementation and tests are authorized; approval does not authorize commit/push/deployment. + +## Verification record + +Execution scope starts at `2ffe6e14` plus this change; outcomes are recorded below. Live cloud/browser/sidecar smoke is not_applicable because only internal static-resource location changes. No TypeScript or rendered UI changes are planned, so frontend rebuild and browser interaction tests are not applicable. + +### Completed verification — 2026-10-14 + +Scope: `2ffe6e14` plus this local migration. T-1–T-4 / AC-1–AC-4 completed. Test-first result was 6 failed / 4 passed before moving files/changing the loader. After implementation: + +| Check | Result | Evidence / limitation | +| --- | --- | --- | +| Targeted compatibility tests | pass | 10 tests, including new location, both source-staged JSON files, missing fallback and visible malformed-file errors. | +| Related compatibility, Studio RBAC/GitHub, release and startup regression | pass | 376 tests with two workers; cloud/provider calls mocked. Pre-mutation compatibility rejection and general-agent paths remain covered. | +| Changed Python Ruff/format/Pyright | pass | Repository Ruff 0.11.12; Pyright uses repository Python, 0 errors/warnings. Temporary uvx tools, no global configuration changes. | +| Standard wheel and actual Studio-staged wheel | pass | Both built locally. Isolated extraction finds the two JSON files at the new path, byte-identical to HEAD originals; default loader reads the packaged matrix and returns compatible for the existing baseline. Real stage_studio_wheel_source excludes node_modules/src and includes the resources. Nothing uploaded/installed globally. | +| Review / documents / secret / whitespace | pass | Paired identifiers/commands/relative links reviewed; repository Gitleaks rules on this changed-file scope; git diff whitespace. No credentials added. | +| Existing local changes | pass | Unrelated frontend/package-lock.json SHA-256 unchanged. | +| Full repository regression / frontend/browser / live cloud / sidecar smoke | not_run / not_applicable | Focused regression covers every known path consumer; no further shared logic, TypeScript, UI, cloud or harness protocol change. No external cloud effects exercised. | +| Commit / push / deployment | not_run | Not requested or authorized for this migration. | + +Final review found no additional behavior, import, ownership or packaging change. Explicit old-root CLI paths must use the new path as approved; custom matrix options and builtin fallback stay compatible. Actual commands (MPA_STAGE_ROOT is the temporary source returned by real Studio staging): + +```bash +uv run --extra dev pytest tests/integrations/test_mpa_compatibility_manifest.py -q +uv run --extra dev pytest -n 2 -q tests/integrations/test_mpa_compatibility_manifest.py tests/cli/test_studio_rbac.py tests/cli/test_github_cicd.py tests/cli/test_studio_release.py tests/test_studio_release_server.py tests/cli/test_studio_startup_imports.py +uvx --from ruff==0.11.12 ruff check veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uvx --from ruff==0.11.12 ruff format --check veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uvx pyright --pythonpath .venv/bin/python veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uv build --wheel --out-dir /tmp/veadk-mpa-contract-wheel-20261014 +uv build "$MPA_STAGE_ROOT" --wheel --out-dir /tmp/veadk-mpa-contract-release-wheel-20261014 +git diff --check +``` diff --git a/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.zh.md b/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.zh.md new file mode 100644 index 000000000..954cc7468 --- /dev/null +++ b/prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.zh.md @@ -0,0 +1,61 @@ +# 将 MPA 兼容性资源迁入 Studio 目录 + +[English](2026-10-14-studio-owned-resources.md) + +- Change ID:`mpa-contract-location`;日期:2026-10-14;状态:implemented。 +- 契约:[Studio MPA 控制面](../../../specs/studio-mpa-control-plane/README.zh.md)。 + +## 证据、需求与非目标 + +根目录 `contracts/mpa-p0` 仅有 `compatibility-matrix.json` 和 `benchmark-report.schema.json`。Studio 与 CLI 共用 `veadk.cli.mpa_p0_contract` 评估器;默认加载器优先读取根目录文件,不存在时使用完全一致的内置规则。集成测试和文档 `--matrix` 示例直接引用根文件。未发现性能报告 schema 的运行时调用方。Studio 发布暂存会复制 frontend Python 树,但 setuptools 目前未声明新路径 JSON 的 package-data。已有无关 `frontend/package-lock.json` 改动须保持字节一致。 + +FR-1:将两个 JSON 原样移至 `frontend/server/mpa/contracts/mpa-p0/`,移除空根目录。不改变规则/schema 内容、检查结果、MPA/通用智能体或 OpenViking 行为。 +FR-2:更新 `default_matrix_path()`、集成测试及文档命令。保留公开函数签名、必填自定义 `--matrix` 参数和内置备用规则。包内文件缺失时仍使用内置规则,存在但格式错误时仍明确失败。明确指定旧根路径的调用方需改用新路径。 +FR-3:Python wheel 及 Studio 源码暂存必须包含两个 JSON;通过相邻文件系统路径读取,不导入较重的 frontend 组合包。验证源码环境与隔离解包 wheel 读取相同规则。 + +非目标:迁移评估器职责、更改 SDK/版本规则、移除兼容性检查、删除 OpenSpec/PRD/spec 目录、更改 UI 或云资源。未请求提交、推送或部署。 + +## 设计、文件与任务 + +保留 `mpa-p0` 层级。从已安装评估器源码根定位 frontend/server/mpa;在 pyproject.toml 的 `frontend.server` package-data 中加入精确资源 glob。Studio copytree 暂存已覆盖该目录,无需改生产实现。同步双语当前设计/验证示例,在维护中的控制面契约追加迁移说明。 + +T-1 / AC-1:先写默认路径/源码加载失败回归,覆盖正常兼容、无效 manifest 和写入前拒绝。逐字节移动资源并更新路径。 +T-2 / AC-2:验证缺文件备用规则及存在但格式错误时失败;更新 CLI 示例/测试,不改显式自定义文件语义。 +T-3 / AC-3:增加两个资源真实源码暂存断言;构建本地 wheel,检查/解包验证 JSON 和默认加载路径,不发布。 +T-4 / AC-4:定向兼容性/CLI/发布检查、改动 Python Ruff/Pyright、双语文档/链接、空白及密钥检查。记录实际证据,保留无关本地改动。 + +## 审查、风险与授权 + +review-spec 不可用,直接审查确认需求、职责、调用方路径、文件系统/wheel、错误语义、不新增 import 边界和双语一致。用户于 2026-10-14 对完整目录迁移明确回复“按此方案迁移(推荐)”。文件位置变化属于预期,自定义 CLI 参数语义不变。不改变运行时并发、权限、凭据或云接口。两种语言及维护契约同步更新。主要风险为漏打包,以 wheel 解包验收。已授权实现/测试,设计批准不包含提交/推送/部署。 + +## 验证记录 + +执行范围从 `2ffe6e14` 加本次差异开始,结果记录如下。真实云/浏览器/sidecar smoke 为 not_applicable,仅改变内部静态资源位置。不计划 TypeScript/界面变更,前端重建及浏览器交互不适用。 + +### 已完成验证 — 2026-10-14 + +范围:`2ffe6e14` 加本地迁移。T-1–T-4 / AC-1–AC-4 完成。移动文件/改加载器前先写回归得到 6 failed / 4 passed。实现后: + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| 定向兼容性测试 | pass | 10 项,含新位置、两个源码暂存 JSON、缺文件备用及格式错误明确失败。 | +| 相关兼容性、Studio RBAC/GitHub、发布及启动回归 | pass | 两个 worker 共 376 项;云/平台调用使用模拟。仍覆盖写入前兼容性拒绝及通用智能体路径。 | +| 改动 Python Ruff/格式/Pyright | pass | 仓库 Ruff 0.11.12;Pyright 使用仓库 Python,0 错误/警告。临时 uvx 工具,未改全局配置。 | +| 普通 wheel 与实际 Studio 暂存 wheel | pass | 均本地构建。隔离解包找到新路径下两个 JSON,与 HEAD 原文件逐字节相同;默认加载器读取包内矩阵,原基线返回兼容。真实 stage_studio_wheel_source 排除 node_modules/src 并包含资源。未上传或全局安装。 | +| 审查 / 文档 / 密钥 / 空白 | pass | 审查双语标识符/命令/相对链接;按仓库 Gitleaks 规则扫描本次变更范围;git diff 空白。未增加凭据。 | +| 已有本地修改 | pass | 无关 frontend/package-lock.json SHA-256 未变。 | +| 全仓回归 / 前端浏览器 / 真实云 / sidecar smoke | not_run / not_applicable | 定向回归覆盖所有已知路径调用方;未改其他共享逻辑、TypeScript、UI、云或 harness 协议,未执行真实云操作。 | +| 提交 / 推送 / 部署 | not_run | 本次迁移未请求或授权。 | + +最终审查没有发现额外行为、import、职责或打包变化。明确指定旧根 CLI 路径须按批准方案改用新路径;自定义矩阵参数与内置备用保持兼容。实际命令(MPA_STAGE_ROOT 为真实 Studio 暂存返回的临时源码目录): + +```bash +uv run --extra dev pytest tests/integrations/test_mpa_compatibility_manifest.py -q +uv run --extra dev pytest -n 2 -q tests/integrations/test_mpa_compatibility_manifest.py tests/cli/test_studio_rbac.py tests/cli/test_github_cicd.py tests/cli/test_studio_release.py tests/test_studio_release_server.py tests/cli/test_studio_startup_imports.py +uvx --from ruff==0.11.12 ruff check veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uvx --from ruff==0.11.12 ruff format --check veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uvx pyright --pythonpath .venv/bin/python veadk/cli/mpa_p0_contract.py tests/integrations/test_mpa_compatibility_manifest.py +uv build --wheel --out-dir /tmp/veadk-mpa-contract-wheel-20261014 +uv build "$MPA_STAGE_ROOT" --wheel --out-dir /tmp/veadk-mpa-contract-release-wheel-20261014 +git diff --check +``` diff --git a/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.md b/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.md new file mode 100644 index 000000000..1c78b58d5 --- /dev/null +++ b/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.md @@ -0,0 +1,37 @@ +# BytePlus change reconciliation after upstream history consolidation + +[中文版](2026-10-15-byteplus-rebase.zh.md) + +- Date: 2026-10-15 +- Scope: reconcile original local commit `078602ec` onto remote branch base `08197629`. +- Authorization: the user requested resolving rebase conflicts and committing the result. +- Status: reconciled; the unchanged macOS MIME regression failure is recorded below. + +## Evidence and approach + +The interrupted rebase replayed seven commits, starting with `7f2ae0f8`. The remote base already consolidated the six historical lifecycle commits, including generic/MPA deployment separation, deletion, automatic OV creation, maximum instances, dependency-lock repair and license headers. Replaying them caused redundant documentation/test-script conflicts and generated-asset rename conflicts. The original tip and interrupted state were backed up before aborting that rebase. Rebase was restarted with `--onto 08197629 2ffe6e14`, replaying only the local BytePlus commit. + +## Preserved behavior and affected files + +Retain upstream TOS mounting configuration, image-selection rules and `ensure_tos_mount_permissions` together with local BytePlus OV provisioning, IAM transient diagnostics, Runtime diagnostics, original-request name recovery, provider-specific default images and server-side APM AppKey injection. Resolve `names.py` using the approved local Worker provenance check: matching `MPA_AGENT_ID` environment plus canonical `managed_by` and `mpa_agent_key` tags; contradictory ownership cannot authorize retry. Runtime tagless recovery remains limited to the authenticated original creation account. Retain the complete remote `frontend/package-lock.json`, since no package dependency change was requested. Regenerate `veadk/webui` from merged frontend source; never manually combine minified bundles. + +Four Pyright findings in existing upstream test doubles were resolved with non-null assertions in `test_iam.py` and `test_service.py`. These assertions do not change production behavior. Shared database/network resources and deployed Runtimes are outside scope. Existing component contracts are unchanged; their already approved bilingual BytePlus additions are preserved. No new public API, provider permission, dependency or cloud mutation is introduced by this reconciliation. + +## Review and acceptance + +Direct review substitutes for the unavailable review-spec skill. History scope, ownership checks, provider separation, TOS/APM ordering, complete lock data, generated assets, test coverage and paired documentation were reviewed. Acceptance requires a single local feature commit above the remote base, no conflict markers, preservation of both upstream TOS and local BytePlus behavior, regenerated assets and the checks below. Live Worker dispatch, OV data-plane compatibility and overseas tracing remain separate Runtime/image work; local tests cannot establish those outcomes. + +## Verification (2026-10-15) + +- pass: targeted conflict/integration tests, 383 passed; test-only assertion follow-up, 204 passed. +- pass: `npm --prefix frontend ci --ignore-scripts --no-audit --no-fund` using the complete lock file. +- pass: `npm --prefix frontend test`, 1,389 Node tests and 111 component tests. +- pass: `npm --prefix frontend run build`, TypeScript and both production bundles. +- pass: `npm --prefix frontend run check:i18n` and `npm --prefix frontend run test:webui-assets`, 113 files and 350 internal references. +- pass: Pyright on 25 changed Python files after the four test-only assertion corrections. +- pass: `uv run --extra dev pre-commit run --all-files`, initial and final staged-source runs; documentation-only final repeat follows this record. +- fail: `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`, 7,441 passed, 1 failed, 53 skipped, 4 xfailed in 509.32 seconds. Two workers limit local resource pressure. The sole failure is `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`: this macOS Python reports no MIME for `.md`, so unchanged code emits `application/octet-stream` instead of `text/markdown`. Writer, MIME helper and test are identical to remote base `08197629`; the isolated unmodified test file reproduces the failure (48 passed, 1 failed). No unrelated production change or global MIME configuration was made. +- pass: a separate process adding only the expected `text/markdown` mapping for `.md` runs all 49 artifact-writer tests successfully. This controlled environment check does not replace the recorded full-suite failure. +- pass: `uv build --wheel --out-dir /tmp/veadk-rebase-wheel`; the new BytePlus modules and relocated contract JSONs are present, `.env` is absent. All seven newly added local Python modules remain byte-identical to `078602ec`. +- blocked: existing Studio process caches pre-build HTML referencing removed assets, yielding HTTP 404. Browser opened the page but could not exercise the creation dialog. The active user service was not restarted; restart is needed to load the rebuilt HTML. +- not_run: real cloud creation/deletion and Runtime smoke; no cloud writes are authorized by this Git reconciliation task. diff --git a/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.zh.md b/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.zh.md new file mode 100644 index 000000000..5d238ce63 --- /dev/null +++ b/prd-spec/refactors/mpa-upstream-reconciliation/2026-10-15-byteplus-rebase.zh.md @@ -0,0 +1,37 @@ +# 上游历史整理后的 BytePlus 改动协调 + +[English](2026-10-15-byteplus-rebase.md) + +- 日期:2026-10-15 +- 范围:将原本地提交 `078602ec` 协调到远端分支基础 `08197629`。 +- 授权:用户要求解决 rebase 冲突并提交结果。 +- 状态:协调完成;未改动的 macOS MIME 回归失败如实记录如下。 + +## 证据与处理方式 + +中断的 rebase 从 `7f2ae0f8` 开始重放七个提交。远端基础已整理了六个历史生命周期提交,包括通用/MPA 部署隔离、删除、OV 自动创建、最大实例数、依赖锁修复和许可证头。再次重放导致重复的文档、测试脚本冲突和构建产物重命名冲突。终止该 rebase 前已备份原分支顶端及中断状态。通过 `--onto 08197629 2ffe6e14` 重启 rebase,仅重放本地 BytePlus 提交。 + +## 保留行为与涉及文件 + +同时保留上游的 TOS 挂载配置、镜像选择规则和 `ensure_tos_mount_permissions`,以及本地 BytePlus OV 创建、IAM 临时错误诊断、Runtime 诊断、原请求名称恢复、分提供商默认镜像和服务端 APM AppKey 注入。`names.py` 使用已批准的本地 Worker 归属检查:`MPA_AGENT_ID` 环境变量匹配,同时核对标准 `managed_by` 和 `mpa_agent_key` 标签;矛盾归属不能授权重试。Runtime 无标签恢复仍只限已认证的原创建账号。保留远端完整的 `frontend/package-lock.json`,因为此次没有请求改变包依赖。从合并后的前端源码重新生成 `veadk/webui`,不手动拼接压缩包。 + +上游测试替身中的四处 Pyright 问题通过在 `test_iam.py`、`test_service.py` 增加非空断言解决;这些断言不改变生产行为。共享数据库/网络和已部署 Runtime 不在范围内。现有组件契约不变,保留其已批准的双语 BytePlus 补充内容。本次协调不新增公共 API、提供商权限、依赖或云端写操作。 + +## 审查与验收 + +review-spec skill 不可用,直接完成等价审查。已检查历史范围、归属校验、提供商隔离、TOS/APM 顺序、完整锁数据、构建产物、测试覆盖和双语文档。验收要求远端基础上只有一个本地功能提交、无冲突标记、上游 TOS 与本地 BytePlus 行为均保留、产物已重建并完成下列检查。真实 Worker 派发、OV 数据面兼容和海外观测仍是单独的 Runtime/镜像联调,本地测试不能证明这些结果。 + +## 验证(2026-10-15) + +- pass:冲突及集成定向测试 383 项通过;测试断言修正后复验 204 项通过。 +- pass:`npm --prefix frontend ci --ignore-scripts --no-audit --no-fund`,使用完整锁文件。 +- pass:`npm --prefix frontend test`,1,389 项 Node 测试和 111 项组件测试通过。 +- pass:`npm --prefix frontend run build`,TypeScript 和两份生产构建通过。 +- pass:`npm --prefix frontend run check:i18n`、`npm --prefix frontend run test:webui-assets`,113 个文件、350 个内部引用通过。 +- pass:四处测试非空断言修正后,对 25 个改动 Python 文件运行 Pyright。 +- pass:`uv run --extra dev pre-commit run --all-files`,首次及最终暂存源码检查通过;本记录完成后再执行仅文档收尾复验。 +- fail:`uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`,7,441 项通过、1 项失败、53 项跳过、4 项 xfailed,用时 509.32 秒。使用两个 worker 限制本地资源压力。唯一失败为 `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`:这台 macOS 的 Python 无法识别 `.md` MIME,未改动的代码返回 `application/octet-stream` 而不是 `text/markdown`。Writer、MIME 辅助函数和测试均与远端基础 `08197629` 相同;单独执行原测试文件可复现(48 项通过、1 项失败)。没有改动无关生产代码或机器全局 MIME 配置。 +- pass:仅在单独进程为 `.md` 增加预期的 `text/markdown` 映射后,49 项产物写入测试全部通过;该受控环境检查不能替代已记录的完整回归失败。 +- pass:`uv build --wheel --out-dir /tmp/veadk-rebase-wheel`;新增 BytePlus 模块、迁移后的 contract JSON 均存在,`.env` 不在包内。本地七个新增 Python 模块均与 `078602ec` 逐字节一致。 +- blocked:现有 Studio 进程缓存重建前的 HTML,引用已移除资源并返回 HTTP 404。浏览器打开页面后无法验证创建弹窗。没有重启用户正在使用的服务;需重启才能加载重建后的 HTML。 +- not_run:真实云端创建/删除与 Runtime smoke;本次 Git 协调任务未授权云端写操作。 diff --git a/pyproject.toml b/pyproject.toml index bac86d31e..1b68b1adf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -161,7 +161,12 @@ include-package-data = true [tool.setuptools.package-data] "veadk" = ["**/*"] -"frontend.server" = ["templates/**/*.tmpl", "templates/**/.*.tmpl", "skills/consts.json"] +"frontend.server" = [ + "templates/**/*.tmpl", + "templates/**/.*.tmpl", + "skills/consts.json", + "mpa/contracts/mpa-p0/*.json", +] # Derive the package version from the latest git tag (e.g. tag "0.5.36" # publishes version 0.5.36). No version string is hardcoded anywhere; release diff --git a/specs/mpa-channels/README.md b/specs/mpa-channels/README.md index 6011456f5..759a0e59b 100644 --- a/specs/mpa-channels/README.md +++ b/specs/mpa-channels/README.md @@ -8,7 +8,7 @@ Studio administrators manage MPA channels through the existing Runtime proxy. Th GET /api/v1/channels/capabilities returns serverSideBinding, bindingReady, bindingError and diagnostics support. Missing capabilities (404) means unsupported. POST /feishu/bindings creates an encrypted durable binding; GET /feishu/bindings/{id} advances it; POST /feishu/bindings/{id}/retry retries failure. Prefix these paths with /api/v1/channels. States are PENDING, SCANNED, AUTHORIZED, REGISTERING, BOUND, FAILED, EXPIRED. Responses contain id, loginUrl, qrCodeImage, expiresAt, pollAfterSeconds, appId, lastErrorCode and lastErrorMessage. Credentials never appear. A lost registration lease reports uncertainty instead of blindly repeating registration. -GET /feishu/diagnostics reports actual stored configuration, missing metadata and observed delivery state. Existing GET /chat-permissions, POST /chat-permissions and DELETE /chat-permissions?channel=feishu&chat_id=... manage groups. POST uses channel, chatId and groupSessionScope (group, group_sender, group_topic, group_topic_sender). Existing DELETE root uses channel and appId. Binding and polling requests are cancelled on navigation; errors preserve the form, terminal states stop polling. Unsupported images show an upgrade message. No success indicator claims live connectivity without observed evidence. +GET /feishu/diagnostics reports actual stored configuration, missing metadata and observed delivery state. Existing GET /chat-permissions, POST /chat-permissions and DELETE /chat-permissions?channel=feishu&chat_id=... manage groups. POST supports channel, chatId and optional groupSessionScope (group, group_sender, group_topic, group_topic_sender); the Studio add-group form omits groupSessionScope. Existing DELETE root uses channel and appId. Binding and polling requests are cancelled on navigation; errors preserve the form, terminal states stop polling. Unsupported images show an upgrade message. No success indicator claims live connectivity without observed evidence. Database boundary: each MPA/formal-debug deployment needs an isolated channel database; startup rejects sharing across deployments. New message mappings include bot identity; old sessions remain history without automatic context migration. New ciphertext is not compatible with old images; rollback requires a matching database snapshot. Studio forwards only the trusted administrator identity as binding owner, replacing client X-User-Id. Runtime-key event ingress validates Authorization injected by APIG. @@ -46,3 +46,15 @@ CON-15: All providers expose mutually exclusive Quick setup / Manual setup, defa CON-16: multiBotChannels containing feishu opts into account management. GET root returns channels with appId and enabled; multiple Feishu records are valid. Select an account before querying diagnostics or permission CRUD, always forwarding appId. POST permission includes appId, DELETE retains chat_id plus appId. PATCH /feishu/accounts/{appId} sets enabled; DELETE root removes only that account after confirmation. QR/manual binding adds a different appId and refreshes selection without replacing other accounts. Legacy capability absence retains single-account flows. Account ambiguity is not registration uncertainty. Target changes abort reads/polling and ignore late completion; mutations prevent switching. Secret handling and administrator proxy authorization remain unchanged. See [design](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md). + + +## Runtime-owned group defaults (2026-10-12) + +CON-17: The Studio add-group form exposes no session-isolation selector and sends channel, trimmed chatId, and selected appId when applicable, omitting groupSessionScope entirely. Runtime default/inheritance rules own the resulting scope. Existing group records and their returned scope display remain unchanged; loading, refreshing or adding another group does not migrate or rewrite existing scopes. The optional API field and server behavior remain available to other callers. Adding an existing ID still follows the unchanged Runtime upsert contract. + +Design: [server-default-scope](../../prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.md). Verification: frontend/tests/runtimeChannels.test.tsx (single/multi-bot payload and existing scope display); local browser fixtures, not cloud E2E. + + +## Lark brand (2026-10-15) + +CON-18 (approved addition): BytePlus exposes Lark only when `feishuDomains` includes `lark` and Feishu multi-account support is advertised. Reuse `/feishu/bindings` and `/feishu/bindings/manual` with `domain=lark`; omission remains Feishu. Canonical storage/API channel is `feishu`; `config.domain` identifies brand, absent means Feishu. Lists filter brand; account operations always carry appId. Runtime owns fixed API hosts and Gateway adapter=lark registration, validates inbound Bot identity and preserves request/delivery IDs. Existing domestic records and APIs remain compatible. See [design](../../prd-spec/features/lark-binding/2026-10-15-lark-binding.md). diff --git a/specs/mpa-channels/README.zh.md b/specs/mpa-channels/README.zh.md index f6db81a82..96aa4c701 100644 --- a/specs/mpa-channels/README.zh.md +++ b/specs/mpa-channels/README.zh.md @@ -8,7 +8,7 @@ Studio 管理员通过现有 Runtime 代理管理 MPA 渠道。BFF 移除传入 GET /api/v1/channels/capabilities 返回 serverSideBinding、bindingReady、bindingError 及诊断支持。能力接口 404 表示不支持。POST /feishu/bindings 创建加密持久绑定;GET /feishu/bindings/{id} 推进状态;POST /feishu/bindings/{id}/retry 重试失败。以上相对路径加 /api/v1/channels 前缀。状态为 PENDING、SCANNED、AUTHORIZED、REGISTERING、BOUND、FAILED、EXPIRED。响应含 id、loginUrl、qrCodeImage、expiresAt、pollAfterSeconds、appId、lastErrorCode、lastErrorMessage,不含凭据。注册租约丢失时报告结果不确定,不盲目重复注册。 -GET /feishu/diagnostics 返回实际保存的配置、缺失元数据及观测投递状态。沿用 GET /chat-permissions、POST /chat-permissions、DELETE /chat-permissions?channel=feishu&chat_id=... 管理群。POST 使用 channel、chatId、groupSessionScope(group、group_sender、group_topic、group_topic_sender)。已有根路径 DELETE 使用 channel 和 appId。离开页面取消绑定和轮询请求;错误保留表单,终态停止轮询。不兼容镜像提示升级。没有观测证据时不声称链路连通。 +GET /feishu/diagnostics 返回实际保存的配置、缺失元数据及观测投递状态。沿用 GET /chat-permissions、POST /chat-permissions、DELETE /chat-permissions?channel=feishu&chat_id=... 管理群。POST 支持 channel、chatId 及可选 groupSessionScope(group、group_sender、group_topic、group_topic_sender);Studio 新增群表单省略 groupSessionScope。已有根路径 DELETE 使用 channel 和 appId。离开页面取消绑定和轮询请求;错误保留表单,终态停止轮询。不兼容镜像提示升级。没有观测证据时不声称链路连通。 数据库边界:每个 MPA/formal-debug 需要独立渠道数据库,启动拒绝不同部署共享。新消息映射包含 Bot 身份,旧会话保留为历史,不自动迁移上下文。新密文不兼容旧镜像,回滚需恢复相应数据库快照。Studio 仅转发受信管理员身份作为绑定 owner,忽略客户端 X-User-Id。Runtime-key 模式事件入口验证 APIG 注入的 Authorization。 @@ -46,3 +46,15 @@ CON-15:所有渠道提供互斥的“极速配置 / 手动配置”,挂载 CON-16:multiBotChannels 包含 feishu 时启用账号管理。根 GET 返回包含 appId 和 enabled 的 channels,允许多个飞书记录。诊断及群权限 CRUD 前先选择账号,始终转发 appId;权限 POST 带 appId,DELETE 保留 chat_id 并附 appId。PATCH /feishu/accounts/{appId} 设置 enabled;根 DELETE 经确认仅删除目标账号。扫码/手动绑定新增不同 appId 并刷新选择,不替换其他账号。缺少能力声明则沿用单账号流程。账号歧义不等于注册不确定。切换目标取消读取/轮询并忽略迟到结果,写入时禁止切换。密钥处理和管理员代理鉴权不变。 见[设计](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md)。 + + +## 群策略默认值由 Runtime 决定(2026-10-12) + +CON-17:Studio 新增群表单不提供会话隔离选择器,仅提交 channel、去空白 chatId,以及适用时所选 appId,完全省略 groupSessionScope。最终策略由 Runtime 的默认/继承规则决定。已有群记录及服务端返回策略的展示保持不变;加载、刷新或新增其他群不会迁移或改写既有策略。其他调用方仍可使用可选 API 字段,服务端行为不变。再次添加已有 ID 仍遵循 Runtime 原 upsert 契约。 + +设计:[server-default-scope](../../prd-spec/bugfixes/channel-group-actions/2026-10-12-server-default-scope.zh.md)。验证:frontend/tests/runtimeChannels.test.tsx(单/多机器人请求体及既有策略展示);本地浏览器 fixture,不是云上 E2E。 + + +## Lark 品牌(2026-10-15) + +CON-18(已批准增量):BytePlus 仅在 `feishuDomains` 包含 `lark` 且声明飞书多账号支持时开放 Lark。复用 `/feishu/bindings` 和 `/feishu/bindings/manual`,传 `domain=lark`;省略仍为飞书。存储/API 的 channel 仍为 `feishu`,以 `config.domain` 区分品牌,缺失为飞书。列表按品牌过滤,账号操作始终带 appId。Runtime 负责固定域名及 Gateway adapter=lark 注册,校验入站 Bot 身份并保留 request/delivery ID。国内已有记录及接口兼容。见[设计](../../prd-spec/features/lark-binding/2026-10-15-lark-binding.zh.md)。 diff --git a/specs/mpa-runtime-provisioning/README.md b/specs/mpa-runtime-provisioning/README.md index 7cc745dea..e086927ba 100644 --- a/specs/mpa-runtime-provisioning/README.md +++ b/specs/mpa-runtime-provisioning/README.md @@ -2,7 +2,7 @@ - **Component ID:** `mpa-runtime-provisioning` - **Status:** Draft; proposed changes are governed by the related PRD -- **Revision:** 2026-10-09 +- **Revision:** 2026-10-12 - **Chinese version:** [README.zh.md](README.zh.md) - **Related PRD:** [MPA Runtime Integration Hardening](../../prd-spec/bugfixes/mpa-runtime-integration/2026-09-12-mpa-runtime-integration-hardening.md) - **Related PRD:** [MPA Studio Workload Identity Provisioning](../../prd-spec/features/mpa-studio-workload-identity/2026-09-20-mpa-studio-workload-identity.md) @@ -93,15 +93,19 @@ Managed provisioning supports `managed.postgres.mode: auto`. It verifies deploym When the private MPA YAML supplies the complete `tos-access-key`, `tos-secret-key`, and `tos-bucket` tuple, a newly created worker Tool MUST carry -an access-key TOS mount with `/sandbox-session/default/default` as its base and +an access-key TOS mount with `/` as its legacy base and `/data/output` as its read-write local path. Credentials MUST remain in the Tool request. The Runtime receives `MPA_CODEX_WORKER_TOS_MOUNT_ENABLED=true` and the non-secret bucket name, but never AK/SK. -The Studio creation page may submit a complete tuple for one creation and -override the YAML defaults. AK/SK pass only in memory through child-process -stdin and MUST NOT enter sessionStorage, task SQLite, or task responses. Partial -input MUST be rejected. A profile using an existing Worker must first select a -new Worker image for the creation. +Studio submits only the optional `tosBucket` and overrides Worker credentials +with IAM Role mode, using `/sandbox-session/default/default` as the IAM base. +Explicit managed profiles may use `tos-credential-type: iam_role` and a bucket +without keys; historical CLI/YAML AK/SK mode remains compatible. Empty Studio +selection preserves server defaults. Bucket IAM authorization follows +[CON-17](../studio-mpa-creation/README.md#con-17--bucket-only-iam-tos-mounts). +Credentials MUST NOT enter sessionStorage, task SQLite, or task responses. +A profile using an existing Worker must first select a new Worker image for the +creation; existing Tools and Sessions are not implicitly modified. For a newly managed Runtime, the initial `CreateRuntime` request MUST include the `ToolId` of the already prepared worker Tool. The final convergent update @@ -138,3 +142,7 @@ New shared standard gateways and cross-zone companion intents follow the [Studio Worker environment configuration and reference precedence follow the [Studio contract](../studio-mpa-creation/README.md#independent-worker-configuration). Built-in Studio does not require an old-account Tool. Explicit CLI references/existing IDs remain supported; legacy non-managed creation is unchanged. Managed Runtime subnet equality and stable retry ordering follow the [Studio network recovery contract](../studio-mpa-creation/README.md#runtime-subnet-ordering-and-recovery). + +## MPA owned-resource deletion (2026-10-12, implemented) + +This change supersedes the Profile prerequisite in the deletion contract: preview/execution do not query Profile; only active operations and active sessions block deletion, and session-query errors remain visible. After session cleanup, MPA deletion removes proven exclusive managed worker templates and Skill Spaces, then Runtime. Proof requires account/region deployment records, matching ownership tags and checks for other deployment/Runtime references. Shared, imported or unproven resources remain. Persist cleanup state for partial-failure retries; other resources and general Runtime deletion remain unchanged. Loading, errors, preview retry and cancellation are visible in the detail confirmation dialog. See the [design](../../prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.md). diff --git a/specs/mpa-runtime-provisioning/README.zh.md b/specs/mpa-runtime-provisioning/README.zh.md index 886f4a5de..52f16885d 100644 --- a/specs/mpa-runtime-provisioning/README.zh.md +++ b/specs/mpa-runtime-provisioning/README.zh.md @@ -2,7 +2,7 @@ - **Component ID:** `mpa-runtime-provisioning` - **状态:** 草案;提议变更由关联 PRD 管理 -- **修订日期:** 2026-10-09 +- **修订日期:** 2026-10-12 - **English version:** [README.md](README.md) - **关联 PRD:** [MPA Runtime 集成加固](../../prd-spec/bugfixes/mpa-runtime-integration/2026-09-12-mpa-runtime-integration-hardening.zh.md) - **关联 PRD:** [MPA Studio 工作负载身份创建](../../prd-spec/features/mpa-studio-workload-identity/2026-09-20-mpa-studio-workload-identity.zh.md) @@ -90,12 +90,16 @@ Studio/CLI 通过共享编排遵循相同保证。平台 operation 清单与 boo 当私有 MPA YAML 同时提供 `tos-access-key`、`tos-secret-key` 和 `tos-bucket` 时,新建 worker Tool 必须携带 access-key 类型的 TOS 挂载:基础路径 -为 `/sandbox-session/default/default`,本地读写路径为 `/data/output`。凭证必须只 +为历史模式的 `/`,本地读写路径为 `/data/output`。凭证必须只 保留在 Tool 请求中;Runtime 只收到 `MPA_CODEX_WORKER_TOS_MOUNT_ENABLED=true` 和非敏感 bucket 名,不接收 AK/SK。 -Studio 创建页可以为单次创建传入完整三元组并覆盖 YAML 默认值;AK/SK 只经子进程 -stdin 在内存中传递,不得进入 sessionStorage、任务 SQLite 或任务查询响应。部分输入 -必须拒绝;使用已有 Worker 时必须先通过本次创建的 Worker 镜像覆盖为新建 Worker。 +Studio 仅提交可选 `tosBucket`,覆盖为不带密钥的 IAM Role 模式,其基础路径为 +`/sandbox-session/default/default`。显式 managed profile 可用 +`tos-credential-type: iam_role` 和桶名,不提供密钥;历史 CLI/YAML AK/SK 模式兼容。 +Studio 空选择保留服务端默认配置,桶授权遵循 +[CON-17](../studio-mpa-creation/README.zh.md#con-17--仅选桶-iam-tos-挂载)。 +凭据不得进入 sessionStorage、任务 SQLite 或任务查询响应。使用已有 Worker 时必须 +先通过本次创建的 Worker 镜像覆盖为新建 Worker;不隐式修改既有 Tool/Session。 对于新建托管 Runtime,首次 `CreateRuntime` 请求必须携带已经准备完成的 Worker Tool 的 `ToolId`。最终收敛更新在发布权威 endpoint/key 环境时继续保留相同 `ToolId`。 @@ -128,3 +132,7 @@ Runtime 创建在 CreateRuntime/UpdateRuntime 前注入 `MCP_TOKEN_SECRET`。显 Worker 环境配置及模板优先级遵循 [Studio 契约](../studio-mpa-creation/README.zh.md#独立-worker-配置)。内置 Studio 不依赖旧账号 Tool。保留显式 CLI 模板/已有 ID;非托管旧创建逻辑不变。 托管 Runtime 的子网等价判断和稳定重试顺序遵循 [Studio 网络恢复契约](../studio-mpa-creation/README.zh.md#runtime-子网顺序与恢复)。 + +## MPA 独占资源删除(2026-10-12,已实现) + +本变更替代删除契约中的 Profile 前置条件:预览与执行不查询 Profile,仅活动操作和运行会话阻止删除;会话查询失败必须可见。MPA 删除在既有会话清理后,按顺序清理已证明独占的受管沙箱模板、Skill Space,再删除 Runtime。依据为账号/地域注册记录、匹配的资源标签和其他部署/Runtime 引用检查;共享、导入或归属不明资源保留。清理状态持久保存,部分失败可重试;其他资源与通用 Runtime 删除不变。加载、错误、预览重试及取消在详情页确认弹窗可见。详见[设计](../../prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.zh.md)。 diff --git a/specs/studio-mpa-control-plane/README.md b/specs/studio-mpa-control-plane/README.md index e684dd31c..e90238ff1 100644 --- a/specs/studio-mpa-control-plane/README.md +++ b/specs/studio-mpa-control-plane/README.md @@ -2,7 +2,7 @@ - Component ID: `studio-mpa-control-plane` - Status: `draft` for remaining P0 amendments; baseline Phase 1, part of Phase 2, and P0 Studio slices through S5-12 browser validation are implemented -- Revision: 2026-09-20 +- Revision: 2026-10-14 - Chinese: [README.zh.md](README.zh.md) - PRD: [MPA Studio Turn Control and Resource Workspace](../../prd-spec/features/mpa-studio-control-plane/2026-09-13-mpa-studio-control-plane-design.md) @@ -28,7 +28,7 @@ Own the Studio-to-mpa-agent contract for Ark model discovery, immutable Turn sna - `CON-12`: Tool activity exposes a tool-specific safe action and subject. Unknown tools expose their concrete name rather than a generic completed label. - `CON-13`: Sanitized tool inputs/results remain completely retrievable by an explicit copy/download action. Preview rendering is bounded, truncation is disclosed, and all detail paths share the same redaction rules. - `CON-14`: Turn model selection is searchable and keyboard accessible, and remains disabled while a non-terminal Turn owns an immutable model snapshot. -- `CON-15`: Runtime listing exposes `agentCategory` and accepts `agentCategory=general|mpa` for server-side category filtering before visible pagination. The authoritative and only MPA source is Runtime tag `veadk:agent-type=mpa`; image names and artifact URLs are not category inputs. `agentCategory=mpa` must first query the Volcano Tag service with a positive tag filter to obtain candidate Runtime IDs, then hydrate those records by Runtime ID, so sparse MPA results do not require scanning unrelated Runtime pages. +- `CON-15`: Runtime listing exposes `agentCategory` and accepts `agentCategory=general|mpa` for server-side category filtering before visible pagination. The authoritative and only MPA source is Runtime tag `veadk:agent-type=mpa`; image names and artifact URLs are not category inputs. `agentCategory=mpa` must first query the Tag service with a positive tag filter to obtain candidate Runtime IDs, then hydrate those records by Runtime ID, so sparse MPA results do not require scanning unrelated Runtime pages. Tag reads use the server-selected provider endpoint: BytePlus uses `open.byteplusapi.com`, while Volcengine retains its generated-SDK endpoint resolution. Browser inputs cannot select or override this endpoint. - `CON-31`: Studio's MPA list narrows `CON-15` discovery to Runtimes carrying both `veadk:agent-type=mpa` and `veadk:managed=true`; administrators with `scope=all` see all Studio-managed MPA Runtimes, while `scope=mine` additionally requires trusted `veadk:owner`. `veadk:provisioner=studio-mpa` is written for future provenance audit but is not yet mandatory for compatibility with existing generic Studio MPA Runtimes. Tag-service failure remains fail-closed, browser inputs cannot disable the mandatory managed filter, and authorization remains independent. Runtime TRN region is applied before hydration because the Tag service can return global mappings. A provider-confirmed missing Runtime may be skipped as a stale tag mapping; any other Runtime-detail hydration failure remains an error rather than being rendered as an empty list. Implemented and locally verified on 2026-09-29 by [Studio-created MPA Runtime filtering](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.md); real-browser discovery remains a separate local acceptance step. ## State and data @@ -101,7 +101,7 @@ PRD section 6 records the actual `frontend/src/App.tsx` and `frontend/src/ui/MyA - `CON-25`: `GET /web/mpa/agents/{mpaInstanceId}/view` returns `MpaAgentView`, combining scope, MPA instance/current Profile revision, the unique Runtime binding/version/readiness, active operation/stage, capabilities, and safe error. Zero Runtime is `runtime_missing`; multiple is `binding_ambiguous` and blocks writes. An `orphan_runtime` has one authorized Runtime but no applied Profile: `capabilities.canWrite` remains true so Studio can perform the first Profile apply, while `canDebug` remains false and Session configuration stays blocked until the binding becomes `bound`. A Runtime whose data plane still requires legacy `X-Jwt-Token` is reported as `runtime_legacy_auth_unsupported`: Studio keeps showing the Runtime binding, but `canWrite=false`, `canDebug=false`, and Session configuration remains unavailable until the Runtime image is updated. Even with a bound Runtime, `canDebug` remains false while its lifecycle operation is `active` or `failed_retryable`; chat/debug becomes available only after recovery reaches a safe terminal state. MPA editing uses the Studio Profile and Runtime persists its immutable revisions. Debug uses an isolated Runtime Session. Do not reuse generic Python projects, personal Sandbox, evaluation, or optimization business logic. GitHub delivery can be reused only through explicit MPA compatibility preflight. The S5-02/S5-03/S5-05/S5-08 slices are implemented: the BFF probes configured Runtime regions, accepts only visible `veadk:agent-type=mpa` bindings, returns 0/1/N binding status, hydrates the unique binding through Runtime `profile-status`, and the frontend consumes this view plus Runtime Console diagnostics. - `CON-25a`: AgentKit Studio is the unified MPA control entry. MPA detail exposes an Agent-level `Profile configuration` section with current apply status, revision/ETag, model, system prompt, and Tool/Skill/MCP summaries. It applies the current Studio Profile through the typed MPA BFF operation path and never probes generic `/list-apps` Runtime update capability for MPA Agents. First apply uses create semantics and `If-None-Match: *`; later applies use the Runtime revision/ETag. The browser idempotency key is deterministic from Runtime ID, operation kind, and canonical Profile SHA-256, so retrying the same Profile replays the same operation while changed content gets a new key. - `CON-29`: MPA Runtime write paths must run the shared P0 compatibility preflight before any AgentKit SDK or GitHub mutation. This covers direct Runtime update via `/web/deploy-agentkit`, GitHub Actions delivery setup via `/web/github-delivery/cicd-pipeline`, initial delivery branch setup via `/web/github-delivery/init-main`, bound source sync via `/web/github-cicd/runtime-sync`, and rollback PR creation via `/web/github-delivery/rollback-pr`. The browser marks MPA flows with `agentCategory=mpa`; an explicit `mpaCompatibilityManifest` or legacy `compatibilityManifest` can override the locally generated shape. Failures return a safe `409` detail with `code=mpa_compatibility_preflight_failed`, `status`, and `errorCode`; the manifest body and secret-like fields are never echoed. Absence of a pinned manifest in local UI paths only runs protocol-shape validation and is not release evidence; the final release gate must run VC-19 with real pinned revisions and image digests. -- `CON-30`: MPA delete uses a preview-then-execute contract. `GET /web/mpa/agents/{mpaInstanceId}/delete-preview` resolves the authorized Runtime binding, reads Runtime `profile-status`, calls existing Runtime `GET /api/v1/sessions?include_a2a=true`, and returns `canDelete`, `blockers`, visible session counts, active-session summaries, and a cleanup plan. `/web/delete-runtime` rechecks the server-side Runtime tag before MPA cleanup; `agentCategory` from the browser is advisory and cannot make a general Runtime use MPA cleanup. Lifecycle operations with `active` status or sessions in `queued|running|pausing|paused|resuming` return structured `409` before mutation. A stale `failed_retryable` lifecycle operation is not a delete blocker once the Runtime binding is `bound` and Runtime `profile-status` proves the Profile is `applied`; this prevents a recovered smoke failure from becoming a permanent cleanup blocker while preserving true active-operation protection. If no blocker exists, Studio deletes visible idle/terminal Runtime sessions through existing Runtime `DELETE /api/v1/sessions/{sessionId}` and then deletes the AgentKit Runtime. Per-session `404` means already cleaned and is ignored for retry safety. The preview is limited to sessions visible through the authorized target Runtime API; cross-user global session state is not claimed without a future Runtime/global admin endpoint. +- `CON-30`: MPA deletion previews authorized binding, active lifecycle operations and visible Runtime sessions; it does not query Profile. Active operations or sessions in `queued|running|pausing|paused|resuming` block deletion before side effects; failed operations alone do not. Session/discovery errors are surfaced rather than represented as empty results. The server rechecks Runtime tags, ownership and references. Cleanup removes visible idle sessions, exclusively owned managed sandbox templates and Skill Spaces, then AgentKit Runtime. Shared/imported/unproven resources, databases, Workspaces, APIG and network remain. Account/region registry locking and durable cleanup state support partial retries and prevent provisioning from recreating deleted resources. Missing session/resource responses are idempotent only for structured not-found errors. Confirmation shows cleanup IDs, retained-resource reasons, loading, errors and preview retry; cancellation aborts preview and ignores late responses. Session counts describe only the authenticated Runtime API’s visible sessions. - `CON-26`: Follow-up only: Resource Library, global Search, and artifact indexing/source adapters. No current development or acceptance. Session resource references and conversation results remain in scope; MPA templates/experts/reviews are not part of this design. - `CON-27`: Message-channel binding for existing MPA Runtimes is implemented in mainline for Feishu, DingTalk, and WeCom and is governed by `specs/mpa-channels`; it is no longer an unimplemented follow-up. Scheduled-task product acceptance and website visitor/A2A integration remain separate follow-ups. This P0 does not add duplicate channel adapters, CLI parity, or provider live gates. - `CON-28`: Applications/developer/global-admin pages retain non-MPA semantics. Gate incompatible MPA targets rather than hiding all general features. MPA runtime admin does not imply platform user-management admin. Trace/log/usage/feedback and CLI examples preserve runtime/worker/Session/Turn correlation and redaction. No unsupported coding/GitHub automation is silently relabelled as MPA. @@ -133,3 +133,25 @@ Scope correction: website/Feishu and other deferred findings in the entry audit ## MPA details availability (2026-10-09) MPA Agent details currently expose only Basic information. Other detail tabs and the footer Profile entry are hidden; restored/external focus resolves to Basic before section effects run. This page does not fetch Agent View or Profile status and cannot submit Profile operations. Runtime details, execution flow, chat/delete actions and their authorization remain. General Agent navigation, backend control-plane APIs, and native chat session Profile handling retain their existing contracts. + +## General deployment isolation (2026-10-12) + +Generic structured/YAML creation defaults to general. Draft presence and quick/traditional UI mode are not MPA intent. Existing targets persist explicit `agentCategory`; legacy `mpaProfileOnly: true` is the only fallback to MPA, and explicit general takes precedence. Only MPA executes or reports Profile/smoke phases, including failure and retry. Local draft filtering follows the same rule. Managed MPA creation retains its dedicated lifecycle. This frontend fix does not migrate existing server Runtime tags. + +## MPA owned-resource deletion (2026-10-12, implemented) + +This change supersedes the Profile prerequisite in the deletion contract: preview/execution do not query Profile; only active operations and active sessions block deletion, and session-query errors remain visible. After session cleanup, MPA deletion removes proven exclusive managed worker templates and Skill Spaces, then Runtime. Proof requires account/region deployment records, matching ownership tags and checks for other deployment/Runtime references. Shared, imported or unproven resources remain. Persist cleanup state for partial-failure retries; other resources and general Runtime deletion remain unchanged. Loading, errors, preview retry and cancellation are visible in the detail confirmation dialog. See the [design](../../prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.md). + +Deletion session listing/cleanup sends Studio’s server-authenticated `owner_id` as `x-user-id`, matching chat/scheduled tasks; browser identity headers are not used. Optional Runtime client `user_id` preserves existing caller compatibility. + +Delete preview has a 25-second deadline and returns HTTP 504 / `mpa_delete_preview_timeout` on expiry. Reference discovery reads at most 4 Runtime details concurrently. Deletion requests may reuse identity verification for unchanged credentials; rotation/account changes require re-verification. Creation retains default per-call verification. + +### CON-30a: MPA deletion deadline and confirmation + +Explicit MPA browser deletion waits up to 180 seconds; general deletion retains 30 seconds. A TimeoutError triggers one authorized, no-store, 30-second read-only confirmation for the same Runtime ID/region. Success requires structured cloud Runtime NotFound plus complete list absence; authorization 404, still-listed runtimes, incomplete pagination and query errors cannot mean success. Unconfirmed results retain a localized error and existing retry UI. No automatic delete replay or change to cleanup order is permitted. See [approved timeout fix](../../prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.md). + +Confirmation is restricted to server-authorized MPA delete attempts with the same Studio owner, Runtime, region and private deployment-credential fingerprint. Contexts are bounded to 1024 entries and expire after one hour; restart/rotation/missing context fails closed. + +## Compatibility resource relocation (2026-10-14) + +The MPA matrix and benchmark schema reside in `frontend/server/mpa/contracts/mpa-p0/`. The shared `veadk.cli.mpa_p0_contract` evaluator and required custom `--matrix` CLI option remain stable; only the default resource path and documented examples change. Missing default resources retain the embedded fallback; malformed present resources still fail. Python wheels and Studio staging include both JSON files without importing frontend composition during default lookup. No manifest fields, rules, pre-mutation guards or general-agent behavior change. See [approved relocation design](../../prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.md). diff --git a/specs/studio-mpa-control-plane/README.zh.md b/specs/studio-mpa-control-plane/README.zh.md index 3e0ab4a93..771657048 100644 --- a/specs/studio-mpa-control-plane/README.zh.md +++ b/specs/studio-mpa-control-plane/README.zh.md @@ -6,7 +6,7 @@ MPA 智能体详情目前只开放基本信息。其他详情 Tab 及底部 Prof - Component ID:`studio-mpa-control-plane` - 状态:剩余 P0 修订为 `draft`;基线第一期、第二期部分能力以及 P0 Studio 切片至 S5-12 浏览器验证已实现 -- 修订日期:2026-09-20 +- 修订日期:2026-10-14 - English:[README.md](README.md) - PRD:[MPA Studio Turn 控制与资源工作台](../../prd-spec/features/mpa-studio-control-plane/2026-09-13-mpa-studio-control-plane-design.zh.md) @@ -32,7 +32,7 @@ MPA 智能体详情目前只开放基本信息。其他详情 Tab 及底部 Prof - `CON-12`:工具活动展示工具特定的安全动作和对象;未知工具展示具体名称,不使用通用完成标签。 - `CON-13`:已脱敏工具输入/结果可通过显式复制/下载完整获取;预览渲染有界、截断有提示,所有详情路径共享同一脱敏规则。 - `CON-14`:Turn 模型选择支持搜索和键盘访问,并在非终态 Turn 拥有不可变模型快照期间保持禁用。 -- `CON-15`:Runtime 列表暴露 `agentCategory`,并接受 `agentCategory=general|mpa` 在可见分页前执行服务端分类过滤。MPA 的权威且唯一来源是 Runtime 标签 `veadk:agent-type=mpa`;镜像名和 artifact URL 不参与分类。`agentCategory=mpa` 必须先通过 Volcano Tag 服务正向标签过滤获得候选 Runtime ID,再按 Runtime ID 补齐详情,避免 MPA 结果稀疏时扫描无关 Runtime 页。 +- `CON-15`:Runtime 列表暴露 `agentCategory`,并接受 `agentCategory=general|mpa` 在可见分页前执行服务端分类过滤。MPA 的权威且唯一来源是 Runtime 标签 `veadk:agent-type=mpa`;镜像名和 artifact URL 不参与分类。`agentCategory=mpa` 必须先通过 Tag 服务正向标签过滤获得候选 Runtime ID,再按 Runtime ID 补齐详情,避免 MPA 结果稀疏时扫描无关 Runtime 页。Tag 读取使用服务端选择的 provider endpoint:BytePlus 使用 `open.byteplusapi.com`,火山引擎保留生成 SDK 的 endpoint 解析。浏览器输入不能选择或覆盖该 endpoint。 - `CON-31`:Studio MPA 列表把 `CON-15` 发现范围收窄到同时带 `veadk:agent-type=mpa` 和 `veadk:managed=true` 的 Runtime;`scope=all` 管理员看到全部 Studio 管理的 MPA Runtime,`scope=mine` 还必须匹配可信 `veadk:owner`。创建时写入 `veadk:provisioner=studio-mpa` 用于未来来源审计,但为兼容已有通用 Studio MPA,当前不把它作为强制条件。Tag 服务失败保持 fail-closed,浏览器参数不能关闭强制 managed 过滤,授权继续独立。由于 Tag 服务可能返回全局映射,补齐详情前必须按 Runtime TRN 地域过滤。provider 明确确认 Runtime 不存在时可把它作为过期标签映射跳过;其他 Runtime 详情补齐失败必须保持错误态,不能渲染为空列表。已由 [Studio 创建的 MPA Runtime 过滤](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.zh.md) 于 2026-09-29 实现并完成本地验证;真实浏览器发现仍是独立的本机验收步骤。 ## 状态与数据 @@ -105,7 +105,7 @@ PRD 第 6 节记录实际 `frontend/src/App.tsx` 与 `frontend/src/ui/MyAgents.t - `CON-25`:`GET /web/mpa/agents/{mpaInstanceId}/view` 返回 `MpaAgentView`,合并 scope、MPA instance/current Profile revision、唯一 Runtime binding/version/readiness、活动 operation/stage、capabilities 和 safe error。0 个 Runtime 为 `runtime_missing`;多个为 `binding_ambiguous` 并禁止写。`orphan_runtime` 表示存在一个已授权 Runtime 但尚未应用 Profile:`capabilities.canWrite` 保持为 true,使 Studio 可以执行首次 Profile apply;`canDebug` 保持为 false,Session 配置在 binding 变为 `bound` 前继续阻塞。若 Runtime data plane 仍要求旧 `X-Jwt-Token`,则返回 `runtime_legacy_auth_unsupported`:Studio 继续展示 Runtime binding,但 `canWrite=false`、`canDebug=false`,且 Session 配置在 Runtime 镜像更新前不可用。即使 Runtime 已 bound,只要 lifecycle operation 仍为 `active` 或 `failed_retryable`,`canDebug` 也必须保持 false;只有恢复到安全终态后才能开放 chat/debug。MPA 编辑使用 Studio Profile,Runtime 保存其不可变 revision;Debug 使用隔离 Runtime Session。不复用通用 Python 工程、个人 Sandbox、评测或优化业务逻辑;GitHub delivery 只有经过显式 MPA compatibility preflight 才可复用。S5-02/S5-03/S5-05/S5-08 切片已实现:BFF 探测已配置 Runtime regions,只接受当前用户可见且带 `veadk:agent-type=mpa` 的 binding,返回 0/1/N binding 状态,并在唯一 binding 时通过 Runtime `profile-status` 补齐 Profile 状态;前端消费该 view 并展示 Runtime Console diagnostics。 - `CON-25a`:AgentKit Studio 是 MPA 的统一管控入口。MPA 详情页提供 Agent 级 `Profile 配置` 分区,展示当前 apply 状态、revision/ETag、模型、系统提示词,以及 Tool/Skill/MCP 摘要。该分区通过类型化 MPA BFF operation 路径应用当前 Studio Profile;MPA Agent 不再探测依赖 `/list-apps` 的通用 Runtime update capability。首次 apply 使用 create 语义和 `If-None-Match: *`;后续 apply 使用 Runtime revision/ETag。浏览器幂等键由 Runtime ID、operation kind 与规范化 Profile 的 SHA-256 确定,因此相同 Profile 重试会重放同一 operation,内容变化会得到新的 key。 - `CON-29`:MPA Runtime 写路径必须在任何 AgentKit SDK 或 GitHub mutation 前执行共享 P0 compatibility preflight。覆盖 `/web/deploy-agentkit` 直连 Runtime update、`/web/github-delivery/cicd-pipeline` GitHub Actions delivery setup、`/web/github-delivery/init-main` 首次 delivery 分支初始化、`/web/github-cicd/runtime-sync` 已绑定源码同步,以及 `/web/github-delivery/rollback-pr` rollback PR 创建。浏览器用 `agentCategory=mpa` 标记 MPA 流程;显式 `mpaCompatibilityManifest` 或兼容旧字段 `compatibilityManifest` 可覆盖本地生成的协议形态。失败返回安全的 `409` detail,包含 `code=mpa_compatibility_preflight_failed`、`status` 和 `errorCode`;不得回显 manifest 正文或 secret-like 字段。没有 pinned manifest 的本地 UI 路径只做协议形态校验,不作为发布证据;最终 release gate 必须用真实固定的 revision 和 image digest 执行 VC-19。 -- `CON-30`:MPA 删除采用“先预览、再执行”的契约。`GET /web/mpa/agents/{mpaInstanceId}/delete-preview` 解析已授权 Runtime binding,读取 Runtime `profile-status`,调用现有 Runtime `GET /api/v1/sessions?include_a2a=true`,返回 `canDelete`、`blockers`、可见会话计数、活动会话摘要和清理计划。`/web/delete-runtime` 在 MPA 清理前重新检查服务端 Runtime 标签;浏览器传入的 `agentCategory` 只是提示,不能让普通 Runtime 进入 MPA 清理。`active` 状态 lifecycle operation 或状态为 `queued|running|pausing|paused|resuming` 的 active session 会在副作用前返回结构化 `409`。若某条遗留 lifecycle operation 为 `failed_retryable`,但 Runtime binding 已是 `bound` 且 Runtime `profile-status` 证明 Profile 已 `applied`,则不再把它作为删除 blocker;这样可以避免已恢复的 smoke 失败记录永久阻塞清理,同时保留真正 active operation 的保护。没有阻断时,Studio 先通过现有 Runtime `DELETE /api/v1/sessions/{sessionId}` 删除可见 idle/terminal Runtime 会话,再删除 AgentKit Runtime。单个 session `404` 表示已清理,会被忽略以支持安全重试。预览只统计已授权目标 Runtime API 可见的会话;若未来需要跨用户全局 session 状态,必须新增 Runtime/global admin endpoint 后再声明。 +- `CON-30`:MPA 删除预览检查已授权绑定、活动生命周期操作和 Runtime 可见会话,不查询 Profile。活动操作或状态为 `queued|running|pausing|paused|resuming` 的会话在副作用前阻止删除;失败操作本身不阻止删除。会话/资源发现错误必须显示,不得当作空结果。服务端重新检查 Runtime 标签、归属和引用。按可见空闲会话、独占受管沙箱模板、Skill Space、AgentKit Runtime 的顺序清理。共享/导入/归属不明资源、数据库、Workspace、APIG 和网络保留。账号/地域注册库锁和持久清理状态支持部分失败重试,并阻止创建流程重建已删除资源。会话/资源不存在仅在结构化 not-found 错误下视为幂等成功。确认弹窗展示清理 ID、保留原因、加载、错误和重新检查;取消终止预览并忽略晚到结果。会话统计仅代表已认证 Runtime API 的可见会话。 - `CON-26`: 仅后续:资源库、全局搜索、产物索引/来源 adapter。本期不开发、不验收。会话资源引用和会话结果仍在本期;MPA 模板/专家/审核不属于本方案。 - `CON-27`: 已有 MPA Runtime 的消息渠道绑定已在主干实现飞书、钉钉和企微,并由 `specs/mpa-channels` 管理,不再属于“代码未开发”的后续项。定时任务产品验收与网站 visitor/A2A 集成仍是独立后续。本 P0 不新增重复渠道 adapter、CLI 等价能力或 provider 专项 live 门禁。 - `CON-28`:应用/开发者/全局管理页保留非 MPA 语义。限制不兼容 MPA target,不隐藏所有通用功能。MPA runtime admin 不等于平台用户管理 admin。Trace/log/usage/feedback、CLI 示例保持 runtime/worker/Session/Turn 关联与脱敏,不将不支持的 coding/GitHub 自动化改名成 MPA。 @@ -133,3 +133,25 @@ S5-11 真实验证:`VEADK_MPA_P0_LIVE=1 VEADK_MPA_P0_ASYNC_STAGE_TIMEOUT_SECON CON-11a 回归验证:会话投影/对账 focused suite 返回 43 passed;完整前端测试返回 1236 passed;TypeScript、i18n、生产构建与 scoped diff 检查均通过。严格真实 Studio 探针在任务完成并额外等待 30 秒后观察到五个有序 `.turn--assistant` 节点,整页重载后仍为相同五个节点。既有可选本地 endpoint 404/503 已单独记录,不影响 transcript 持久展示。 CON-11b 回归验证:完整前端测试返回 1237 passed;TypeScript、i18n、生产构建与 scoped diff 检查均通过。新的真实 Studio `whoami` 执行观察到父级 `sandbox_task` 和子命令无需刷新即从 running 变为 completed,页面不再有 spinner 或 running activity,最终回答为 `root`;整页刷新后两条终态活动和回答均保持。 范围修正:上述入口审计中网站/飞书等后续项仅供未来参考,不是本期开发要求。 + +## 通用部署隔离(2026-10-12) + +通用结构化/YAML 创建默认 general。存在草稿或快捷/传统界面模式不代表 MPA 意图。已有目标保存明确的 `agentCategory`;旧 `mpaProfileOnly: true` 是唯一的 MPA 回退依据,明确 general 优先。仅 MPA 执行或报告 Profile/smoke 阶段,包括失败与重试。本地草稿筛选遵循相同规则。托管 MPA 创建保留独立流程。本次前端修复不迁移已有服务端 Runtime 标签。 + +## MPA 独占资源删除(2026-10-12,已实现) + +本变更替代删除契约中的 Profile 前置条件:预览与执行不查询 Profile,仅活动操作和运行会话阻止删除;会话查询失败必须可见。MPA 删除在既有会话清理后,按顺序清理已证明独占的受管沙箱模板、Skill Space,再删除 Runtime。依据为账号/地域注册记录、匹配的资源标签和其他部署/Runtime 引用检查;共享、导入或归属不明资源保留。清理状态持久保存,部分失败可重试;其他资源与通用 Runtime 删除不变。加载、错误、预览重试及取消在详情页确认弹窗可见。详见[设计](../../prd-spec/features/mpa-owned-resource-deletion/2026-10-12-owned-resource-deletion.zh.md)。 + +删除会话查询和清理使用 Studio 服务端已认证的 `owner_id` 作为 `x-user-id`,与聊天/定时任务保持一致;不使用浏览器传入的身份头。Runtime client 的可选 `user_id` 参数维持旧调用兼容。 + +删除预览限时 25 秒,超时返回 HTTP 504 / `mpa_delete_preview_timeout`;引用发现最多并发读取 4 个 Runtime 详情。删除请求内相同凭据可复用身份核验,轮换/账号变化必须重新检查;创建流程保持默认逐次核验。 + +### CON-30a:MPA 删除超时与确认 + +明确选择的 MPA 浏览器删除最多等待 180 秒;通用删除保持 30 秒。TimeoutError 后,对同一 Runtime ID/地域执行一次已授权、no-store、限时 30 秒的只读确认。仅结构化云端 Runtime NotFound 且完整列表不存在时成功;授权 404、仍在列表、分页不完整和查询失败不能视作成功。无法确认时保留本地化错误及既有重试 UI。不自动重复删除,不改变清理顺序。见[已批准超时修复](../../prd-spec/bugfixes/mpa-delete-timeout/2026-10-13-confirm-delete-outcome.zh.md)。 + +结果确认仅限服务端已授权的 MPA 删除尝试,须匹配 Studio 用户、Runtime、地域及私有部署凭据指纹。上下文最多 1024 条、一小时到期;重启/轮换/上下文缺失均失败关闭。 + +## 兼容性资源位置迁移(2026-10-14) + +MPA 矩阵及性能报告 schema 移至 `frontend/server/mpa/contracts/mpa-p0/`。共享 `veadk.cli.mpa_p0_contract` 评估器和必填自定义 `--matrix` CLI 参数保持不变,仅默认资源路径和文档示例调整。缺默认文件继续使用内置备用规则,存在但格式错误时仍失败。Python wheel 和 Studio 暂存须包含两个 JSON,默认查找不导入 frontend 组合模块。不改变 manifest 字段、规则、写入前检查或通用智能体行为。见[已批准迁移设计](../../prd-spec/refactors/mpa-contract-location/2026-10-14-studio-owned-resources.zh.md)。 diff --git a/specs/studio-mpa-creation/README.md b/specs/studio-mpa-creation/README.md index 7750134a3..44c9f89a4 100644 --- a/specs/studio-mpa-creation/README.md +++ b/specs/studio-mpa-creation/README.md @@ -4,7 +4,7 @@ - Component ID: `studio-mpa-creation` - Status: active -- Revised: 2026-10-09 +- Revised: 2026-10-12 - Design and evidence: [Studio MPA creation](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-20-studio-mpa-creation.md) - Owned code: `veadk/integrations/mpa/managed/`, `frontend/server/mpa_creation.py`, `frontend/src/adk/mpaCreation.ts`, `frontend/src/ui/mpa-create/`; CLI and directory integration. - Tests: `tests/integrations/mpa_managed/`, `frontend/tests/mpaCreation.test.tsx`. @@ -13,6 +13,31 @@ ## Responsibility and boundaries +### Session output storage — bucket-only IAM TOS mounts + +The approved [bucket-only design](../../prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.md) +supersedes Studio access-key input. Studio accepts an +optional `tosBucket` beginning with `agentkit-platform-`, selects IAM Role using the actual Worker role, strips old +draft credentials, and uses the existing bucket resource selector. Before other +provisioning writes, verify account/region bucket ownership and add a stable, +exact bucket-specific Global IAM policy binding. Bucket actions are HeadBucket +and ListBucket; object actions are GetObject, PutObject, AbortMultipartUpload, +and DeleteObject, restricted to `sandbox-session/*`. Preserve existing role, +trust, policies, and bindings; reject conflicts and bound retries/cancellation. +Tool payloads omit Credentials and reuse checks include mode/role. CLI access-key +mode remains compatible. No implicit existing-Tool/Session or public-bucket-policy +change, no KMS grants, and no strict tenant isolation from the shared role. +Implementation, automated/browser verification, and cloud E2E are separate. +An empty selection preserves the server profile; the built-in profile has no TOS +mount by default. Deployment credentials require TOS ListBuckets and IAM GetRole, +GetPolicy, CreatePolicy, ListAttachedRolePolicies and AttachRolePolicy. Granting +bucket access does not imply KMS access or override existing IAM denies. +The existing `/web/deployment-resources` API accepts optional `namePrefix` for +TOS lists, applied before search/counts/pagination. Only MPA creation supplies the +platform prefix; general queries remain unchanged. Creation validates the prefix +before cloud calls, including recovered drafts; explicit CLI profiles are not +restricted by this Studio-only selection rule. + VeADK owns managed YAML parsing, cloud/database orchestration, authorized durable creation tasks and the MPA directory dialog. No external source checkout is required. Shared registry/bootstrap contracts remain interoperable with the MPA image. Legacy `veadk mpa create` remains separate and unchanged. Model execution and channel routing remain Runtime responsibilities. Managed runtime IAM preparation follows the contract below. ## Contracts @@ -93,7 +118,7 @@ CON-1 explicit infrastructure: `managed.runtime` optionally accepts `role-name`, CON-9 creation images: New forms have no image inputs and use the built-in latest defaults. Only legacy requests and already-submitted drafts retain explicit images; submitted fields stay locked. POST accepts optional trimmed image references (max 1024 characters), rejects URLs/credentials/query fragments/invalid SHA256 digests, and never treats them as shell commands. Config exposes only locally available image defaults; reference-only defaults may remain empty. CON-6/CON-8 task storage adds an `images` JSON column with `{}` for legacy rows. First submission snapshots locally resolved effective images; retries reuse that column and reject changes to explicit inputs. Task responses include this nonsecret snapshot, and the fixed runner applies it to a copied profile. Explicit worker images clear a configured existing-worker selection for this new task. Authorization and all other resource settings remain server-owned. -CON-10 — worker recovery/diagnostics: transient Worker operations have at most 4 attempts with 1/2/4-second waits, within a default 600-second stage budget and the task deadline. Create retries retain the same payload/ClientToken; recognized not-found is recoverable only for a registered managed worker. Permanent/unknown errors and ownership conflicts fail immediately. Safe enum-only diagnostics are logged and stored in `task_diagnostics` (latest 100 per task, retained across retries); raw exception data is never persisted. Task HTTP fields and error codes are unchanged. See [approved design](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-20-worker-retry.md). +CON-10 — worker recovery/diagnostics: transient Worker operations have at most 4 attempts with 1/2/4-second waits, within a default 600-second stage budget and the task deadline. Create retries retain the same payload/ClientToken; recognized not-found is recoverable only for a registered managed worker. Permanent/unknown errors and ownership conflicts fail immediately. Safe validated diagnostic fields are logged and stored in `task_diagnostics` (latest 100 per task, retained across retries); raw exception data is never persisted. Task HTTP fields and error codes are unchanged. See [approved design](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-20-worker-retry.md). CON-10 metadata visibility: distinguish absent initialization metadata from explicit conflicts. A managed Worker with persisted ID/token/hash may wait for missing ID/project/ownership tags only in Creating/Pending/Starting/Initializing/Provisioning or absent status, polling every 5 seconds within the existing Worker/task deadline, without an independent observation limit. Ready with missing metadata, present conflicts, terminal/unknown states and workers without managed creation intent fail immediately. Fixed field diagnostics never include values; metadata attempts saturate at 4 to preserve the diagnostic protocol. Worker API error retry limits remain unchanged. See [deadline correction and verification limits](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-30-worker-metadata-deadline.md). @@ -117,7 +142,7 @@ The config response adds optional `postgresLayout: "split-workspaces"`, `adminWo `managed.postgres.mode: auto` opts into deployment-STS-backed AIDAP preparation. Configuration inspection is read-only and needs no PG credentials; it returns `postgresMode: "auto"` and empty `pgHost`/`pgPort`. The PG wizard step explains preparation; POST rejects nonempty PG host/port fields. Unsubmitted drafts clear old PG targets; submitted payloads remain unchanged and incompatible retries are blocked. OpenViking configuration remains the third step. The Studio execution role must cover caller identity, all VPC/subnet discovery and creation performed by `NetworkCloud`, all APIG/IM Gateway operations performed by `GatewayCloud`, the nine explicit AIDAP operations performed by `PGCloud`, and AgentKit Worker, Skill Space, and Runtime operations. The default role grants the [audited explicit cloud set](../../prd-spec/bugfixes/studio-mpa-aidap-permissions/2026-09-23-complete-mpa-cloud-runtime-policy.md) plus its existing `agentkit:*` coverage and is refreshed during `studio update`; customer-owned roles remain operator-managed. -For each verified account/region/project, prepare `mpa_admin_workspace/mpa_admin_db` and one `mpa_business_workspace` (business name configurable). Each MPA retains its independent business database. AIDAP Workspace IDs are resolved/validated against account, region, project, name, engine and ownership tags. Optional explicit IDs adopt existing Workspaces. Legacy/manual mode is unchanged. New task stages are `admin_workspace`, `business_workspace`, `admin_database`. +For shared-layout requests (CON-19 defines new per-agent requests), prepare `mpa_admin_workspace/mpa_admin_db` and one `mpa_business_workspace` (business name configurable). Each MPA retains its independent business database. AIDAP Workspace IDs are resolved/validated against account, region, project, name, engine and ownership tags. Optional explicit IDs adopt existing Workspaces. Legacy/manual mode is unchanged. New task stages are `admin_workspace`, `business_workspace`, `admin_database`. Store nonsecret intent and resource identity in a private SQLite bootstrap file. The built-in Studio profile temporarily uses `/tmp/veadk-studio/mpa-pg-bootstrap.sqlite3` so cloud creation does not write to its read-only code directory; standalone YAML retains `.adk/mpa-pg-bootstrap.sqlite3` unless configured otherwise. All creation processes on one instance must share this state path and its OS locks. The Studio `/tmp` path is not durable across instance replacement and is not shared by independent hosts; after state loss, inspect cloud resources before retrying an uncertain create. Persist intent before CreateWorkspace and ID before readiness waits. Never blindly retry uncertain creation; discover by scope/tags or adopt by ID. Definite authorization/parameter rejections can retry after correction. Preserve resources on cancellation, timeout and downstream failure; never replace a deleted recorded Workspace. Provider errors are sanitized; credentials are refreshed and account-checked per SDK call, used only server-side, and never returned by config/tasks or written to bootstrap state. @@ -183,8 +208,75 @@ Defined by [account-key design](../../prd-spec/features/mpa-model-key-discovery/ Studio's server-selected provider enables managed MPA creation for BytePlus `ap-southeast-1` as well as the existing Volcengine flow. The browser cannot supply provider, account or cloud endpoints. Provider/region mismatches fail before mutation. Domestic profile values remain unchanged. BytePlus uses its own AK/SK/session token or explicit rotating IAM credential file, with STS account verification via `open.byteplusapi.com` on every credential refresh; it never reads Volcengine environment credentials. Runtime, Skills and Tools SDK clients are constructed inside the provider context in their worker threads. Identity and signed VPC/ECS/APIG/AIDAP/Ark/IAM requests select the provider's endpoints. Unsupported APIs and required IAM policies fail explicitly, without domestic fallback or omitted permissions. -BytePlus defaults to the existing overseas Studio model/base, propagates provider/region to Runtime and Worker, and uses Runtime's `APIG_TOP_ENDPOINT` override. Optional TOS mounts use the overseas endpoint. Existing public images remain defaults; trusted server overrides are `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE`. `VEADK_MPA_BYTEPLUS_AIDAP_HOST` may override the AIDAP hostname on the server; invalid URL/path/user-info inputs fail local inspection. `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` explicitly selects a rotating IAM file; missing BytePlus environment credentials never implicitly read the domestic mounted file. Zone validation accepts both `ap-southeast-1a` and `ap-southeast-1-a` without rewriting IDs, preserving domestic validation. Browser and task responses contain no credential values. A BytePlus task adds a trusted provider marker to its durable fingerprint and child stdin. Default task and PG bootstrap files have `-byteplus` suffixes, so domestic recovery state is preserved. Shared Workspace/database layout, lock/retry/cancellation/readiness and optional OpenViking semantics remain unchanged. Console links use the selected provider. Image pull, overseas API/policy availability and actual ready/chat behavior require separate live verification; local config readiness is not evidence of cloud resource availability. See [design and verification](../../prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.md). +BytePlus defaults to the existing overseas Studio model/base, propagates provider/region to Runtime and Worker, and uses Runtime's `APIG_TOP_ENDPOINT` override. Optional TOS mounts use the overseas endpoint. New BytePlus tasks default to `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_agent:latest` and `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_codex_worker:latest`; trusted server overrides remain `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE`. Domestic defaults and existing task snapshots remain unchanged. See the [BytePlus image correction](../../prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.md). `VEADK_MPA_BYTEPLUS_AIDAP_HOST` may override the AIDAP hostname on the server; invalid URL/path/user-info inputs fail local inspection. `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` explicitly selects a rotating IAM file; missing BytePlus environment credentials never implicitly read the domestic mounted file. Zone validation accepts both `ap-southeast-1a` and `ap-southeast-1-a` without rewriting IDs, preserving domestic validation. Browser and task responses contain no credential values. A BytePlus task adds a trusted provider marker to its durable fingerprint and child stdin. Default task and PG bootstrap files have `-byteplus` suffixes, so domestic recovery state is preserved. Shared Workspace/database layout, lock/retry/cancellation/readiness and optional OpenViking semantics remain unchanged. Console links use the selected provider. Image pull, overseas API/policy availability and actual ready/chat behavior require separate live verification; local config readiness is not evidence of cloud resource availability. See [design and verification](../../prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.md). Managed BytePlus IAM defaults to `open.byteplusapi.com`, retaining the trusted server `IAM_OPENAPI_HOST` override; shared IAM utilities and domestic creation behavior remain unchanged. Managed BytePlus AIDAP defaults to `open.byteplusapi.com` and retains the validated `VEADK_MPA_BYTEPLUS_AIDAP_HOST` override. API connectivity is not proof of Workspace creation success; failed states and ownership checks remain enforced, with no automatic deletion or adoption of failed same-name resources. + +BytePlus managed Runtime inherits the enabled application and control-plane APM defaults: `ENABLE_APMPLUS=true`, `FORCE_APMPLUS_EXPORTER_REGISTRATION=true`, and `ApmplusEnable=true`, matching Volcengine. Existing Runtime and submitted task snapshots are unchanged. See the [BytePlus APM restoration](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.md). + +## CON-18: Automatic OpenViking + +New built-in Beijing Studio requests explicitly select `openvikingMode: auto`; old requests without it, manual CLI profiles and BytePlus retain existing behavior. Third-step automatic preparation replaces manual OV inputs for these new requests. Provision one enterprise library with default VLM/Embedding identities, explicit Credentials Source=volcengine and versioned EndpointID values; add the already resolved Ark key only to a copied create payload. Never persist the model key in the intent; wait INIT to READY, obtain default user API Key server-side and inject OPENVIKING_URL/RESOURCE_ID/API_KEY/USER before Runtime deployment. Record scoped nonsecret intent/ID in the authorized deployment registry, reuse on retry and validate ownership/configuration. Missing registered resources, FAILED status or ambiguous create outcome fail explicitly; no blind recreation or Ark endpoint fallback. Keys are never stored in registry/tasks/results. Cancellation and Agent deletion retain OV. Default-model creation capability remains unverified until isolated live acceptance. General agents are unaffected. [Design](../../prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.md). + +CON-18 source correction: permit a matching previous no-Credentials intent to upgrade only with no OV ID, no pending Runtime operation and an explicitly false create-dispatch flag after proven rejection. Unknown/in-flight/changed or registered intents remain conflicts. Get readback must match Source/EndpointID. No UI fields or model-endpoint creation are added. See [source correction](../../prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.md). + +## CON-19: Independent business Workspace for new MPA requests + +New built-in Studio configurations advertise optional `businessWorkspaceMode: "per-agent"`. New forms explicitly submit/persist it; omission preserves `shared` and submitted drafts are not upgraded. `managed.postgres.business-workspace-mode` defaults to `shared`; explicit `per-agent` requires automatic PG and no configured business Workspace ID. Stable agent-scoped name/scope/tags protect independent business creation and retry. Prepare the shared management DB before reading existing per-agent deployment bindings; registered legacy shared bindings remain shared, conflicts fail closed. The resolved Workspace ID, layout and endpoint are pinned in the management registry; each Runtime receives its own business connection and unchanged shared registry connection. Preserve current uncertainty/cancellation recovery and local-lock limitations. No migration, business table initialization or Workspace deletion occurs; generic agents and runtime business interfaces are unchanged. Both existing provider adapters follow this contract. See [design and verification](../../prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.md). + +## CON-20: Name preflight and dedicated aidb requests + +New built-in Studio config/forms explicitly select `businessDatabaseName: aidb` with `businessWorkspaceMode: per-agent`. They use `mpa_agent_` for the Workspace, and `aidb` for the business database. Missing database selection retains legacy hashes and request fingerprints. Existing Workspace/database bindings are never renamed or switched. Initial unmarked aidb adoption requires verified dedicated Workspace ownership, matching database owner, no non-system/non-extension relation data and no previous Runtime/ready binding; missing/mismatched/nonempty databases fail closed. Initialization is transaction-locked and agent-marked before Runtime creation. + +Authorized name checks precede first Next, task acceptance and new-layout cloud preparation. Runtime, worker and target Workspace collisions reject foreign/ambiguous ownership; validated own bindings permit retry. Query failures/timeouts are explicit errors. A private provider/account/region task snapshot guards same-host concurrent names and prevents retry under different credentials; only active tasks reserve names. Cross-host atomic exclusion is not guaranteed by read-only checks. Generic agents, shared control resources and PG deletion policy are unchanged. See [approved design](../../prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md). + +New-layout web preflight/submission uses the server-derived owner/request internal identity. A supplied different agent ID is rejected; legacy explicit-ID requests retain their previous contract. + +## CON-21: Per-request maximum instances + +New editable MPA forms submit strict positive integer `maxInstance` in basic information, defaulting to 20 for Volcengine and 10 for BytePlus. Provider-specific help and new-request resets use the same default; explicit saved draft values and submitted/legacy retry inputs remain unchanged. The value is persisted with request identity, forwarded to the runner and applied as Runtime `MaxInstance`. Below-configured-minimum values fail before acceptance. Submitted values are immutable on retry; omitted/null legacy fields preserve existing fingerprints/profile defaults and are not auto-upgraded. Name-conflict errors use the existing danger/soft Alert with unchanged localized text. General-agent creation and existing Runtime settings are unaffected. See [design](../../prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.md). + +OV route registration and configuration inspection must preserve lazy Studio startup: the signing/network helper loads on the first actual OV API call, not when importing the adapter. See [upstream-readiness correction](../../prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.md). + +CON-18 BytePlus extension: BytePlus `ap-southeast-1` new automatic requests prepare a developer library with top-level and credential Source=volcengine, reusing the resolved MPA inference API Key. Model names remain seed-2-0-lite/skylark-embedding-vision; EndpointID defaults are seed-2-0-lite-260428/skylark-embedding-vision-251215, which BytePlus Ark accepts for the corresponding foundation-model versions. Server OV_VLM_ENDPOINT_ID/OV_EMBEDDING_ENDPOINT_ID override defaults; invalid values fail before cloud mutation. OV_MODEL_API_KEY and Coding Plan are not used. Source/EndpointID are stored as nonsecret intent; changed endpoints or old Coding Plan bindings cause a conflict rather than recreation. Overseas signing, default-key access without UserID, four Runtime variables, retention, unknown-create and secret-exclusion guarantees remain unchanged. Domestic and submitted manual flows stay unchanged. Personal default-user and overseas data-plane support still require separate Runtime adaptation. See [approved successor](../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.md) and [model-identity correction](../../prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.md). + + +CON-10/CON-11 IAM recovery: preserve allowlisted operations/categories and validated optional Request IDs in additive task diagnostics. Retry transient IAM reconciliation at most four times with 1/2/4-second waits under the existing deadline, restarting fixed-name readback after uncertain writes. Permanent/unknown failures are immediate; exhausted transient failures use iamTemporaryFailure. Cancellation prevents further SDK dispatch. Legacy diagnostic fields and existing permission keys remain compatible. See [approved fix](../../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md). + +CON-10/CON-18 OV diagnostics: structured provider rejections and HTTP/SDK exception bodies retain optional validated errorCode (capitalized ASCII code, at most 128 characters; credential-shaped values excluded) and the existing optional hex/UUID requestId. These identifiers pass through the child diagnostic event into backend logs and additive task_diagnostics.error_code/request_id columns; legacy events/rows and the 100-events/task limit remain compatible. Raw Message, bodies, credentials and exception text are excluded. Public task fields, domestic/BytePlus payloads, error categories and uncertain-create retry protection stay unchanged. Missing/malformed metadata may still leave the original cause unavailable. See [diagnostic fix](../../prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.md). + +CON-17/CON-18 BytePlus default restored: supported ap-southeast-1 new/editable requests advertise automatic personal OV again. Existing submitted auto/manual/no-OV identities remain immutable; testing OV after a no-OV submission requires New Agent. Domestic auto, manual fallback and uncertain-create guards are unchanged. See [restoration](../../prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md). + +CON-10 Runtime diagnostics: create_runtime/update_runtime failures retain validated category/errorCode and optional requestId from SDK attributes, structured HTTP/SDK bodies and bounded JSON or bytes-literal exception arguments. Parsing is capped at 65,536 bytes/characters with at most eight cycle-safe causes. Raw messages/arguments/bodies, credentials and ClientToken never enter diagnostics. Same exception, call count, cancellation, category, payload and retry semantics are preserved; absent metadata remains omitted. See [completion](../../prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.md). + +CON-20 implementation correction: combine matching Runtime list/detail ownership and use canonical Worker managed_by/mpa_agent_key tags plus MPA_AGENT_ID environment. Contract unchanged; see [retry fix](../../prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.md). + +CON-20 retry proof: empty cloud owner tags may be filled only by an authenticated accepted request with identical normalized stored inputs, server-derived agent identity and private provider/account/region snapshot verified against STS. Explicit foreign tags still reject. The POST obtains this proof server-side; its existing expectedAccount snapshot carries the same check into child provisioning. No browser retry flag, new public fields, or cloud preflight bypass. + +CON-17 APM key handoff: Studio BytePlus creation obtains `data.app_key` through `GetAppKey` on `apmplus-server.ap-southeast-1.byteplusapi.com` with verified deployment credentials before resource mutations, and injects `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY` into Runtime Envs. Valid trusted explicit Runtime keys are preserved. Lookup failures stop creation with bounded retries and safe `get_apm_key` diagnostics; the key is never stored in task/bootstrap/deployment records or browser results. Domestic and non-Studio paths remain unchanged. Existing pending-input hash checks are retained; old tasks are not silently upgraded. See the [server-side APM key design](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.md). + +Provider-specific default adjustment: [BytePlus maximum instances](../../prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.md). Backend/YAML/CLI profile defaults remain unchanged. + +CON-17 OTLP collector: new BytePlus Studio profiles inject `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317`. Trusted explicit Runtime environment overrides retain precedence. Domestic defaults, generic agents, AppKey retrieval, existing resources and submitted snapshots are unchanged. See [endpoint design](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.md). + + +### Cloud Studio MPA IAM credentials and OpenViking permissions + +BytePlus `veadk studio deploy` supplies the nonsecret function environment variable +`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential`. Managed creation +uses the mounted rotating role credentials, rereading the file for each call; missing, +malformed or incomplete credentials fail explicitly. Deployment does not copy the +operator's AK/SK or local credential-file path. Local BytePlus AK/SK and explicit CLI +file selection are unchanged; domestic creation retains its existing IAM fallback. +The shared default Studio custom role policy grants +`vikingdb:CreateOpenVikingCollection`, `vikingdb:GetOpenVikingCollection` and +`vikingdb:AccessOpenVikingApiKey` for both providers, without OV deletion permission. +Redeploy existing Studio installations to apply the environment and update the default +role policy. Custom roles need equivalent authorization separately. Service activation, +quotas, model access and network connectivity remain prerequisites; this change does +not claim live cloud verification. + + +CON-17 TOS resource credentials: `/web/deployment-resources` passes the current server-resolved AK/SK/session token to TOS queries as well as CR. Each request resolves credentials anew; clients are not cached across requests. Without complete explicit credentials, existing SDK discovery remains available. Provider endpoint resolution, filtering and credential-redacted failures are preserved. diff --git a/specs/studio-mpa-creation/README.zh.md b/specs/studio-mpa-creation/README.zh.md index ec747ab84..10f894105 100644 --- a/specs/studio-mpa-creation/README.zh.md +++ b/specs/studio-mpa-creation/README.zh.md @@ -2,9 +2,28 @@ [English](README.md) +### 会话输出存储 — 仅选桶 IAM TOS 挂载 + +已批准的[仅选桶设计](../../prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.zh.md) +替代 Studio 的 AK/SK 输入。Studio 接受以 `agentkit-platform-` 开头的可选 `tosBucket`,使用实际 +Worker 角色的 IAM Role,清除旧草稿凭据,复用已有桶资源选择器。在其他准备 +写操作前核验桶账号/地域归属,增量绑定稳定、精确的桶专属 Global IAM 策略。 +桶动作仅 HeadBucket、ListBucket;对象动作仅 GetObject、PutObject、 +AbortMultipartUpload、DeleteObject,限定 `sandbox-session/*`。保留既有角色、 +信任、策略和绑定,冲突失败,重试/取消有界。Tool 不带 Credentials,复用核验 +包含模式/角色;CLI AK/SK 兼容。不得隐式修改已有 Tool/Session 或桶公开策略, +不增加 KMS 授权,共享角色不提供严格租户隔离。实现、自动化/浏览器验证和云端 +E2E 是独立状态。 +空选择保留服务端 profile;内置 profile 默认不挂载 TOS。部署凭据须具备 TOS +ListBuckets 和 IAM GetRole、GetPolicy、CreatePolicy、ListAttachedRolePolicies、 +AttachRolePolicy。桶授权不包含 KMS 授权,也不能覆盖现有 IAM Deny。 +现有 `/web/deployment-resources` 接口接受 TOS 列表可选 `namePrefix`,在搜索、计数 +和分页前过滤。只有 MPA 创建传入平台前缀,通用查询保持原行为。创建在云调用前 +验证前缀,也适用于恢复草稿;显式 CLI profile 不受这项 Studio 选择规则限制。 + - 组件 ID:`studio-mpa-creation` - 状态:active -- 修订日期: 2026-10-09 +- 修订日期: 2026-10-12 - 设计及证据:[Studio MPA 创建](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-20-studio-mpa-creation.zh.md) - 所属代码:`veadk/integrations/mpa/managed/`、`frontend/server/mpa_creation.py`、`frontend/src/adk/mpaCreation.ts`、`frontend/src/ui/mpa-create/`;CLI 和目录接入。 - 测试:`tests/integrations/mpa_managed/`、`frontend/tests/mpaCreation.test.tsx`。 @@ -91,7 +110,7 @@ CON-1 显式基础设施:`managed.runtime` 可选字段包括 `role-name`、 CON-9 创建镜像:新表单没有镜像输入框,使用内置 latest 默认值。仅旧请求和已提交草稿保留显式镜像;提交后锁定输入。POST 接受可选镜像引用(去除首尾空白,最多 1024 字符),拒绝 URL/凭据/查询片段/非法 SHA256 digest,绝不作为 shell 命令执行。配置接口仅返回本地可确定的默认镜像,纯参考配置可为空。CON-6/CON-8 任务存储新增 `images` JSON 列,旧记录为 `{}`。首次提交保存本地可确定的实际镜像,重试沿用该列并拒绝修改显式输入。任务响应包含该非秘密快照,固定 runner 将其应用于配置副本。显式 worker 镜像会在本次新任务中取消配置的已有 worker 选择。权限和其他资源设置仍由服务端管理。 -CON-10 — Worker 恢复/诊断:暂时性 Worker 操作最多尝试 4 次,间隔 1/2/4 秒,受默认 600 秒阶段预算和总任务期限限制。创建重试保持同一载荷/ClientToken;仅已登记的托管 Worker 可恢复已识别的不存在错误。永久/未知错误和归属冲突立即失败。只含安全枚举的诊断记录到日志和 `task_diagnostics`(每任务最新 100 条,跨重试保留),绝不持久化原始异常数据。任务 HTTP 字段和错误码不变。见[已批准设计](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-20-worker-retry.zh.md)。 +CON-10 — Worker 恢复/诊断:暂时性 Worker 操作最多尝试 4 次,间隔 1/2/4 秒,受默认 600 秒阶段预算和总任务期限限制。创建重试保持同一载荷/ClientToken;仅已登记的托管 Worker 可恢复已识别的不存在错误。永久/未知错误和归属冲突立即失败。已安全验证的诊断字段记录到日志和 `task_diagnostics`(每任务最新 100 条,跨重试保留),绝不持久化原始异常数据。任务 HTTP 字段和错误码不变。见[已批准设计](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-20-worker-retry.zh.md)。 CON-10 元数据可见性:区分初始化元数据缺失和显式冲突。具有持久化 ID/令牌/哈希的托管 Worker 仅在 Creating/Pending/Starting/Initializing/Provisioning 或无状态时可等待缺失 ID/项目/归属标签,每 5 秒检查,受现有 Worker/任务期限限制,不设置独立观察次数上限。Ready 缺失字段、已有值冲突、终态/未知状态以及无托管创建意图的 Worker 立即失败。固定字段诊断不包含值;元数据 attempt 最大保持 4,兼容已有诊断协议。Worker API 错误重试限制不变。见[期限修复及验证限制](../../prd-spec/bugfixes/mpa-worker-retry/2026-09-30-worker-metadata-deadline.zh.md)。 @@ -115,7 +134,7 @@ CON-10 元数据可见性:区分初始化元数据缺失和显式冲突。具 `managed.postgres.mode: auto` 显式启用基于部署账号 STS 的 AIDAP 准备流程。配置检查只读,无需 PG 凭据;返回 `postgresMode: "auto"` 以及空的 `pgHost`/`pgPort`。创建向导 PG 步骤展示准备说明;POST 拒绝非空 PG 地址/端口。未提交草稿清空旧 PG 目标;已提交请求保持不变,不兼容的重试被拦截。OpenViking 仍为第三步。Studio 执行角色必须覆盖调用方身份、`NetworkCloud` 执行的全部 VPC/子网查询与创建、`GatewayCloud` 执行的全部 APIG/IM Gateway 操作、`PGCloud` 执行的 9 项明确 AIDAP 操作,以及 AgentKit Worker、Skill Space 和 Runtime 操作。默认角色授予[经审计的明确云端权限集合](../../prd-spec/bugfixes/studio-mpa-aidap-permissions/2026-09-23-complete-mpa-cloud-runtime-policy.zh.md)及现有 `agentkit:*` 覆盖,并在 `studio update` 时刷新;客户自有角色仍由运维管理。 -每个已核验账号/地域/项目准备 `mpa_admin_workspace/mpa_admin_db` 及一个 `mpa_business_workspace`(业务名称可配置)。每个 MPA 保持独立业务库。AIDAP Workspace ID 必须与账号、地域、项目、名称、引擎和归属标签一致。可用显式 ID 接管已有 Workspace。旧配置/手动模式保持兼容。新增任务阶段为 `admin_workspace`、`business_workspace`、`admin_database`。 +共享布局请求(新独立布局见 CON-19)按已核验账号/地域/项目准备 `mpa_admin_workspace/mpa_admin_db` 及一个 `mpa_business_workspace`(业务名称可配置)。每个 MPA 保持独立业务库。AIDAP Workspace ID 必须与账号、地域、项目、名称、引擎和归属标签一致。可用显式 ID 接管已有 Workspace。旧配置/手动模式保持兼容。新增任务阶段为 `admin_workspace`、`business_workspace`、`admin_database`。 在私有 SQLite 引导文件中保存无密钥的意图与资源身份。内置 Studio 配置临时使用 `/tmp/veadk-studio/mpa-pg-bootstrap.sqlite3`,避免云端创建写入只读代码目录;独立 YAML 未显式配置时仍使用 `.adk/mpa-pg-bootstrap.sqlite3`。同一实例上的所有创建进程必须共享该路径及操作系统锁。Studio 的 `/tmp` 路径在实例替换后不持久,也不被独立主机共享;状态丢失后,必须先检查云资源再重试结果不确定的创建。调用 CreateWorkspace 前保存意图,等待就绪前保存 ID。创建结果不确定时禁止盲目重试,按范围/标签发现或通过 ID 接管。确定的权限/参数拒绝允许修正后重试。取消、超时及后续失败保留资源,不替换已登记但删除的 Workspace。服务商错误脱敏;每次 SDK 请求刷新凭据并核验账号,凭据只在服务端使用,不进入配置/任务响应或引导状态文件。 @@ -181,8 +200,72 @@ SubnetIds 按非空、唯一成员判断相同,不受平台返回顺序影响 Studio 服务端选择的云平台允许 BytePlus `ap-southeast-1` 托管创建 MPA,并保留现有火山引擎流程。浏览器不能指定云平台、账号或云接口地址;平台与地域不匹配时,在资源变更前失败。国内配置值保持不变。BytePlus 使用自己的 AK/SK/会话令牌,或显式指定的轮转 IAM 凭据文件,每次刷新凭据通过 `open.byteplusapi.com` STS 核验账号;不读取火山引擎环境凭据。Runtime、Skills、Tools SDK 客户端在线程内按平台上下文构造。Identity 及签名 VPC/ECS/APIG/AIDAP/Ark/IAM 请求选择对应平台接口。不支持的 API 或必要 IAM 策略显式失败,不回退国内服务,也不省略权限。 -BytePlus 默认使用现有海外 Studio 模型及地址,将平台/地域传入 Runtime 和 Worker,并使用 Runtime 的 `APIG_TOP_ENDPOINT` 覆盖项。可选 TOS 挂载使用海外地址。默认仍使用现有公开镜像;可信服务端覆盖项为 `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE`。服务端可通过 `VEADK_MPA_BYTEPLUS_AIDAP_HOST` 覆盖 AIDAP 主机名;URL、路径及用户信息等无效输入在本地检查时失败。`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` 显式指定轮转 IAM 文件;没有 BytePlus 环境凭据时,不会隐式读取国内挂载文件。可用区校验接受 `ap-southeast-1a` 和 `ap-southeast-1-a`,不改写资源 ID,并保留国内校验。浏览器及任务响应不包含凭据。BytePlus 任务在持久化指纹和子进程 stdin 中增加可信平台标记;默认任务及 PG 引导文件增加 `-byteplus` 后缀,保留国内恢复状态。共享 Workspace/数据库布局、锁/重试/取消/就绪检查及可选 OpenViking 语义不变。控制台链接跟随平台。镜像拉取、海外 API/策略可用性及真实就绪/聊天行为须单独实测;本地配置就绪不能证明云资源可用。参见[设计及验证](../../prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.zh.md)。 +BytePlus 默认使用现有海外 Studio 模型及地址,将平台/地域传入 Runtime 和 Worker,并使用 Runtime 的 `APIG_TOP_ENDPOINT` 覆盖项。可选 TOS 挂载使用海外地址。新的 BytePlus 任务默认使用 `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_agent:latest` 和 `agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa/mpa_codex_worker:latest`;可信服务端覆盖项仍为 `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE`。国内默认值和已有任务快照保持不变。参见 [BytePlus 镜像修复](../../prd-spec/bugfixes/mpa-byteplus-images/2026-10-14-byteplus-default-images.zh.md)。服务端可通过 `VEADK_MPA_BYTEPLUS_AIDAP_HOST` 覆盖 AIDAP 主机名;URL、路径及用户信息等无效输入在本地检查时失败。`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` 显式指定轮转 IAM 文件;没有 BytePlus 环境凭据时,不会隐式读取国内挂载文件。可用区校验接受 `ap-southeast-1a` 和 `ap-southeast-1-a`,不改写资源 ID,并保留国内校验。浏览器及任务响应不包含凭据。BytePlus 任务在持久化指纹和子进程 stdin 中增加可信平台标记;默认任务及 PG 引导文件增加 `-byteplus` 后缀,保留国内恢复状态。共享 Workspace/数据库布局、锁/重试/取消/就绪检查及可选 OpenViking 语义不变。控制台链接跟随平台。镜像拉取、海外 API/策略可用性及真实就绪/聊天行为须单独实测;本地配置就绪不能证明云资源可用。参见[设计及验证](../../prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.zh.md)。 BytePlus 托管 IAM 默认通过 `open.byteplusapi.com` 调用,保留可信服务端 `IAM_OPENAPI_HOST` 覆盖;共享 IAM 工具与国内创建行为不变。 BytePlus 托管 AIDAP 默认使用 `open.byteplusapi.com`,仍支持已校验的 `VEADK_MPA_BYTEPLUS_AIDAP_HOST` 覆盖。API 可访问不代表 Workspace 创建成功;继续保留失败状态及属主校验,不自动删除或接管失败的同名资源。 + +BytePlus 托管 Runtime 继承启用的应用及控制面 APM 默认值:`ENABLE_APMPLUS=true`、`FORCE_APMPLUS_EXPORTER_REGISTRATION=true` 和 `ApmplusEnable=true`,与火山引擎一致。已有 Runtime 和已提交任务快照不变。参见 [BytePlus APM 恢复](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-restore-application-apm.zh.md)。 + +## CON-18:自动 OpenViking + +新的北京内置 Studio 请求显式选择 `openvikingMode: auto`;缺少该值的旧请求、手动 CLI 和 BytePlus 保留现有行为。此类新请求第三步以自动准备替代 OV 手填。使用默认 VLM/Embedding 模型身份、显式 Credentials Source=volcengine 和带版本 EndpointID 创建独立企业库,已解析方舟 Key 仅加入复制的创建请求,不进入持久化意图,等待 INIT 至 READY,服务端取得 default 用户 Key,部署前注入 OPENVIKING_URL/RESOURCE_ID/API_KEY/USER。作用域非秘密意图/ID 写入授权部署注册库,重试复用并核验归属/配置。注册资源丢失、FAILED 或创建结果不确定均明确失败;不盲目重建或回退创建方舟接入点。Key 不存入注册库/任务/结果。取消及删除智能体保留 OV。默认模型建库能力在隔离实测前仍未确认。通用智能体不变。[设计](../../prd-spec/features/mpa-openviking-auto/2026-10-13-default-model-creation.zh.md)。 + +CON-18 来源修正:仅在没有 OV ID、没有待完成 Runtime 操作、明确拒绝后创建发送标志为 false,且旧无 Credentials 意图完全匹配时允许升级。未知/进行中/改变及已登记意图保持冲突拒绝。Get 回读须匹配 Source/EndpointID。不增加 UI 字段或模型接入点创建。参见[来源修正](../../prd-spec/bugfixes/mpa-openviking-source/2026-10-13-model-source.zh.md)。 + +## CON-19:新 MPA 请求独立业务 Workspace + +内置 Studio 新配置声明可选 `businessWorkspaceMode: "per-agent"`。新表单显式提交/持久化,缺省保持 `shared`,已提交草稿不升级。`managed.postgres.business-workspace-mode` 默认 `shared`;显式 `per-agent` 要求自动 PG 且未配置业务 Workspace ID。稳定智能体范围的名称/范围/标签保证独立创建和重试。先准备共享管理库再读取智能体部署绑定;旧共享绑定继续共享,冲突明确失败。管理注册库固定实际 Workspace ID、布局及端点;Runtime 获得自己的业务连接及不变的共享注册库连接。保留现有未知结果/取消恢复和本地锁限制。不迁移、不初始化业务表、不删除 Workspace;通用智能体和 Runtime 业务接口不变。两个现有提供商适配器均遵循此契约。见[设计与验证](../../prd-spec/features/mpa-agent-pg-workspace/2026-10-13-independent-business-workspace.zh.md)。 + +## CON-20:名称预检查与独立 aidb 请求 + +内置 Studio 新配置/表单显式选择 `businessDatabaseName: aidb` 及 `businessWorkspaceMode: per-agent`。Workspace 为 `mpa_agent_`,业务库为 `aidb`。缺少库选择时保留旧哈希及请求指纹;已有 Workspace/数据库绑定不重命名、不切换。初始无标记 aidb 的接管要求独立 Workspace 归属已核验、数据库属主匹配、无非系统/非扩展关系数据且无已有 Runtime/ready 绑定;缺失/不匹配/非空明确失败。初始化使用事务锁,在创建 Runtime 前写入智能体标记。 + +授权名称检查发生于首次下一步、任务接收及新布局云准备前。Runtime、worker 和目标 Workspace 重名时拒绝其他/不明确归属,已核验自身绑定可重试。查询失败/超时明确报错。私有提供商/账号/地域任务快照防止本机并发同名及换凭据重试,仅活跃任务占用名称。只读检查不保证跨主机原子互斥。通用智能体、共享控制资源及 PG 删除策略不变。见[批准设计](../../prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md)。 + +新布局 Web 预检查/提交使用服务端按用户/请求生成的内部身份;传入不同 agent ID 会被拒绝。旧显式 ID 请求保留原契约。 + +## CON-21:本次创建最大实例数 + +新的可编辑 MPA 表单在基本信息中提交严格正整数 `maxInstance`,火山默认 20、BytePlus 默认 10。提供商帮助文字和新请求重置使用相同默认值;显式已保存草稿及已提交/旧请求重试输入保持原样。数值随请求身份保存、传入 runner 并应用为 Runtime `MaxInstance`。小于配置最小值在受理前拒绝。提交后重试数值不可更改;省略/null 的旧字段保留原指纹/配置默认,不自动升级。重名错误复用既有 danger/soft Alert,本地化文案不变。不影响通用创建及已部署 Runtime 设置。见[设计](../../prd-spec/features/mpa-create-scaling/2026-10-13-max-instance-input.zh.md)。 + +OV 路由注册及配置检查须保留 Studio 延迟加载启动:签名/网络函数只在首次实际 OV API 调用时加载,不在导入适配器时加载。见[官方 PR 检查修正](../../prd-spec/bugfixes/mpa-upstream-readiness/2026-10-13-startup-and-lockfile.zh.md)。 + +CON-18 BytePlus 扩展:BytePlus `ap-southeast-1` 新自动请求创建个人版库,顶层及凭据 Source=volcengine,复用已解析的 MPA 推理 API Key。模型名保留 seed-2-0-lite/skylark-embedding-vision;EndpointID 默认值为 seed-2-0-lite-260428/skylark-embedding-vision-251215,BytePlus Ark 已接受其对应基础模型版本。服务端 OV_VLM_ENDPOINT_ID/OV_EMBEDDING_ENDPOINT_ID 可覆盖;非法值在云资源变更前失败。不使用 OV_MODEL_API_KEY 或 Coding Plan。Source/EndpointID 作为非密钥意图保存;改变接入点或旧 Coding Plan 绑定产生冲突,不重新建库。海外签名、取 default Key 不传 UserID、四个 Runtime 变量、资源保留、创建结果未知及密钥不落盘保证不变。国内及已提交手动流程不变。个人版 default 用户与海外数据面仍需单独适配 Runtime。见[已批准后续设计](../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.zh.md)和[模型标识修正](../../prd-spec/bugfixes/mpa-byteplus-model-identities/2026-10-14-byteplus-model-identities.zh.md)。 + + +CON-10/CON-11 IAM 恢复:在增量任务诊断中保留白名单接口/类别及经校验的可选 Request ID。在已有期限内最多四次重试临时 IAM 协调,等待 1/2/4 秒,不确定写入后从固定名称回读开始。永久/未知失败立即结束,临时失败耗尽使用 iamTemporaryFailure。取消后不再发送 SDK 调用。兼容旧诊断字段及已有权限错误 key。见[已批准修复](../../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md)。 + +CON-10/CON-18 OV 诊断:结构化云端拒绝及 HTTP/SDK 异常响应体保留可选且已验证的 errorCode(大写字母开头的 ASCII 错误码,最多 128 字符;排除凭证形式的值)及现有可选十六进制/UUID requestId。标识通过子进程诊断事件进入后台日志和追加的 task_diagnostics.error_code/request_id 列;兼容旧事件/记录,每任务仍最多 100 条诊断。排除原始 Message、响应体、凭证和异常文本。公开任务字段、国内/BytePlus 载荷、错误分类和不确定建库重试保护均不变。缺失或无效元信息时仍可能无法取得原始原因。见[诊断修复](../../prd-spec/bugfixes/mpa-openviking-diagnostics/2026-10-14-provider-errors.zh.md)。 + +CON-17/CON-18 BytePlus 默认已恢复:支持的 ap-southeast-1 新请求/可编辑草稿重新启用个人版自动 OV。已提交的自动/手动/无 OV 身份保持不变;无 OV 请求提交后要测试 OV,须“新建另一个智能体”。国内自动、手动路径和不确定建库保护不变。见[恢复修复](../../prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md)。 + +CON-10 Runtime 诊断:create_runtime/update_runtime 失败从 SDK 属性、结构化 HTTP/SDK 响应体及有界 JSON/字节串异常参数保留已验证的 category/errorCode 和可选 requestId。解析上限 65,536 字节/字符,最多八个防循环 cause。原始文案/参数/响应体、凭证和 ClientToken 不进入诊断。同一异常、调用次数、取消、分类、载荷和重试语义保持不变,缺失元信息仍省略。见[补齐修复](../../prd-spec/bugfixes/mpa-runtime-diagnostics/2026-10-14-sdk-json-and-restore-ov.zh.md)。 + +CON-20 实现纠正:组合对应 Runtime 列表/详情归属证据,Worker 使用真实 managed_by/mpa_agent_key 标签及 MPA_AGENT_ID 环境变量。契约不变,见[重试修复](../../prd-spec/bugfixes/mpa-name-retry/2026-10-14-owned-resource-metadata.zh.md)。 + +CON-20 重试证明:仅认证过的已接受请求,且标准化参数与存储值完全一致、服务端派生 agent 身份及私有 provider/account/region 快照通过 STS 核对时,才能补足空的云端创建者标签。明确外部标签仍拒绝。POST 在服务端取得证明,已有 expectedAccount 快照将同一检查带入子进程创建。不信任浏览器重试标志、不增加公开字段、不直接跳过云端预检。 + +CON-17 APM Key 传递:Studio BytePlus 创建在写资源前使用已核验部署凭据,向 `apmplus-server.ap-southeast-1.byteplusapi.com` 调用 `GetAppKey`,取得 `data.app_key`,注入 Runtime Envs 的 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY`。保留可信配置中的有效显式 Runtime Key。获取失败时停止创建,采用有限重试和安全的 `get_apm_key` 诊断;Key 不保存在任务/启动/部署记录或浏览器结果中。国内和非 Studio 路径不变。保留未完成输入哈希检查,不静默升级旧任务。见[服务端 APM Key 设计](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-14-server-app-key.zh.md)。 + +分提供商默认值调整:[BytePlus 最大实例数](../../prd-spec/bugfixes/mpa-byteplus-scaling/2026-10-15-default-maximum.zh.md)。后端/YAML/CLI 配置默认值保持不变。 + +CON-17 OTLP 采集地址:新的 BytePlus Studio 配置注入 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317`。可信的显式 Runtime 环境变量仍按既有优先级覆盖。国内默认值、通用智能体、AppKey 获取、已有资源和已提交快照不变。见[地址设计](../../prd-spec/bugfixes/mpa-byteplus-apm/2026-10-15-otlp-endpoint.zh.md)。 + + +### 云端 Studio MPA IAM 凭据与 OpenViking 权限 + +BytePlus `veadk studio deploy` 自动写入非密钥函数环境变量 +`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential`。托管创建使用 +挂载的轮转角色凭据,每次调用重新读取;文件缺失、格式错误或字段不完整时明确失败。 +部署不复制操作者的 AK/SK 或本地凭据文件路径。本地 BytePlus AK/SK 和显式 CLI 文件 +选择不变,国内创建保留现有 IAM 回退。 +两个平台共用的默认 Studio 自定义角色策略授权 +`vikingdb:CreateOpenVikingCollection`、`vikingdb:GetOpenVikingCollection` 和 +`vikingdb:AccessOpenVikingApiKey`,不增加 OV 删除权限。 +已有 Studio 需重新部署以应用环境变量并更新默认角色策略;自定义角色需单独具备等价权限。 +服务开通、配额、模型访问和网络连通仍是前置条件,本改动不代表已经完成真实云端验证。 + + +CON-17 TOS 资源凭据:`/web/deployment-resources` 将当前服务端解析的 AK/SK/session token 传给 TOS 和 CR 查询。每次请求重新解析凭据,客户端不跨请求缓存。没有完整显式凭据时保留原有 SDK 发现机制。保持 provider endpoint 解析、过滤和凭据脱敏错误行为。 diff --git a/tests/cli/test_frontend_deploy_iam.py b/tests/cli/test_frontend_deploy_iam.py index 0710e5682..252583eea 100644 --- a/tests/cli/test_frontend_deploy_iam.py +++ b/tests/cli/test_frontend_deploy_iam.py @@ -18,6 +18,8 @@ import pytest +from veadk.utils.cloud_provider import CloudProvider + from veadk.cli.frontend_deploy_iam import ( ensure_default_frontend_role_policy, ensure_frontend_role, @@ -445,3 +447,55 @@ def test_custom_frontend_role_policy_is_not_replaced( ) is False ) + + +@pytest.mark.parametrize("provider", ["volcengine", "byteplus"]) +@pytest.mark.parametrize("existing", [False, True]) +def test_frontend_role_provisions_openviking_permissions( + monkeypatch: pytest.MonkeyPatch, provider: CloudProvider, existing: bool +) -> None: + service = MagicMock() + if existing: + service.get_role.return_value = { + "Result": {"Role": {"Trn": "trn:iam::123:role/VeADKFrontendServiceRole"}} + } + service.update_policy.return_value = {"Result": {}} + else: + service.get_role.return_value = { + "ResponseMetadata": {"Error": {"Message": "role not found"}} + } + service.update_policy.return_value = { + "ResponseMetadata": {"Error": {"Message": "policy not found"}} + } + service.create_policy.return_value = {"Result": {}} + service.create_role.return_value = { + "Result": {"Role": {"Trn": "trn:iam::123:role/VeADKFrontendServiceRole"}} + } + service.get_policy.return_value = _policy_response() + service.list_attached_role_policies.return_value = { + "Result": {"AttachedPolicyMetadata": []} + } + service.attach_role_policy.return_value = {"Result": {}} + _install_iam_service(monkeypatch, service) + + ensure_frontend_role("ak", "sk", provider=provider) + + operation = service.update_policy if existing else service.create_policy + document = json.loads( + operation.call_args.args[0][ + "NewPolicyDocument" if existing else "PolicyDocument" + ] + ) + actions = { + action + for statement in document["Statement"] + if statement["Effect"] == "Allow" + for action in statement["Action"] + } + assert { + "vikingdb:CreateOpenVikingCollection", + "vikingdb:GetOpenVikingCollection", + "vikingdb:AccessOpenVikingApiKey", + } <= actions + assert "vikingdb:DeleteOpenVikingCollection" not in actions + assert "vikingdb:*" not in actions diff --git a/tests/cli/test_frontend_runtime_proxy.py b/tests/cli/test_frontend_runtime_proxy.py index 23a5add99..8ab19704a 100644 --- a/tests/cli/test_frontend_runtime_proxy.py +++ b/tests/cli/test_frontend_runtime_proxy.py @@ -2043,6 +2043,42 @@ def list_runtimes(self, _request: Any) -> SimpleNamespace: assert calls == [("iam-ak", "iam-sk", "iam-token", "ap-southeast-1")] +def test_byteplus_mpa_runtime_list_uses_byteplus_tag_endpoint( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + monkeypatch.setenv("BYTEPLUS_ACCESS_KEY", "byte-ak") + monkeypatch.setenv("BYTEPLUS_SECRET_KEY", "byte-sk") + app = _create_frontend_app(monkeypatch, tmp_path, provider="byteplus") + tag_hosts: list[str | None] = [] + + class _FakeTagApi: + def __init__(self, api_client: Any) -> None: + tag_hosts.append(api_client.configuration.host) + + def get_resources(self, _request: Any) -> SimpleNamespace: + return SimpleNamespace( + resource_tag_mapping_list=[], + next_token="", + ) + + monkeypatch.setattr("volcenginesdktag.TAGApi", _FakeTagApi) + + with TestClient(app) as client: + response = client.get( + "/web/runtimes", + params={ + "region": "ap-southeast-1", + "page_size": 1, + "agentCategory": "mpa", + }, + ) + + assert response.status_code == 200 + assert response.json() == {"runtimes": [], "nextToken": ""} + assert tag_hosts == ["https://open.byteplusapi.com"] + + def test_byteplus_runtime_detail_coerces_volcengine_region( monkeypatch: pytest.MonkeyPatch, tmp_path: Path, diff --git a/tests/cli/test_studio_deploy_target.py b/tests/cli/test_studio_deploy_target.py index 6c37dab43..62988f66f 100644 --- a/tests/cli/test_studio_deploy_target.py +++ b/tests/cli/test_studio_deploy_target.py @@ -1032,6 +1032,22 @@ def test_studio_deploy_passes_region_and_project_to_cloud_engine( "existing-studio-storage", ) + monkeypatch.setitem( + veadk_environments, + "VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE", + "/developer-only/credential", + ) + monkeypatch.setenv( + "VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE", "/developer-only/credential" + ) + for secret_name in ( + "BYTEPLUS_ACCESS_KEY", + "BYTEPLUS_SECRET_KEY", + "VOLCENGINE_ACCESS_KEY", + "VOLCENGINE_SECRET_KEY", + ): + monkeypatch.setitem(veadk_environments, secret_name, "test-deployer-secret") + if update_bucket_env is None: monkeypatch.delenv("VEADK_STUDIO_UPDATE_BUCKET", raising=False) else: @@ -1142,6 +1158,18 @@ def configure_user_pool_for_idp_only(self, user_pool_uid: str) -> None: } assert captured["provider"] == provider assert veadk_environments["CLOUD_PROVIDER"] == provider + credential_env = "VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE" + if provider == "byteplus": + assert veadk_environments[credential_env] == "/var/run/secrets/iam/credential" + else: + assert credential_env not in veadk_environments + for secret_name in ( + "BYTEPLUS_ACCESS_KEY", + "BYTEPLUS_SECRET_KEY", + "VOLCENGINE_ACCESS_KEY", + "VOLCENGINE_SECRET_KEY", + ): + assert secret_name not in veadk_environments assert veadk_environments["AGENTKIT_CLOUD_PROVIDER"] == provider assert veadk_environments["VEIDENTITY_REGION"] == expected_identity_region assert veadk_environments["VEADK_STUDIO_ADMINS"] == "" diff --git a/tests/cli/test_studio_rbac.py b/tests/cli/test_studio_rbac.py index ad0f64f99..6d515479f 100644 --- a/tests/cli/test_studio_rbac.py +++ b/tests/cli/test_studio_rbac.py @@ -3858,7 +3858,7 @@ async def request( assert response.json()["detail"]["blockers"] == ["active_sessions"] assert response.json()["detail"]["sessionCounts"]["active"] == 1 assert deleted == [] - assert [method for method, _url in runtime_requests] == ["GET", "GET"] + assert [method for method, _url in runtime_requests] == ["GET"] def test_mpa_runtime_delete_cleans_idle_sessions_then_runtime( @@ -3936,7 +3936,6 @@ async def request( assert response.json() == {"success": True} assert deleted == [runtime.runtime_id] assert [method for method, _url in runtime_requests] == [ - "GET", "GET", "DELETE", "DELETE", @@ -4039,7 +4038,6 @@ async def request( assert response.json() == {"success": True} assert deleted == [runtime.runtime_id] assert [method for method, _url in runtime_requests] == [ - "GET", "GET", "DELETE", ] @@ -9002,3 +9000,85 @@ def catalog(): == 404 ) assert writes + + +@pytest.mark.parametrize("fail_cleanup", [False, True]) +def test_mpa_delete_cleans_exclusive_resources_before_runtime( + monkeypatch, tmp_path, fail_cleanup +): + from contextlib import asynccontextmanager + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + from veadk.integrations.mpa.managed.deletion import ResourceDeletionError + + runtime = _runtime_with_public_endpoint( + _runtime("runtime-mpa-owned-delete", "developer") + ) + runtime.tags.append(SimpleNamespace(key="veadk:agent-type", value="mpa")) + events = [] + + class Cleanup: + async def preview(self): + return {"cleanupPlan": [], "retainedResources": []} + + async def delete_resources(self): + events.append("resources") + if fail_cleanup: + raise ResourceDeletionError("skill_space", "permission") + + async def mark_runtime_deleted(self): + events.append("registry_deleted") + + @asynccontextmanager + async def cleanup(**kwargs): + assert kwargs["runtime"]["RuntimeId"] == runtime.runtime_id + assert kwargs["agent_id"] == runtime.runtime_id + yield Cleanup() + + class Client: + def __init__(self, **kwargs): + pass + + async def __aenter__(self): + return self + + async def __aexit__(self, *args): + pass + + async def request(self, method, url, **kwargs): + assert "profile-status" not in url + assert kwargs["headers"]["x-user-id"] == "developer" + if method == "GET": + return _RuntimeJsonResponse( + {"sessions": [{"sessionId": "s-idle", "status": "idle"}]} + ) + events.append("session") + return _RuntimeJsonResponse({}, status_code=204) + + monkeypatch.setattr(AgentkitRuntimeClient, "get_runtime", lambda self, req: runtime) + monkeypatch.setattr( + AgentkitRuntimeClient, + "delete_runtime", + lambda self, req: events.append("runtime"), + ) + monkeypatch.setattr("httpx.AsyncClient", Client) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.deletion.owned_resource_cleanup", cleanup + ) + app = _create_studio_app(monkeypatch, tmp_path, developers="developer") + with TestClient(app) as client: + response = client.post( + "/web/delete-runtime", + headers={"X-VeADK-Local-User": "developer", "x-user-id": "forged-user"}, + json={ + "runtimeId": runtime.runtime_id, + "region": "cn-beijing", + "mpaInstanceId": "untrusted-client-id", + }, + ) + if fail_cleanup: + assert response.status_code == 409, response.text + assert response.json()["detail"]["stage"] == "skill_space" + assert events == ["session", "resources"] + else: + assert response.status_code == 200, response.text + assert events == ["session", "resources", "runtime", "registry_deleted"] diff --git a/tests/frontend/server/mpa/test_runtime_profile_client.py b/tests/frontend/server/mpa/test_runtime_profile_client.py index 4835e8373..f65aa1ec4 100644 --- a/tests/frontend/server/mpa/test_runtime_profile_client.py +++ b/tests/frontend/server/mpa/test_runtime_profile_client.py @@ -338,3 +338,35 @@ def handler(request: httpx.Request) -> httpx.Response: assert requests[0].headers["authorization"] == "Bearer bearer-value" assert requests[1].method == "DELETE" assert str(requests[1].url) == ("https://runtime.example/api/v1/sessions/session-1") + + +@pytest.mark.asyncio +async def test_deletion_session_transport_forwards_authenticated_identity(): + requests = [] + + def handler(request): + requests.append(request) + if request.method == "GET": + return httpx.Response(200, json={"sessions": []}) + return httpx.Response(204) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as transport: + client = MpaRuntimeClient(transport=transport) + await client.list_sessions( + endpoint="https://runtime.example", + bearer_token="test-runtime-token", + user_id="authenticated-owner", + ) + await client.delete_session( + endpoint="https://runtime.example", + session_id="s-one", + bearer_token="test-runtime-token", + user_id="authenticated-owner", + ) + assert all( + request.headers["x-user-id"] == "authenticated-owner" for request in requests + ) + assert all( + request.headers["authorization"] == "Bearer test-runtime-token" + for request in requests + ) diff --git a/tests/frontend/server/mpa/test_runtime_profile_routes.py b/tests/frontend/server/mpa/test_runtime_profile_routes.py index 9559148f5..558f0c22a 100644 --- a/tests/frontend/server/mpa/test_runtime_profile_routes.py +++ b/tests/frontend/server/mpa/test_runtime_profile_routes.py @@ -22,8 +22,8 @@ from fastapi import FastAPI from fastapi.testclient import TestClient -from frontend.server.mpa.routes import MpaRuntimeBinding, mount_mpa_profile_routes from frontend.server.mpa.operations import MpaLifecycleOperation, MpaOperationConflict +from frontend.server.mpa.routes import MpaRuntimeBinding, mount_mpa_profile_routes from frontend.server.mpa.runtime_client import MpaRuntimeClient, MpaRuntimeError @@ -236,6 +236,7 @@ def _app( authorize_error: Exception | None = None, operation_service: FakeOperationService | None = None, runtime_bindings: list[MpaRuntimeBinding] | None = None, + delete_resources=None, ) -> TestClient: app = FastAPI() @@ -266,6 +267,7 @@ async def resolve_bindings(_request, mpa_instance_id: str, region: str): resolve_runtime_bindings=( resolve_bindings if runtime_bindings is not None else None ), + resolve_delete_resources=delete_resources, ) return TestClient(app) @@ -598,20 +600,13 @@ def test_mpa_agent_delete_preview_blocks_active_sessions_and_reports_cleanup_pla "agentkit_runtime", ] assert runtime_client.calls == [ - ( - "status", - { - "endpoint": "https://runtime.example", - "mpa_instance_id": "mpa-1", - "bearer_token": "runtime-secret", - }, - ), ( "list_sessions", { "endpoint": "https://runtime.example", "bearer_token": "runtime-secret", "include_a2a": True, + "user_id": "owner-1", }, ), ] @@ -667,7 +662,7 @@ def test_mpa_agent_delete_preview_ignores_recovered_retryable_operation(): assert body["canDelete"] is True assert body["blockers"] == [] assert body["activeOperation"]["status"] == "failed_retryable" - assert body["profile"]["status"] == "applied" + assert body["profile"] is None def test_mpa_agent_delete_preview_requires_single_runtime_binding(): @@ -690,30 +685,30 @@ def test_mpa_agent_delete_preview_requires_single_runtime_binding(): assert body["blockers"] == ["binding_ambiguous"] -def test_mpa_agent_delete_preview_marks_orphan_runtime_from_profile_status(): +def test_mpa_agent_delete_preview_does_not_read_missing_profile(): runtime_client = OrphanRuntimeClient() client = _app(runtime_client) - response = client.get( "/web/mpa/agents/mpa-1/delete-preview", params={"runtimeId": "runtime-1", "region": "cn-beijing"}, ) - assert response.status_code == 200, response.text - body = response.json() - assert body["bindingStatus"] == "orphan_runtime" - assert body["canDelete"] is False - assert body["blockers"] == ["orphan_runtime"] - assert runtime_client.calls == [ - ( - "status", - { - "endpoint": "https://runtime.example", - "mpa_instance_id": "mpa-1", - "bearer_token": "runtime-secret", - }, - ) - ] + assert response.json()["canDelete"] is True + assert response.json()["profile"] is None + assert [call[0] for call in runtime_client.calls] == ["list_sessions"] + + +def test_mpa_delete_preview_propagates_session_auth_failure(): + class Client(FakeRuntimeClient): + async def list_sessions(self, **kwargs): + raise MpaRuntimeError("runtime_auth_error", status_code=500) + + response = _app(Client()).get( + "/web/mpa/agents/mpa-1/delete-preview", + params={"runtimeId": "runtime-1", "region": "cn-beijing"}, + ) + assert response.status_code == 500 + assert "sessionCounts" not in response.json() def test_session_execution_config_routes_forward_runtime_request(): @@ -967,3 +962,57 @@ def test_mpa_agent_operation_route_maps_idempotency_conflict(): assert response.status_code == 409 assert response.json()["detail"]["code"] == "idempotency_mismatch" + + +def test_delete_preview_includes_owned_and_retained_resource_plan(): + async def resources(runtime, agent_id, region): + assert agent_id == "mpa-1" and region == "cn-beijing" + return { + "cleanupPlan": [ + {"stage": "worker_template", "resourceId": "t-one", "count": 1} + ], + "retainedResources": [ + {"stage": "skill_space", "resourceId": "ss-shared", "reason": "shared"} + ], + } + + response = _app(FakeRuntimeClient(), delete_resources=resources).get( + "/web/mpa/agents/mpa-1/delete-preview", + params={"runtimeId": "runtime-1", "region": "cn-beijing"}, + ) + assert response.status_code == 200, response.text + assert response.json()["cleanupPlan"][-2]["resourceId"] == "t-one" + assert response.json()["retainedResources"][0]["reason"] == "shared" + + +def test_delete_preview_uses_authenticated_owner_not_browser_header(): + runtime = FakeRuntimeClient() + response = _app(runtime).get( + "/web/mpa/agents/mpa-1/delete-preview", + params={"runtimeId": "runtime-1", "region": "cn-beijing"}, + headers={"x-user-id": "forged-user"}, + ) + assert response.status_code == 200, response.text + assert runtime.calls[0][0] == "list_sessions" + assert runtime.calls[0][1]["user_id"] == "owner-1" + + +def test_delete_preview_deadline_is_visible_and_does_not_mutate(monkeypatch): + import asyncio + from frontend.server.mpa import routes + + monkeypatch.setattr(routes, "MPA_DELETE_PREVIEW_TIMEOUT_SECONDS", 0.001) + + class SlowClient(FakeRuntimeClient): + async def list_sessions(self, **kwargs): + await asyncio.sleep(10) + return [] + + runtime = SlowClient() + response = _app(runtime).get( + "/web/mpa/agents/mpa-1/delete-preview", + params={"runtimeId": "runtime-1", "region": "cn-beijing"}, + ) + assert response.status_code == 504, response.text + assert response.json()["detail"]["code"] == "mpa_delete_preview_timeout" + assert not runtime.calls diff --git a/tests/frontend/server/test_deployment_resources.py b/tests/frontend/server/test_deployment_resources.py index 77014646d..13d01945d 100644 --- a/tests/frontend/server/test_deployment_resources.py +++ b/tests/frontend/server/test_deployment_resources.py @@ -90,6 +90,7 @@ def service( "namespace": "", "workspace_id": "workspace-id", "search": "", + "name_prefix": "", "page_number": 1, "page_size": 100, }, @@ -425,6 +426,72 @@ def test_tos_search_filters_before_pagination() -> None: assert [item["name"] for item in result["items"]] == ["theta"] +@pytest.mark.parametrize( + "search,page_number,expected,total,has_more", + [ + ("", 1, ["agentkit-platform-alpha"], 3, True), + ("TA", 2, ["agentkit-platform-theta"], 2, False), + ("not-found", 1, [], 0, False), + ], +) +def test_tos_name_prefix_filters_before_search_and_pagination( + search, page_number, expected, total, has_more +): + service = object.__new__(deployment_resources.DeploymentResourceService) + service.provider = "volcengine" + service.region = "cn-beijing" + service.credentials = None + service._tos = cast( + Any, + SimpleNamespace( + actual_region="cn-beijing", + list_buckets=lambda: [ + {"Name": name, "Location": region} + for name, region in [ + ("agentkit-platform-alpha", "cn-beijing"), + ("agentkit-platform-beta", "cn-beijing"), + ("agentkit-platform-theta", "cn-beijing"), + ("agentkit-demo", "cn-beijing"), + ("x-agentkit-platform-lookalike", "cn-beijing"), + ("Agentkit-platform-case", "cn-beijing"), + ("agentkit-platform-wrong-region", "cn-shanghai"), + ] + ], + ), + ) + result = service.list_resources( + "tos-bucket", + name_prefix="agentkit-platform-", + search=search, + page_number=page_number, + page_size=1, + ) + assert [item["name"] for item in result["items"]] == expected + assert result["totalCount"] == total + assert result["hasMore"] is has_more + + +def test_resource_route_forwards_tos_name_prefix(monkeypatch): + service = _FakeResourceService("volcengine", "cn-beijing") + monkeypatch.setattr( + deployment_resources, "DeploymentResourceService", lambda *args: service + ) + app = FastAPI() + deployment_resources.mount_deployment_resource_routes( + app, authorize=lambda request: None, provider="volcengine" + ) + response = TestClient(app).get( + "/web/deployment-resources", + params={ + "kind": "tos-bucket", + "region": "cn-beijing", + "namePrefix": "agentkit-platform-", + }, + ) + assert response.status_code == 200 + assert service.calls[0][1]["name_prefix"] == "agentkit-platform-" + + def test_cr_search_scans_all_pages_before_paginating_matches() -> None: calls: list[tuple[int, int]] = [] pages = { @@ -1029,3 +1096,108 @@ def test_all_resource_mode_combinations_map_to_agentkit_config(monkeypatch) -> N assert ("cp_workspace_name" in resolved) is (cp_mode != "auto") assert ("cp_pipeline_name" in resolved) is (cp_mode != "auto") assert ("cp_pipeline_id" in resolved) is (cp_mode == "existing") + + +@pytest.mark.parametrize( + ("provider", "region"), + [("byteplus", "ap-southeast-1"), ("volcengine", "cn-beijing")], +) +@pytest.mark.parametrize("token", [None, "rotating-session-token"]) +def test_tos_explicit_credentials_reach_sdk(monkeypatch, provider, region, token): + from agentkit.platform import VolcConfiguration + + calls = [] + + def create_client(access_key, secret_key, endpoint, actual_region, **kwargs): + calls.append((access_key, secret_key, endpoint, actual_region, kwargs)) + return SimpleNamespace( + list_buckets=lambda: SimpleNamespace( + buckets=[SimpleNamespace(name="bucket-a", location=region)] + ) + ) + + monkeypatch.setattr("tos.TosClientV2", create_client) + monkeypatch.setattr( + VolcConfiguration, + "_get_global_env_credentials", + lambda *_: pytest.fail("Explicit credentials must bypass SDK rediscovery"), + ) + endpoint = VolcConfiguration(provider=provider, region=region).get_service_endpoint( + "tos" + ) + service = deployment_resources.DeploymentResourceService( + provider, region, ("test-access", "test-secret", token) + ) + assert service.list_resources("tos-bucket")["items"][0]["name"] == "bucket-a" + assert ( + service._require_existing_resource("tos-bucket", resource_id="bucket-a")["name"] + == "bucket-a" + ) + assert calls == [ + ( + "test-access", + "test-secret", + endpoint.host, + endpoint.region, + {"security_token": token or ""}, + ) + ] + + +@pytest.mark.parametrize("provider", ["byteplus", "volcengine"]) +def test_tos_without_explicit_credentials_preserves_sdk_fallback(monkeypatch, provider): + calls = [] + expected = SimpleNamespace(actual_region="test-region") + + def create_service(config, *, provider): + calls.append((config.bucket, config.region, provider)) + return expected + + monkeypatch.setattr( + "agentkit.toolkit.volcengine.services.tos_service.TOSService", create_service + ) + service = deployment_resources.DeploymentResourceService(provider, "test-region") + assert service._tos_client() is expected + assert calls == [("", "test-region", provider)] + + +def test_tos_route_refreshes_credentials_and_redacts_sdk_failure(monkeypatch): + snapshots = iter( + [ + ("test-access-one", "test-secret-one", "test-token-one"), + ("test-access-two", "test-secret-two", "test-token-two"), + ] + ) + calls = [] + + def create_client(access_key, secret_key, endpoint, region, **kwargs): + token = kwargs["security_token"] + calls.append((access_key, secret_key, token)) + + def list_buckets(): + if len(calls) == 2: + raise RuntimeError(f"TOS failed: {access_key} {secret_key} {token}") + return SimpleNamespace(buckets=[]) + + return SimpleNamespace(list_buckets=list_buckets) + + monkeypatch.setattr("tos.TosClientV2", create_client) + app = FastAPI() + deployment_resources.mount_deployment_resource_routes( + app, + authorize=lambda _: None, + provider="byteplus", + resolve_credentials=lambda: next(snapshots), + ) + with TestClient(app) as client: + params = {"kind": "tos-bucket", "region": "ap-southeast-1"} + first = client.get("/web/deployment-resources", params=params) + second = client.get("/web/deployment-resources", params=params) + assert first.status_code == 200 + assert first.json()["items"] == [] + assert second.status_code == 502 + assert second.json()["detail"] == "TOS failed: *** *** ***" + assert calls == [ + ("test-access-one", "test-secret-one", "test-token-one"), + ("test-access-two", "test-secret-two", "test-token-two"), + ] diff --git a/tests/frontend/server/test_mpa_deletion_status.py b/tests/frontend/server/test_mpa_deletion_status.py new file mode 100644 index 000000000..27b87fefd --- /dev/null +++ b/tests/frontend/server/test_mpa_deletion_status.py @@ -0,0 +1,295 @@ +# 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. + +"""MPA deletion confirmation never turns uncertain cloud reads into success.""" + +import json +from types import SimpleNamespace +from unittest.mock import Mock + +import pytest +from agentkit.toolkit.errors import ApiError +from fastapi import FastAPI, HTTPException, Request +from fastapi.testclient import TestClient + +from frontend.server.mpa_deletion_status import mount_mpa_deletion_status + + +def missing(): + return ApiError("Runtime missing", error_code="InvalidAgentKitRuntime.NotFound") + + +def setup(): + app = FastAPI() + credentials = Mock(return_value=("test-ak", "test-secret", "")) + get_runtime = Mock(side_effect=missing()) + list_page = Mock(return_value={"AgentKitRuntimes": []}) + + def owner(request): + user = request.headers.get("x-test-user", "developer") + if user == "viewer": + raise HTTPException(403, "Agent management is not allowed") + return user + + remember = mount_mpa_deletion_status( + app, + owner=owner, + get_runtime=get_runtime, + list_page=list_page, + credentials=credentials, + region=lambda value: value, + ) + + @app.post("/fixture/start") + def start(request: Request): + remember(request, "r-one", "cn-beijing") + return {} + + client = TestClient(app) + client.post("/fixture/start") + return client, credentials, get_runtime, list_page + + +def check(client, **kwargs): + return client.get( + "/web/mpa-runtime-deletion-status", + params={"runtimeId": "r-one", "region": "cn-beijing"}, + **kwargs, + ) + + +def test_deleted_requires_not_found_and_all_pages_absent(): + client, _, get_runtime, pages = setup() + pages.side_effect = [ + {"AgentKitRuntimes": [{"RuntimeId": "r-other"}], "NextToken": "next"}, + {"AgentKitRuntimes": []}, + ] + response = check(client) + assert response.json() == {"deleted": True} + assert response.headers["cache-control"] == "no-store" + assert pages.call_args_list[1].args == ("cn-beijing", "next") + get_runtime.assert_called_once() + + +@pytest.mark.parametrize("listed", [False, True]) +def test_present_runtime_never_means_deleted(listed): + client, _, get_runtime, pages = setup() + if listed: + pages.return_value = {"AgentKitRuntimes": [{"RuntimeId": "r-one"}]} + else: + get_runtime.side_effect = None + get_runtime.return_value = SimpleNamespace(runtime_id="r-one") + assert check(client).json() == {"deleted": False} + if not listed: + pages.assert_not_called() + + +@pytest.mark.parametrize( + "error", + [ + HTTPException(404, "runtime_access_denied"), + ApiError("private token must not leak", error_code="AccessDenied"), + TimeoutError("private token must not leak"), + RuntimeError("InvalidAgentKitRuntime.NotFound appears in unrelated text"), + ], +) +def test_query_errors_fail_closed_and_never_leak_exception(error): + client, _, get_runtime, pages = setup() + get_runtime.side_effect = error + response = check(client) + assert response.status_code in {404, 503} + assert "private token" not in response.text + assert "deleted" not in response.json() + pages.assert_not_called() + + +def test_wrapped_structured_provider_error_is_recognized(): + client, _, get_runtime, _ = setup() + cause = Exception( + json.dumps( + {"ResponseMetadata": {"Error": {"Code": "InvalidAgentKitRuntime.NotFound"}}} + ).encode() + ) + wrapped = ApiError("Failed to GetRuntime") + wrapped.__cause__ = cause + get_runtime.side_effect = wrapped + assert check(client).json() == {"deleted": True} + + +@pytest.mark.parametrize( + "page", + [ + {"AgentKitRuntimes": [], "NextToken": "repeat"}, + {}, + {"AgentKitRuntimes": [{"Name": "missing identity"}]}, + {"AgentKitRuntimes": "invalid"}, + {"AgentKitRuntimes": [], "NextToken": 0}, + ], +) +def test_incomplete_or_invalid_listing_never_means_deleted(page): + client, _, _, pages = setup() + pages.return_value = page + assert check(client).status_code == 503 + assert pages.call_count <= 2 + + +def test_permission_failure_in_list_never_means_deleted(): + client, _, _, pages = setup() + pages.side_effect = ApiError("denied", error_code="AccessDenied") + assert check(client).status_code == 503 + + +@pytest.mark.parametrize("user", ["viewer", "another-developer"]) +def test_confirmation_is_scoped_to_authorized_studio_owner(user): + client, _, get_runtime, pages = setup() + response = check(client, headers={"x-test-user": user}) + assert response.status_code in {403, 503} + get_runtime.assert_not_called() + pages.assert_not_called() + + +@pytest.mark.parametrize("during_query", [False, True]) +def test_credential_changes_never_mean_deleted(during_query): + client, credentials, get_runtime, pages = setup() + if during_query: + + def rotate(_region, _token): + credentials.return_value = ("changed-ak", "changed-secret", "") + return {"AgentKitRuntimes": []} + + pages.side_effect = rotate + else: + credentials.return_value = ("changed-ak", "changed-secret", "") + assert check(client).status_code == 503 + if not during_query: + get_runtime.assert_not_called() + + +def test_unrelated_scope_and_expired_context_fail_closed(monkeypatch): + from frontend.server import mpa_deletion_status as module + + client, _, get_runtime, _ = setup() + response = client.get( + "/web/mpa-runtime-deletion-status", + params={"runtimeId": "r-other", "region": "cn-beijing"}, + ) + assert response.status_code == 503 + response = client.get( + "/web/mpa-runtime-deletion-status", + params={"runtimeId": "r-one", "region": "cn-shanghai"}, + ) + assert response.status_code == 503 + monkeypatch.setattr(module, "_CONTEXT_TTL", -1) + assert check(client).status_code == 503 + get_runtime.assert_not_called() + + +def test_pagination_budget_is_bounded(): + client, _, _, pages = setup() + pages.side_effect = lambda _region, _token: { + "AgentKitRuntimes": [], + "NextToken": str(pages.call_count), + } + assert check(client).status_code == 503 + assert pages.call_count == 20 + + +def test_context_count_is_bounded(monkeypatch): + from frontend.server import mpa_deletion_status as module + + monkeypatch.setattr(module, "_CONTEXT_LIMIT", 1) + client, _, get_runtime, _ = setup() + client.post("/fixture/start", headers={"x-test-user": "another-developer"}) + assert check(client).status_code == 503 + get_runtime.assert_not_called() + + +def test_explicit_permission_error_overrides_wrapped_not_found(): + client, _, get_runtime, _ = setup() + error = ApiError("denied", error_code="AccessDenied") + error.__cause__ = missing() + get_runtime.side_effect = error + assert check(client).status_code == 503 + + +@pytest.mark.parametrize("mpa", [False, True]) +def test_studio_route_registers_confirmation_only_for_actual_mpa( + monkeypatch, tmp_path, mpa +): + from unittest.mock import AsyncMock + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + from agentkit.sdk.runtime.types import ListRuntimesResponse + from frontend.server.mpa.runtime_client import MpaRuntimeClient + from tests.cli.test_studio_rbac import ( + _create_studio_app, + _runtime, + _runtime_with_public_endpoint, + ) + + runtime = _runtime_with_public_endpoint(_runtime("r-delete-status", "developer")) + if mpa: + runtime.tags.append(SimpleNamespace(key="veadk:agent-type", value="mpa")) + removed = [] + + def get_runtime(_self, _request): + if removed: + raise missing() + return runtime + + monkeypatch.setattr(AgentkitRuntimeClient, "get_runtime", get_runtime) + monkeypatch.setattr( + AgentkitRuntimeClient, + "delete_runtime", + lambda _self, _request: removed.append(runtime.runtime_id), + ) + monkeypatch.setattr( + AgentkitRuntimeClient, + "list_runtimes", + lambda _self, _request: ListRuntimesResponse(), + ) + monkeypatch.setattr(MpaRuntimeClient, "list_sessions", AsyncMock(return_value=[])) + app = _create_studio_app(monkeypatch, tmp_path, developers="developer") + headers = {"X-VeADK-Local-User": "developer"} + with TestClient(app) as client: + response = client.post( + "/web/delete-runtime", + headers=headers, + json={ + "runtimeId": runtime.runtime_id, + "region": "cn-beijing", + "agentCategory": "mpa", + }, + ) + assert response.status_code == 200, response.text + assert removed == [runtime.runtime_id] + status = client.get( + "/web/mpa-runtime-deletion-status", + headers=headers, + params={"runtimeId": runtime.runtime_id, "region": "cn-beijing"}, + ) + if mpa: + assert status.status_code == 200, status.text + assert status.json() == {"deleted": True} + else: + assert status.status_code == 503 + + +def test_status_timeout_remains_unconfirmed(monkeypatch): + from frontend.server import mpa_deletion_status as module + + client, _, _, _ = setup() + monkeypatch.setattr(module, "_CHECK_TIMEOUT", 0) + response = check(client) + assert response.status_code == 503 + assert response.json()["detail"]["code"] == "mpa_deletion_unconfirmed" diff --git a/tests/integrations/mpa_managed/test_agent_deployment.py b/tests/integrations/mpa_managed/test_agent_deployment.py index fbae14b81..f98a6a777 100644 --- a/tests/integrations/mpa_managed/test_agent_deployment.py +++ b/tests/integrations/mpa_managed/test_agent_deployment.py @@ -88,6 +88,8 @@ async def close(self): class Databases: + business_database_name: str = "" + def __init__(self): self.key = "" self.mcp_key = "" @@ -881,3 +883,28 @@ async def run(): assert not registry.row["pending"] asyncio.run(run()) + + +def test_dedicated_aidb_deploys_and_reuses_the_same_database(): + async def run(): + svc, registry, cloud, databases = deployer() + databases.business_database_name = "aidb" + original = databases.ensure + + async def ensure(*args, **kwargs): + await original(*args, **kwargs) + return "aidb" + + databases.ensure = ensure + databases.mcp_token_secret = AsyncMock(wraps=databases.mcp_token_secret) + first = await svc.deploy(template()) + second = await svc.deploy(template()) + assert first["database_name"] == second["database_name"] == "aidb" + assert env_map(cloud.runtimes["r-agent"])["PGDATABASE"] == "aidb" + assert all( + call.args[0] == "aidb" + for call in databases.mcp_token_secret.await_args_list + ) + assert len(cloud.creates) == 1 + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_agent_pg.py b/tests/integrations/mpa_managed/test_agent_pg.py new file mode 100644 index 000000000..71b41450e --- /dev/null +++ b/tests/integrations/mpa_managed/test_agent_pg.py @@ -0,0 +1,287 @@ +# 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 regression for agent-scoped business Workspace provisioning.""" + +import asyncio +from unittest.mock import AsyncMock + +import pytest +from sqlalchemy.engine import make_url + +from tests.integrations.mpa_managed.test_auto_pg import recovery_setup +from veadk.integrations.mpa.managed.config import ( + ConfigurationError, + with_creation_resources, +) +from veadk.integrations.mpa.managed.database import DeploymentError, database_name +from veadk.integrations.mpa.managed.pg_bootstrap import prepare_postgres + + +def setup(tmp_path, monkeypatch, provider="volcengine"): + profile, cloud, store, scope = recovery_setup(tmp_path, monkeypatch, provider) + assert profile.managed.postgres is not None + assert profile.managed.postgres is not None + profile.managed.postgres = profile.managed.postgres.model_copy( + update={"business_workspace_mode": "per-agent"} + ) + read = AsyncMock(return_value={}) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.pg_bootstrap.registered_business_binding", read + ) + return profile, cloud, store, scope, read + + +@pytest.mark.asyncio +@pytest.mark.parametrize("provider", ["volcengine", "byteplus"]) +async def test_distinct_business_workspaces_share_admin_and_retry( + tmp_path, monkeypatch, provider +): + profile, cloud, store, scope, read = setup(tmp_path, monkeypatch, provider) + first, second = await asyncio.gather( + prepare_postgres(profile, cloud, "account", agent_id="mi-first"), + prepare_postgres(profile, cloud, "account", agent_id="mi-second"), + ) + retried = await prepare_postgres(profile, cloud, "account", agent_id="mi-first") + assert cloud.created == 3 + assert first.shared_url == second.shared_url == retried.shared_url + assert first.admin_url == retried.admin_url != second.admin_url + assert store.read(scope, "business") is None + for resolved, ident in [(first, "mi-first"), (second, "mi-second")]: + settings = resolved.managed.postgres + assert settings.business_workspace_mode == "per-agent" + assert cloud.rows[settings.business_workspace_id][ + "workspace_name" + ] == database_name("account", profile.region, ident) + assert ( + resolved.managed.runtime.env["PGHOST"] == make_url(resolved.admin_url).host + ) + assert read.await_count == 3 + assert "fake" not in store.path.read_bytes().decode(errors="ignore") + + +@pytest.mark.asyncio +async def test_legacy_registered_agent_retains_shared_workspace(tmp_path, monkeypatch): + profile, cloud, store, scope = recovery_setup(tmp_path, monkeypatch) + shared = await prepare_postgres(profile, cloud, "account") + assert profile.managed.postgres is not None + assert profile.managed.postgres is not None + profile.managed.postgres = profile.managed.postgres.model_copy( + update={"business_workspace_mode": "per-agent"} + ) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.pg_bootstrap.registered_business_binding", + AsyncMock( + return_value={ + "admin_workspace_id": "ws-1", + "business_workspace_id": "ws-2", + "database_host": "ws-2.example", + "database_port": 5432, + } + ), + ) + retried = await prepare_postgres(profile, cloud, "account", agent_id="mi-old") + assert retried.admin_url == shared.admin_url + assert retried.managed.postgres.business_workspace_mode == "shared" + assert cloud.created == 2 + assert store.read(scope, "business")[1] == "ws-2" + + +@pytest.mark.asyncio +async def test_registry_error_prevents_business_purchase(tmp_path, monkeypatch): + profile, cloud, _, _, read = setup(tmp_path, monkeypatch) + read.side_effect = RuntimeError("connection unavailable") + with pytest.raises(DeploymentError): + await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + assert cloud.created == 1 + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "binding", + [ + {"business_workspace_id": "old", "admin_workspace_id": "wrong"}, + { + "business_workspace_id": "old", + "admin_workspace_id": "ws-1", + "business_workspace_mode": "unknown", + }, + {"database_name": "old"}, + {"state": "deleted"}, + ], +) +async def test_invalid_old_binding_fails_before_purchase( + tmp_path, monkeypatch, binding +): + profile, cloud, _, _, read = setup(tmp_path, monkeypatch) + read.return_value = binding + with pytest.raises(DeploymentError): + await prepare_postgres(profile, cloud, "account", agent_id="mi-old") + assert cloud.created == 1 + + +@pytest.mark.asyncio +async def test_business_unknown_create_does_not_duplicate(tmp_path, monkeypatch): + profile, cloud, _, _, _ = setup(tmp_path, monkeypatch) + create = cloud.create + + async def uncertain(name, project, tags): + if tags["veadk-pg-purpose"] == "business": + cloud.created += 1 + raise TimeoutError() + return await create(name, project, tags) + + cloud.create = uncertain + for _ in range(2): + with pytest.raises(DeploymentError, match="uncertain"): + await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + assert cloud.created == 2 + + +@pytest.mark.asyncio +async def test_per_agent_requires_id_before_cloud_mutation(tmp_path, monkeypatch): + profile, cloud, _, _, _ = setup(tmp_path, monkeypatch) + with pytest.raises(DeploymentError): + await prepare_postgres(profile, cloud, "account") + assert cloud.created == 0 + + +def test_creation_mode_is_additive_and_validated(tmp_path, monkeypatch): + profile, _, _, _ = recovery_setup(tmp_path, monkeypatch) + shared = with_creation_resources(profile, {}).managed.postgres + independent = with_creation_resources( + profile, {"businessWorkspaceMode": "per-agent"} + ).managed.postgres + assert shared is not None and shared.business_workspace_mode == "shared" + assert ( + independent is not None and independent.business_workspace_mode == "per-agent" + ) + with pytest.raises(ConfigurationError): + with_creation_resources(profile, {"businessWorkspaceMode": "invalid"}) + + +@pytest.mark.asyncio +async def test_registered_per_agent_identity_reused_after_bootstrap_loss( + tmp_path, monkeypatch +): + profile, cloud, store, _, read = setup(tmp_path, monkeypatch) + first = await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + read.return_value = { + "admin_workspace_id": first.managed.postgres.admin_workspace_id, + "business_workspace_id": first.managed.postgres.business_workspace_id, + "business_workspace_mode": "per-agent", + "database_host": make_url(first.admin_url).host, + "database_port": 5432, + } + with store.connection() as db: + db.execute("DELETE FROM workspaces WHERE purpose='business'") + second = await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + assert second.admin_url == first.admin_url + assert cloud.created == 2 + + +@pytest.mark.asyncio +async def test_unowned_name_collision_is_not_adopted(tmp_path, monkeypatch): + from tests.integrations.mpa_managed.test_auto_pg import workspace + + profile, cloud, _, _, _ = setup(tmp_path, monkeypatch) + cloud.rows["foreign"] = workspace( + database_name("account", profile.region, "mi-new"), "foreign" + ) + with pytest.raises(DeploymentError): + await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + assert cloud.created == 1 + + +@pytest.mark.asyncio +async def test_registered_reader_closes_registry_on_error(monkeypatch): + from contextlib import asynccontextmanager + from types import SimpleNamespace + from veadk.integrations.mpa.managed import pg_bootstrap + + @asynccontextmanager + async def lock(*args): + yield SimpleNamespace(read=AsyncMock(side_effect=RuntimeError("unavailable"))) + + registry = SimpleNamespace(lock=lock, close=AsyncMock()) + monkeypatch.setattr(pg_bootstrap, "AgentDeploymentRegistry", lambda *_: registry) + with pytest.raises(RuntimeError): + await pg_bootstrap.registered_business_binding( + "unused", "account", "region", "agent" + ) + registry.close.assert_awaited_once() + + +def test_per_agent_profile_rejects_shared_adoption_and_manual_mode(): + from pydantic import ValidationError + from veadk.integrations.mpa.managed.config import PostgresWorkspaces + + for values in [ + {"mode": "auto", "business_workspace_id": "shared"}, + { + "mode": "manual", + "admin_workspace_id": "admin", + "business_workspace_id": "business", + }, + ]: + with pytest.raises(ValidationError): + PostgresWorkspaces.model_validate( + {"business_workspace_mode": "per-agent", **values} + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("runtime_name", ["test-mpa", "1234", "Case_Name", "x" * 64]) +async def test_aidb_layout_uses_readable_workspace_and_pins_name( + tmp_path, monkeypatch, runtime_name +): + profile, cloud, store, _, _ = setup(tmp_path, monkeypatch) + assert profile.managed.postgres is not None + profile.managed.postgres = profile.managed.postgres.model_copy( + update={"business_database_name": "aidb"} + ) + first = await prepare_postgres( + profile, cloud, "account", agent_id="mi-new", runtime_name=runtime_name + ) + second = await prepare_postgres( + profile, cloud, "account", agent_id="mi-new", runtime_name=runtime_name + ) + assert cloud.created == 2 + assert first.admin_url == second.admin_url + assert first.managed.postgres.business_workspace_name == "mpa_agent_" + runtime_name + assert first.managed.postgres.business_database_name == "aidb" + assert cloud.rows["ws-2"]["workspace_name"] == "mpa_agent_" + runtime_name + assert "aidb" in store.path.read_bytes().decode(errors="ignore") + + +@pytest.mark.asyncio +async def test_new_aidb_selection_does_not_upgrade_existing_hash_bootstrap( + tmp_path, monkeypatch +): + profile, cloud, _, _, _ = setup(tmp_path, monkeypatch) + old = await prepare_postgres(profile, cloud, "account", agent_id="mi-new") + assert profile.managed.postgres is not None + profile.managed.postgres = profile.managed.postgres.model_copy( + update={"business_database_name": "aidb"} + ) + retried = await prepare_postgres( + profile, cloud, "account", agent_id="mi-new", runtime_name="new-name" + ) + assert retried.admin_url == old.admin_url + assert retried.managed.postgres.business_database_name == "" + assert ( + retried.managed.postgres.business_workspace_name + == old.managed.postgres.business_workspace_name + ) + assert cloud.created == 2 diff --git a/tests/integrations/mpa_managed/test_apm_key.py b/tests/integrations/mpa_managed/test_apm_key.py new file mode 100644 index 000000000..64526f15f --- /dev/null +++ b/tests/integrations/mpa_managed/test_apm_key.py @@ -0,0 +1,310 @@ +# 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. + +"""BytePlus APM AppKey lookup and Runtime-only secret handoff.""" + +import asyncio +import threading +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest +import requests + +from veadk.integrations.mpa.managed import apm_key, service +from veadk.integrations.mpa.managed.config import load_studio_profile +from veadk.integrations.mpa.managed.diagnostics import diagnostic_scope + +KEY = "test-apm-app-value" + + +class Cloud: + def __init__(self): + self.count = 0 + + def _credentials(self): + self.count += 1 + return SimpleNamespace( + access_key_id=f"test-ak-{self.count}", + secret_access_key="test-sk", + session_token=f"test-sts-{self.count}", + ) + + +def test_signed_lookup_returns_key_without_mutating_profile(monkeypatch): + calls = [] + monkeypatch.setattr( + apm_key, + "volcengine_signed_request", + lambda **kw: calls.append(kw) or {"data": {"app_key": KEY}}, + ) + profile = load_studio_profile(provider="byteplus") + original = profile.managed.model_dump() + assert asyncio.run(apm_key.get_runtime_apm_key(profile, Cloud())) == KEY + assert profile.managed.model_dump() == original + assert KEY not in repr(profile) and KEY not in str(profile.summary()) + call = calls[0] + assert call["host"] == "apmplus-server.ap-southeast-1.byteplusapi.com" + assert call["region"] == "ap-southeast-1" + assert call["service"] == "apmplus_server" + assert call["query"] == {"Action": "GetAppKey", "Version": "2024-07-30"} + assert call["header"] == { + "X-Security-Token": "test-sts-1", + "X-Apmplus-Region": "ap_southeast_1", + } + assert call["ak"] == "test-ak-1" + assert call["timeout"] == (10, 30) + + +def test_explicit_runtime_key_skips_lookup_and_domestic_is_unchanged(monkeypatch): + def forbidden(**kw): + raise AssertionError("Unexpected APM lookup") + + monkeypatch.setattr(apm_key, "volcengine_signed_request", forbidden) + profile = load_studio_profile(provider="byteplus") + profile.managed.runtime.env[apm_key.RUNTIME_APM_KEY] = KEY + assert asyncio.run(apm_key.get_runtime_apm_key(profile, Cloud())) == KEY + assert ( + asyncio.run(apm_key.get_runtime_apm_key(load_studio_profile(), Cloud())) == "" + ) + + +@pytest.mark.parametrize( + "response", + [None, [], {}, {"data": []}] + + [ + {"data": {"app_key": value}} + for value in [None, 42, "", "***", " has-space", "x" * 4097] + ], +) +def test_invalid_response_fails_safely_without_retry(monkeypatch, response): + calls = [] + monkeypatch.setattr( + apm_key, "volcengine_signed_request", lambda **kw: calls.append(kw) or response + ) + diagnostics = [] + with ( + diagnostic_scope(diagnostics.append), + pytest.raises(apm_key.ApmKeyError) as error, + ): + asyncio.run( + apm_key.get_runtime_apm_key( + load_studio_profile(provider="byteplus"), Cloud() + ) + ) + assert len(calls) == 1 + assert diagnostics[-1]["category"] == "protocol_error" + assert "app_key" not in str(error.value) + + +@pytest.mark.parametrize( + "code,category,attempts", + [ + ("AccessDenied", "permission", 1), + ("InternalServiceTimeout", "timeout", 3), + ("Throttling", "throttled", 3), + ], +) +def test_provider_failure_reports_only_safe_metadata( + monkeypatch, code, category, attempts +): + def request(**kw): + return { + "ResponseMetadata": { + "RequestId": "0123456789ABCDEF0123456789ABCDEF", + "Error": {"Code": code, "Message": KEY}, + }, + "data": {"app_key": KEY}, + } + + monkeypatch.setattr(apm_key, "volcengine_signed_request", request) + diagnostics = [] + cloud = Cloud() + with ( + diagnostic_scope(diagnostics.append), + pytest.raises(apm_key.ApmKeyError) as error, + ): + asyncio.run( + apm_key.get_runtime_apm_key(load_studio_profile(provider="byteplus"), cloud) + ) + assert cloud.count == attempts + assert diagnostics[-1]["category"] == category + assert diagnostics[-1]["errorCode"] == code + assert diagnostics[-1]["requestId"] == "0123456789ABCDEF0123456789ABCDEF" + assert KEY not in str(diagnostics) + str(error.value) + + +def test_http_error_retains_metadata_without_provider_text(monkeypatch): + response = requests.Response() + response.status_code = 403 + response._content = b'{"ResponseMetadata":{"RequestId":"0123456789ABCDEF","Error":{"Code":"AccessDenied","Message":"test-apm-app-value"}}}' + + def request(**kw): + raise requests.HTTPError(KEY, response=response) + + monkeypatch.setattr(apm_key, "volcengine_signed_request", request) + diagnostics = [] + with diagnostic_scope(diagnostics.append), pytest.raises(apm_key.ApmKeyError): + asyncio.run( + apm_key.get_runtime_apm_key( + load_studio_profile(provider="byteplus"), Cloud() + ) + ) + assert diagnostics[-1]["category"] == "permission" + assert diagnostics[-1]["errorCode"] == "AccessDenied" + assert KEY not in str(diagnostics) + + +def test_transient_retry_refreshes_credentials(monkeypatch): + calls = [] + + def request(**kw): + calls.append(kw) + if len(calls) == 1: + raise requests.Timeout(KEY) + return {"data": {"app_key": KEY}} + + monkeypatch.setattr(apm_key, "volcengine_signed_request", request) + assert ( + asyncio.run( + apm_key.get_runtime_apm_key( + load_studio_profile(provider="byteplus"), Cloud() + ) + ) + == KEY + ) + assert [c["ak"] for c in calls] == ["test-ak-1", "test-ak-2"] + + +def test_cancellation_does_not_retry_or_continue(monkeypatch): + async def run(): + started, release = threading.Event(), threading.Event() + cloud = Cloud() + + def request(**kw): + started.set() + release.wait(2) + return {"data": {"app_key": KEY}} + + monkeypatch.setattr(apm_key, "volcengine_signed_request", request) + task = asyncio.create_task( + apm_key.get_runtime_apm_key(load_studio_profile(provider="byteplus"), cloud) + ) + await asyncio.to_thread(started.wait, 2) + task.cancel() + release.set() + with pytest.raises(asyncio.CancelledError): + await task + assert cloud.count == 1 + + asyncio.run(run()) + + +def test_lookup_failure_does_not_block_resource_preparation(monkeypatch): + profile = load_studio_profile(provider="byteplus") + cloud = Cloud() + monkeypatch.setattr( + cloud, "account_id", AsyncMock(return_value="test-account"), raising=False + ) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + monkeypatch.setattr(service, "resolve_model_key", AsyncMock(return_value=profile)) + lookup = AsyncMock(side_effect=apm_key.ApmKeyError("APM AppKey lookup failed")) + monkeypatch.setattr(service, "get_runtime_apm_key", lookup) + iam, identity = AsyncMock(), AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", iam) + identity.side_effect = RuntimeError("isolated-stop-after-apm-skip") + monkeypatch.setattr(service, "ensure_workload_identity", identity) + with pytest.raises(RuntimeError, match="isolated-stop-after-apm-skip"): + asyncio.run( + service.provision( + profile, + agent_id="mi-test", + owner="test-owner", + studio_runtime_owner="studio-user", + ) + ) + lookup.assert_awaited_once_with(profile, cloud) + iam.assert_awaited_once() + identity.assert_awaited_once() + + +def test_invalid_explicit_apm_key_still_blocks_resource_preparation(monkeypatch): + profile = load_studio_profile(provider="byteplus") + profile.managed.runtime.env[apm_key.RUNTIME_APM_KEY] = "bad\nkey" + cloud = Cloud() + monkeypatch.setattr( + cloud, "account_id", AsyncMock(return_value="test-account"), raising=False + ) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + monkeypatch.setattr(service, "resolve_model_key", AsyncMock(return_value=profile)) + iam, identity = AsyncMock(), AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", iam) + monkeypatch.setattr(service, "ensure_workload_identity", identity) + with pytest.raises(apm_key.ApmKeyError, match="Configured APM AppKey is invalid"): + asyncio.run( + service.provision( + profile, + agent_id="mi-test", + owner="test-owner", + studio_runtime_owner="studio-user", + ) + ) + iam.assert_not_awaited() + identity.assert_not_awaited() + + +@pytest.mark.parametrize( + "provider,studio_owner", [("volcengine", "studio-user"), ("byteplus", None)] +) +def test_domestic_and_cli_provision_do_not_lookup_apm( + monkeypatch, provider, studio_owner +): + profile = load_studio_profile(provider=provider) + cloud = Cloud() + monkeypatch.setattr( + cloud, "account_id", AsyncMock(return_value="test-account"), raising=False + ) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + monkeypatch.setattr(service, "resolve_model_key", AsyncMock(return_value=profile)) + lookup = AsyncMock(return_value=KEY) + monkeypatch.setattr(service, "get_runtime_apm_key", lookup) + monkeypatch.setattr(service, "ensure_runtime_role", AsyncMock()) + monkeypatch.setattr( + service, + "ensure_workload_identity", + AsyncMock(side_effect=RuntimeError("isolated-stop-before-resources")), + ) + with pytest.raises(RuntimeError, match="isolated-stop-before-resources"): + asyncio.run( + service.provision( + profile, + agent_id="mi-test", + owner="test-owner", + studio_runtime_owner=studio_owner, + ) + ) + lookup.assert_not_awaited() + + +@pytest.mark.parametrize("value", ["masked***", "bad\nkey"]) +def test_invalid_explicit_key_does_not_lookup(monkeypatch, value): + profile = load_studio_profile(provider="byteplus") + profile.managed.runtime.env[apm_key.RUNTIME_APM_KEY] = value + + def request(**kw): + raise AssertionError("Explicit invalid key must fail before lookup") + + monkeypatch.setattr(apm_key, "volcengine_signed_request", request) + with pytest.raises(apm_key.ApmKeyError, match="Configured APM AppKey is invalid"): + asyncio.run(apm_key.get_runtime_apm_key(profile, Cloud())) diff --git a/tests/integrations/mpa_managed/test_auto_pg.py b/tests/integrations/mpa_managed/test_auto_pg.py index 92eccd588..50297e401 100644 --- a/tests/integrations/mpa_managed/test_auto_pg.py +++ b/tests/integrations/mpa_managed/test_auto_pg.py @@ -887,6 +887,37 @@ def create_workspace(self, request, **kw): ] +@pytest.mark.asyncio +async def test_sdk_create_workspace_failure_does_not_retry(monkeypatch): + from types import SimpleNamespace + from veadk.integrations.mpa.managed.pg_cloud import PGCloud, PGCloudError + import volcenginesdkaidap as sdk + + calls = 0 + + def credentials(): + return SimpleNamespace( + access_key_id="fake-ak", secret_access_key="fake-sk", session_token="" + ) + + class Client: + def __init__(self, client): + pass + + def create_workspace(self, request, **kw): + nonlocal calls + calls += 1 + raise RuntimeError("private transport failure") + + monkeypatch.setattr(sdk, "AIDAPApi", Client) + cloud = PGCloud(region="cn-beijing", credentials=credentials) + with pytest.raises(PGCloudError, match="CloudRequestFailed"): + await cloud.create( + "mpa_admin_workspace", "default", {"veadk-pg-purpose": "admin"} + ) + assert calls == 1 + + @pytest.mark.asyncio async def test_sdk_connection_and_pagination_contract(monkeypatch): from veadk.integrations.mpa.managed.pg_cloud import PGCloud @@ -956,6 +987,176 @@ async def pages(method, request, **params): assert calls == [0, 100] +@pytest.mark.asyncio +async def test_sdk_read_calls_retry_transient_failures(monkeypatch): + from types import SimpleNamespace + from veadk.integrations.mpa.managed.diagnostics import diagnostic_scope + from veadk.integrations.mpa.managed.pg_cloud import PGCloud + import volcenginesdkaidap as sdk + + calls = [] + + def credentials(): + return SimpleNamespace( + access_key_id="fake-ak", secret_access_key="fake-sk", session_token="" + ) + + class TransientError(RuntimeError): + body = json.dumps( + { + "ResponseMetadata": { + "RequestId": "0123456789ABCDEF", + "Error": {"Code": "InternalError", "Message": "private"}, + } + } + ) + + class Client: + def __init__(self, client): + pass + + def describe_branches(self, request, **kw): + calls.append("describe_branches") + if len(calls) < 3: + raise TransientError("private") + return SimpleNamespace( + to_dict=lambda: { + "branches": [ + { + "branch_id": "branch", + "branch_name": "main", + "branch_status": "Running", + } + ] + } + ) + + def describe_computes(self, request, **kw): + return SimpleNamespace( + to_dict=lambda: { + "computes": [{"compute_id": "compute", "compute_status": "Running"}] + } + ) + + def describe_workspace_endpoint(self, request, **kw): + return SimpleNamespace( + to_dict=lambda: { + "endpoints": [ + { + "addresses": [ + {"address_type": "Public", "address_id": "address"} + ] + } + ] + } + ) + + def describe_db_accounts(self, request, **kw): + return SimpleNamespace( + to_dict=lambda: {"accounts": [{"account_name": "user_admin"}]} + ) + + def describe_databases(self, request, **kw): + return SimpleNamespace( + to_dict=lambda: {"databases": [{"database_name": "aidb"}]} + ) + + def describe_db_account_connection(self, request, **kw): + return SimpleNamespace( + to_dict=lambda: { + "connection_examples": [ + { + "connection_type": "Parameters", + "connection_example": "PGHOST=db.example\nPGUSER=user_admin\nPGPASSWORD=fake\nPGDATABASE=aidb", + } + ] + } + ) + + monkeypatch.setattr(sdk, "AIDAPApi", Client) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.pg_cloud.asyncio.sleep", AsyncMock() + ) + diagnostics = [] + with diagnostic_scope(diagnostics.append): + assert "db.example" in await PGCloud( + region="cn-beijing", credentials=credentials + ).connection("ws") + assert calls == ["describe_branches", "describe_branches", "describe_branches"] + assert diagnostics[:2] == [ + { + "operation": "aidap_describe_branches", + "category": "unavailable", + "attempt": 1, + "outcome": "retrying", + "errorCode": "InternalError", + "requestId": "0123456789ABCDEF", + }, + { + "operation": "aidap_describe_branches", + "category": "unavailable", + "attempt": 2, + "outcome": "retrying", + "errorCode": "InternalError", + "requestId": "0123456789ABCDEF", + }, + ] + + +@pytest.mark.asyncio +async def test_sdk_read_calls_tolerate_repeated_cross_region_failures(monkeypatch): + from types import SimpleNamespace + from veadk.integrations.mpa.managed.diagnostics import diagnostic_scope + from veadk.integrations.mpa.managed.pg_cloud import PGCloud + import volcenginesdkaidap as sdk + + calls = [] + + def credentials(): + return SimpleNamespace( + access_key_id="fake-ak", secret_access_key="fake-sk", session_token="" + ) + + class TransientError(RuntimeError): + body = json.dumps( + { + "ResponseMetadata": { + "RequestId": "0123456789ABCDEF", + "Error": {"Code": "CloudRequestFailed", "Message": "private"}, + } + } + ) + + class Client: + def __init__(self, client): + pass + + def describe_db_accounts(self, request, **kw): + calls.append("describe_db_accounts") + if len(calls) < 6: + raise TransientError("private") + return SimpleNamespace( + to_dict=lambda: {"accounts": [{"account_name": "user_admin"}]} + ) + + monkeypatch.setattr(sdk, "AIDAPApi", Client) + sleep = AsyncMock() + monkeypatch.setattr("veadk.integrations.mpa.managed.pg_cloud.asyncio.sleep", sleep) + diagnostics = [] + with diagnostic_scope(diagnostics.append): + assert await PGCloud(region="cn-beijing", credentials=credentials).listing( + "describe_db_accounts", + "DescribeDBAccountsRequest", + "accounts", + workspace_id="ws", + branch_id="branch", + ) == [{"account_name": "user_admin"}] + assert calls == ["describe_db_accounts"] * 6 + assert [call.args[0] for call in sleep.call_args_list] == [1, 2, 4, 8, 16] + assert [item["attempt"] for item in diagnostics] == [1, 2, 3, 4, 5] + assert all(item["outcome"] == "retrying" for item in diagnostics) + + @pytest.mark.asyncio async def test_provider_errors_do_not_expose_response_secrets(monkeypatch): from veadk.integrations.mpa.managed.pg_cloud import PGCloud diff --git a/tests/integrations/mpa_managed/test_byteplus.py b/tests/integrations/mpa_managed/test_byteplus.py index 647629122..435d6554e 100644 --- a/tests/integrations/mpa_managed/test_byteplus.py +++ b/tests/integrations/mpa_managed/test_byteplus.py @@ -15,11 +15,14 @@ """Provider isolation for managed creation; no real cloud operations.""" import asyncio +import hashlib +import json from pathlib import Path from types import SimpleNamespace from unittest.mock import AsyncMock import pytest +from agentkit.toolkit.errors import ApiError from fastapi import FastAPI from fastapi.testclient import TestClient @@ -50,10 +53,76 @@ def test_byteplus_profile_is_separate_from_domestic_defaults(monkeypatch): domestic_pg = load_studio_profile().managed.postgres assert profile.managed.postgres is not None and domestic_pg is not None assert profile.managed.postgres.bootstrap_path != domestic_pg.bootstrap_path - assert profile.image_defaults() == load_studio_profile().image_defaults() + assert profile.image_defaults() == { + "runtimeImage": ( + "agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/" + "mpa/mpa_agent:latest" + ), + "workerImage": ( + "agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/" + "mpa/mpa_codex_worker:latest" + ), + } + assert load_studio_profile().image_defaults() == { + "runtimeImage": ( + "agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest" + ), + "workerImage": ( + "agentkit-platform-2112682748-cn-beijing.cr.volces.com/" + "mpa/mpa_codex_worker:latest" + ), + } assert profile.summary()["configured"] is True +@pytest.mark.parametrize( + ("provider", "region", "expected", "expected_control"), + [ + ("volcengine", "cn-beijing", "true", True), + ("byteplus", "ap-southeast-1", "true", True), + ], +) +def test_provider_application_apm_defaults_are_isolated( + provider, region, expected, expected_control +): + from veadk.integrations.mpa.managed import service + + values = studio_profile_values(provider) + raw_env = values["managed"]["runtime"]["env"] + assert raw_env["ENABLE_APMPLUS"] == expected + assert raw_env["FORCE_APMPLUS_EXPORTER_REGISTRATION"] == expected + + profile = load_studio_profile(provider=provider, region=region) + assert profile.managed.runtime.apmplus_enable is expected_control + assert profile.managed.runtime.env["ENABLE_APMPLUS"] == expected + assert ( + profile.managed.runtime.env["FORCE_APMPLUS_EXPORTER_REGISTRATION"] == expected + ) + + template = {"ApmplusEnable": False, "Envs": []} + service.apply_runtime_settings(template, profile.managed.runtime) + env = {item["Key"]: item["Value"] for item in template["Envs"]} + assert template["ApmplusEnable"] is expected_control + assert env["ENABLE_APMPLUS"] == expected + assert env["FORCE_APMPLUS_EXPORTER_REGISTRATION"] == expected + + endpoint_key = "OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT" + endpoint = "http://apmplus-ap-southeast-1.bytepluses.com:4317" + for configured_env in (raw_env, profile.managed.runtime.env, env): + if provider == "byteplus": + assert configured_env[endpoint_key] == endpoint + else: + assert endpoint_key not in configured_env + + profile.managed.runtime.env[endpoint_key] = "http://collector.example.test:4317" + service.apply_runtime_settings(template, profile.managed.runtime) + overridden = {item["Key"]: item["Value"] for item in template["Envs"]} + assert overridden[endpoint_key] == "http://collector.example.test:4317" + + domestic = studio_profile_values("volcengine") + assert domestic["managed"]["runtime"]["env"]["ENABLE_APMPLUS"] == "true" + + @pytest.mark.parametrize( "provider,region", [("byteplus", "cn-beijing"), ("volcengine", "ap-southeast-1")] ) @@ -511,6 +580,7 @@ async def test_byteplus_worker_mount_and_environment_are_overseas(): runtime=SimpleNamespace(provider="byteplus"), find=AsyncMock(return_value=[]), create=AsyncMock(side_effect=DeploymentError("request captured")), + get=AsyncMock(), ) with pytest.raises(DeploymentError, match="request captured"): await ensure_worker( @@ -524,13 +594,232 @@ async def test_byteplus_worker_mount_and_environment_are_overseas(): request = cloud.create.await_args.args[0] assert ( request["TosMountConfig"]["MountPoints"][0]["Endpoint"] - == "https://tos-ap-southeast-1.bytepluses.com" + == "http://tos-ap-southeast-1.bytepluses.com" ) assert {item["Key"]: item["Value"] for item in request["Envs"]}[ "CLOUD_PROVIDER" ] == "byteplus" +@pytest.mark.asyncio +@pytest.mark.parametrize( + "legacy_endpoint", + [ + "", + "tos-ap-southeast-1.bytepluses.com", + "https://tos-ap-southeast-1.bytepluses.com", + ], +) +async def test_byteplus_worker_recovers_legacy_tos_endpoint(legacy_endpoint): + from tests.integrations.mpa_managed.test_agent_deployment import Registry + from veadk.integrations.mpa.managed.database import DeploymentError + from veadk.integrations.mpa.managed.worker import ensure_worker + + profile = load_studio_profile(provider="byteplus") + profile.managed.worker.tos_bucket = "test-bucket" + profile.managed.worker.tos_credential_type = "iam_role" + registry = Registry() + cloud = SimpleNamespace( + runtime=SimpleNamespace(provider="byteplus"), + find=AsyncMock(return_value=[]), + create=AsyncMock(side_effect=DeploymentError("request captured")), + get=AsyncMock(), + ) + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + registry, + cloud, + profile.managed.worker, + account="test-account", + region="ap-southeast-1", + agent_id="mi-test", + runtime_name="test-agent", + ) + original = dict(cloud.create.await_args.args[0]) + original.pop("ClientToken") + legacy = json.loads(json.dumps(original)) + if legacy_endpoint: + legacy["TosMountConfig"]["MountPoints"][0]["Endpoint"] = legacy_endpoint + else: + legacy["TosMountConfig"]["MountPoints"][0].pop("Endpoint") + registry.row["worker_hash"] = hashlib.sha256( + json.dumps(legacy, sort_keys=True).encode() + ).hexdigest() + registry.row["worker_name"] = "test-agent" + registry.row.pop("worker_id", None) + cloud.create.reset_mock() + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + registry, + cloud, + profile.managed.worker, + account="test-account", + region="ap-southeast-1", + agent_id="mi-test", + runtime_name="test-agent", + ) + request = cloud.create.await_args.args[0] + assert ( + request["TosMountConfig"]["MountPoints"][0]["Endpoint"] + == "http://tos-ap-southeast-1.bytepluses.com" + ) + assert ( + registry.row["worker_hash"] + == hashlib.sha256( + json.dumps( + {key: value for key, value in request.items() if key != "ClientToken"}, + sort_keys=True, + ).encode() + ).hexdigest() + ) + + +@pytest.mark.asyncio +async def test_byteplus_worker_tos_endpoint_failure_falls_back_without_mount(): + from tests.integrations.mpa_managed.test_agent_deployment import Registry + from veadk.integrations.mpa.managed.database import agent_suffix + from veadk.integrations.mpa.managed.worker import ensure_worker + + profile = load_studio_profile(provider="byteplus") + profile.managed.worker.tos_bucket = "test-bucket" + profile.managed.worker.tos_credential_type = "iam_role" + registry = Registry() + cloud = SimpleNamespace( + runtime=SimpleNamespace(provider="byteplus"), + find=AsyncMock(return_value=[]), + create=AsyncMock( + side_effect=[ + ApiError("private", error_code="InvalidParameter.TosEndpoint"), + "t-created", + ] + ), + get=AsyncMock( + return_value={ + "ToolId": "t-created", + "ProjectName": "default", + "Status": "Ready", + "Tags": [ + {"Key": "managed_by", "Value": "mpa-deployment"}, + { + "Key": "mpa_agent_key", + "Value": agent_suffix( + "test-account", "ap-southeast-1", "mi-test" + ), + }, + ], + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + } + ), + ) + assert ( + await ensure_worker( + registry, + cloud, + profile.managed.worker, + account="test-account", + region="ap-southeast-1", + agent_id="mi-test", + runtime_name="test-agent", + ) + == "t-created" + ) + first, second = [call.args[0] for call in cloud.create.call_args_list] + assert ( + first["TosMountConfig"]["MountPoints"][0]["Endpoint"] + == "http://tos-ap-southeast-1.bytepluses.com" + ) + assert "TosMountConfig" not in second + assert first["ClientToken"] != second["ClientToken"] + assert registry.row["worker_tos_mount_disabled"] is True + assert ( + registry.row["worker_tos_mount_disabled_reason"] + == "InvalidParameter.TosEndpoint" + ) + assert ( + registry.row["worker_hash"] + == hashlib.sha256( + json.dumps( + {key: value for key, value in second.items() if key != "ClientToken"}, + sort_keys=True, + ).encode() + ).hexdigest() + ) + + +@pytest.mark.asyncio +async def test_byteplus_worker_resumes_tos_intent_after_ui_loses_bucket(): + from tests.integrations.mpa_managed.test_agent_deployment import Registry + from veadk.integrations.mpa.managed.database import DeploymentError, agent_suffix + from veadk.integrations.mpa.managed.worker import ensure_worker + + profile = load_studio_profile(provider="byteplus") + tos_profile = load_studio_profile(provider="byteplus") + tos_profile.managed.worker.tos_bucket = "agentkit-platform-test-account" + tos_profile.managed.worker.tos_credential_type = "iam_role" + registry = Registry() + cloud = SimpleNamespace( + runtime=SimpleNamespace(provider="byteplus"), + find=AsyncMock(return_value=[]), + create=AsyncMock(side_effect=DeploymentError("request captured")), + get=AsyncMock(), + ) + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + registry, + cloud, + tos_profile.managed.worker, + account="test-account", + region="ap-southeast-1", + agent_id="mi-test", + runtime_name="test-agent", + ) + previous_hash = registry.row["worker_hash"] + registry.row = { + "worker_hash": previous_hash, + "worker_name": "test-agent", + "worker_managed": True, + } + cloud.create.reset_mock() + cloud.get.return_value = { + "ToolId": "t-created", + "ProjectName": "default", + "Status": "Ready", + "Tags": [ + {"Key": "managed_by", "Value": "mpa-deployment"}, + { + "Key": "mpa_agent_key", + "Value": agent_suffix("test-account", "ap-southeast-1", "mi-test"), + }, + ], + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + } + cloud.create.side_effect = ["t-created"] + assert ( + await ensure_worker( + registry, + cloud, + profile.managed.worker, + account="test-account", + region="ap-southeast-1", + agent_id="mi-test", + runtime_name="test-agent", + ) + == "t-created" + ) + request = cloud.create.await_args.args[0] + assert "TosMountConfig" not in request + assert registry.row["worker_tos_mount_disabled"] is True + assert ( + registry.row["worker_hash"] + == hashlib.sha256( + json.dumps( + {key: value for key, value in request.items() if key != "ClientToken"}, + sort_keys=True, + ).encode() + ).hexdigest() + ) + + @pytest.mark.parametrize( "host", [ @@ -569,3 +858,39 @@ def test_managed_byteplus_iam_retains_trusted_host_override(monkeypatch): managed_host("iam", "ap-southeast-1", "byteplus") == "iam-test.byteplusapi.com" ) assert managed_host("iam", "cn-beijing", "volcengine") == "iam.volcengineapi.com" + + +@pytest.mark.parametrize("invalid", [None, "not-json", "{}"]) +def test_byteplus_cloud_profile_refreshes_iam_file_and_rejects_invalid_file( + monkeypatch, tmp_path, invalid +): + import json + + from veadk.integrations.mpa.managed.credentials import load_provider_credentials + + credential_file = tmp_path / "credential" + monkeypatch.setenv("VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE", str(credential_file)) + monkeypatch.delenv("BYTEPLUS_ACCESS_KEY", raising=False) + monkeypatch.delenv("BYTEPLUS_SECRET_KEY", raising=False) + profile = load_studio_profile(provider="byteplus", region="ap-southeast-1") + for generation in ("first", "rotated"): + credential_file.write_text( + json.dumps( + { + "AccessKeyId": generation, + "SecretAccessKey": generation, + "SessionToken": generation, + } + ) + ) + credential = load_provider_credentials( + profile.provider, profile.managed.credential_file + ) + assert credential.access_key_id == generation + assert credential.session_token == generation + if invalid is None: + credential_file.unlink() + else: + credential_file.write_text(invalid) + with pytest.raises(ValueError, match="unavailable or invalid"): + load_provider_credentials(profile.provider, profile.managed.credential_file) diff --git a/tests/integrations/mpa_managed/test_config.py b/tests/integrations/mpa_managed/test_config.py index 3e6603239..dad13bb51 100644 --- a/tests/integrations/mpa_managed/test_config.py +++ b/tests/integrations/mpa_managed/test_config.py @@ -377,6 +377,83 @@ def test_worker_model_rejects_partial_tos_and_external_tool_mount() -> None: ) +@pytest.mark.parametrize( + "bucket", ["agentkit-platform-output", "", " agentkit-platform-output "] +) +def test_studio_bucket_only_uses_worker_role_without_credentials(monkeypatch, bucket): + from veadk.integrations.mpa.managed.config import ( + load_studio_profile, + validate_creation_tos, + with_creation_tos, + ) + + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-key") + profile = load_studio_profile(region="cn-beijing") + selected = validate_creation_tos({"tosBucket": bucket}) + assert selected == {"tosBucket": bucket.strip()} + updated = with_creation_tos(profile, selected) + if bucket.strip(): + worker = updated.managed.worker + assert worker.tos_mount_enabled + assert worker.tos_credential_type == "iam_role" + assert worker.tos_bucket == "agentkit-platform-output" + assert not worker.tos_access_key and not worker.tos_secret_key + assert not profile.managed.worker.tos_bucket + else: + assert updated is profile + + +@pytest.mark.parametrize("bucket", ["*", "bad/name", "ab", "Uppercase", "a" * 64]) +def test_studio_rejects_invalid_bucket_names(bucket): + from veadk.integrations.mpa.managed.config import validate_creation_tos + + with pytest.raises(ConfigurationError, match="bucket"): + validate_creation_tos({"tosBucket": bucket}) + + +@pytest.mark.parametrize("field", ["tosAccessKey", "tosSecretKey"]) +def test_studio_rejects_legacy_credential_input(field): + from veadk.integrations.mpa.managed.config import validate_creation_tos + + with pytest.raises(ConfigurationError) as caught: + validate_creation_tos({"tosBucket": "session-output", field: "private-value"}) + assert "private-value" not in str(caught.value) + + +@pytest.mark.parametrize( + "bucket", + [ + "agentkit-demo", + "agentkit-platform", + "x-agentkit-platform-output", + "Agentkit-platform-output", + ], +) +def test_studio_rejects_buckets_outside_platform_prefix(bucket): + from veadk.integrations.mpa.managed.config import validate_creation_tos + + with pytest.raises(ConfigurationError, match="bucket"): + validate_creation_tos({"tosBucket": bucket}) + + +def test_worker_iam_mode_requires_no_keys_and_cannot_mutate_existing_tool(): + from veadk.integrations.mpa.managed.config import Worker + + worker = Worker( + image="worker:v1", tos_bucket="session-output", tos_credential_type="iam_role" + ) + assert worker.tos_mount_enabled + assert not Worker( + image="worker:v1", tos_credential_type="iam_role" + ).tos_mount_enabled + for overrides in ( + {"tos_access_key": "private-value"}, + {"existing_id": "t-existing", "image": ""}, + ): + with pytest.raises(ValueError): + Worker.model_validate({**worker.model_dump(), **overrides}) + + def test_invalid_profile_and_missing_secret_are_safe(tmp_path, monkeypatch): path = profile_file(tmp_path, monkeypatch, **{"provider-root": "/not-supported"}) with pytest.raises(ConfigurationError): @@ -639,3 +716,23 @@ def test_runtime_override_validation_is_safe(tmp_path, monkeypatch, settings): with pytest.raises(ConfigurationError) as error: load_profile(profile_file(tmp_path, monkeypatch, runtime=settings)) assert "private-test-value" not in str(error.value) + + +def test_automatic_openviking_is_explicit_and_preserves_old_requests(): + profile = load_studio_profile(region="cn-beijing") + assert profile.summary()["openvikingMode"] == "auto" + assert with_creation_resources(profile, {}).managed.openviking.mode == "manual" + selected = with_creation_resources(profile, {"openvikingMode": "auto"}) + assert selected.managed.openviking.mode == "auto" + assert selected.openviking_enabled is True + assert not any(k.startswith("OPENVIKING_") for k in selected.managed.runtime.env) + with pytest.raises(ConfigurationError): + with_creation_resources( + profile, + { + "openvikingMode": "auto", + "openvikingUrl": "https://example.test", + "openvikingResourceId": "ov-test", + "openvikingApiKey": "test-key", + }, + ) diff --git a/tests/integrations/mpa_managed/test_creation_images.py b/tests/integrations/mpa_managed/test_creation_images.py index 39dfe6006..b87ee3c4b 100644 --- a/tests/integrations/mpa_managed/test_creation_images.py +++ b/tests/integrations/mpa_managed/test_creation_images.py @@ -14,7 +14,9 @@ import asyncio import json +import sqlite3 import sys +from contextlib import closing import pytest from fastapi import FastAPI @@ -60,20 +62,17 @@ def test_creation_tos_override_requires_new_worker(tmp_path, monkeypatch): ) profile = load_profile(profile_file(tmp_path, monkeypatch)) - tos = { - "tosAccessKey": "tos-ak", - "tosSecretKey": "tos-sk", - "tosBucket": "session-output", - } + tos = {"tosBucket": "agentkit-platform-output"} with pytest.raises(ConfigurationError): with_creation_tos(profile, tos) selected = with_creation_tos( with_creation_images(profile, {"workerImage": "worker:v2"}), tos ) - assert selected.managed.worker.tos_access_key == "tos-ak" - assert selected.managed.worker.tos_secret_key == "tos-sk" - assert selected.managed.worker.tos_bucket == "session-output" + assert selected.managed.worker.tos_credential_type == "iam_role" + assert selected.managed.worker.tos_access_key == "" + assert selected.managed.worker.tos_secret_key == "" + assert selected.managed.worker.tos_bucket == "agentkit-platform-output" assert profile.managed.worker.tos_mount_enabled is False @@ -136,9 +135,7 @@ def test_authorized_config_returns_defaults_and_task_freezes_them( "region": "cn-beijing", "runtimeImage": "", "workerImage": "registry.example/worker:custom", - "tosAccessKey": "sensitive-ak", - "tosSecretKey": "sensitive-sk", - "tosBucket": "session-output", + "tosBucket": "agentkit-platform-output", } with TestClient(app) as client: config = client.get("/web/mpa-creation/config?region=cn-beijing").json() @@ -149,11 +146,17 @@ def test_authorized_config_returns_defaults_and_task_freezes_them( "runtimeImage": config["runtimeImage"], "workerImage": "registry.example/worker:custom", } - assert "sensitive-ak" not in response.text - assert "sensitive-sk" not in response.text - database = service.path.read_bytes().decode(errors="ignore") - assert "sensitive-ak" not in database - assert "sensitive-sk" not in database + task = response.json() + assert task["tosBucket"] == payload["tosBucket"] + with closing(sqlite3.connect(service.path)) as database: + row = database.execute( + "SELECT payload FROM tasks WHERE id = ?", (task["taskId"],) + ).fetchone() + assert row is not None + durable = json.loads(row[0]) + assert durable["tosBucket"] == payload["tosBucket"] + for data in (task, durable): + assert "tosAccessKey" not in data and "tosSecretKey" not in data rejected = client.post( "/web/mpa-creation/tasks", json={**payload, "workerImage": "https://repo?token=private"}, @@ -161,6 +164,91 @@ def test_authorized_config_returns_defaults_and_task_freezes_them( assert rejected.status_code == 422 and "private" not in rejected.text +@pytest.mark.parametrize("field", ["tosAccessKey", "tosSecretKey"]) +def test_stale_studio_credentials_are_rejected_without_echo_or_cloud_calls( + field, monkeypatch +): + from types import SimpleNamespace + from unittest.mock import AsyncMock, Mock + + load = Mock(side_effect=AssertionError("must reject before profile loading")) + monkeypatch.setattr(mpa_creation, "load_studio_profile", load) + service = SimpleNamespace(start=AsyncMock(), close=AsyncMock()) + app = FastAPI() + mpa_creation.mount_mpa_creation_routes( + app, owner=lambda request: "local", service=service + ) + with TestClient(app) as client: + response = client.post( + "/web/mpa-creation/tasks", + json={ + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "agent", + "region": "cn-beijing", + "tosBucket": "agentkit-platform-output", + field: "sensitive-legacy-value", + }, + ) + assert response.status_code == 422 + assert response.json() == {"detail": "Invalid MPA creation request"} + assert "sensitive-legacy-value" not in response.text + load.assert_not_called() + service.start.assert_not_called() + service.close.assert_awaited_once() + + +@pytest.mark.parametrize("openviking_mode", ["manual", "auto"]) +def test_role_bucket_preserves_dedicated_lifecycle_request( + openviking_mode, tmp_path, monkeypatch +): + from types import SimpleNamespace + from unittest.mock import AsyncMock + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + monkeypatch.setattr(mpa_creation, "RuntimeCloud", lambda **kw: SimpleNamespace()) + check = AsyncMock(return_value="test-account") + monkeypatch.setattr(mpa_creation, "check_creation_name", check) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "new-task"}) + app = FastAPI() + mpa_creation.mount_mpa_creation_routes( + app, owner=lambda request: "local", service=service + ) + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "region": "cn-beijing", + "name": "role-integration", + "maxInstance": 20, + "businessWorkspaceMode": "per-agent", + "businessDatabaseName": "aidb", + "openvikingMode": openviking_mode, + "tosBucket": "agentkit-platform-output", + } + with TestClient(app) as client: + response = client.post("/web/mpa-creation/tasks", json=payload) + assert response.status_code == 202 + call = service.start.await_args + assert call is not None + durable = call.args[1] + assert durable["maxInstance"] == 20 + assert durable["businessWorkspaceMode"] == "per-agent" + assert durable["businessDatabaseName"] == "aidb" + if openviking_mode == "auto": + assert durable["openvikingMode"] == "auto" + else: + assert "openvikingMode" not in durable + assert durable["tosBucket"] == payload["tosBucket"] + assert "tosAccessKey" not in durable and "tosSecretKey" not in durable + assert call.kwargs["tos"] == {"tosBucket": "agentkit-platform-output"} + assert call.kwargs["name_scope"] == { + "provider": "volcengine", + "account": "test-account", + "region": "cn-beijing", + } + check.assert_awaited_once() + assert check.await_args.kwargs["agent_id"] == durable["agentId"] + + def test_blank_retry_keeps_first_image_snapshot_and_runner_receives_it(tmp_path): async def run(): service = CreationTasks(tmp_path / "tasks.db") diff --git a/tests/integrations/mpa_managed/test_creation_scaling.py b/tests/integrations/mpa_managed/test_creation_scaling.py new file mode 100644 index 000000000..0166e2856 --- /dev/null +++ b/tests/integrations/mpa_managed/test_creation_scaling.py @@ -0,0 +1,245 @@ +# 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. + +"""Per-request MPA scaling survives validation, task recovery and deployment.""" + +import asyncio +import io +import json +import sys +from unittest.mock import AsyncMock + +import pytest +from fastapi import FastAPI +from fastapi.testclient import TestClient + +from frontend.server.mpa_creation import CreationRequest, mount_mpa_creation_routes +from veadk.integrations.mpa.managed.config import ConfigurationError, load_profile +from veadk.integrations.mpa.managed.tasks import CreationTasks, TaskError +from tests.integrations.mpa_managed.test_config import profile_file + + +def selected_profile(tmp_path, monkeypatch, value): + from veadk.integrations.mpa.managed.config import with_creation_scaling + + profile = load_profile( + profile_file( + tmp_path, monkeypatch, runtime={"min-instance": 1, "max-instance": 1} + ) + ) + return profile, with_creation_scaling(profile, value) + + +def test_scaling_is_optional_and_does_not_mutate_config(tmp_path, monkeypatch): + profile, selected = selected_profile(tmp_path, monkeypatch, 20) + assert selected.managed.runtime.max_instance == 20 + assert profile.managed.runtime.max_instance == 1 + from veadk.integrations.mpa.managed.config import with_creation_scaling + + assert with_creation_scaling(profile, None) is profile + + +@pytest.mark.parametrize("value", [0, -1, 1.2, True, "20", 2**53]) +def test_scaling_rejects_invalid_integer_values(tmp_path, monkeypatch, value): + with pytest.raises(ConfigurationError): + selected_profile(tmp_path, monkeypatch, value) + + +def test_scaling_rejects_below_configured_minimum(tmp_path, monkeypatch): + from veadk.integrations.mpa.managed.config import with_creation_scaling + + profile = load_profile( + profile_file( + tmp_path, monkeypatch, runtime={"min-instance": 3, "max-instance": 4} + ) + ) + with pytest.raises(ConfigurationError, match="[Mm]inimum"): + with_creation_scaling(profile, 2) + + +@pytest.mark.parametrize( + "provider,region", [("volcengine", "cn-beijing"), ("byteplus", "ap-southeast-1")] +) +def test_creation_accepts_explicit_maximum_and_keeps_legacy_payload( + tmp_path, monkeypatch, provider, region +): + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + monkeypatch.setattr(mpa_creation, "load_provider_credentials", lambda *_: None) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "fixture"}) + app = FastAPI() + mount_mpa_creation_routes( + app, owner=lambda _request: "local", service=service, provider=provider + ) + body = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "name": "test-name", + "region": region, + } + with TestClient(app) as client: + assert ( + client.post( + "/web/mpa-creation/tasks", json={**body, "maxInstance": 35} + ).status_code + == 202 + ) + call = service.start.await_args + assert call is not None + assert call.args[1]["maxInstance"] == 35 + assert client.post("/web/mpa-creation/tasks", json=body).status_code == 202 + call = service.start.await_args + assert call is not None + assert "maxInstance" not in call.args[1] + assert ( + client.post( + "/web/mpa-creation/tasks", json={**body, "maxInstance": None} + ).status_code + == 202 + ) + call = service.start.await_args + assert call is not None + assert "maxInstance" not in call.args[1] + + +@pytest.mark.parametrize("value", [0, -1, 1.2, True, "20", 2**53]) +def test_creation_schema_rejects_invalid_maximum(value): + with pytest.raises(ValueError): + CreationRequest.model_validate( + { + "requestId": "11111111-1111-4111-8111-111111111111", + "name": "test-name", + "region": "cn-beijing", + "maxInstance": value, + } + ) + + +@pytest.mark.asyncio +async def test_task_pins_and_forwards_selected_maximum(tmp_path): + tasks = CreationTasks(tmp_path / "tasks.db") + received = tmp_path / "stdin.json" + tasks.command = lambda: [ + sys.executable, + "-c", + "import json,sys,pathlib; data=json.loads(sys.stdin.read()); " + + f"pathlib.Path({str(received)!r}).write_text(json.dumps(data)); " + + "print('MPA_EVENT '+json.dumps({'error':'creationFailed'}))", + ] + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "name": "test-name", + "description": "", + "region": "cn-beijing", + "maxInstance": 35, + } + try: + task = await tasks.start("owner", payload, config_path=None, timeout=60) + await asyncio.gather(*tasks.running.values()) + assert json.loads(received.read_text())["maxInstance"] == 35 + assert tasks.get("owner", task["taskId"])["maxInstance"] == 35 + with pytest.raises(TaskError, match="different inputs"): + await tasks.start( + "owner", {**payload, "maxInstance": 20}, config_path=None, timeout=60 + ) + await tasks.start("owner", payload, config_path=None, timeout=60) + await asyncio.gather(*tasks.running.values()) + assert json.loads(received.read_text())["maxInstance"] == 35 + finally: + await tasks.close() + + +def test_runner_applies_explicit_maximum_before_provision(tmp_path, monkeypatch): + from veadk.integrations.mpa.managed import runner + + profile = load_profile( + profile_file( + tmp_path, monkeypatch, runtime={"min-instance": 1, "max-instance": 1} + ) + ) + monkeypatch.setattr(runner, "load_profile", lambda *_args, **_kwargs: profile) + monkeypatch.setattr(runner, "emit", lambda **_kwargs: None) + result = { + "runtime_id": "r-test", + "skill_space_id": "ss-test", + "gateway_id": "gw-test", + "agent_id": "mi-test", + "region": "cn-beijing", + "state": "ready", + } + provision = AsyncMock(return_value=result) + monkeypatch.setattr(runner, "provision", provision) + data = { + "config": None, + "agentId": "mi-test", + "owner": "owner", + "description": "", + "region": "cn-beijing", + "maxInstance": 35, + } + monkeypatch.setattr(sys, "stdin", io.StringIO(json.dumps(data))) + assert runner.run() == 0 + call = provision.await_args + assert call is not None + assert call.args[0].managed.runtime.max_instance == 35 + + +@pytest.mark.asyncio +async def test_selected_maximum_reaches_create_and_retry_runtime_payload( + tmp_path, monkeypatch +): + from veadk.integrations.mpa.managed.service import apply_runtime_settings + from tests.integrations.mpa_managed.test_agent_deployment import deployer, template + + _, profile = selected_profile(tmp_path, monkeypatch, 35) + svc, _, cloud, _ = deployer() + request = template() + apply_runtime_settings(request, profile.managed.runtime) + await svc.deploy(request) + await svc.deploy(request) + assert cloud.creates[0]["MaxInstance"] == 35 + assert cloud.updates[0]["MaxInstance"] == 35 + assert len(cloud.creates) == 1 + + +def test_bff_rejects_below_minimum_before_starting_task(tmp_path, monkeypatch): + from frontend.server import mpa_creation + + profile = load_profile( + profile_file( + tmp_path, monkeypatch, runtime={"min-instance": 3, "max-instance": 4} + ) + ) + monkeypatch.setattr(mpa_creation, "load_studio_profile", lambda **_kwargs: profile) + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock() + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda _request: "local", service=service) + with TestClient(app) as client: + response = client.post( + "/web/mpa-creation/tasks", + json={ + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "name": "test-name", + "region": "cn-beijing", + "maxInstance": 2, + }, + ) + assert response.status_code == 400 + service.start.assert_not_awaited() diff --git a/tests/integrations/mpa_managed/test_deletion.py b/tests/integrations/mpa_managed/test_deletion.py new file mode 100644 index 000000000..1a6f898d6 --- /dev/null +++ b/tests/integrations/mpa_managed/test_deletion.py @@ -0,0 +1,391 @@ +# 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 contracts for exclusive MPA resource cleanup.""" + +import asyncio +import copy +from unittest.mock import AsyncMock + +import pytest + +from veadk.integrations.mpa.managed.database import agent_suffix +from veadk.integrations.mpa.managed.deletion import ( + OwnedResourceCleanup, + ResourceDeletionError, +) + + +class Entry: + def __init__(self, record=None, others=()): + self.record = copy.deepcopy(record or {}) + self.others = list(others) + self.saved = [] + + async def read(self): + return copy.deepcopy(self.record) + + async def save(self, record): + self.record = copy.deepcopy(record) + self.saved.append(copy.deepcopy(record)) + + async def other_records(self): + return self.others + + +def setup(record=None, others=(), runtimes=()): + suffix = agent_suffix("account", "cn-beijing", "mi-one") + tags = [ + {"Key": "managed_by", "Value": "mpa-deployment"}, + {"Key": "mpa_agent_key", "Value": suffix}, + ] + record = ( + record + if record is not None + else { + "runtime_id": "r-one", + "worker_id": "t-one", + "worker_managed": True, + "skill_space_id": "ss-one", + "skill_space_managed": True, + } + ) + entry = Entry(record, others) + cloud = AsyncMock() + cloud.list_runtimes.return_value = list(runtimes) + cloud.get_skill_space.return_value = { + "Id": "ss-one", + "Tags": tags, + "ProjectName": "default", + } + worker = AsyncMock() + worker.get.return_value = { + "ToolId": "t-one", + "Tags": tags, + "ProjectName": "default", + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-one"}], + } + runtime = { + "RuntimeId": "r-one", + "ToolId": "t-one", + "ProjectName": "default", + "Envs": [{"Key": "SKILL_SPACE_ID", "Value": "ss-one"}], + } + cleanup = OwnedResourceCleanup( + entry=entry, + cloud=cloud, + worker=worker, + account="account", + region="cn-beijing", + agent_id="mi-one", + runtime=runtime, + ) + return cleanup, entry, cloud, worker + + +def test_exclusive_cleanup_is_ordered_and_durable(): + async def run(): + cleanup, entry, cloud, worker = setup() + events = [] + worker.delete.side_effect = lambda resource: events.append(("worker", resource)) + cloud.delete_skill_space.side_effect = lambda resource: events.append( + ("skills", resource) + ) + plan = await cleanup.preview() + assert [item["stage"] for item in plan["cleanupPlan"]] == [ + "worker_template", + "skill_space", + ] + assert [item["resourceId"] for item in plan["cleanupPlan"]] == [ + "t-one", + "ss-one", + ] + await cleanup.delete_resources() + assert events == [("worker", "t-one"), ("skills", "ss-one")] + assert entry.record["deletion"]["worker_template"] == "deleted" + assert entry.record["deletion"]["skill_space"] == "deleted" + assert entry.record["state"] == "deleting" + await cleanup.mark_runtime_deleted() + assert entry.record["state"] == "deleted" + + asyncio.run(run()) + + +@pytest.mark.parametrize("reference", ["registry", "runtime"]) +def test_shared_resources_are_preserved(reference): + async def run(): + others = ( + [{"worker_id": "t-one", "skill_space_id": "ss-one"}] + if reference == "registry" + else [] + ) + runtimes = ( + [ + { + "RuntimeId": "r-other", + "ToolId": "t-one", + "Envs": [{"Key": "SKILL_SPACE_ID", "Value": "ss-one"}], + } + ] + if reference == "runtime" + else [] + ) + cleanup, _, cloud, worker = setup(others=others, runtimes=runtimes) + plan = await cleanup.preview() + assert plan["cleanupPlan"] == [] + assert len(plan["retainedResources"]) == 2 + assert all(item["reason"] == "shared" for item in plan["retainedResources"]) + await cleanup.delete_resources() + worker.delete.assert_not_awaited() + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +def test_unregistered_resources_are_preserved(): + async def run(): + cleanup, _, cloud, worker = setup(record={}) + plan = await cleanup.preview() + assert plan["cleanupPlan"] == [] + assert all(item["reason"] == "unproven" for item in plan["retainedResources"]) + cloud.list_runtimes.assert_not_awaited() + worker.delete.assert_not_awaited() + + asyncio.run(run()) + + +def test_tag_conflict_blocks_before_any_deletion(): + async def run(): + cleanup, _, cloud, worker = setup() + cloud.get_skill_space.return_value["Tags"] = [] + with pytest.raises(ResourceDeletionError, match="ownership"): + await cleanup.delete_resources() + worker.delete.assert_not_awaited() + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +def test_partial_failure_retries_without_redeleting_completed_worker(): + async def run(): + cleanup, entry, cloud, worker = setup() + cloud.delete_skill_space.side_effect = RuntimeError( + "sensitive provider details" + ) + with pytest.raises(ResourceDeletionError, match="skill_space") as caught: + await cleanup.delete_resources() + assert "sensitive" not in str(caught.value) + assert entry.record["deletion"]["worker_template"] == "deleted" + cloud.delete_skill_space.side_effect = None + await cleanup.delete_resources() + worker.delete.assert_awaited_once() + assert entry.record["deletion"]["skill_space"] == "deleted" + + asyncio.run(run()) + + +@pytest.mark.parametrize("change", ["binding", "discovery", "pending"]) +def test_conflicts_fail_closed(change): + async def run(): + cleanup, entry, cloud, worker = setup() + if change == "binding": + entry.record["runtime_id"] = "r-other" + elif change == "pending": + entry.record["pending"] = True + else: + cloud.list_runtimes.side_effect = RuntimeError("private error") + with pytest.raises(ResourceDeletionError): + await cleanup.delete_resources() + worker.delete.assert_not_awaited() + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +@pytest.mark.parametrize("phase", ["get", "delete"]) +def test_missing_owned_resource_is_idempotent(phase): + from agentkit.toolkit.errors import ApiError + + async def run(): + cleanup, entry, cloud, worker = setup() + missing = ApiError("redacted", error_code="ResourceNotFound") + if phase == "get": + worker.get.side_effect = missing + cloud.get_skill_space.side_effect = missing + else: + worker.delete.side_effect = missing + cloud.delete_skill_space.side_effect = missing + await cleanup.delete_resources() + assert entry.record["deletion"]["worker_template"] == "deleted" + assert entry.record["deletion"]["skill_space"] == "deleted" + + asyncio.run(run()) + + +def test_references_are_rechecked_after_preview(): + async def run(): + cleanup, entry, cloud, worker = setup() + assert len((await cleanup.preview())["cleanupPlan"]) == 2 + entry.others.append({"worker_id": "t-one", "skill_space_id": "ss-one"}) + await cleanup.delete_resources() + worker.delete.assert_not_awaited() + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +def test_cancelled_cleanup_keeps_durable_intent(): + async def run(): + cleanup, entry, cloud, worker = setup() + worker.delete.side_effect = asyncio.CancelledError() + with pytest.raises(asyncio.CancelledError): + await cleanup.delete_resources() + assert entry.record["deletion"]["worker_template"] == "deleting" + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +def test_legacy_cleanup_does_not_create_or_contact_registry(monkeypatch): + from veadk.integrations.mpa.managed.deletion import owned_resource_cleanup + from unittest.mock import Mock + + factory = Mock(side_effect=AssertionError("no registry provisioning")) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.deletion.AgentDeploymentRegistry", factory + ) + + async def run(): + cloud = AsyncMock() + async with owned_resource_cleanup( + runtime={"RuntimeId": "r-legacy"}, + agent_id="mi-old", + region="cn-beijing", + cloud=cloud, + ) as cleanup: + assert (await cleanup.preview())["cleanupPlan"] == [] + await cleanup.delete_resources() + await cleanup.mark_runtime_deleted() + cloud.account_id.assert_not_awaited() + factory.assert_not_called() + + asyncio.run(run()) + + +@pytest.mark.parametrize("provider", ["volcengine", "byteplus"]) +def test_cleanup_cloud_requests_and_complete_discovery(provider): + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + from veadk.integrations.mpa.managed.worker import WorkerCloud + + async def run(): + cloud = RuntimeCloud( + region="test-region", credential_file="", provider=provider + ) + cloud.call = AsyncMock( + side_effect=[ + {"AgentKitRuntimes": [{"RuntimeId": "r-one"}], "NextToken": "next"}, + {"AgentKitRuntimes": [{"RuntimeId": "r-two"}]}, + {}, + ] + ) + cloud.get = AsyncMock( + side_effect=[ + {"RuntimeId": "r-one", "Envs": []}, + {"RuntimeId": "r-two", "ToolId": "t-one"}, + ] + ) + result = await cloud.list_runtimes() + assert result[1]["ToolId"] == "t-one" + assert cloud.call.call_args_list[1].args[1].next_token == "next" + await cloud.delete_skill_space("ss-one") + method, request = cloud.call.call_args.args + assert method == "delete_skill_space" and request.id == "ss-one" + assert cloud.call.call_args.kwargs["skills"] is True + worker = WorkerCloud(cloud) + worker.call = AsyncMock() + await worker.delete("t-one") + worker.call.assert_awaited_once_with( + "delete_tool", "DeleteToolRequest", ToolId="t-one" + ) + + asyncio.run(run()) + + +def test_changed_target_binding_blocks_cleanup(): + async def run(): + cleanup, _, cloud, worker = setup( + runtimes=[{"RuntimeId": "r-one", "ToolId": "t-replacement"}] + ) + with pytest.raises(ResourceDeletionError, match="resource_binding_conflict"): + await cleanup.delete_resources() + worker.delete.assert_not_awaited() + cloud.delete_skill_space.assert_not_awaited() + + asyncio.run(run()) + + +def test_runtime_reference_discovery_uses_bounded_parallel_reads(): + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + + async def run(): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + cloud.call = AsyncMock( + return_value={ + "AgentKitRuntimes": [{"RuntimeId": f"r-{i}"} for i in range(12)] + } + ) + active = peak = 0 + + async def get(runtime_id): + nonlocal active, peak + active += 1 + peak = max(active, peak) + await asyncio.sleep(0.001) + active -= 1 + return {"RuntimeId": runtime_id} + + cloud.get = get + records = await cloud.list_runtimes() + assert 1 < peak <= 4 + assert [r["RuntimeId"] for r in records] == [f"r-{i}" for i in range(12)] + + asyncio.run(run()) + + +def test_deletion_identity_cache_rechecks_rotated_credentials(monkeypatch): + from veadk.integrations.mpa.managed.credentials import Credentials + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + from unittest.mock import Mock + + selected = [Credentials("test-ak", "test-sk", "session-one")] + identity = Mock( + side_effect=[{"AccountId": "one"}, {"AccountId": "one"}, {"AccountId": "other"}] + ) + monkeypatch.setattr("agentkit.auth.sts.get_caller_identity", identity) + cloud = RuntimeCloud( + region="cn-beijing", + credential_file="", + credentials=lambda: selected[0], + cache_identity=True, + ) + cloud._credentials() + cloud._credentials() + assert identity.call_count == 1 + selected[0] = Credentials("test-ak", "test-sk", "session-two") + cloud._credentials() + assert identity.call_count == 2 + selected[0] = Credentials("other-ak", "other-sk", "session-three") + with pytest.raises(Exception, match="changed accounts"): + cloud._credentials() + assert identity.call_count == 3 diff --git a/tests/integrations/mpa_managed/test_deployment_database_unit.py b/tests/integrations/mpa_managed/test_deployment_database_unit.py index fecb2f1f6..87474b924 100644 --- a/tests/integrations/mpa_managed/test_deployment_database_unit.py +++ b/tests/integrations/mpa_managed/test_deployment_database_unit.py @@ -382,3 +382,85 @@ async def run(): engine.dispose.assert_awaited_once() asyncio.run(run()) + + +@pytest.mark.parametrize("nonempty", [False, True]) +def test_initial_aidb_marks_only_an_empty_owned_dedicated_database( + db_factory, nonempty +): + async def run(): + db, engine = db_factory( + row={"owner": "agent", "marker": None}, scalars=[nonempty] + ) + db.business_database_name = "aidb" + entry = Registry() + entry.row = { + "business_workspace_mode": "per-agent", + "business_workspace_id": "ws-own", + "business_database_name": "aidb", + } + if nonempty: + with pytest.raises(mod.DeploymentError): + await db.ensure(entry, account="a", region="r", agent_id="i") + assert not any(s.startswith("COMMENT") for s, _ in engine.conn.sql) + else: + assert ( + await db.ensure(entry, account="a", region="r", agent_id="i") == "aidb" + ) + assert entry.row["database_name"] == "aidb" + assert any('COMMENT ON DATABASE "aidb"' in s for s, _ in engine.conn.sql) + assert not any(s.startswith("CREATE DATABASE") for s, _ in engine.conn.sql) + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "row,extra", + [ + (None, {}), + ({"owner": "other", "marker": None}, {}), + ({"owner": "agent", "marker": "foreign"}, {}), + ({"owner": "agent", "marker": None}, {"database_ready": True}), + ({"owner": "agent", "marker": None}, {"runtime_id": "r-existing"}), + ], +) +def test_aidb_never_replaces_or_adopts_an_existing_unproven_database( + db_factory, row, extra +): + async def run(): + db, engine = db_factory(row=row) + db.business_database_name = "aidb" + entry = Registry() + entry.row = { + "business_workspace_mode": "per-agent", + "business_workspace_id": "ws-own", + "business_database_name": "aidb", + **extra, + } + with pytest.raises(mod.DeploymentError): + await db.ensure(entry, account="a", region="r", agent_id="i") + assert not any( + s.startswith(("COMMENT", "CREATE DATABASE")) for s, _ in engine.conn.sql + ) + + asyncio.run(run()) + + +def test_aidb_initialization_failure_closes_transaction_engine(db_factory): + async def run(): + db, engine = db_factory( + row={"owner": "agent", "marker": None}, scalars=[asyncio.CancelledError()] + ) + db.business_database_name = "aidb" + entry = Registry() + entry.row = { + "business_workspace_mode": "per-agent", + "business_workspace_id": "ws-own", + "business_database_name": "aidb", + } + with pytest.raises(asyncio.CancelledError): + await db.ensure(entry, account="a", region="r", agent_id="i") + engine.dispose.assert_awaited_once() + assert not entry.row.get("database_ready") + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_iam.py b/tests/integrations/mpa_managed/test_iam.py index 0320109f2..fc9ea0b7b 100644 --- a/tests/integrations/mpa_managed/test_iam.py +++ b/tests/integrations/mpa_managed/test_iam.py @@ -91,6 +91,276 @@ async def call(self, method, **params) -> dict[str, Any]: return {} +class FakeTosIAM(FakeIAM): + def __init__(self): + super().__init__() + self.role = { + "RoleName": ROLE_NAME, + "Trn": f"trn:iam::123:role/{ROLE_NAME}", + "TrustPolicyDocument": copy.deepcopy(TRUST_DOCUMENT), + } + self.policies = {} + self.checked_buckets = [] + + async def verify_tos_bucket(self, bucket): + self.checked_buckets.append(bucket) + + async def call(self, method, **params): + if method not in {"get_policy", "create_policy"}: + return await super().call(method, **params) + self.calls.append((method, params)) + if self.fail == method: + raise IamError("AccessDenied") + name = params["PolicyName"] + if method == "get_policy": + if name not in self.policies: + raise IamError("PolicyNotExist") + return {"Policy": {"PolicyDocument": copy.deepcopy(self.policies[name])}} + self.policies[name] = json.loads(params["PolicyDocument"]) + if self.race: + raise IamError("PolicyAlreadyExist") + return {} + + +@pytest.mark.asyncio +@pytest.mark.parametrize("race", [False, True]) +async def test_tos_role_grant_is_scoped_additive_and_repeatable(race): + from veadk.integrations.mpa.managed import iam + + cloud = FakeTosIAM() + cloud.race = race + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + assert cloud.checked_buckets == ["session-output"] + assert len(cloud.policies) == 1 + name, policy = next(iter(cloud.policies.items())) + assert cloud.bindings == {("unrelated", "Custom"), (name, "Custom")} + assert policy == { + "Statement": [ + { + "Effect": "Allow", + "Action": ["tos:HeadBucket", "tos:ListBucket"], + "Resource": ["trn:tos:::session-output"], + }, + { + "Effect": "Allow", + "Action": [ + "tos:GetObject", + "tos:PutObject", + "tos:AbortMultipartUpload", + "tos:DeleteObject", + ], + "Resource": ["trn:tos:::session-output/sandbox-session/*"], + }, + ] + } + cloud.calls.clear() + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + assert not any( + method.startswith(("create_", "attach_")) for method, _ in cloud.calls + ) + await iam.ensure_tos_mount_permissions( + cloud, "123", "other-output", poll_interval=0 + ) + assert len(cloud.policies) == 2 + assert cloud.policies[name] == policy + + +@pytest.mark.asyncio +@pytest.mark.parametrize("problem", ["account", "trust", "policy", "permission"]) +async def test_tos_role_grant_refuses_conflicts_without_overwriting(problem): + from veadk.integrations.mpa.managed import iam + + cloud = FakeTosIAM() + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + assert cloud.role is not None + if problem == "account": + cloud.role["Trn"] = f"trn:iam::456:role/{ROLE_NAME}" + elif problem == "trust": + cloud.role["TrustPolicyDocument"] = {"Statement": []} + elif problem == "policy": + next(iter(cloud.policies.values()))["Statement"][1]["Resource"] = ["*"] + else: + cloud.fail = "get_role" + cloud.calls.clear() + with pytest.raises(IamError): + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + assert all(method.startswith(("get_", "list_")) for method, _ in cloud.calls) + + +@pytest.mark.asyncio +async def test_tos_role_grant_waits_for_readback_and_preserves_cancellation(): + from veadk.integrations.mpa.managed import iam + + cloud = FakeTosIAM() + cloud.hidden = 3 + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + cloud.hidden = 100000 + with pytest.raises(IamError, match="iamVerificationFailed"): + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", timeout=0.01, poll_interval=0.02 + ) + task = asyncio.create_task( + iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=10 + ) + ) + await asyncio.sleep(0.01) + task.cancel() + with pytest.raises(asyncio.CancelledError): + await task + assert cloud.policies + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "method", ["get_policy", "create_policy", "attach_role_policy"] +) +async def test_tos_role_grant_propagates_provider_permission_errors(method): + from veadk.integrations.mpa.managed import iam + + cloud = FakeTosIAM() + cloud.fail = method + with pytest.raises(IamError, match="iamPermissionDenied"): + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", poll_interval=0 + ) + assert not any(name.startswith("update_") for name, _ in cloud.calls) + + +@pytest.mark.asyncio +async def test_tos_role_grant_transient_deadline_and_actual_worker_role(monkeypatch): + from veadk.integrations.mpa.managed import iam + + cloud = FakeTosIAM() + assert cloud.role is not None + cloud.role.update(RoleName="WorkerRole", Trn="trn:iam::123:role/WorkerRole") + call = cloud.call + attempts = 0 + + async def transient(method, **params): + nonlocal attempts + if method == "get_policy" and attempts == 0: + attempts += 1 + raise IamError("Throttling") + return await call(method, **params) + + cloud.call = transient + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", role_name="WorkerRole", poll_interval=0 + ) + assert attempts == 1 + assert all( + params.get("RoleName", "WorkerRole") == "WorkerRole" + for _, params in cloud.calls + ) + times = iter([0, 200]) + monkeypatch.setattr(iam, "time", SimpleNamespace(monotonic=lambda: next(times))) + cloud.hidden = 1000 + with pytest.raises(IamError, match="iamVerificationFailed"): + await iam.ensure_tos_mount_permissions( + cloud, "123", "session-output", role_name="WorkerRole", poll_interval=0 + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("bucket", ["", "*", "bad/name"]) +async def test_tos_role_grant_rejects_unsafe_names_before_cloud(bucket): + from veadk.integrations.mpa.managed import iam + from veadk.integrations.mpa.managed.config import ConfigurationError + + cloud = FakeTosIAM() + with pytest.raises((IamError, ConfigurationError)): + await iam.ensure_tos_mount_permissions(cloud, "123", bucket) + assert not cloud.calls and not cloud.checked_buckets + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "scenario", + [ + "owned", + "region", + "missing", + "permission", + "unknown", + "constructor", + "credentials", + ], +) +async def test_tos_bucket_check_uses_fresh_credentials_and_closes_client( + monkeypatch, scenario +): + import tos + + calls = [] + closed = [] + + def credentials(): + calls.append("credentials") + if scenario == "credentials": + raise RuntimeError("private-token") + return SimpleNamespace( + access_key_id="test-ak", + secret_access_key="test-sk", + session_token="test-token", + ) + + class Client: + def __init__(self, *args, **kwargs): + calls.append((args, kwargs)) + if scenario == "constructor": + raise RuntimeError("private-token") + + def list_buckets(self): + if scenario in {"permission", "unknown"}: + raise RuntimeError( + "AccessDenied private-token" + if scenario == "permission" + else "private-token" + ) + return SimpleNamespace( + buckets=[] + if scenario == "missing" + else [ + SimpleNamespace( + name="session-output", + location="other-region" + if scenario == "region" + else "cn-beijing", + ) + ] + ) + + def close(self): + closed.append(True) + + monkeypatch.setattr(tos, "TosClientV2", Client) + cloud = IamCloud(SimpleNamespace(region="cn-beijing", _credentials=credentials)) + if scenario == "owned": + await cloud.verify_tos_bucket("session-output") + await cloud.verify_tos_bucket("session-output") + assert calls.count("credentials") == 2 + assert closed == [True, True] + assert calls[1][1]["security_token"] == "test-token" + else: + with pytest.raises(IamError) as caught: + await cloud.verify_tos_bucket("session-output") + assert "private-token" not in str(caught.value) + if scenario in {"region", "missing"}: + assert caught.value.key == "tosBucketUnavailable" + assert bool(closed) == (scenario not in {"constructor", "credentials"}) + + @pytest.mark.asyncio @pytest.mark.parametrize("race", [False, True]) async def test_new_role_and_policy_converge_and_retry_is_additive(race): @@ -168,7 +438,7 @@ async def test_permission_error_does_not_trigger_create(): async def test_readback_timeout_and_cancellation_keep_resources(): cloud = FakeIAM() cloud.hidden = 100000 - with pytest.raises(IamError, match="iamVerificationFailed"): + with pytest.raises(IamError, match="iamTemporaryFailure"): await ensure_runtime_role(cloud, "123", timeout=0.01, poll_interval=0.02) assert cloud.role and cloud.policy task = asyncio.create_task(ensure_runtime_role(cloud, "123", poll_interval=10)) diff --git a/tests/integrations/mpa_managed/test_iam_retry.py b/tests/integrations/mpa_managed/test_iam_retry.py new file mode 100644 index 000000000..880b14d82 --- /dev/null +++ b/tests/integrations/mpa_managed/test_iam_retry.py @@ -0,0 +1,346 @@ +# 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. + +"""IAM transient recovery without real cloud calls.""" + +import asyncio +import json +import sqlite3 +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest +import requests + +from veadk.integrations.mpa.managed import iam +from veadk.integrations.mpa.managed.diagnostics import ( + diagnostic_scope, + validate_diagnostic, +) +from veadk.integrations.mpa.managed.tasks import CreationTasks +from tests.integrations.mpa_managed.test_iam import FakeIAM + +REQUEST_ID = "20261014064128489F845912CDFFF9B5DB" + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "category", ["timeout", "connection", "throttled", "unavailable"] +) +async def test_transient_reconciliation_retries_and_keeps_safe_diagnostics( + monkeypatch, category +): + cloud = FakeIAM() + await iam.ensure_runtime_role(cloud, "123", poll_interval=0) + original = cloud.call + attempts = 0 + + async def call(method, **params): + nonlocal attempts + if method == "get_role": + attempts += 1 + if attempts < 3: + raise iam.IamError( + category=category, operation=method, request_id=REQUEST_ID + ) + return await original(method, **params) + + cloud.call = call + delay = AsyncMock() + monkeypatch.setattr(iam.asyncio, "sleep", delay) + events = [] + with diagnostic_scope(events.append): + await iam.ensure_runtime_role(cloud, "123") + assert attempts == 4 # Two failed reads followed by initial/final readback. + assert [x.args[0] for x in delay.await_args_list] == [1, 2] + assert events == [ + dict( + operation="iam_get_role", + category=category, + attempt=i, + outcome="retrying", + requestId=REQUEST_ID, + ) + for i in [1, 2] + ] + + +@pytest.mark.asyncio +async def test_transient_exhaustion_stops_at_four_attempts(monkeypatch): + cloud = FakeIAM() + calls = [] + + async def call(method, **params): + calls.append(method) + raise iam.IamError(category="timeout", operation=method, request_id=REQUEST_ID) + + cloud.call = call + delay = AsyncMock() + monkeypatch.setattr(iam.asyncio, "sleep", delay) + events = [] + with ( + diagnostic_scope(events.append), + pytest.raises(iam.IamError, match="iamTemporaryFailure"), + ): + await iam.ensure_runtime_role(cloud, "123") + assert calls == ["get_role"] * 4 + assert [x.args[0] for x in delay.await_args_list] == [1, 2, 4] + assert events[-1]["outcome"] == "failed" and events[-1]["attempt"] == 4 + + +@pytest.mark.asyncio +async def test_lost_create_response_reads_existing_role_before_retry(monkeypatch): + cloud = FakeIAM() + original = cloud.call + lost = False + + async def call(method, **params): + nonlocal lost + result = await original(method, **params) + if method == "create_role" and not lost: + lost = True + raise iam.IamError(category="connection", operation=method) + return result + + cloud.call = call + monkeypatch.setattr(iam.asyncio, "sleep", AsyncMock()) + await iam.ensure_runtime_role(cloud, "123") + assert len([m for m, _ in cloud.calls if m == "create_role"]) == 1 + assert cloud.role and cloud.policy + + +@pytest.mark.asyncio +@pytest.mark.parametrize("code", ["AccessDenied", "UnexpectedPrivateError"]) +async def test_permanent_and_unknown_errors_do_not_retry(monkeypatch, code): + cloud = FakeIAM() + call = AsyncMock( + side_effect=iam.IamError(code, operation="get_role", request_id=REQUEST_ID) + ) + cloud.call = call + delay = AsyncMock() + monkeypatch.setattr(iam.asyncio, "sleep", delay) + events = [] + with diagnostic_scope(events.append), pytest.raises(iam.IamError) as error: + await iam.ensure_runtime_role(cloud, "123") + assert error.value.key == ( + "iamPermissionDenied" if code == "AccessDenied" else "iamVerificationFailed" + ) + call.assert_awaited_once() + delay.assert_not_awaited() + assert events[-1]["requestId"] == REQUEST_ID + + +@pytest.mark.asyncio +async def test_deadline_is_temporary_and_cancellation_dispatches_no_more_calls(): + cloud = FakeIAM() + + async def slow(method, **params): + await asyncio.sleep(10) + + call = AsyncMock(side_effect=slow) + cloud.call = call + with pytest.raises(iam.IamError, match="iamTemporaryFailure"): + await iam.ensure_runtime_role(cloud, "123", timeout=0.01) + task = asyncio.create_task(iam.ensure_runtime_role(cloud, "123")) + await asyncio.sleep(0.01) + task.cancel() + with pytest.raises(asyncio.CancelledError): + await task + count = call.await_count + await asyncio.sleep(0.01) + assert call.await_count == count + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "problem,category", + [ + (requests.Timeout("private-token"), "timeout"), + (requests.ConnectionError("private-token"), "connection"), + ( + Exception( + json.dumps( + { + "ResponseMetadata": { + "RequestId": REQUEST_ID, + "Error": {"Code": "Throttling", "Message": "private-token"}, + } + } + ) + ), + "throttled", + ), + ], +) +async def test_sdk_retains_safe_category_and_request_id(monkeypatch, problem, category): + from volcengine.iam.IamService import IamService + + monkeypatch.setattr(IamService, "__init__", lambda self: None) + for setter in [ + "set_ak", + "set_sk", + "set_session_token", + "set_scheme", + "set_connection_timeout", + "set_socket_timeout", + ]: + monkeypatch.setattr(IamService, setter, lambda self, value: None) + + def fail(self, params): + raise problem + + monkeypatch.setattr(IamService, "get_role", fail) + source = SimpleNamespace( + _credentials=lambda: SimpleNamespace( + access_key_id="test", secret_access_key="test", session_token="test" + ) + ) + with pytest.raises(iam.IamError) as error: + await iam.IamCloud(source).call("get_role", RoleName=iam.ROLE_NAME) + assert error.value.category == category + assert error.value.operation == "iam_get_role" + assert error.value.request_id == (REQUEST_ID if category == "throttled" else "") + assert "private-token" not in str(error.value) + + +def test_diagnostics_migrate_request_id_and_drop_untrusted_values(tmp_path, caplog): + path = tmp_path / "tasks.sqlite3" + with sqlite3.connect(path) as db: + db.execute( + "CREATE TABLE task_diagnostics (id INTEGER PRIMARY KEY, task_id TEXT NOT NULL, stage TEXT NOT NULL, operation TEXT NOT NULL, category TEXT NOT NULL, attempt INTEGER NOT NULL, outcome TEXT NOT NULL, created REAL NOT NULL)" + ) + db.execute( + "INSERT INTO task_diagnostics VALUES (1,'old-task','worker','get_worker','timeout',1,'failed',0)" + ) + tasks = CreationTasks(path) + with tasks.db() as db: + db.execute( + "INSERT INTO tasks(id,owner,request,payload,state,stage,supervisor,updated) VALUES ('test-task','owner','request','{}','failed','iam_role',0,0)" + ) + assert ( + db.execute("SELECT request_id FROM task_diagnostics WHERE id=1").fetchone()[ + 0 + ] + == "" + ) + base = dict( + operation="iam_get_role", category="timeout", attempt=1, outcome="failed" + ) + tasks.record_diagnostic("test-task", dict(base, requestId=REQUEST_ID)) + tasks.record_diagnostic("test-task", dict(base, requestId="private-token\nsecret")) + with tasks.db() as db: + rows = db.execute( + "SELECT request_id FROM task_diagnostics WHERE task_id='test-task' ORDER BY id" + ).fetchall() + assert [r[0] for r in rows] == [REQUEST_ID, ""] + assert "private-token" not in caplog.text + assert validate_diagnostic(dict(base, requestId="private-token")) == base + assert ( + validate_diagnostic( + dict( + operation="get_worker", category="timeout", attempt=1, outcome="failed" + ) + ) + is not None + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "status,category", + [ + (429, "throttled"), + (500, "unavailable"), + (503, "unavailable"), + (403, "permission"), + ], +) +async def test_http_status_is_classified_with_request_id(monkeypatch, status, category): + from volcengine.iam.IamService import IamService + + response = requests.Response() + response.status_code = status + response._content = json.dumps( + {"ResponseMetadata": {"RequestId": REQUEST_ID}} + ).encode() + problem = requests.HTTPError("private-provider-message", response=response) + monkeypatch.setattr(IamService, "__init__", lambda self: None) + for setter in [ + "set_ak", + "set_sk", + "set_session_token", + "set_scheme", + "set_connection_timeout", + "set_socket_timeout", + ]: + monkeypatch.setattr(IamService, setter, lambda self, value: None) + + def fail(self, params): + raise problem + + monkeypatch.setattr(IamService, "get_role", fail) + source = SimpleNamespace( + _credentials=lambda: SimpleNamespace( + access_key_id="test", secret_access_key="test", session_token="test" + ) + ) + with pytest.raises(iam.IamError) as error: + await iam.IamCloud(source).call("get_role", RoleName=iam.ROLE_NAME) + assert error.value.category == category + assert error.value.request_id == REQUEST_ID + assert "private-provider-message" not in str(error.value) + + +@pytest.mark.asyncio +async def test_cancelled_sdk_thread_does_not_dispatch_later_requests(monkeypatch): + import threading + from volcengine.iam.IamService import IamService + + started, release, finished = threading.Event(), threading.Event(), threading.Event() + calls = [] + monkeypatch.setattr(IamService, "__init__", lambda self: None) + for setter in [ + "set_ak", + "set_sk", + "set_session_token", + "set_scheme", + "set_connection_timeout", + "set_socket_timeout", + ]: + monkeypatch.setattr(IamService, setter, lambda self, value: None) + + def late(self, params): + calls.append("get_role") + started.set() + release.wait(2) + finished.set() + return {"Result": {}} + + monkeypatch.setattr(IamService, "get_role", late) + source = SimpleNamespace( + _credentials=lambda: SimpleNamespace( + access_key_id="test", secret_access_key="test", session_token="test" + ) + ) + task = asyncio.create_task(iam.ensure_runtime_role(iam.IamCloud(source), "123")) + try: + assert await asyncio.to_thread(started.wait, 2) + task.cancel() + with pytest.raises(asyncio.CancelledError): + await task + finally: + release.set() + assert await asyncio.to_thread(finished.wait, 2) + await asyncio.sleep(0) + assert calls == ["get_role"] diff --git a/tests/integrations/mpa_managed/test_name_preflight.py b/tests/integrations/mpa_managed/test_name_preflight.py new file mode 100644 index 000000000..256f2a5ad --- /dev/null +++ b/tests/integrations/mpa_managed/test_name_preflight.py @@ -0,0 +1,395 @@ +# 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 name preflight, account scope and retry ownership contracts.""" + +from dataclasses import replace +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest + +from tests.integrations.mpa_managed.test_auto_pg import recovery_setup +from veadk.integrations.mpa.managed.database import agent_suffix + + +def setup(tmp_path, monkeypatch): + from veadk.integrations.mpa.managed import names + + profile, _, _, _ = recovery_setup(tmp_path, monkeypatch) + assert profile.managed.postgres is not None + profile.managed.postgres = profile.managed.postgres.model_copy( + update={ + "business_workspace_mode": "per-agent", + "business_database_name": "aidb", + } + ) + runtime = SimpleNamespace( + account_id=AsyncMock(return_value="account"), + find_runtimes=AsyncMock(return_value=[]), + get=AsyncMock(), + _credentials=lambda: None, + ) + worker = SimpleNamespace(find=AsyncMock(return_value=[]), get=AsyncMock()) + pg = SimpleNamespace(find=AsyncMock(return_value=[])) + monkeypatch.setattr(names, "WorkerCloud", lambda *_: worker) + monkeypatch.setattr(names, "PGCloud", lambda **kw: pg) + return names, profile, runtime, worker, pg + + +@pytest.mark.asyncio +@pytest.mark.parametrize("kind", ["runtime", "worker", "workspace"]) +async def test_foreign_name_collision_blocks_before_writes(tmp_path, monkeypatch, kind): + names, profile, runtime, worker, pg = setup(tmp_path, monkeypatch) + if kind == "runtime": + runtime.find_runtimes.return_value = [ + {"RuntimeId": "r-foreign", "Name": "test-name"} + ] + runtime.get.return_value = {"Envs": [{"Key": "MPA_AGENT_ID", "Value": "other"}]} + elif kind == "worker": + worker.find.return_value = [{"ToolId": "t-other"}] + worker.get.return_value = {"Envs": [{"Key": "MPA_AGENT_ID", "Value": "other"}]} + else: + pg.find.return_value = [{"workspace_tags": []}] + with pytest.raises(names.NameCheckError) as caught: + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + assert caught.value.key == "runtimeNameTaken" + + +@pytest.mark.asyncio +async def test_verified_own_runtime_and_worker_allow_retry(tmp_path, monkeypatch): + names, profile, runtime, worker, _ = setup(tmp_path, monkeypatch) + runtime.find_runtimes.return_value = [{"RuntimeId": "r-own", "Name": "test-name"}] + runtime.get.return_value = { + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + "Tags": [{"Key": "veadk:owner", "Value": "local"}], + } + worker.find.return_value = [{"ToolId": "t-own"}] + worker.get.return_value = { + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + "Tags": [ + {"Key": "managed_by", "Value": "mpa-deployment"}, + { + "Key": "mpa_agent_key", + "Value": agent_suffix("account", profile.region, "mi-test"), + }, + ], + } + assert ( + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + == "account" + ) + + +@pytest.mark.asyncio +async def test_worker_with_matching_env_but_foreign_managed_tag_blocks_retry( + tmp_path, monkeypatch +): + names, profile, runtime, worker, _ = setup(tmp_path, monkeypatch) + worker.find.return_value = [{"ToolId": "t-foreign"}] + worker.get.return_value = { + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + "Tags": [ + {"Key": "managed_by", "Value": "mpa-deployment"}, + {"Key": "mpa_agent_key", "Value": "foreign"}, + ], + } + with pytest.raises(names.NameCheckError) as caught: + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + assert caught.value.key == "runtimeNameTaken" + + +@pytest.mark.asyncio +async def test_query_failure_is_not_available_or_secret_output(tmp_path, monkeypatch): + names, profile, runtime, _, _ = setup(tmp_path, monkeypatch) + runtime.find_runtimes.side_effect = RuntimeError("private credential") + with pytest.raises(names.NameCheckError) as caught: + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + assert caught.value.key == "runtimeNameCheckFailed" + assert "private" not in str(caught.value) + + +@pytest.mark.asyncio +async def test_runtime_lookup_does_not_expand_unrelated_details(monkeypatch): + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + cloud.call = AsyncMock( + side_effect=[ + { + "AgentKitRuntimes": [{"RuntimeId": "r-1", "Name": "other"}], + "NextToken": "next", + }, + {"AgentKitRuntimes": [{"RuntimeId": "r-2", "Name": "match"}]}, + ] + ) + cloud.get = AsyncMock(side_effect=AssertionError("Must not expand details")) + assert await cloud.find_runtimes("match") == [{"RuntimeId": "r-2", "Name": "match"}] + + +@pytest.mark.asyncio +async def test_runtime_name_pagination_repeated_token_fails_closed(): + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + from veadk.integrations.mpa.managed.database import DeploymentError + + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + cloud.call = AsyncMock(return_value={"AgentKitRuntimes": [], "NextToken": "repeat"}) + with pytest.raises(DeploymentError): + await cloud.find_runtimes("name") + assert cloud.call.await_count == 2 + + +@pytest.mark.asyncio +async def test_verified_own_workspace_can_be_reused(tmp_path, monkeypatch): + from veadk.integrations.mpa.managed.pg_bootstrap import agent_business_scope + from tests.integrations.mpa_managed.test_auto_pg import workspace + + names, profile, runtime, _, pg = setup(tmp_path, monkeypatch) + pg.find.return_value = [ + { + **workspace("mpa_agent_test-name", "ws-own"), + "workspace_tags": [ + { + "key": "veadk-pg-scope", + "value": agent_business_scope( + "account", profile.region, "default", "mi-test" + ), + }, + {"key": "veadk-pg-purpose", "value": "business"}, + {"key": "veadk-pg-database", "value": "aidb"}, + ], + } + ] + assert ( + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + == "account" + ) + + +@pytest.mark.asyncio +async def test_creation_account_snapshot_is_checked_before_prerequisites( + tmp_path, monkeypatch +): + from veadk.integrations.mpa.managed import service + from veadk.integrations.mpa.managed.database import DeploymentError + + profile, _, _, _ = recovery_setup(tmp_path, monkeypatch) + cloud = SimpleNamespace(account_id=AsyncMock(return_value="changed-account")) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + identity = AsyncMock() + monkeypatch.setattr(service, "ensure_workload_identity", identity) + with pytest.raises(DeploymentError, match="account snapshot"): + await service.provision( + profile, + agent_id="mi-test", + owner="local", + expected_account="original-account", + ) + identity.assert_not_awaited() + + +@pytest.mark.asyncio +@pytest.mark.parametrize("provider", ["volcengine", "byteplus"]) +async def test_sdk_runtime_list_tags_allow_retry_when_detail_omits_tags( + tmp_path, monkeypatch, provider +): + from agentkit.sdk.runtime.types import GetRuntimeResponse + + names, profile, runtime, _, _ = setup(tmp_path, monkeypatch) + profile = replace(profile, values={**profile.values, "cloud_provider": provider}) + runtime.find_runtimes.return_value = [ + { + "RuntimeId": "r-own", + "Name": "test-name", + "Tags": [ + {"Key": "veadk:owner", "Value": "local"}, + {"Key": "veadk:mpa-instance-id", "Value": "mi-test"}, + ], + } + ] + runtime.get.return_value = GetRuntimeResponse.model_validate( + {"RuntimeId": "r-own", "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}]} + ).model_dump(by_alias=True, exclude_none=True) + assert "Tags" not in runtime.get.return_value + assert ( + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + == "account" + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "tag_key,wrong", + [("veadk:owner", "foreign"), ("veadk:mpa-instance-id", "mi-foreign")], +) +@pytest.mark.parametrize("source", ["list", "detail"]) +async def test_runtime_ownership_contradiction_never_hides_in_other_response( + tmp_path, monkeypatch, tag_key, wrong, source +): + names, profile, runtime, _, _ = setup(tmp_path, monkeypatch) + own = {"veadk:owner": "local", "veadk:mpa-instance-id": "mi-test"} + other = {**own, tag_key: wrong} + listing, detail = (other, own) if source == "list" else (own, other) + runtime.find_runtimes.return_value = [ + { + "RuntimeId": "r-own", + "Tags": [{"Key": k, "Value": v} for k, v in listing.items()], + } + ] + runtime.get.return_value = { + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + "Tags": [{"Key": k, "Value": v} for k, v in detail.items()], + } + with pytest.raises(names.NameCheckError, match="runtimeNameTaken"): + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "managed,agent_tag", + [ + (None, None), + ("other", "own"), + ("mpa-deployment", "foreign"), + ("mpa-deployment", None), + ], +) +async def test_worker_requires_creation_tags_not_a_legacy_agent_id_tag( + tmp_path, monkeypatch, managed, agent_tag +): + names, profile, runtime, worker, _ = setup(tmp_path, monkeypatch) + worker.find.return_value = [{"ToolId": "t-existing"}] + labels = {"MPA_AGENT_ID": "mi-test"} + if managed is not None: + labels["managed_by"] = managed + if agent_tag is not None: + labels["mpa_agent_key"] = agent_suffix( + "account", profile.region, "mi-test" if agent_tag == "own" else "mi-foreign" + ) + worker.get.return_value = { + "Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}], + "Tags": [{"Key": k, "Value": v} for k, v in labels.items()], + } + with pytest.raises(names.NameCheckError, match="runtimeNameTaken"): + await names.check_creation_name( + profile, runtime, agent_id="mi-test", name="test-name", owner="local" + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "scope_account,expected", [("account", True), ("foreign", False), ("", False)] +) +async def test_missing_runtime_owner_needs_verified_original_creation_account( + tmp_path, monkeypatch, scope_account, expected +): + names, profile, runtime, _, _ = setup(tmp_path, monkeypatch) + runtime.find_runtimes.return_value = [{"RuntimeId": "r-own", "Name": "test-name"}] + runtime.get.return_value = {"Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}]} + if expected: + assert ( + await names.check_creation_name( + profile, + runtime, + agent_id="mi-test", + name="test-name", + owner="local", + verified_creation_account=scope_account, + ) + == "account" + ) + else: + with pytest.raises(names.NameCheckError): + await names.check_creation_name( + profile, + runtime, + agent_id="mi-test", + name="test-name", + owner="local", + verified_creation_account=scope_account, + ) + + +@pytest.mark.asyncio +async def test_verified_creation_account_never_overrides_foreign_runtime_owner( + tmp_path, monkeypatch +): + names, profile, runtime, _, _ = setup(tmp_path, monkeypatch) + runtime.find_runtimes.return_value = [ + {"RuntimeId": "r-other", "Tags": [{"Key": "veadk:owner", "Value": "foreign"}]} + ] + runtime.get.return_value = {"Envs": [{"Key": "MPA_AGENT_ID", "Value": "mi-test"}]} + with pytest.raises(names.NameCheckError, match="runtimeNameTaken"): + await names.check_creation_name( + profile, + runtime, + agent_id="mi-test", + name="test-name", + owner="local", + verified_creation_account="account", + ) + + +def test_saved_name_scope_requires_owner_and_identical_secret_free_inputs(tmp_path): + import json + import time + from veadk.integrations.mpa.managed.tasks import CreationTasks, TaskError + + tasks = CreationTasks(tmp_path / "tasks.db") + payload = { + "requestId": "original-request", + "name": "test-name", + "agentId": "mi-test", + "region": "ap-southeast-1", + "provider": "byteplus", + "description": "", + } + scope = {"provider": "byteplus", "account": "account", "region": "ap-southeast-1"} + with tasks.db() as db: + db.execute( + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,name_scope) VALUES (?,?,?,?,?,?,?,?,?)", + ( + "original-task", + "owner", + payload["requestId"], + json.dumps(payload, sort_keys=True), + "failed", + "verifying", + 0, + time.time(), + json.dumps(scope), + ), + ) + assert tasks.name_scope_for_request("owner", payload) == scope + assert tasks.name_scope_for_request("other-owner", payload) is None + assert ( + tasks.name_scope_for_request("owner", {**payload, "requestId": "new-request"}) + is None + ) + with pytest.raises(TaskError, match="different inputs"): + tasks.name_scope_for_request("owner", {**payload, "description": "changed"}) diff --git a/tests/integrations/mpa_managed/test_openviking.py b/tests/integrations/mpa_managed/test_openviking.py new file mode 100644 index 000000000..d0bc1b440 --- /dev/null +++ b/tests/integrations/mpa_managed/test_openviking.py @@ -0,0 +1,395 @@ +# 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. + +import asyncio +import copy +import json +from unittest.mock import AsyncMock, Mock +from types import SimpleNamespace + +import pytest + +from veadk.integrations.mpa.managed.database import agent_suffix +from veadk.integrations.mpa.managed.openviking import ( + OpenVikingCloud, + OpenVikingError, + ensure_openviking, +) + + +class Entry: + def __init__(self): + self.record = {} + + async def read(self): + return copy.deepcopy(self.record) + + async def save(self, record): + self.record = copy.deepcopy(record) + + +def setup(): + entry = Entry() + suffix = agent_suffix("account", "cn-beijing", "mi-test") + row = { + "ResourceID": "ov-test", + "Name": "mpa_ov_" + suffix, + "Description": "mpa-openviking:v1:" + suffix, + "Project": "default", + "Version": "enterprise", + "Status": "READY", + "VLM": { + "ModelName": "doubao-seed-2-0-lite", + "ModelVersion": "260428", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "doubao-seed-2-0-lite-260428"} + ], + }, + "Embedding": { + "ModelName": "doubao-embedding-vision", + "ModelVersion": "251215", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "doubao-embedding-vision-251215"} + ], + }, + } + cloud = Mock() + cloud.create = AsyncMock(return_value="ov-test") + cloud.get = AsyncMock(return_value=row) + cloud.api_key = AsyncMock(return_value="private-test-ov-key") + return entry, cloud, row + + +async def ensure(entry, cloud, **kwargs): + return await ensure_openviking( + entry, + cloud, + account="account", + region="cn-beijing", + agent_id="mi-test", + timeout=10, + model_api_key=kwargs.pop("model_api_key", "private-test-ark-key"), + **kwargs, + ) + + +def test_creation_injects_key_without_persisting_it_and_reuses_library(): + async def run(): + entry, cloud, _ = setup() + stages = [] + env = await ensure(entry, cloud, progress=stages.append) + assert env == { + "OPENVIKING_URL": "https://api.vikingdb.cn-beijing.volces.com/openviking", + "OPENVIKING_RESOURCE_ID": "ov-test", + "OPENVIKING_API_KEY": "private-test-ov-key", + "OPENVIKING_USER": "default", + } + request = cloud.create.await_args.args[0] + assert request["Version"] == "enterprise" + assert request["VLM"] == { + "ModelName": "doubao-seed-2.0-lite", + "ModelVersion": "260428", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "doubao-seed-2-0-lite-260428"} + ], + } + assert request["Embedding"]["Credentials"] == [ + {"Source": "volcengine", "EndpointID": "doubao-embedding-vision-251215"} + ] + assert cloud.create.await_args.kwargs["model_api_key"] == "private-test-ark-key" + assert "private-test-ark-key" not in json.dumps(entry.record) + assert "private-test-ov-key" not in json.dumps(entry.record) + assert entry.record["openviking_id"] == "ov-test" + assert "openviking" in stages and "openviking_key" in stages + assert await ensure(entry, cloud) == env + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "change", + [ + {"Status": "FAILED"}, + {"Status": "UNKNOWN"}, + {"ResourceID": "ov-other"}, + {"Project": "other"}, + {"Description": "unowned"}, + {"Name": "collision"}, + {"VLM": {"ModelName": "unrelated", "ModelVersion": "260428"}}, + ], +) +def test_invalid_library_never_reaches_key_or_runtime(change): + async def run(): + entry, cloud, row = setup() + row.update(change) + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + cloud.api_key.assert_not_awaited() + assert entry.record["openviking_id"] == "ov-test" + + asyncio.run(run()) + + +def test_ambiguous_create_blocks_duplicate_retry(): + async def run(): + entry, cloud, _ = setup() + cloud.create.side_effect = TimeoutError("provider secret in exception") + with pytest.raises(OpenVikingError) as error: + await ensure(entry, cloud) + assert error.value.key == "openvikingCreateUnknown" + assert "secret" not in str(error.value) + cloud.create.side_effect = None + with pytest.raises(OpenVikingError) as retry: + await ensure(entry, cloud) + assert retry.value.key == "openvikingCreateUnknown" + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +def test_proven_rejection_allows_retry_without_default_model_fallback(): + async def run(): + entry, cloud, _ = setup() + cloud.create.side_effect = OpenVikingError( + "openvikingModelConfigurationRejected", category="invalid_request" + ) + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + assert not entry.record["openviking_create_requested"] + cloud.create.side_effect = None + await ensure(entry, cloud) + assert cloud.create.await_count == 2 + + asyncio.run(run()) + + +def test_cancellation_retains_binding_and_stops_key_read(): + async def run(): + entry, cloud, _ = setup() + cloud.get.side_effect = asyncio.CancelledError() + with pytest.raises(asyncio.CancelledError): + await ensure(entry, cloud) + assert entry.record["openviking_id"] == "ov-test" + cloud.api_key.assert_not_awaited() + cloud.get.side_effect = None + await ensure(entry, cloud) + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +def test_poll_waits_for_ready_and_times_out_without_reading_key(monkeypatch): + async def run(): + entry, cloud, row = setup() + cloud.get.side_effect = [{**row, "Status": "INIT"}, row] + sleep = AsyncMock() + monkeypatch.setattr( + "veadk.integrations.mpa.managed.openviking.asyncio.sleep", sleep + ) + await ensure(entry, cloud) + sleep.assert_awaited_once() + cloud.get.side_effect = None + cloud.get.return_value = {**row, "Status": "INIT"} + cloud.api_key.reset_mock() + clock = Mock(side_effect=[0, 11]) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.openviking.time", + SimpleNamespace(monotonic=clock), + ) + with pytest.raises(OpenVikingError) as error: + await ensure(entry, cloud) + assert error.value.key == "openvikingNotReady" + cloud.api_key.assert_not_awaited() + + asyncio.run(run()) + + +def test_deleted_agent_never_creates_library(): + async def run(): + entry, cloud, _ = setup() + entry.record["state"] = "deleted" + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + cloud.create.assert_not_awaited() + + asyncio.run(run()) + + +def test_adapter_uses_current_sts_and_safe_errors(monkeypatch): + from veadk.integrations.mpa.managed.credentials import Credentials + + async def run(): + source = Mock() + source.provider = "volcengine" + source.region = "cn-beijing" + source._credentials.return_value = Credentials( + "test-ak", "test-sk", "test-session" + ) + signed = Mock( + return_value={"Result": {"ResourceID": "ov-test", "Success": True}} + ) + monkeypatch.setattr( + "veadk.utils.volcengine_sign.volcengine_signed_request", + signed, + ) + cloud = OpenVikingCloud(source) + assert ( + await cloud.create( + { + "Name": "mpa_test", + "VLM": { + "Credentials": [ + {"Source": "volcengine", "EndpointID": "model-vlm"} + ] + }, + "Embedding": { + "Credentials": [ + {"Source": "volcengine", "EndpointID": "model-embedding"} + ] + }, + }, + model_api_key="private-test-ark-key", + ) + == "ov-test" + ) + assert ( + signed.call_args.kwargs["host"] == "vikingdb.cn-beijing.volcengineapi.com" + ) + assert signed.call_args.kwargs["header"]["X-Security-Token"] == "test-session" + signed.return_value = { + "ResponseMetadata": { + "Error": {"Code": "AccessDenied", "Message": "private-provider-key"} + } + } + with pytest.raises(OpenVikingError) as error: + await cloud.api_key("ov-test") + assert error.value.key == "openvikingPermissionDenied" + assert "private-provider-key" not in str(error.value) + signed.return_value = {"Result": {"ApiKey": "***"}} + with pytest.raises(OpenVikingError): + await cloud.api_key("ov-test") + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "provider,region", [("byteplus", "cn-beijing"), ("volcengine", "cn-shanghai")] +) +def test_adapter_rejects_unsupported_scope(provider, region): + with pytest.raises(OpenVikingError): + OpenVikingCloud(Mock(provider=provider, region=region)) + + +@pytest.mark.parametrize("key", ["", "***", "", "has space", None]) +def test_invalid_model_key_never_dispatches_or_records_intent(key): + async def run(): + entry, cloud, _ = setup() + with pytest.raises(OpenVikingError): + await ensure(entry, cloud, model_api_key=key) + cloud.create.assert_not_awaited() + assert entry.record == {} + + asyncio.run(run()) + + +def test_wire_key_is_added_only_to_copy_and_never_to_intent(monkeypatch): + async def run(): + entry, cloud, _ = setup() + await ensure(entry, cloud) + request = copy.deepcopy(entry.record["openviking_request"]) + saved = copy.deepcopy(request) + source = Mock(provider="volcengine", region="cn-beijing") + source._credentials.return_value = SimpleNamespace( + access_key_id="test-ak", + secret_access_key="test-sk", + session_token="test-token", + ) + signed = Mock( + return_value={"Result": {"ResourceID": "ov-test", "Success": True}} + ) + monkeypatch.setattr( + "veadk.utils.volcengine_sign.volcengine_signed_request", + signed, + ) + await OpenVikingCloud(source).create( + request, model_api_key="private-test-ark-key" + ) + assert request == saved + for field in ("VLM", "Embedding"): + credentials = signed.call_args.kwargs["request_body"][field]["Credentials"] + assert credentials[0]["ApiKey"] == "private-test-ark-key" + assert credentials[0]["Source"] == "volcengine" + assert "private-test-ark-key" not in json.dumps(entry.record) + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "requested,ident,pending,changed,allowed", + [ + (False, "", False, False, True), + (True, "", False, False, False), + (None, "", False, False, False), + (False, "ov-registered", False, False, False), + (False, "", True, False, False), + (False, "", False, True, False), + ], +) +def test_only_proven_rejected_legacy_intent_can_be_upgraded( + requested, ident, pending, changed, allowed +): + async def run(): + entry, cloud, row = setup() + old = { + k: copy.deepcopy(v) + for k, v in row.items() + if k not in ("ResourceID", "Status") + } + old["VLM"]["ModelName"] = "doubao-seed-2.0-lite" + for field in ("VLM", "Embedding"): + old[field].pop("Credentials") + if changed: + old["Project"] = "other" + entry.record = { + "openviking_request": old, + "openviking_create_requested": requested, + "pending": pending, + } + if ident: + entry.record.update(openviking_id=ident, openviking_managed=True) + before = copy.deepcopy(entry.record) + if allowed: + await ensure(entry, cloud) + assert entry.record["openviking_id"] == "ov-test" + assert entry.record["openviking_request"]["Name"] == old["Name"] + cloud.create.assert_awaited_once() + else: + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + cloud.create.assert_not_awaited() + assert entry.record == before + + asyncio.run(run()) + + +def test_changed_model_source_does_not_reuse_library(): + async def run(): + entry, cloud, row = setup() + row["VLM"]["Credentials"][0]["Source"] = "codeplan" + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + cloud.api_key.assert_not_awaited() + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_openviking_byteplus.py b/tests/integrations/mpa_managed/test_openviking_byteplus.py new file mode 100644 index 000000000..89b515fb4 --- /dev/null +++ b/tests/integrations/mpa_managed/test_openviking_byteplus.py @@ -0,0 +1,378 @@ +# 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. + +import asyncio +import copy +import json +from types import SimpleNamespace +from unittest.mock import AsyncMock, Mock + +import pytest + +from veadk.integrations.mpa.managed.config import ( + load_studio_profile, + with_creation_resources, +) +from veadk.integrations.mpa.managed.openviking import ( + OpenVikingCloud, + OpenVikingError, + ensure_openviking, +) +from veadk.integrations.mpa.managed.database import agent_suffix + + +class Entry: + def __init__(self): + self.record = {} + + async def read(self): + return copy.deepcopy(self.record) + + async def save(self, row): + self.record = copy.deepcopy(row) + + +def fixture(): + suffix = agent_suffix("account", "ap-southeast-1", "mi-example") + row = { + "ResourceID": "ov-example", + "Status": "READY", + "Name": "mpa_ov_" + suffix, + "Description": "mpa-openviking:v1:" + suffix, + "Project": "default", + "Version": "developer", + "Source": "volcengine", + "VLM": { + "ModelName": "seed-2-0-lite", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "seed-2-0-lite-260428"} + ], + }, + "Embedding": { + "ModelName": "skylark-embedding-vision", + "Credentials": [ + { + "Source": "volcengine", + "EndpointID": "skylark-embedding-vision-251215", + } + ], + }, + } + cloud = Mock( + create=AsyncMock(return_value="ov-example"), + get=AsyncMock(return_value=row), + api_key=AsyncMock(return_value="test-library-key"), + ) + return Entry(), cloud, row + + +async def ensure(entry, cloud): + return await ensure_openviking( + entry, + cloud, + account="account", + region="ap-southeast-1", + provider="byteplus", + agent_id="mi-example", + model_api_key="test-inference-key", + ) + + +@pytest.fixture(autouse=True) +def isolate_model_environment(monkeypatch): + for name in ("OV_MODEL_API_KEY", "OV_VLM_ENDPOINT_ID", "OV_EMBEDDING_ENDPOINT_ID"): + monkeypatch.delenv(name, raising=False) + + +def test_byteplus_new_profile_advertises_ov_and_preserves_explicit_requests( + monkeypatch, +): + profile = load_studio_profile(provider="byteplus") + assert profile.summary()["openvikingMode"] == "auto" + assert profile.managed.openviking.mode == "manual" + assert with_creation_resources(profile, {}).managed.openviking.mode == "manual" + updated = with_creation_resources(profile, {"openvikingMode": "auto"}) + assert updated.managed.openviking.mode == "auto" + monkeypatch.setenv("OV_MODEL_API_KEY", "unused-legacy-value") + assert with_creation_resources(profile, {"openvikingMode": "auto"}) == updated + + +def test_developer_binding_reuse_and_no_keys_in_registry(): + async def run(): + entry, cloud, row = fixture() + env = await ensure(entry, cloud) + assert env == { + "OPENVIKING_URL": "https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking", + "OPENVIKING_RESOURCE_ID": "ov-example", + "OPENVIKING_API_KEY": "test-library-key", + "OPENVIKING_USER": "default", + } + expected = {k: v for k, v in row.items() if k not in {"ResourceID", "Status"}} + assert cloud.create.await_args.args[0] == expected + assert await ensure(entry, cloud) == env + cloud.create.assert_awaited_once() + assert "test-inference-key" not in json.dumps(entry.record) + assert "test-library-key" not in json.dumps(entry.record) + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "field,value", + [("Version", "enterprise"), ("Source", "codeplan"), ("Status", "FAILED")], +) +def test_readback_conflicts_never_inject_keys(field, value): + async def run(): + entry, cloud, row = fixture() + row[field] = value + with pytest.raises(OpenVikingError): + await ensure(entry, cloud) + cloud.api_key.assert_not_awaited() + + asyncio.run(run()) + + +def test_ambiguous_byteplus_create_does_not_duplicate(): + async def run(): + entry, cloud, _ = fixture() + cloud.create.side_effect = TimeoutError("test-private-value") + for _ in range(2): + with pytest.raises(OpenVikingError, match="openvikingCreateUnknown"): + await ensure(entry, cloud) + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +def test_byteplus_wire_path_credentials_and_default_user(monkeypatch): + async def run(): + source = Mock(provider="byteplus", region="ap-southeast-1") + source._credentials.return_value = SimpleNamespace( + access_key_id="test-ak", + secret_access_key="test-sk", + session_token="test-sts", + ) + signed = Mock(return_value={"result": {"ResourceID": "ov-example"}}) + monkeypatch.setattr( + "veadk.integrations.mpa.managed.openviking_byteplus.signed_request", signed + ) + cloud = OpenVikingCloud(source) + _, _, row = fixture() + request = {k: v for k, v in row.items() if k not in {"ResourceID", "Status"}} + assert ( + await cloud.create(request, model_api_key="test-inference-key") + == "ov-example" + ) + assert signed.call_args.kwargs["action"] == "CreateOpenVikingCollection" + assert signed.call_args.kwargs["credential"].session_token == "test-sts" + assert signed.call_args.kwargs["body"]["VLM"]["Credentials"] == [ + { + "Source": "volcengine", + "ApiKey": "test-inference-key", + "EndpointID": "seed-2-0-lite-260428", + } + ] + assert "ApiKey" not in request["VLM"]["Credentials"][0] + signed.return_value = { + "Result": {"ApiKey": "test-library-key", "UserID": "default"} + } + assert await cloud.api_key("ov-example") == "test-library-key" + assert signed.call_args.kwargs["body"] == {"ResourceID": "ov-example"} + signed.return_value = { + "Result": {"ApiKey": "test-library-key", "UserID": "other"} + } + with pytest.raises(OpenVikingError): + await cloud.api_key("ov-example") + + asyncio.run(run()) + + +@pytest.mark.parametrize("name", ["OV_VLM_ENDPOINT_ID", "OV_EMBEDDING_ENDPOINT_ID"]) +@pytest.mark.parametrize("value", ["", "bad value", "https://example.test", "x" * 129]) +def test_invalid_endpoint_stops_before_cloud_construction(monkeypatch, name, value): + from veadk.integrations.mpa.managed.service import provision + + monkeypatch.setenv(name, value) + profile = load_studio_profile(provider="byteplus") + with pytest.raises( + ValueError, match="OV_VLM_ENDPOINT_ID.*OV_EMBEDDING_ENDPOINT_ID" + ): + with_creation_resources(profile, {"openvikingMode": "auto"}) + assert with_creation_resources(profile, {}).managed.openviking.mode == "manual" + profile.managed.openviking.mode = "auto" + runtime = Mock() + monkeypatch.setattr("veadk.integrations.mpa.managed.service.RuntimeCloud", runtime) + with pytest.raises(OpenVikingError, match="openvikingModelEndpointsInvalid"): + asyncio.run(provision(profile, agent_id="mi-example", owner="test-owner")) + runtime.assert_not_called() + + +def test_cancellation_keeps_byteplus_library_for_retry(): + async def run(): + entry, cloud, _ = fixture() + cloud.get.side_effect = asyncio.CancelledError() + with pytest.raises(asyncio.CancelledError): + await ensure(entry, cloud) + assert entry.record["openviking_id"] == "ov-example" + cloud.api_key.assert_not_awaited() + cloud.get.side_effect = None + await ensure(entry, cloud) + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +@pytest.mark.parametrize("token", ["", "test-sts"]) +def test_wire_signature_includes_required_headers_and_path(monkeypatch, token): + import datetime + import hashlib + import hmac + import requests + from veadk.integrations.mpa.managed import openviking_byteplus as module + + class Clock(datetime.datetime): + @classmethod + def now(cls, tz=None): + return cls(2026, 10, 14, 0, 0, 0, tzinfo=tz) + + monkeypatch.setattr( + module, "datetime", SimpleNamespace(datetime=Clock, timezone=datetime.timezone) + ) + response = Mock() + response.json.return_value = {"Result": {"Status": "READY"}} + post = Mock(return_value=response) + monkeypatch.setattr(requests, "post", post) + credential = SimpleNamespace( + access_key_id="test-ak", secret_access_key="test-sk", session_token=token + ) + module.signed_request( + action="GetOpenVikingCollection", + body={"ResourceID": "ov-example"}, + credential=credential, + ) + assert ( + post.call_args.args[0] + == "https://vikingdb.ap-southeast-1.byteplusapi.com/api/openviking/GetOpenVikingCollection?Action=GetOpenVikingCollection&Version=2025-06-09" + ) + wire = post.call_args.kwargs + assert wire["timeout"] == (10, 30) + assert wire["data"] == '{"ResourceID": "ov-example"}' + headers = wire["headers"] + assert headers["X-Top-Service"] == "vikingdb" + assert headers["X-Top-Region"] == "ap-southeast-1" + digest = hashlib.sha256(b'{"ResourceID": "ov-example"}').hexdigest() + names = "content-type;host;x-content-sha256;x-date" + ( + ";x-security-token" if token else "" + ) + canonical = ( + "POST\n/api/openviking/GetOpenVikingCollection\n" + "Action=GetOpenVikingCollection&Version=2025-06-09\n" + "content-type:application/json\nhost:vikingdb.ap-southeast-1.byteplusapi.com\n" + f"x-content-sha256:{digest}\nx-date:20261014T000000Z" + + (f"\nx-security-token:{token}" if token else "") + + f"\n\n{names}\n{digest}" + ) + scope = "20261014/ap-southeast-1/vikingdb/request" + to_sign = f"HMAC-SHA256\n20261014T000000Z\n{scope}\n{hashlib.sha256(canonical.encode()).hexdigest()}" + key = b"test-sk" + for part in (b"20261014", b"ap-southeast-1", b"vikingdb", b"request"): + key = hmac.new(key, part, hashlib.sha256).digest() + signature = hmac.new(key, to_sign.encode(), hashlib.sha256).hexdigest() + assert ( + headers["Authorization"] + == f"HMAC-SHA256 Credential=test-ak/{scope}, SignedHeaders={names}, Signature={signature}" + ) + assert headers.get("x-security-token", "") == token + + +def test_transport_preserves_safe_provider_error_for_adapter(monkeypatch): + import requests + from veadk.integrations.mpa.managed.openviking_byteplus import signed_request + + response = Mock() + response.json.return_value = { + "ResponseMetadata": { + "Error": {"Code": "AccessDenied", "Message": "test-private-provider-value"} + } + } + monkeypatch.setattr(requests, "post", Mock(return_value=response)) + source = Mock(provider="byteplus", region="ap-southeast-1") + source._credentials.return_value = SimpleNamespace( + access_key_id="test-ak", secret_access_key="test-sk", session_token="" + ) + with pytest.raises(OpenVikingError, match="openvikingPermissionDenied") as caught: + asyncio.run(OpenVikingCloud(source).api_key("ov-example")) + assert "test-private-provider-value" not in str(caught.value) + response.json.side_effect = ValueError("bad json") + response.raise_for_status.side_effect = requests.HTTPError( + "test-private-http-error" + ) + with pytest.raises(requests.HTTPError): + signed_request( + action="GetOpenVikingCollection", body={}, credential=source._credentials() + ) + + +def test_endpoint_overrides_are_bound_and_cannot_change_on_retry(monkeypatch): + async def run(): + entry, cloud, row = fixture() + monkeypatch.setenv("OV_VLM_ENDPOINT_ID", "ep-vlm-test") + monkeypatch.setenv("OV_EMBEDDING_ENDPOINT_ID", "ep-embedding-test") + row["VLM"]["Credentials"][0]["EndpointID"] = "ep-vlm-test" + row["Embedding"]["Credentials"][0]["EndpointID"] = "ep-embedding-test" + await ensure(entry, cloud) + await ensure(entry, cloud) + cloud.create.assert_awaited_once() + assert ( + entry.record["openviking_request"]["VLM"]["Credentials"][0]["EndpointID"] + == "ep-vlm-test" + ) + monkeypatch.setenv("OV_VLM_ENDPOINT_ID", "ep-other") + with pytest.raises(OpenVikingError, match="openvikingConfigurationConflict"): + await ensure(entry, cloud) + cloud.create.assert_awaited_once() + + asyncio.run(run()) + + +def test_mismatched_remote_endpoint_does_not_inject_key(): + async def run(): + entry, cloud, row = fixture() + row["Embedding"]["Credentials"][0]["EndpointID"] = "ep-other" + with pytest.raises(OpenVikingError, match="openvikingConfigurationConflict"): + await ensure(entry, cloud) + cloud.api_key.assert_not_awaited() + + asyncio.run(run()) + + +@pytest.mark.parametrize("bound", [False, True]) +def test_legacy_coding_intent_never_migrates_or_duplicates(bound): + async def run(): + entry, cloud, row = fixture() + request = {k: v for k, v in row.items() if k not in {"ResourceID", "Status"}} + request["Source"] = "codeplan" + for field in ("VLM", "Embedding"): + request[field]["Credentials"] = [{"Source": "codeplan"}] + entry.record.update( + openviking_request=request, openviking_create_requested=True + ) + if bound: + entry.record.update(openviking_id="ov-existing", openviking_managed=True) + with pytest.raises(OpenVikingError, match="openvikingConfigurationConflict"): + await ensure(entry, cloud) + cloud.create.assert_not_awaited() + cloud.api_key.assert_not_awaited() + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_openviking_diagnostics.py b/tests/integrations/mpa_managed/test_openviking_diagnostics.py new file mode 100644 index 000000000..d98cd6a09 --- /dev/null +++ b/tests/integrations/mpa_managed/test_openviking_diagnostics.py @@ -0,0 +1,299 @@ +# 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. + +import asyncio +import json +import sqlite3 +import sys +from types import SimpleNamespace +from unittest.mock import Mock + +import pytest +import requests + +from veadk.integrations.mpa.managed.diagnostics import ( + diagnostic_scope, + validate_diagnostic, +) +from veadk.integrations.mpa.managed.openviking import OpenVikingCloud, OpenVikingError +from veadk.integrations.mpa.managed.tasks import CreationTasks + +REQUEST_ID = "20261014084601ABCDEF0123456789ABCD" + + +def cloud_with_response(monkeypatch, provider, response=None, error=None): + source = SimpleNamespace( + provider=provider, + region="ap-southeast-1" if provider == "byteplus" else "cn-beijing", + _credentials=lambda: SimpleNamespace( + access_key_id="test-access", + secret_access_key="test-secret", + session_token="", + ), + ) + call = Mock(return_value=response, side_effect=error) + if provider == "byteplus": + monkeypatch.setattr( + "veadk.integrations.mpa.managed.openviking_byteplus.signed_request", call + ) + else: + monkeypatch.setattr( + "veadk.utils.volcengine_sign.volcengine_signed_request", call + ) + return OpenVikingCloud(source), call + + +@pytest.mark.parametrize("provider", ["byteplus", "volcengine"]) +@pytest.mark.parametrize( + "operation,action", + [ + ("create_openviking", "CreateOpenVikingCollection"), + ("get_openviking", "GetOpenVikingCollection"), + ("get_openviking_key", "AccessOpenVikingApiKey"), + ], +) +def test_structured_provider_error_survives_without_response_text( + monkeypatch, caplog, provider, operation, action +): + response = { + "ResponseMetadata": { + "RequestId": REQUEST_ID, + "Error": { + "Code": "InvalidParameter.ModelCredential", + "Message": "test-private-model-key", + }, + }, + "ApiKey": "test-private-library-key", + } + cloud, call = cloud_with_response(monkeypatch, provider, response) + events = [] + with diagnostic_scope(events.append), pytest.raises(OpenVikingError) as caught: + asyncio.run( + cloud._call(action, {}, operation, create=operation == "create_openviking") + ) + assert events[-1]["errorCode"] == "InvalidParameter.ModelCredential" + assert events[-1]["requestId"] == REQUEST_ID + assert events[-1]["operation"] == operation + assert events[-1]["category"] == "provider_error" + assert call.call_count == 1 + assert "test-private" not in json.dumps(events) + str(caught.value) + caplog.text + + +def test_http_error_extracts_structured_body_and_preserves_category(monkeypatch): + response = requests.Response() + response.status_code = 403 + response._content = json.dumps( + { + "ResponseMetadata": { + "RequestId": REQUEST_ID, + "Error": {"Code": "AccessDenied", "Message": "test-private-error"}, + } + } + ).encode() + error = requests.HTTPError("test-private-exception", response=response) + cloud, call = cloud_with_response(monkeypatch, "byteplus", error=error) + events = [] + with ( + diagnostic_scope(events.append), + pytest.raises(OpenVikingError, match="openvikingPermissionDenied"), + ): + asyncio.run( + cloud._call( + "CreateOpenVikingCollection", {}, "create_openviking", create=True + ) + ) + assert events[-1]["errorCode"] == "AccessDenied" + assert events[-1]["requestId"] == REQUEST_ID + assert events[-1]["category"] == "permission" + assert call.call_count == 1 + assert "test-private" not in json.dumps(events) + + +@pytest.mark.parametrize( + "bad", + [ + "ark-test-private", + "SK_private_token", + "Bearer private", + "https://private.invalid", + "Invalid\nprivate", + "A" * 129, + {"Code": "Private"}, + ], +) +def test_untrusted_metadata_is_omitted(monkeypatch, bad): + cloud, _ = cloud_with_response( + monkeypatch, + "byteplus", + { + "ResponseMetadata": { + "RequestId": "test-private-key", + "Error": {"Code": bad, "Message": "test-private-error"}, + } + }, + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(OpenVikingError): + asyncio.run( + cloud._call( + "CreateOpenVikingCollection", {}, "create_openviking", create=True + ) + ) + assert "errorCode" not in events[-1] + assert "requestId" not in events[-1] + assert "test-private" not in json.dumps(events) + + +def test_malformed_success_retains_request_id(monkeypatch): + cloud, _ = cloud_with_response( + monkeypatch, + "byteplus", + { + "ResponseMetadata": {"RequestId": REQUEST_ID}, + "Result": "test-private-invalid", + }, + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(OpenVikingError): + asyncio.run( + cloud._call( + "CreateOpenVikingCollection", {}, "create_openviking", create=True + ) + ) + assert events[-1]["requestId"] == REQUEST_ID + assert events[-1]["category"] == "protocol_error" + assert "errorCode" not in events[-1] + + +def test_create_transport_failure_has_no_text_or_extra_attempt(monkeypatch): + cloud, call = cloud_with_response( + monkeypatch, "byteplus", error=requests.Timeout("test-private-timeout") + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(OpenVikingError): + asyncio.run( + cloud._call( + "CreateOpenVikingCollection", {}, "create_openviking", create=True + ) + ) + assert events == [ + { + "operation": "create_openviking", + "category": "timeout", + "attempt": 1, + "outcome": "failed", + } + ] + assert call.call_count == 1 + + +def test_legacy_diagnostics_and_safe_code_validation(): + old = { + "operation": "create_openviking", + "category": "provider_error", + "attempt": 1, + "outcome": "failed", + } + assert validate_diagnostic(old) == old + assert validate_diagnostic( + {**old, "errorCode": "InvalidParameter.ModelCredential"} + ) == {**old, "errorCode": "InvalidParameter.ModelCredential"} + assert validate_diagnostic({**old, "errorCode": "SK_private_token"}) == old + assert validate_diagnostic({**old, "Message": "private"}) is None + + +def test_child_error_code_persists_and_old_sqlite_rows_survive(tmp_path, caplog): + path = tmp_path / "tasks.sqlite3" + with sqlite3.connect(path) as db: + db.execute( + "CREATE TABLE task_diagnostics (id INTEGER PRIMARY KEY, task_id TEXT NOT NULL, stage TEXT NOT NULL, operation TEXT NOT NULL, category TEXT NOT NULL, attempt INTEGER NOT NULL, outcome TEXT NOT NULL, created REAL NOT NULL)" + ) + db.execute( + "INSERT INTO task_diagnostics VALUES (1,'old','openviking','create_openviking','provider_error',1,'failed',1)" + ) + + async def run(): + service = CreationTasks(path) + diagnostic = { + "operation": "create_openviking", + "category": "provider_error", + "attempt": 1, + "outcome": "failed", + "requestId": REQUEST_ID, + "errorCode": "InvalidParameter.ModelCredential", + } + event = "MPA_EVENT " + json.dumps({"diagnostic": diagnostic}) + service.command = lambda: [ + sys.executable, + "-c", + f"print({event!r}); print('test-private-response'); raise SystemExit(1)", + ] + task = await service.start( + "owner", + { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + }, + config_path="unused", + timeout=60, + ) + await asyncio.gather(*service.running.values()) + assert "errorCode" not in service.get("owner", task["taskId"]) + await service.close() + return task["taskId"] + + ident = asyncio.run(run()) + with sqlite3.connect(path) as db: + assert db.execute( + "SELECT error_code FROM task_diagnostics WHERE task_id='old'" + ).fetchone() == ("",) + assert db.execute( + "SELECT error_code,request_id FROM task_diagnostics WHERE task_id=?", + (ident,), + ).fetchone() == ("InvalidParameter.ModelCredential", REQUEST_ID) + assert "InvalidParameter.ModelCredential" in caplog.text + assert "test-private-response" not in caplog.text + + +@pytest.mark.parametrize("valid", [True, False]) +def test_sdk_exception_body_is_structured_only(monkeypatch, valid): + class SDKError(Exception): + body = ( + json.dumps( + { + "ResponseMetadata": { + "RequestId": REQUEST_ID, + "Error": {"Code": "ModelAccessDenied", "Message": "private"}, + } + } + ) + if valid + else "private non-JSON exception body" + ) + + cloud, _ = cloud_with_response(monkeypatch, "byteplus", error=SDKError("private")) + events = [] + with diagnostic_scope(events.append), pytest.raises(OpenVikingError): + asyncio.run( + cloud._call( + "CreateOpenVikingCollection", {}, "create_openviking", create=True + ) + ) + assert ("errorCode" in events[-1]) is valid + assert ("requestId" in events[-1]) is valid + if valid: + assert events[-1]["errorCode"] == "ModelAccessDenied" + assert "private" not in json.dumps(events) diff --git a/tests/integrations/mpa_managed/test_routes.py b/tests/integrations/mpa_managed/test_routes.py index 0d6fe2d1d..ea49a4354 100644 --- a/tests/integrations/mpa_managed/test_routes.py +++ b/tests/integrations/mpa_managed/test_routes.py @@ -23,7 +23,7 @@ _studio_task_path, mount_mpa_creation_routes, ) -from veadk.integrations.mpa.managed.tasks import CreationTasks +from veadk.integrations.mpa.managed.tasks import CreationTasks, owner_key def test_studio_task_path_uses_tmp_by_default_and_honors_override( @@ -107,6 +107,111 @@ def denied(_request): assert getattr(client, method)(path).status_code == 403 +def test_creation_task_list_recovers_owner_scoped_local_state_with_diagnostics( + tmp_path, +): + import json + import time + + service = CreationTasks(tmp_path / "tasks.db") + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "name": "test-agent", + "description": "", + "region": "cn-beijing", + "tosBucket": "agentkit-platform-output", + } + with service.db() as db: + db.execute( + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,images,name_scope) VALUES (?,?,?,?,?,?,?,?,?,?)", + ( + "task-1", + owner_key("local"), + payload["requestId"], + json.dumps(payload, sort_keys=True), + "failed", + "worker", + 0, + time.time(), + "{}", + "{}", + ), + ) + service.record_diagnostic( + "task-1", + { + "operation": "provision", + "category": "configuration_changed", + "attempt": 1, + "outcome": "failed", + }, + ) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + with TestClient(app) as client: + response = client.get("/web/mpa-creation/tasks?region=cn-beijing") + other = client.get("/web/mpa-creation/tasks?region=ap-southeast-1") + assert response.status_code == 200 + assert other.json() == {"tasks": []} + task = response.json()["tasks"][0] + assert task["taskId"] == "task-1" + assert task["name"] == "test-agent" + assert task["tosBucket"] == "agentkit-platform-output" + assert task["latestDiagnostic"] == { + "stage": "worker", + "operation": "provision", + "category": "configuration_changed", + "attempt": 1, + "outcome": "failed", + } + + +def test_creation_route_reports_changed_request_fields(tmp_path, monkeypatch): + import json + import time + + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + service = CreationTasks(tmp_path / "tasks.db") + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + "tosBucket": "agentkit-platform-old", + } + with service.db() as db: + db.execute( + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,images,name_scope) VALUES (?,?,?,?,?,?,?,?,?,?)", + ( + "task-1", + owner_key("local"), + payload["requestId"], + json.dumps(payload, sort_keys=True), + "failed", + "worker", + 0, + time.time(), + "{}", + "{}", + ), + ) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + with TestClient(app) as client: + response = client.post( + "/web/mpa-creation/tasks", + json={**payload, "tosBucket": "agentkit-platform-new"}, + ) + assert response.status_code == 409 + assert response.json()["detail"] == ( + "Request identity already has different inputs: tosBucket" + ) + assert "agentkit-platform" not in response.text + + def test_model_key_discovery_needs_no_secret_for_local_inspection( tmp_path, monkeypatch ): @@ -192,3 +297,256 @@ def test_creation_key_is_passed_separately_from_stored_payload(tmp_path, monkeyp args, kwargs = start_call assert "openvikingApiKey" not in args[1] assert kwargs["secrets"] == {"openvikingApiKey": "private-ov-key-for-test"} + + +def test_auto_openviking_mode_reaches_task_and_has_no_browser_secret( + tmp_path, monkeypatch +): + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "test-task"}) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + with TestClient(app) as client: + config = client.get("/web/mpa-creation/config?region=cn-beijing") + assert config.json()["openvikingMode"] == "auto" + result = client.post( + "/web/mpa-creation/tasks", + json={ + "requestId": "11111111-1111-4111-8111-111111111111", + "name": "test-agent", + "region": "cn-beijing", + "openvikingMode": "auto", + }, + ) + assert result.status_code == 202 + call = service.start.await_args + assert call is not None + payload = call.args[1] + assert payload["openvikingMode"] == "auto" + assert "openvikingApiKey" not in payload + assert call.kwargs["secrets"] == {"openvikingApiKey": ""} + + +def test_business_workspace_request_mode_and_legacy_omission(tmp_path, monkeypatch): + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "test-task"}) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + with TestClient(app) as client: + assert ( + client.get("/web/mpa-creation/config?region=cn-beijing").json()[ + "businessWorkspaceMode" + ] + == "per-agent" + ) + for mode in [None, "shared", "per-agent"]: + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "region": "cn-beijing", + } + if mode is not None: + payload["businessWorkspaceMode"] = mode + response = client.post("/web/mpa-creation/tasks", json=payload) + assert response.status_code == 202 + call = service.start.await_args + assert call is not None + passed = call.args[1] + if mode == "per-agent": + assert passed["businessWorkspaceMode"] == mode + else: + assert "businessWorkspaceMode" not in passed + + +def test_new_layout_checks_name_before_accepting_task_and_returns_only_codes( + tmp_path, monkeypatch +): + from types import SimpleNamespace + from frontend.server import mpa_creation + from veadk.integrations.mpa.managed.names import NameCheckError + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + monkeypatch.setattr(mpa_creation, "RuntimeCloud", lambda **kw: SimpleNamespace()) + check = AsyncMock(return_value="test-account") + monkeypatch.setattr(mpa_creation, "check_creation_name", check) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "new-task"}) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "region": "cn-beijing", + "name": "test-name", + "businessWorkspaceMode": "per-agent", + "businessDatabaseName": "aidb", + } + with TestClient(app) as client: + for key, status in [("runtimeNameTaken", 409), ("runtimeNameCheckFailed", 503)]: + check.side_effect = NameCheckError(key) + result = client.post("/web/mpa-creation/tasks", json=payload) + assert result.status_code == status + assert result.json()["detail"] == {"code": key} + service.start.assert_not_awaited() + check.side_effect = None + result = client.post( + "/web/mpa-creation/name-check", + json={k: payload[k] for k in ["requestId", "name", "region"]}, + ) + assert result.json() == {"available": True} + assert "test-account" not in result.text + service.start.assert_not_awaited() + result = client.post("/web/mpa-creation/tasks", json=payload) + assert result.status_code == 202 + call = service.start.await_args + assert call is not None + assert call.kwargs["name_scope"] == { + "provider": "volcengine", + "region": "cn-beijing", + "account": "test-account", + } + assert call.args[1]["businessDatabaseName"] == "aidb" + assert check.await_args is not None + assert check.await_args.kwargs["agent_id"] == call.args[1]["agentId"] + + +def test_name_check_requires_auth_and_valid_input(tmp_path, monkeypatch): + from frontend.server import mpa_creation + + check = AsyncMock() + monkeypatch.setattr(mpa_creation, "check_creation_name", check) + app = FastAPI() + + def deny(_request): + raise HTTPException(403, "Denied") + + mount_mpa_creation_routes( + app, owner=deny, service=CreationTasks(tmp_path / "tasks.db") + ) + with TestClient(app) as client: + result = client.post( + "/web/mpa-creation/name-check", + json={ + "requestId": "11111111-1111-4111-8111-111111111111", + "name": "test-name", + "region": "cn-beijing", + }, + ) + assert result.status_code == 403 + result = client.post( + "/web/mpa-creation/name-check", + json={ + "requestId": "11111111-1111-4111-8111-111111111111", + "name": "bad name", + "region": "cn-beijing", + }, + ) + assert result.status_code == 422 + check.assert_not_awaited() + + +def test_new_layout_cannot_claim_another_requests_internal_identity( + tmp_path, monkeypatch +): + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + check = AsyncMock() + monkeypatch.setattr(mpa_creation, "check_creation_name", check) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock() + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "name": "test-name", + "agentId": "mi-other-request", + "region": "cn-beijing", + } + with TestClient(app) as client: + assert ( + client.post("/web/mpa-creation/name-check", json=payload).status_code == 400 + ) + assert ( + client.post( + "/web/mpa-creation/tasks", + json={ + **payload, + "businessWorkspaceMode": "per-agent", + "businessDatabaseName": "aidb", + }, + ).status_code + == 400 + ) + check.assert_not_awaited() + service.start.assert_not_awaited() + + +def test_retry_uses_private_scope_after_exact_payload_normalization( + tmp_path, monkeypatch +): + import json + import time + from types import SimpleNamespace + from frontend.server import mpa_creation + from veadk.integrations.mpa.managed.names import NameCheckError + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) + monkeypatch.setattr(mpa_creation, "RuntimeCloud", lambda **kw: SimpleNamespace()) + check = AsyncMock(return_value="test-account") + monkeypatch.setattr(mpa_creation, "check_creation_name", check) + service = CreationTasks(tmp_path / "tasks.db") + service.start = AsyncMock(return_value={"taskId": "original-task"}) + app = FastAPI() + mount_mpa_creation_routes(app, owner=lambda request: "local", service=service) + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "region": "cn-beijing", + "name": "test-name", + "businessWorkspaceMode": "per-agent", + "businessDatabaseName": "aidb", + } + with TestClient(app) as client: + assert client.post("/web/mpa-creation/tasks", json=payload).status_code == 202 + assert check.await_args is not None + assert check.await_args.kwargs["verified_creation_account"] == "" + assert service.start.await_args is not None + owner, normalized = service.start.await_args.args + assert service.start.await_args is not None + scope = service.start.await_args.kwargs["name_scope"] + with service.db() as db: + db.execute( + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,name_scope) VALUES (?,?,?,?,?,?,?,?,?)", + ( + "original-task", + owner, + normalized["requestId"], + json.dumps(normalized, sort_keys=True), + "failed", + "verifying", + 0, + time.time(), + json.dumps(scope), + ), + ) + assert client.post("/web/mpa-creation/tasks", json=payload).status_code == 202 + assert check.await_count == 1 + count = check.await_count + changed = client.post( + "/web/mpa-creation/tasks", json={**payload, "description": "changed"} + ) + assert changed.status_code == 409 + assert check.await_count == count + check.side_effect = NameCheckError("runtimeNameTaken") + fresh = client.post( + "/web/mpa-creation/tasks", + json={**payload, "requestId": "22222222-2222-4222-8222-222222222222"}, + ) + assert fresh.status_code == 409 + assert check.await_args is not None + assert check.await_args.kwargs["verified_creation_account"] == "" diff --git a/tests/integrations/mpa_managed/test_runtime_diagnostics.py b/tests/integrations/mpa_managed/test_runtime_diagnostics.py new file mode 100644 index 000000000..cbadf90a8 --- /dev/null +++ b/tests/integrations/mpa_managed/test_runtime_diagnostics.py @@ -0,0 +1,217 @@ +# 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. + +import asyncio +import json +from types import SimpleNamespace +from unittest.mock import Mock + +import pytest +from agentkit.toolkit.errors import ApiError + +from veadk.integrations.mpa.managed.diagnostics import diagnostic_scope +from veadk.integrations.mpa.managed.runtime import RuntimeCloud + + +@pytest.mark.parametrize("provider", ["byteplus", "volcengine"]) +@pytest.mark.parametrize("method", ["create_runtime", "update_runtime"]) +def test_sdk_failure_records_code_without_changing_payload_or_exception( + monkeypatch, provider, method +): + cloud = RuntimeCloud( + region="ap-southeast-1" if provider == "byteplus" else "cn-beijing", + credential_file="", + provider=provider, + ) + error = ApiError("private provider response", error_code="InvalidParameter.Runtime") + api = Mock(side_effect=error) + client = SimpleNamespace(**{method: api}) + monkeypatch.setattr(cloud, "_client", lambda **kwargs: client) + request = SimpleNamespace( + ClientToken="private-idempotency-token", + Envs=[{"Key": "MODEL_AGENT_API_KEY", "Value": "private-model-key"}], + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(ApiError) as caught: + asyncio.run(cloud.call(method, request)) + assert caught.value is error + api.assert_called_once_with(request) + assert request.ClientToken == "private-idempotency-token" + assert events == [ + { + "operation": method, + "category": "provider_error", + "attempt": 1, + "outcome": "failed", + "errorCode": "InvalidParameter.Runtime", + } + ] + assert "private" not in str(events) + + +def test_wrapped_error_uses_safe_structured_metadata_and_stops_on_cycle(monkeypatch): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + + class SDKError(Exception): + error_code = "AccessDenied" + request_id = "20261014094649ABCDEF0123456789ABCD" + + inner = SDKError("private cause") + outer = ApiError("private wrapper") + outer.__cause__ = inner + inner.__cause__ = outer + api = Mock(side_effect=outer) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(create_runtime=api) + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(ApiError): + asyncio.run(cloud.call("create_runtime", object())) + assert events[-1]["errorCode"] == "AccessDenied" + assert events[-1]["requestId"] == inner.request_id + assert "private" not in str(events) + + +@pytest.mark.parametrize( + "code", [None, "sk-private-token", "SK_private_token", "Bad\nprivate", "A" * 129] +) +def test_invalid_or_absent_sdk_metadata_is_not_logged(monkeypatch, code): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + error = ApiError("private body", error_code=code) + api = Mock(side_effect=error) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(create_runtime=api) + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(ApiError): + asyncio.run(cloud.call("create_runtime", object())) + assert "errorCode" not in events[-1] + assert "requestId" not in events[-1] + assert "private" not in str(events) + + +def test_success_and_cancel_do_not_emit_failure_diagnostics(monkeypatch): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + response = Mock() + response.model_dump.return_value = {"RuntimeId": "r-test"} + api = Mock(return_value=response) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(create_runtime=api) + ) + events = [] + with diagnostic_scope(events.append): + assert asyncio.run(cloud.call("create_runtime", object())) == { + "RuntimeId": "r-test" + } + assert events == [] + api.side_effect = asyncio.CancelledError() + with diagnostic_scope(events.append), pytest.raises(asyncio.CancelledError): + asyncio.run(cloud.call("create_runtime", object())) + assert events == [] + + +def test_transport_failure_has_category_and_no_auto_replay(monkeypatch): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + api = Mock(side_effect=TimeoutError("private timeout")) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(update_runtime=api) + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(TimeoutError): + asyncio.run(cloud.call("update_runtime", object())) + assert events[-1]["category"] == "timeout" + assert api.call_count == 1 + assert "errorCode" not in events[-1] + + +@pytest.mark.parametrize("method", ["create_runtime", "update_runtime"]) +@pytest.mark.parametrize("encoding", ["bytes", "json", "bytes_repr", "body", "http"]) +def test_wrapped_sdk_json_rejection_retains_only_identifiers( + monkeypatch, method, encoding +): + metadata = { + "ResponseMetadata": { + "RequestId": "20261014100728ABCDEF0123456789ABCD", + "Error": { + "Code": "InvalidParameter.Runtime", + "Message": "private secret response", + }, + }, + "Result": {"ApiKey": "private key"}, + } + + class SDKBodyError(Exception): + body: str | None = None + response: object | None = None + + body = json.dumps(metadata) + inner = SDKBodyError(body.encode() if encoding == "bytes" else body) + if encoding == "bytes_repr": + inner = SDKBodyError(str(body.encode())) + elif encoding == "body": + inner = SDKBodyError("private wrapper") + inner.body = body + elif encoding == "http": + inner = SDKBodyError("private wrapper") + inner.response = SimpleNamespace(json=lambda: metadata) + outer = ApiError("private SDK wrapper") + outer.__cause__ = inner + cloud = RuntimeCloud( + region="ap-southeast-1", provider="byteplus", credential_file="" + ) + api = Mock(side_effect=outer) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(**{method: api}) + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(ApiError) as caught: + asyncio.run(cloud.call(method, object())) + assert caught.value is outer + assert api.call_count == 1 + assert events[-1]["errorCode"] == "InvalidParameter.Runtime" + assert events[-1]["requestId"] == metadata["ResponseMetadata"]["RequestId"] + assert "private" not in str(events) + + +@pytest.mark.parametrize( + "argument", + [ + "private non-JSON response", + b"not JSON", + "{'ResponseMetadata': 'private python literal'}", + "__import__('os').system('private')", + '{"ResponseMetadata":{"Error":{"Code":"SK_private_token"},"RequestId":"private token"}}', + 'b"invalid bytes representation', + '{"ResponseMetadata":{"Error":{"Code":"AccessDenied"}}}' + " " * 65536, + "[" * 1000 + "0" + "]" * 1000, + ], +) +def test_sdk_argument_decoder_rejects_unsafe_malformed_and_oversized_values( + monkeypatch, argument +): + cloud = RuntimeCloud(region="cn-beijing", credential_file="") + error = ApiError("private wrapper") + error.__cause__ = Exception(argument) + api = Mock(side_effect=error) + monkeypatch.setattr( + cloud, "_client", lambda **kwargs: SimpleNamespace(create_runtime=api) + ) + events = [] + with diagnostic_scope(events.append), pytest.raises(ApiError) as caught: + asyncio.run(cloud.call("create_runtime", object())) + assert caught.value is error + assert api.call_count == 1 + assert "errorCode" not in events[-1] + assert "requestId" not in events[-1] + assert "private" not in str(events) diff --git a/tests/integrations/mpa_managed/test_service.py b/tests/integrations/mpa_managed/test_service.py index 2e1a5b4d8..86bc84df2 100644 --- a/tests/integrations/mpa_managed/test_service.py +++ b/tests/integrations/mpa_managed/test_service.py @@ -38,7 +38,7 @@ @pytest.mark.parametrize("source", ["reference", "template", "flat"]) @pytest.mark.parametrize("image", [None, "registry.example/mpa:pinned"]) @pytest.mark.parametrize("split_workspaces", [False, True]) -@pytest.mark.parametrize("openviking", [False, True]) +@pytest.mark.parametrize("openviking", [False, True, "auto"]) @pytest.mark.parametrize("studio_runtime_owner", [None, "studio-user"]) @pytest.mark.parametrize("runtime_name", ["", "Support-Agent_01"]) def test_network_gateway_worker_precede_runtime( @@ -49,18 +49,24 @@ def test_network_gateway_worker_precede_runtime( openviking, studio_runtime_owner, runtime_name, + provider="volcengine", ): async def run(): entry = Registry() cloud = Cloud(entry) + if provider == "byteplus": + cloud.network.zone_ids = ["ap-southeast-1a", "ap-southeast-1b"] + cloud.network.subnet_rows["subnet-one"]["zone_id"] = "ap-southeast-1a" + monkeypatch.setattr(cloud.network, "provider", provider, raising=False) events = [] identity_values = { + "cloud_provider": provider, "user_pool_name": "studio-pool", "user_pool_client_name": "studio-client", "identity_callback_url": "https://studio.example.com/oauth/callback", } profile = Profile( - region="cn-beijing", + region="ap-southeast-1" if provider == "byteplus" else "cn-beijing", values=identity_values, template=template(), admin_url="fake", @@ -128,9 +134,13 @@ async def run(): } if image is None: profile.values["image"] = "registry/image:v1" + if openviking == "auto": + profile.values["model_api_key"] = "fake" profile = with_creation_resources( profile, - { + {"openvikingMode": "auto"} + if openviking == "auto" + else { "openvikingUrl": "https://selected.example.test/openviking", "openvikingResourceId": "ov-selected", "openvikingApiKey": "selected-key", @@ -139,6 +149,14 @@ async def run(): else {}, ) monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + if provider == "byteplus": + from veadk.integrations.mpa.managed import apm_key + + monkeypatch.setattr( + apm_key, + "volcengine_signed_request", + lambda **kw: {"data": {"app_key": "test-apm-app-value"}}, + ) monkeypatch.setattr(service, "AgentDeploymentRegistry", lambda url: entry) databases = Databases() monkeypatch.setattr(service, "AgentDatabaseProvisioner", lambda **kw: databases) @@ -192,20 +210,67 @@ async def worker(*a, **kw): service, "GatewayCloud", lambda _: SimpleNamespace( - available_zones=AsyncMock(return_value=["cn-beijing-a", "cn-beijing-c"]) + available_zones=AsyncMock(return_value=cloud.network.zone_ids) ), ) monkeypatch.setattr(service, "SharedAPIGService", Gateway) monkeypatch.setattr(service, "ensure_worker", worker) + if openviking == "auto": + + async def create_ov(request, *, model_api_key): + assert entry.mutex.locked() + assert events == ["identity", "gateway", "worker"] + assert request["VLM"]["Credentials"][0]["Source"] == "volcengine" + assert model_api_key == "fake" + if provider == "byteplus": + assert request["Source"] == "volcengine" + assert request["Version"] == "developer" + assert ( + request["VLM"]["Credentials"][0]["EndpointID"] + == "ep-vlm-selected" + ) + assert ( + request["Embedding"]["Credentials"][0]["EndpointID"] + == "ep-embedding-selected" + ) + assert "fake" not in str(entry.row["openviking_request"]) + events.append("openviking") + return "ov-auto" + + async def get_ov(ident): + return { + **entry.row["openviking_request"], + "ResourceID": ident, + "Status": "READY", + } + + monkeypatch.setattr( + service, + "OpenVikingCloud", + lambda _: SimpleNamespace( + create=create_ov, + get=get_ov, + api_key=AsyncMock(return_value="auto-ov-key"), + ), + ) cloud_create = cloud.create async def create(request): - assert events == ["identity", "gateway", "worker"] + assert events == ["identity", "gateway", "worker"] + ( + ["openviking"] if openviking == "auto" else [] + ) assert request["Name"] == (runtime_name or "mi-123456789abc") assert cloud.space_creates[0]["Description"] == ( "Skills for MPA agent " + (runtime_name or "mi-123456789abc") ) assert request["ToolId"] == "t-one" + if provider == "byteplus" and studio_runtime_owner is not None: + assert ( + service.env_map(request)[ + "OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY" + ] + == "test-apm-app-value" + ) runtime_tags = { item["Key"]: item["Value"] for item in request.get("Tags", []) } @@ -241,6 +306,17 @@ async def create(request): } assert openviking_env == ( { + "OPENVIKING_URL": ( + "https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking" + if provider == "byteplus" + else "https://api.vikingdb.cn-beijing.volces.com/openviking" + ), + "OPENVIKING_RESOURCE_ID": "ov-auto", + "OPENVIKING_API_KEY": "auto-ov-key", + "OPENVIKING_USER": "default", + } + if openviking == "auto" + else { "OPENVIKING_URL": "https://selected.example.test/openviking", "OPENVIKING_RESOURCE_ID": "ov-selected", "OPENVIKING_API_KEY": "selected-key", @@ -285,6 +361,7 @@ async def create(request): ) assert cloud.creates[0]["Name"] == (runtime_name or "mi-123456789abc") assert result["runtime_id"] == "r-agent" + assert "test-apm-app-value" not in str(entry.row) + str(result) assert result["gateway_id"] == "gw-one" assert cloud.runtimes[result["runtime_id"]]["ToolId"] == "t-one" if split_workspaces: @@ -317,6 +394,7 @@ async def create(request): {"business_workspace_id": "ws-other"}, {"database_host": "old-business"}, {"database_port": 6543}, + {"business_workspace_mode": "per-agent"}, ], ) def test_retry_does_not_rebind_existing_database(tmp_path, monkeypatch, existing): @@ -629,6 +707,18 @@ def test_tos_runtime_env_is_owned_and_contains_no_credentials(): "MPA_CODEX_WORKER_TOS_BUCKET": "mpa-output", } + service.apply_tos_runtime_env( + env, + Worker( + image="worker:v1", + tos_access_key="private-ak", + tos_secret_key="private-sk", + tos_bucket="mpa-output", + ), + enabled=False, + ) + assert env == {} + @pytest.mark.parametrize( "settings,source_values", @@ -668,6 +758,54 @@ async def test_explicit_profile_account_mismatch_stops_before_role(monkeypatch): identity.assert_not_awaited() +@pytest.mark.asyncio +@pytest.mark.parametrize("grant_failed", [False, True]) +async def test_studio_tos_grant_precedes_identity_and_propagates_failure( + monkeypatch, grant_failed +): + from veadk.integrations.mpa.managed.config import ( + load_studio_profile, + with_creation_tos, + ) + from veadk.integrations.mpa.managed.iam import IamError, ROLE_NAME + + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") + profile = with_creation_tos( + load_studio_profile(), {"tosBucket": "agentkit-platform-output"} + ) + resolve_key = AsyncMock(spec=service.resolve_model_key, return_value=profile) + monkeypatch.setattr(service, "resolve_model_key", resolve_key) + cloud = AsyncMock() + cloud.account_id.return_value = "123" + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + role = AsyncMock() + grant = AsyncMock(side_effect=IamError("AccessDenied") if grant_failed else None) + identity = AsyncMock(side_effect=DeploymentError("stop after grant")) + monkeypatch.setattr(service, "ensure_runtime_role", role) + monkeypatch.setattr(service, "ensure_tos_mount_permissions", grant) + monkeypatch.setattr(service, "ensure_workload_identity", identity) + stages = [] + with pytest.raises( + DeploymentError, + match="iamPermissionDenied" if grant_failed else "stop after grant", + ): + await service.provision( + profile, agent_id="mi-test", owner="user", progress=stages.append + ) + resolve_key.assert_awaited_once_with(profile, cloud) + role.assert_awaited_once() + assert grant.await_args is not None + args, kwargs = grant.await_args + assert args[0].runtime is cloud + assert args[1:] == ("123", "agentkit-platform-output") + assert kwargs == {"role_name": ROLE_NAME} + assert stages == ["checking", "iam_role", "iam_role"] + if grant_failed: + identity.assert_not_awaited() + else: + identity.assert_awaited_once() + + @pytest.mark.parametrize("role", [None, "custom-role"]) def test_fresh_template_role_trn_uses_verified_account_and_selected_role( monkeypatch, role @@ -775,3 +913,33 @@ async def test_existing_runtime_keeps_network_when_new_standard_gateway_needs_co cloud.runtimes["r-existing"]["NetworkConfigurations"][1]["VpcConfiguration"] == original["VpcConfiguration"] ) + + +def test_byteplus_service_reuses_agent_key_in_ov_and_injects_library_key(monkeypatch): + monkeypatch.setenv("OV_MODEL_API_KEY", "unused-legacy-credential") + monkeypatch.setenv("OV_VLM_ENDPOINT_ID", "ep-vlm-selected") + monkeypatch.setenv("OV_EMBEDDING_ENDPOINT_ID", "ep-embedding-selected") + test_network_gateway_worker_precede_runtime( + monkeypatch, + "flat", + None, + False, + "auto", + "studio-user", + "Support-Agent_01", + provider="byteplus", + ) + + +@pytest.mark.parametrize("source", ["reference", "template", "flat"]) +def test_byteplus_without_ov_strips_inherited_settings(monkeypatch, source): + test_network_gateway_worker_precede_runtime( + monkeypatch, + source=source, + image=None, + split_workspaces=True, + openviking=False, + studio_runtime_owner=None, + runtime_name="overseas-no-ov", + provider="byteplus", + ) diff --git a/tests/integrations/mpa_managed/test_tasks.py b/tests/integrations/mpa_managed/test_tasks.py index 55f32266e..45edc79fa 100644 --- a/tests/integrations/mpa_managed/test_tasks.py +++ b/tests/integrations/mpa_managed/test_tasks.py @@ -61,6 +61,70 @@ async def run(): asyncio.run(run()) +def test_changed_request_identity_reports_safe_field_names(tmp_path): + async def run(): + service = CreationTasks(tmp_path / "tasks.sqlite3") + service.command = lambda: [sys.executable, "-c", "import time; time.sleep(30)"] + payload = { + "requestId": "11111111-1111-4111-8111-111111111111", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + "tosBucket": "agentkit-platform-old", + } + task = await service.start( + "owner", + payload, + config_path="not-read-by-fake", + timeout=60, + tos={"tosBucket": "agentkit-platform-old"}, + ) + with pytest.raises(TaskError) as caught: + await service.start( + "owner", + {**payload, "tosBucket": "agentkit-platform-new"}, + config_path="x", + timeout=60, + tos={"tosBucket": "agentkit-platform-new"}, + ) + assert "tosBucket" in str(caught.value) + assert "agentkit-platform" not in str(caught.value) + await service.cancel("owner", task["taskId"]) + await service.close() + + asyncio.run(run()) + + +def test_legacy_task_without_bucket_can_resume_with_bucket(tmp_path): + async def run(): + service = CreationTasks(tmp_path / "tasks.sqlite3") + service.command = lambda: [sys.executable, "-c", "import time; time.sleep(30)"] + legacy = { + "requestId": "12121212-1212-4121-8121-121212121212", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + } + task = await service.start( + "owner", + legacy, + config_path="unused", + timeout=60, + ) + await service.cancel("owner", task["taskId"]) + resumed = await service.start( + "owner", + {**legacy, "tosBucket": "agentkit-platform-output"}, + config_path="unused", + timeout=60, + tos={"tosBucket": "agentkit-platform-output"}, + ) + assert resumed["taskId"] == task["taskId"] + await service.close() + + asyncio.run(run()) + + def test_raw_child_errors_never_reach_task_response(tmp_path): async def run(): service = CreationTasks(tmp_path / "tasks.sqlite3") @@ -215,6 +279,7 @@ async def run(): "agentId": "mi-test", "description": "", "region": "cn-beijing", + "businessWorkspaceMode": "per-agent", "pgHost": "db.example", "pgPort": "5432", "openvikingUrl": "https://api.example.test/openviking", @@ -225,7 +290,13 @@ async def run(): assert service.get("owner", task["taskId"])["state"] == "succeeded" assert json.loads(received.read_text()) == { key: payload[key] - for key in ("pgHost", "pgPort", "openvikingUrl", "openvikingResourceId") + for key in ( + "pgHost", + "pgPort", + "openvikingUrl", + "openvikingResourceId", + "businessWorkspaceMode", + ) } await service.close() @@ -336,6 +407,60 @@ async def run(): asyncio.run(run()) +def test_tos_bucket_is_part_of_request_identity_and_reaches_child(tmp_path): + import json + + async def run(): + service = CreationTasks(tmp_path / "tasks.sqlite3") + received = tmp_path / "tos.json" + result = { + "runtime_id": "r-test", + "skill_space_id": "ss-test", + "gateway_id": "gw-test", + "agent_id": "mi-test", + "region": "cn-beijing", + "state": "ready", + } + code = ( + "import json,sys,pathlib; " + "data=json.loads(sys.stdin.read()); " + f"pathlib.Path({str(received)!r}).write_text(json.dumps(data['tos'])); " + f"print('MPA_EVENT '+json.dumps({{'result': {result!r}}}))" + ) + service.command = lambda: [sys.executable, "-c", code] + payload = { + "requestId": "91919191-9191-4191-8191-919191919191", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + "tosBucket": "agentkit-platform-output", + } + task = await service.start( + "owner", + payload, + config_path="unused", + timeout=60, + tos={"tosBucket": payload["tosBucket"]}, + ) + await asyncio.gather(*service.running.values()) + response = service.get("owner", task["taskId"]) + assert response["tosBucket"] == "agentkit-platform-output" + assert json.loads(received.read_text()) == { + "tosBucket": "agentkit-platform-output" + } + with pytest.raises(TaskError, match="different inputs"): + await service.start( + "owner", + {**payload, "tosBucket": "agentkit-platform-other"}, + config_path="unused", + timeout=60, + tos={"tosBucket": "agentkit-platform-other"}, + ) + await service.close() + + asyncio.run(run()) + + def test_stopped_supervisor_retries_original_task_without_nested_writer(tmp_path): async def run(): service = CreationTasks(tmp_path / "tasks.sqlite3") @@ -487,6 +612,11 @@ async def started(): "key,expected", [ ("iamPermissionDenied", "iamPermissionDenied"), + ( + "openvikingModelConfigurationRejected", + "openvikingModelConfigurationRejected", + ), + ("openvikingCreateUnknown", "openvikingCreateUnknown"), ("private-provider-text", "creationFailed"), ], ) @@ -515,3 +645,57 @@ async def run(): await service.close() asyncio.run(run()) + + +def test_name_scope_reserves_only_active_tasks_and_remains_private(tmp_path): + import json + import os + from veadk.integrations.mpa.managed.names import NameCheckError + from veadk.integrations.mpa.managed.tasks import TaskError + + async def run(): + service = CreationTasks(tmp_path / "tasks.sqlite3") + scope = {"provider": "volcengine", "account": "a", "region": "cn-beijing"} + first = { + "requestId": "first", + "name": "same-name", + "agentId": "mi-first", + "description": "", + "region": "cn-beijing", + } + with service.db() as db: + db.execute( + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,name_scope) VALUES (?,?,?,?,?,?,?,?,?)", + ( + "old", + "owner-a", + "first", + json.dumps(first, sort_keys=True), + "running", + "queued", + os.getpid(), + 0, + json.dumps(scope), + ), + ) + other = {**first, "requestId": "second", "agentId": "mi-second"} + with pytest.raises(NameCheckError): + await service.start( + "owner-b", other, config_path=None, timeout=60, name_scope=scope + ) + assert service.get("owner-a", "old")["state"] == "running" + assert "name_scope" not in service.get("owner-a", "old") + service.check_name("owner-b", other, {**scope, "account": "different"}) + service._update("old", state="failed") + service.check_name("owner-b", other, scope) + with pytest.raises(TaskError, match="account snapshot"): + await service.start( + "owner-a", + first, + config_path=None, + timeout=60, + name_scope={**scope, "account": "different"}, + ) + await service.close() + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_worker.py b/tests/integrations/mpa_managed/test_worker.py index 7d0068b93..43b7182db 100644 --- a/tests/integrations/mpa_managed/test_worker.py +++ b/tests/integrations/mpa_managed/test_worker.py @@ -592,6 +592,71 @@ def test_worker_tos_metadata_mismatch_fails_closed(): ) +@pytest.mark.parametrize( + "mode,role,credentials", + [ + ("TOS_CREDENTIAL_TYPE_ACCESS_KEY", "WorkerRole", None), + ("TOS_CREDENTIAL_TYPE_IAM_ROLE", "OtherRole", None), + ("TOS_CREDENTIAL_TYPE_IAM_ROLE", "WorkerRole", {"AccessKeyId": "test-key"}), + (None, "WorkerRole", None), + ], +) +def test_iam_mount_reuse_rejects_mode_role_or_credentials_conflict( + mode, role, credentials +): + from veadk.integrations.mpa.managed.worker import _missing_worker_metadata + from veadk.integrations.mpa.mpa_tool import build_tos_mount_config + + expected = build_tos_mount_config( + tos_bucket="session-output", region="cn-beijing", tos_credential_type="iam_role" + ).model_dump(by_alias=True, exclude_none=True, mode="json") + with pytest.raises(DeploymentError, match="IAM role"): + _missing_worker_metadata( + { + "RoleName": role, + "TosMountConfig": { + **expected, + "CredentialType": mode, + "Credentials": credentials, + }, + }, + tool_id="t-one", + project="default", + owned={}, + agent_id="agent", + managed=False, + expected_tos=expected, + expected_role="WorkerRole", + ) + + +def test_iam_mount_reuse_accepts_exact_worker_role(): + from veadk.integrations.mpa.managed.worker import _missing_worker_metadata + from veadk.integrations.mpa.mpa_tool import build_tos_mount_config + + expected = build_tos_mount_config( + tos_bucket="session-output", region="cn-beijing", tos_credential_type="iam_role" + ).model_dump(by_alias=True, exclude_none=True, mode="json") + assert ( + _missing_worker_metadata( + { + "ToolId": "t-one", + "ProjectName": "default", + "RoleName": "WorkerRole", + "TosMountConfig": expected, + }, + tool_id="t-one", + project="default", + owned={}, + agent_id="agent", + managed=False, + expected_tos=expected, + expected_role="WorkerRole", + ) + == [] + ) + + def test_worker_discovery_follows_cursor_even_after_short_page(): cloud = WorkerCloud(None) target = {"Name": "target", "ToolId": "target-id"} diff --git a/tests/integrations/mpa_managed/test_worker_recovery.py b/tests/integrations/mpa_managed/test_worker_recovery.py index fbaa43b8c..e5700d5a2 100644 --- a/tests/integrations/mpa_managed/test_worker_recovery.py +++ b/tests/integrations/mpa_managed/test_worker_recovery.py @@ -17,6 +17,7 @@ import asyncio import json import sys +from types import SimpleNamespace from unittest.mock import AsyncMock import pytest @@ -160,6 +161,85 @@ async def run(): asyncio.run(run()) +def test_worker_retry_records_safe_wrapped_provider_metadata(monkeypatch): + from veadk.integrations.mpa.managed import diagnostics + + metadata = { + "ResponseMetadata": { + "RequestId": "20261015153100ABCDEF0123456789ABCD", + "Error": { + "Code": "AccessDenied", + "Message": "private provider detail", + }, + }, + "Result": {"Secret": "private value"}, + } + + class SDKBodyError(Exception): + response = SimpleNamespace(json=lambda: metadata) + + async def run(): + sleep = AsyncMock() + monkeypatch.setattr(diagnostics.asyncio, "sleep", sleep) + outer = ApiError("private wrapper") + outer.__cause__ = SDKBodyError("private body") + + async def fail(): + raise outer + + events = [] + with diagnostics.diagnostic_scope(events.append), pytest.raises(ApiError): + await diagnostics.retry_worker("create_worker", fail) + assert events == [ + { + "operation": "create_worker", + "category": "permission", + "attempt": 1, + "outcome": "failed", + "errorCode": "AccessDenied", + "requestId": metadata["ResponseMetadata"]["RequestId"], + } + ] + sleep.assert_not_called() + assert "private" not in json.dumps(events) + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "argument", + [ + "private non-JSON response", + b"not JSON", + '{"ResponseMetadata":{"Error":{"Code":"SK_private_token"},"RequestId":"private token"}}', + ], +) +def test_worker_retry_rejects_unsafe_wrapped_provider_metadata(argument): + from veadk.integrations.mpa.managed import diagnostics + + async def run(): + outer = ApiError("private wrapper") + outer.__cause__ = Exception(argument) + + async def fail(): + raise outer + + events = [] + with diagnostics.diagnostic_scope(events.append), pytest.raises(ApiError): + await diagnostics.retry_worker("create_worker", fail) + assert events == [ + { + "operation": "create_worker", + "category": "provider_error", + "attempt": 1, + "outcome": "failed", + } + ] + assert "private" not in json.dumps(events) + + asyncio.run(run()) + + @pytest.mark.parametrize("cancel", [True, False]) def test_cancel_or_deadline_stops_backoff_without_next_call(monkeypatch, cancel): from veadk.integrations.mpa.managed import diagnostics diff --git a/tests/integrations/test_mpa_compatibility_manifest.py b/tests/integrations/test_mpa_compatibility_manifest.py index c9fe5958b..f95fa1500 100644 --- a/tests/integrations/test_mpa_compatibility_manifest.py +++ b/tests/integrations/test_mpa_compatibility_manifest.py @@ -16,14 +16,21 @@ import json import subprocess + +import pytest from pathlib import Path -from veadk.cli.mpa_p0_contract import load_default_matrix +from veadk.cli.mpa_p0_contract import ( + DEFAULT_COMPATIBILITY_MATRIX, + default_matrix_path, + load_default_matrix, +) ROOT = Path(__file__).resolve().parents[2] RUNNER = ROOT / "scripts" / "verify-mpa-p0-contract.sh" -MATRIX = ROOT / "contracts" / "mpa-p0" / "compatibility-matrix.json" +RESOURCE_DIR = ROOT / "frontend" / "server" / "mpa" / "contracts" / "mpa-p0" +MATRIX = RESOURCE_DIR / "compatibility-matrix.json" def _manifest(tmp_path: Path, **overrides: object) -> Path: @@ -98,3 +105,59 @@ def test_preflight_rejects_malformed_or_secret_bearing_manifest(tmp_path: Path) assert report["status"] == "invalid_manifest" assert "accessKey" not in result.stdout assert "must-not-be-accepted" not in result.stdout + + +def test_default_matrix_path_is_owned_by_studio_mpa() -> None: + assert default_matrix_path() == MATRIX + assert MATRIX.is_file() + + +def test_absent_default_matrix_preserves_embedded_rules(tmp_path, monkeypatch) -> None: + from veadk.cli import mpa_p0_contract + + monkeypatch.setattr( + mpa_p0_contract, "default_matrix_path", lambda: tmp_path / "absent.json" + ) + assert load_default_matrix() == DEFAULT_COMPATIBILITY_MATRIX + + +@pytest.mark.parametrize("content", ["invalid JSON", "[]"]) +def test_malformed_present_matrix_is_not_hidden_by_fallback( + tmp_path, monkeypatch, content +) -> None: + from veadk.cli import mpa_p0_contract + + matrix = tmp_path / "invalid.json" + matrix.write_text(content) + monkeypatch.setattr(mpa_p0_contract, "default_matrix_path", lambda: matrix) + with pytest.raises(ValueError): + load_default_matrix() + + +@pytest.mark.parametrize( + "filename", ["compatibility-matrix.json", "benchmark-report.schema.json"] +) +def test_studio_wheel_staging_carries_mpa_contract_resources( + tmp_path, filename +) -> None: + from frontend.service.studio_release_server.publisher import ( + stage_studio_wheel_source, + ) + + source = tmp_path / "source" + source.mkdir() + for filename_root in ("pyproject.toml", "README.md", "LICENSE"): + (source / filename_root).write_text("fixture") + (source / "veadk").mkdir() + (source / "veadk" / "__init__.py").write_text("") + relative = Path("frontend/server/mpa/contracts/mpa-p0") / filename + resource = source / relative + resource.parent.mkdir(parents=True) + expected = (RESOURCE_DIR / filename).read_bytes() + resource.write_bytes(expected) + assets = tmp_path / "assets" + assets.mkdir() + (assets / "index.html").write_text("fixture") + destination = tmp_path / "wheel-source" + stage_studio_wheel_source(source, assets, destination) + assert (destination / relative).read_bytes() == expected diff --git a/tests/integrations/test_mpa_tool.py b/tests/integrations/test_mpa_tool.py index 8d63eed7b..042081976 100644 --- a/tests/integrations/test_mpa_tool.py +++ b/tests/integrations/test_mpa_tool.py @@ -27,6 +27,17 @@ ) +def test_iam_tos_payload_uses_role_without_access_keys(): + from veadk.integrations.mpa.mpa_tool import build_tos_mount_config + + payload = build_tos_mount_config( + tos_bucket="session-output", region="cn-beijing", tos_credential_type="iam_role" + ).model_dump(by_alias=True, exclude_none=True, mode="json") + assert payload["CredentialType"] == "TOS_CREDENTIAL_TYPE_IAM_ROLE" + assert "Credentials" not in payload + assert payload["MountPoints"][0]["LocalMountPath"] == "/data/output" + + class _FakeToolsClient: """Minimal stub of AgentkitToolsClient recording calls.""" diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index d4387869a..19b801943 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -111,6 +111,7 @@ default_region, default_vefaas_application_template_id, normalize_cloud_provider, + tag_openapi_host, ) from veadk.utils.logger import get_logger @@ -10061,6 +10062,12 @@ def _runtime_resource_tags( configuration.session_token = token or "" configuration.region = region configuration.client_side_validation = True + if provider == "byteplus": + setattr( + configuration, + "host", + f"https://{tag_openapi_host(provider)}", + ) client = volcenginesdktag.TAGApi(volcenginesdkcore.ApiClient(configuration)) response = client.get_resources( volcenginesdktag.GetResourcesRequest( @@ -10116,6 +10123,12 @@ def _runtime_resources_by_tags( configuration.session_token = token or "" configuration.region = region configuration.client_side_validation = True + if provider == "byteplus": + setattr( + configuration, + "host", + f"https://{tag_openapi_host(provider)}", + ) client = volcenginesdktag.TAGApi(volcenginesdkcore.ApiClient(configuration)) request = volcenginesdktag.GetResourcesRequest( max_results=max(1, min(max_results, 100)), @@ -10778,6 +10791,42 @@ async def _list_one(reg: str) -> list[dict]: logger.error(f"list my-runtimes failed: {e}", exc_info=True) raise HTTPException(status_code=502, detail=str(e)) + from frontend.server.mpa_deletion_status import mount_mpa_deletion_status + + def _mpa_deletion_runtime_page(region: str, token: str) -> dict: + from agentkit.sdk.runtime import types as _rt + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + + ak, sk, svc_token = _resolve_ve_credentials() + client = AgentkitRuntimeClient( + access_key=ak, secret_key=sk, session_token=svc_token or "", region=region + ) + response = client.list_runtimes( + _rt.ListRuntimesRequest(PageSize=100, NextToken=token or None) + ) + return { + "AgentKitRuntimes": [ + item.model_dump(by_alias=True, exclude_none=True) + for item in response.agent_kit_runtimes or [] + ], + "NextToken": response.next_token, + } + + def _mpa_deletion_owner(request: Request) -> str: + principal = _require_agent_management(request) + return str(principal.owner_id if principal is not None else "local") + + remember_mpa_deletion = mount_mpa_deletion_status( + app, + owner=_mpa_deletion_owner, + get_runtime=lambda request, runtime_id, region: _authorized_runtime( + request, runtime_id, region, managed_only=True, coded_access_error=True + ), + list_page=_mpa_deletion_runtime_page, + credentials=_resolve_ve_credentials, + region=_coerce_cloud_region, + ) + @app.post("/web/delete-runtime") async def _web_delete_runtime(request: Request): """Delete an AgentKit runtime by id (used by the '管理 Agent' view).""" @@ -10797,16 +10846,14 @@ async def _web_delete_runtime(request: Request): AgentReviewService.require_editable(runtime) runtime_tags = _runtime_tags(runtime) if _runtime_agent_category(runtime, runtime_tags) == "mpa": + remember_mpa_deletion(request, runtime_id, region) await _delete_mpa_runtime_with_preview_guard( request=request, runtime_id=runtime_id, region=region, runtime=runtime, - mpa_instance_id=str( - data.get("mpaInstanceId") - or _runtime_mpa_instance_id(runtime, runtime_tags) - or runtime_id - ), + mpa_instance_id=_runtime_mpa_instance_id(runtime, runtime_tags) + or runtime_id, owner=str(principal.owner_id if principal is not None else "local"), ) return {"success": True} @@ -12309,6 +12356,67 @@ def _resolve_mpa_runtime_profile_connection( allow_in_memory=dev, ) + from contextlib import asynccontextmanager + + from veadk.integrations.mpa.managed.credentials import Credentials + from veadk.integrations.mpa.managed.deletion import ( + ResourceDeletionError, + owned_resource_cleanup, + ) + from veadk.integrations.mpa.managed.runtime import RuntimeCloud + + @asynccontextmanager + async def _mpa_resource_cleanup(runtime: Any, agent_id: str, region: str): + snapshot = { + "RuntimeId": str(getattr(runtime, "runtime_id", "") or ""), + "ToolId": str(getattr(runtime, "tool_id", "") or ""), + "ProjectName": str(getattr(runtime, "project_name", "") or "default"), + "Envs": [ + {"Key": key, "Value": value} + for key, value in _runtime_env_map(runtime).items() + ], + } + + def credentials(): + ak, sk, token = _resolve_ve_credentials() + return Credentials(ak, sk, token or "") + + cloud = RuntimeCloud( + region=region, + credential_file="", + provider=provider, + credentials=credentials, + cache_identity=True, + ) + try: + async with owned_resource_cleanup( + runtime=snapshot, agent_id=agent_id, region=region, cloud=cloud + ) as cleanup: + yield cleanup + except (HTTPException, MpaRuntimeError): + raise + except ResourceDeletionError as error: + raise HTTPException( + status_code=409, + detail={ + "code": "mpa_resource_cleanup_failed", + "message": str(error), + "stage": error.stage, + }, + ) from None + except Exception: + raise HTTPException( + status_code=502, + detail={ + "code": "mpa_resource_cleanup_failed", + "message": "Unable to verify MPA resource ownership; check registry and cloud permissions, then retry.", + }, + ) from None + + async def _mpa_delete_resources_preview(runtime: Any, agent_id: str, region: str): + async with _mpa_resource_cleanup(runtime, agent_id, region) as cleanup: + return await cleanup.preview() + async def _delete_mpa_runtime_with_preview_guard( *, request: Request, @@ -12333,30 +12441,14 @@ async def _delete_mpa_runtime_with_preview_guard( owner, mpa_instance_id, ) - profile: dict[str, Any] | None = None - sessions: list[Any] = [] + profile = None blockers: list[str] = [] - try: - profile_result = await mpa_runtime_client.profile_status( - endpoint=endpoint, - mpa_instance_id=mpa_instance_id, - bearer_token=runtime_bearer, - ) - profile = ( - profile_result.model_dump(mode="json", by_alias=True) - if hasattr(profile_result, "model_dump") - else dict(profile_result) - ) - sessions = await mpa_runtime_client.list_sessions( - endpoint=endpoint, - bearer_token=runtime_bearer, - include_a2a=True, - ) - except MpaRuntimeError as error: - if error.status_code == 404: - blockers.append("orphan_runtime") - else: - raise + sessions = await mpa_runtime_client.list_sessions( + endpoint=endpoint, + bearer_token=runtime_bearer, + include_a2a=True, + user_id=owner, + ) session_payloads = [_session_payload(session) for session in sessions] active_sessions = [ item @@ -12365,9 +12457,7 @@ async def _delete_mpa_runtime_with_preview_guard( ] if _operation_blocks_delete( active_operation, - binding_status=( - "orphan_runtime" if "orphan_runtime" in blockers else "bound" - ), + binding_status="bound", profile=profile, ): blockers.append("active_operation") @@ -12376,9 +12466,7 @@ async def _delete_mpa_runtime_with_preview_guard( if blockers: detail = _delete_preview_payload( mpa_instance_id=mpa_instance_id, - binding_status=( - "orphan_runtime" if "orphan_runtime" in blockers else "bound" - ), + binding_status="bound", runtime={ "runtimeId": runtime_id, "region": region, @@ -12394,20 +12482,25 @@ async def _delete_mpa_runtime_with_preview_guard( sessions=sessions, ) raise HTTPException(status_code=409, detail=detail) - for item in session_payloads: - session_id = item["sessionId"].strip() - if not session_id: - continue - try: - await mpa_runtime_client.delete_session( - endpoint=endpoint, - session_id=session_id, - bearer_token=runtime_bearer, - ) - except MpaRuntimeError as error: - if error.status_code != 404: - raise - _delete_agentkit_runtime(runtime_id, region) + async with _mpa_resource_cleanup(runtime, mpa_instance_id, region) as cleanup: + await cleanup.preview() + for item in session_payloads: + session_id = item["sessionId"].strip() + if not session_id: + continue + try: + await mpa_runtime_client.delete_session( + endpoint=endpoint, + session_id=session_id, + bearer_token=runtime_bearer, + user_id=owner, + ) + except MpaRuntimeError as error: + if error.status_code != 404: + raise + await cleanup.delete_resources() + await asyncio.to_thread(_delete_agentkit_runtime, runtime_id, region) + await cleanup.mark_runtime_deleted() mount_mpa_profile_routes( app, @@ -12426,6 +12519,7 @@ async def _delete_mpa_runtime_with_preview_guard( else "local" ), resolve_runtime_bindings=_resolve_mpa_runtime_bindings, + resolve_delete_resources=_mpa_delete_resources_preview, ) @app.get("/web/runtime-tool-channel/{runtime_id}/capabilities") @@ -17857,6 +17951,9 @@ def frontend_deploy( veadk_environments["AGENTKIT_CLOUD_PROVIDER"] = provider_id if provider_id == "byteplus": veadk_environments["BYTEPLUS_REGION"] = region + veadk_environments["VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE"] = ( + "/var/run/secrets/iam/credential" + ) veadk_environments["DATABASE_VIKING_REGION"] = ( DEFAULT_BYTEPLUS_VIKING_MEMORY_REGION ) diff --git a/veadk/cli/frontend_deploy_policy.py b/veadk/cli/frontend_deploy_policy.py index 2c03649d3..4f551203c 100644 --- a/veadk/cli/frontend_deploy_policy.py +++ b/veadk/cli/frontend_deploy_policy.py @@ -242,6 +242,9 @@ "vikingdb:UpdateCollection", "vikingdb:DeleteCollection", "vikingdb:CreateMemorydbInstance", + "vikingdb:CreateOpenVikingCollection", + "vikingdb:GetOpenVikingCollection", + "vikingdb:AccessOpenVikingApiKey", "vpc:DescribeSecurityGroups", "vpc:CreateSubnet", "vpc:CreateVpc", diff --git a/veadk/cli/mpa_p0_contract.py b/veadk/cli/mpa_p0_contract.py index 084063a39..51f1730f3 100644 --- a/veadk/cli/mpa_p0_contract.py +++ b/veadk/cli/mpa_p0_contract.py @@ -62,6 +62,9 @@ def default_matrix_path() -> Path: return ( Path(__file__).resolve().parents[2] + / "frontend" + / "server" + / "mpa" / "contracts" / "mpa-p0" / "compatibility-matrix.json" diff --git a/veadk/integrations/mpa/managed/README.md b/veadk/integrations/mpa/managed/README.md index ad3bdc256..a29776f64 100644 --- a/veadk/integrations/mpa/managed/README.md +++ b/veadk/integrations/mpa/managed/README.md @@ -4,6 +4,40 @@ VeADK prepares MPA prerequisites and deploys an agent without an `agentkit-mpa-agent` source checkout. Studio and `veadk mpa provision` use the same implementation. The deployed MPA image must support account-shared APIG registration and metadata bootstrap. +## TOS output storage with IAM Role + +In Studio, optionally select an owned bucket beginning with `agentkit-platform-` +in the deployment region; no TOS +access keys are requested. Creation adds a bucket-specific custom policy to the +actual Worker Tool role (normally `IDRoleForArkClawShareAgent`) before preparing +workload identity, databases or network resources. It preserves existing policies +and refuses conflicting trust, account ownership or same-name policy content. +Empty selection keeps server defaults; the built-in profile has no mount. + +The added policy allows HeadBucket/ListBucket on that bucket and +GetObject/PutObject/AbortMultipartUpload/DeleteObject only on its +`sandbox-session/*` objects. The read-write mount remains `/data/output`, with +canonical per-session TOS paths. All consumers of the shared role receive these +permissions; directory separation is not tenant authorization. Public bucket +policies are unchanged and SSE-KMS needs separately approved key permissions. + +Deployment credentials must allow `tos:ListBuckets` and IAM GetRole, GetPolicy, +CreatePolicy, ListAttachedRolePolicies and AttachRolePolicy, in addition to normal +provisioning permissions. Managed CLI YAML can opt in without keys: + +```yaml +managed: + worker: + tos-credential-type: iam_role + tos-bucket: example-output-bucket + # Keep the existing image, role and remaining managed options. +``` + +Historical CLI/YAML AK/SK mode remains compatible. Existing Tools/Sessions are +not changed automatically. Old Studio pages sending credential fields must be +refreshed. See [the maintained contract](../../../../specs/studio-mpa-creation/README.md#con-17--bucket-only-iam-tos-mounts) +and [implementation/verification evidence](../../../../prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.md). + ## Automatic PG setup (recommended for new installations) Studio's built-in Beijing profile uses automatic PostgreSQL preparation; CLI users set `managed.postgres.mode: auto` in their private YAML. No PG host/user/password or PG URL environment variables are needed. Use the deployment account's rotating STS credentials with `GetCallerIdentity`, AIDAP `CreateWorkspace`, `DescribeWorkspaces`, `DescribeWorkspaceDetail`, `DescribeBranches`, `DescribeComputes`, `DescribeWorkspaceEndpoint`, `DescribeDBAccounts`, `DescribeDatabases`, and `DescribeDBAccountConnection` permissions, in addition to the existing AgentKit/VPC/APIG permissions and model/role setup. Enable AIDAP for that account and ensure the returned PostgreSQL endpoint is reachable from Studio and Runtime. This flow uses the provider's public endpoint and does not modify database network/allowlist settings. @@ -27,6 +61,15 @@ All Studio/CLI processes for a scope must use the **same durable bootstrap file Confirmed `CreateFailed` Workspaces no longer permanently block later automatic requests. The bootstrap validates their scope, retains their cloud resources and records their IDs separately before releasing the failed binding. Retry may create a replacement; a newly failed purchase is not repeated in the same task. Explicit Workspace IDs, operational failures and uncertain outcomes still require inspection rather than blind replacement. Previously retired failures cannot authorize repeating a newer timed-out request. See CON-13 in the [recovery contract](../../../../specs/studio-mpa-creation/README.md). + +### Independent business Workspace for new Studio agents + +New Studio forms submit `businessWorkspaceMode: per-agent` and `businessDatabaseName: aidb`. They reuse `mpa_admin_workspace/mpa_admin_db`, create `mpa_agent_` as the dedicated business Workspace, and use its initial `aidb` database. Workspace IDs, names, database selection and endpoints are pinned. Existing submitted requests/registered Workspaces keep their original hash or shared names and databases. No existing resource is renamed or migrated. + +The first Next and final submission perform authorized, bounded name checks for Runtime, sandbox template and target Workspace. Same-request own resources may be reused; foreign/ambiguous collisions require another name, and query failures require rechecking. Active requests on one Studio host reserve their names by verified provider/account/region; failed requests do not hold a local reservation. The backend checks again before new-layout prerequisites. Read-only checks do not provide atomic exclusion across independent hosts; cloud ownership/uniqueness enforcement remains authoritative. + +Explicit CLI/YAML profiles enable the new layout with `managed.postgres.mode: auto`, `business-workspace-mode: per-agent` and `business-database-name: aidb`, without a configured business Workspace ID. Omitting the database selection preserves the previous hashed per-agent layout; omitting both selects the original shared layout. Initial aidb adoption validates the dedicated Workspace, database owner, absence of non-system/non-extension relations and absence of a previous Runtime/ready binding, then transaction-locks and marks it. Missing, foreign or nonempty initial databases fail closed. `init-admin-db` migration remains a shared-layout operation. Runtime/skill/Feishu logic is unchanged; deleting MPA retains PG resources. See [design and verification](../../../../prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.md). + ### Existing installation cutover Automatic mode refuses to run while the old shared registry URL remains configured by default. If old MPA resources may be abandoned for **new** creations, CLI users set `managed.postgres.legacy-urls: ignore` in their private YAML; Studio's built-in profile already uses this setting. Both paths then ignore `SHARED_APIG_DATABASE_URL` and `DEPLOYMENT_DATABASE_ADMIN_URL` even if they remain in the process environment. New agents start with fresh admin and business Workspaces; old agents, databases, Runtime connections and records are not changed or deleted. Do not use this setting to resume an unfinished old creation task under the same agent ID. @@ -131,7 +174,7 @@ VPC/APIG still share by account and region. Deployment JSON records retain both After a new `veadk studio deploy`, managed creation automatically reuses that Studio's UserPool, client, Identity region, and `/oauth/callback` from server-side VeFaaS environment. Studio uses built-in Beijing Runtime/worker image and model defaults without any creation YAML; its deployment account comes from STS. Its model API key is read with deployment credentials during creation (see Ark key discovery below). For standalone CLI YAML profiles, explicitly different `user-pool-name`, `user-pool-client-name`, `identity-callback-url`, `identity-region`, or corresponding `managed.runtime.env` values fail configuration inspection before cloud writes. A Studio deployed before this capability must be redeployed to receive the values. Standalone `veadk mpa provision` without these Studio environment values continues to use explicit YAML. The shared PostgreSQL Workspace is created later during MPA creation and is not the deployment-time Identity store. -Choose **Agents → MPA agents → Create MPA agent**. The three steps collect basic information, automatic PostgreSQL preparation, and optional OpenViking service URL/resource ID/API Key. Enter a Runtime name (4–64 ASCII letters, digits, underscores or hyphens). The server generates the agent ID and injects it into Agent and Worker; it is not shown as an input. New creations use `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` and `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest` without image inputs. Already-submitted tasks retain their image selection for retry. Existing Runtimes are not renamed or automatically upgraded. The PG step links to the [Volcengine AIDAP console](https://console.volcengine.com/aidap/region:aidap+cn-beijing/); the service obtains Workspace connections after submission. The OpenViking step links to the [context-management console](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default); this is a console page, not the service URL to enter. PG credentials stay server-configured. Enter the OpenViking URL, resource ID and masked API Key together to inject `OPENVIKING_URL`, `OPENVIKING_RESOURCE_ID`, `OPENVIKING_API_KEY` and `OPENVIKING_USER=default`. Leave all three blank to omit these variables, including inherited template/reference values. The key is not saved in browser drafts or task SQLite and must be re-entered after a browser restart. Review the resource plan and submit on step three. The workflow prepares account network/APIG/IM Gateway, a worker, an isolated business database and Skill Space, then deploys and checks Runtime and application readiness. Successful creation refreshes the directory. +Choose **Agents → MPA agents → Create MPA agent**. The three steps collect basic information, automatic PostgreSQL preparation, and OpenViking preparation. Enter a Runtime name (4–64 ASCII letters, digits, underscores or hyphens). The server generates the agent ID and injects it into Agent and Worker; it is not shown as an input. New creations use `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` and `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest` without image inputs. Already-submitted tasks retain their image selection for retry. Existing Runtimes are not renamed or automatically upgraded. The PG step links to the [Volcengine AIDAP console](https://console.volcengine.com/aidap/region:aidap+cn-beijing/); the service obtains Workspace connections after submission. The OpenViking step links to the [OpenViking console](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/). New Beijing requests automatically create an independent enterprise library with default VLM/Embedding models, wait for READY, and obtain the default-user API Key server-side. The library is a paid retained resource and is not removed when an MPA is deleted. Registered libraries are reused on retry; an ambiguous create outcome requires operator reconciliation. Default-model acceptance for new API-created libraries requires live verification. PG credentials stay server-configured. For BytePlus and already-submitted manual requests, enter the OpenViking URL, resource ID and masked API Key together to inject `OPENVIKING_URL`, `OPENVIKING_RESOURCE_ID`, `OPENVIKING_API_KEY` and `OPENVIKING_USER=default`. In manual mode, leave all three blank to omit these variables, including inherited template/reference values. The key is not saved in browser drafts or task SQLite and must be re-entered after a browser restart. Review the resource plan and submit on step three. The workflow prepares account network/APIG/IM Gateway, a worker, an isolated business database and Skill Space, then deploys and checks Runtime and application readiness. Successful creation refreshes the directory. The initial configuration check is local validation, **not** proof of live permissions or connectivity. Cloud identity and database permissions are checked after submission and before resource creation; each later cloud step validates its own response. Close the dialog to leave creation running, or cancel explicitly to stop orchestration. Reopen it in the same browser session to recover progress. The dialog supports keyboard operation, multiline Chinese input, both themes and narrow windows. @@ -294,6 +337,57 @@ Ark mode requires `model-provider: openai` and the selected region's Ark `/api/v ### BytePlus managed MPA creation -Start Studio with `BYTEPLUS_ACCESS_KEY` / `BYTEPLUS_SECRET_KEY` in the server process and `uv run veadk studio --provider byteplus --open`. MPA creation currently targets `ap-southeast-1`, using the same three-step form and shared admin/business Workspace layout. Provider selection is server-owned; domestic credentials and recovery files are not reused. In role-based deployments, set `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` to the rotating credential file explicitly. The default model is the existing overseas Studio ModelArk model; Ark key discovery requires overseas ListApiKeys/GetRawApiKey permissions and an existing usable key. +Start Studio with `BYTEPLUS_ACCESS_KEY` / `BYTEPLUS_SECRET_KEY` in the server process and `uv run veadk studio --provider byteplus --open`. MPA creation currently targets `ap-southeast-1`, using the same three-step form and shared admin/business Workspace layout. Provider selection is server-owned; domestic credentials and recovery files are not reused. Cloud `veadk studio deploy` sets `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` to the mounted rotating IAM credential file automatically; other role-based hosting must configure the file explicitly. The default model is the existing overseas Studio ModelArk model; Ark key discovery requires overseas ListApiKeys/GetRawApiKey permissions and an existing usable key. There are no overseas image defaults yet. The existing public MPA/Worker images remain defaults, with optional server overrides `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE`; overseas image pull and image compatibility require a real creation test. `VEADK_MPA_BYTEPLUS_AIDAP_HOST` optionally selects a deployment-specific AIDAP hostname. Cloud service activation, IAM policy/API availability, quotas and model access are account prerequisites; a locally configured form does not prove they are available. Missing overseas services fail instead of falling back to Volcengine. Existing Volcengine defaults and general-agent chat remain unchanged. + +BytePlus Studio creation obtains an APM AppKey using deployment credentials and `GetAppKey` on `apmplus-server.ap-southeast-1.byteplusapi.com`, then injects `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY` into Runtime Envs so its bundled VeADK skips automatic lookup. Deployment credentials need `apmplus_server:GetAppKey`. Enabled application and platform APM defaults are restored; domestic and CLI paths are unchanged. A valid trusted explicit Runtime AppKey is reused. Lookup has bounded transient retries and safe diagnostics; keys never enter browser/task/bootstrap/deployment records. Restart Studio and use a new creation request; existing Runtimes are not automatically updated and pending-input hash checks remain. This does not validate OTLP export or fix BytePlus sandbox credential discovery. + +### Automatic OpenViking for explicit CLI profiles + +For Volcengine `cn-beijing`, opt in with `managed.openviking.mode: auto`; explicit profiles otherwise default to `manual`. BytePlus Johor is covered separately below. Deployment credentials need `vikingdb:CreateOpenVikingCollection`, `vikingdb:GetOpenVikingCollection` and `vikingdb:AccessOpenVikingApiKey`. Do not combine auto mode with manual OV connection fields. Auto creates use VLM `doubao-seed-2.0-lite` / `260428` and Embedding `doubao-embedding-vision` / `251215` with explicit Credentials Source=volcengine and the versioned model identifier as EndpointID. The already resolved Ark model key (or the explicitly configured/template MODEL_AGENT_API_KEY for CLI) is added only to the copied create payload; it is not stored in the registry. An exactly matching legacy no-Credentials intent can be corrected after a proven rejection with no registered library or pending Runtime operation. Unknown/registered intents cannot be automatically replaced. The registry stores intent and ResourceID only; keys are read again on retry. `OPENVIKING_USER=default` and the other three OV variables are injected before Runtime deployment. Failed, cancelled or deleted MPA deployments retain OV; reconcile uncertain creates before retrying. + + +### BytePlus Johor automatic OpenViking + +New BytePlus Studio requests select automatic personal-library preparation in `ap-southeast-1`, reusing the ordinary ModelArk API Key resolved by the MPA creation pipeline. No extra `OV_MODEL_API_KEY` or Coding Plan credential is required or read. Explicit CLI profiles opt in with `managed.openviking.mode: auto`; submitted manual tasks keep their original behavior. The resulting OV library Key remains separate from the model inference key. + +The adapter uses `vikingdb.ap-southeast-1.byteplusapi.com`, POST `/api/openviking/{Action}`, signing region `ap-southeast-1`, API version `2025-06-09`, and deployment-account BytePlus AK/SK/STS. It creates `Version=developer`, `Source=volcengine`, VLM `seed-2-0-lite` and Embedding `skylark-embedding-vision`, without ModelVersion. Each model credential contains the ordinary ApiKey and its EndpointID. After READY it obtains the default Key without sending UserID and injects the existing four variables, using `https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking`. Retry reuses the bound ResourceID, unknown create results block blind recreation, and cancellation/deletion retains the library. Secrets are not persisted in the resource registry. + +Personal libraries only support the default user. The supplied overseas contract requires Bearer authentication and `x-tt-env: pre` for data requests. This repository prepares resources; `agentkit-mpa-agent` must separately implement those semantics before OV memory can work. These changes do not establish live cloud availability or change Beijing enterprise provisioning. See the [design](../../../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.md). + +BytePlus inference EndpointID defaults (requested for trial, not verified overseas): + +| Model | Default EndpointID | Optional server override | +| --- | --- | --- | +| VLM | `doubao-seed-2-0-lite-260428` | `OV_VLM_ENDPOINT_ID` | +| Embedding | `doubao-embedding-vision-251215` | `OV_EMBEDDING_ENDPOINT_ID` | + +The key must have access to both endpoints. Overrides accept 1–128 ASCII letters/digits/hyphens/underscores/periods, starting with a letter or digit. Explicit blank/invalid overrides fail before resource mutation. Restart Studio after changing server settings. Domestic parameters do not use these overrides. Endpoint creation/discovery is not part of this flow. Provider rejection is surfaced; there is no Coding Plan or AgentPlan fallback. A retry after an OV intent was recorded must use the same endpoints and source; a prior Coding Plan intent cannot be silently migrated or recreated. See [inference design](../../../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.md). + + +### IAM temporary failures + +Runtime role preparation retries timeout, connection, throttling and unavailable failures at most four times with 1/2/4-second waits, inside the existing 120-second role deadline. Each retry reads the fixed role/policy names before writing, so a lost response cannot blindly recreate resources. Permission, invalid input, unknown errors and ownership/trust/policy conflicts fail immediately. Exhausted transient requests use `iamTemporaryFailure`; `iamPermissionDenied` continues to indicate deployment authorization failures. Cancellation stops subsequent calls; an already dispatched SDK request may still finish. + +Validated IAM operation/category/attempt/outcome and optional provider Request ID are stored in `task_diagnostics.request_id` and server logs; legacy rows receive an empty value through additive migration. Original messages, request bodies and credentials are excluded. Request IDs must be 16–128 hexadecimal characters/hyphens; unrecognized values are omitted. The previous four-field diagnostic protocol remains valid. To inspect, select `operation, category, attempt, outcome, request_id` from the task diagnostics for the affected task. Restart Studio to load this change. See [IAM recovery design](../../../../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.md). + +OpenViking failures write safe operation/category/errorCode/requestId diagnostics to the Studio backend log and bounded task_diagnostics records when structured provider metadata is available. errorCode/requestId are optional; transport errors may provide neither. Raw provider messages, request/response bodies and API keys are excluded. Load the updated backend before reproducing; existing uncertain-create tasks remain guarded and are not automatically redispatched. Historical error metadata cannot be recovered. + +BytePlus Studio new requests in ap-southeast-1 again automatically prepare personal OV. Submitted no-OV requests retain their mode on retry; use New Agent to test OV. Domestic automatic OV and existing binding/uncertain-create protection remain unchanged. + +Runtime create/update failures retain validated errorCode/requestId from structured SDK/HTTP metadata and bounded JSON or SDK bytes-literal exception arguments (65,536 bytes/characters, eight cycle-safe causes). Raw provider text, body and credentials are excluded. Restart Studio before reproducing; retries preserve existing inputs and ClientToken. Historical errors cannot be recovered. + +New BytePlus Studio creation also injects `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317` for OTLP/gRPC export. This collector differs from the GetAppKey control-plane host. Trusted explicit Runtime environment overrides retain precedence. Restart Studio before new requests; existing Runtimes and submitted task snapshots are not updated. Domestic creation remains unchanged. Actual Trace delivery requires separate live verification. + + +### Cloud Studio MPA IAM credentials and OpenViking permissions + +BytePlus `veadk studio deploy` automatically sets +`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential` for rotating +function-role credentials. Local AK/SK usage remains unchanged. Redeploy existing +installations to apply this setting and refresh the default Studio role policy, which +now includes the three OV provisioning operations on both providers. Custom roles +need equivalent authorization separately. See the maintained +[cloud IAM contract](../../../../specs/studio-mpa-creation/README.md#cloud-studio-mpa-iam-credentials-and-openviking-permissions) +for credential failure behavior and prerequisites. diff --git a/veadk/integrations/mpa/managed/README.zh.md b/veadk/integrations/mpa/managed/README.zh.md index 8c1a05c3e..d82d9caaf 100644 --- a/veadk/integrations/mpa/managed/README.zh.md +++ b/veadk/integrations/mpa/managed/README.zh.md @@ -4,6 +4,34 @@ VeADK 可准备 MPA 前置资源并部署智能体,无需检出 `agentkit-mpa-agent` 源码。Studio 和 `veadk mpa provision` 共用同一实现。部署的 MPA 镜像须支持账号共享 APIG 注册和元数据初始化。 +## 使用 IAM Role 的 TOS 输出存储 + +Studio 可选部署账号、部署地域下以 `agentkit-platform-` 开头的已有桶,不再要求 TOS AK/SK。创建流程会在 +准备工作负载身份、数据库或网络之前,为实际 Worker Tool 角色(通常为 +`IDRoleForArkClawShareAgent`)增量绑定桶专属自定义策略。保留已有策略,角色信任、 +账号归属或同名策略内容冲突则拒绝。空选择保留服务端默认配置;内置 profile 默认 +不挂载。 + +新增策略仅允许该桶的 HeadBucket/ListBucket,以及其 `sandbox-session/*` 对象的 +GetObject/PutObject/AbortMultipartUpload/DeleteObject。本地读写挂载保持 +`/data/output`,TOS 使用规范的逐会话目录。共享角色所有使用者都会获得这些权限, +目录区分不是租户授权。桶公开策略保持不变;SSE-KMS 需要另行批准密钥权限。 + +部署凭据除正常创建权限外,还须具备 `tos:ListBuckets` 和 IAM GetRole、GetPolicy、 +CreatePolicy、ListAttachedRolePolicies、AttachRolePolicy。managed CLI YAML 可配置: + +```yaml +managed: + worker: + tos-credential-type: iam_role + tos-bucket: example-output-bucket + # 保留已有镜像、角色及其他 managed 配置。 +``` + +历史 CLI/YAML AK/SK 模式保持兼容,不自动修改已有 Tool/Session。仍发送凭据字段的 +旧 Studio 页面需刷新。参见[维护契约](../../../../specs/studio-mpa-creation/README.zh.md#con-17--仅选桶-iam-tos-挂载) +及[实现与验证记录](../../../../prd-spec/features/studio-mpa-tos-iam/2026-10-12-bucket-only.zh.md)。 + ## 自动准备 PG(新部署推荐) Studio 内置的北京地域配置采用 PostgreSQL 自动准备;CLI 用户在私有 YAML 中设置 `managed.postgres.mode: auto`。不需要 PG 地址/用户名/密码或 PG URL 环境变量。部署账号的轮转 STS 凭据除已有 AgentKit/VPC/APIG 权限及模型/角色配置外,还需 `GetCallerIdentity`、AIDAP `CreateWorkspace`、`DescribeWorkspaces`、`DescribeWorkspaceDetail`、`DescribeBranches`、`DescribeComputes`、`DescribeWorkspaceEndpoint`、`DescribeDBAccounts`、`DescribeDatabases` 和 `DescribeDBAccountConnection` 权限。账号须已开通 AIDAP,且 Studio、Runtime 能连接返回的 PostgreSQL 端点。该流程使用服务商公网端点,不修改数据库网络/白名单设置。 @@ -27,6 +55,14 @@ managed: 明确为 `CreateFailed` 的 Workspace 不再永久阻塞后续自动创建请求。流程核验其范围,保留失败云资源,将 ID 单独记录后解除失败绑定。重试可创建替代资源,本次新购买失败不会在同一任务内重复购买。显式 Workspace ID、运行故障和未知结果仍需核查,不能盲目替换。之前已退出的失败资源不能用于授权重发更新的超时请求。参见[恢复规则](../../../../specs/studio-mpa-creation/README.zh.md)的 CON-13。 +### Studio 新智能体独立业务 Workspace + +Studio 新表单提交 `businessWorkspaceMode: per-agent` 和 `businessDatabaseName: aidb`。复用 `mpa_admin_workspace/mpa_admin_db`,独立业务 Workspace 为 `mpa_agent_<手填 Runtime 名称>`,业务库使用预建的 `aidb`。固定 Workspace ID、名称、数据库选择及端点。已提交请求/已有 Workspace 保留原哈希或共享名称及数据库,不重命名、不迁移。 + +首次下一步和最终提交对 Runtime、沙箱模板及目标 Workspace 执行授权、有超时的名称检查。同请求自身资源可复用;其他/不明确归属重名要求改名,查询失败要求重新检查。同一 Studio 主机活跃请求按已核验提供商/账号/地域占用名称,失败请求不保留本地占位。后端在新布局前置资源准备前再次检查。只读检查不能保证独立主机之间的原子互斥,最终依赖云端归属/唯一性约束。 + +显式 CLI/YAML 配置使用 `managed.postgres.mode: auto`、`business-workspace-mode: per-agent`、`business-database-name: aidb` 启用新布局,不配置业务 Workspace ID。省略数据库选择保持前一版独立 Workspace/哈希库,两个字段均省略则沿用原共享布局。接管初始 aidb 须核验独立 Workspace、数据库属主、无非系统/非扩展关系对象且无已有 Runtime/ready 绑定,再持事务锁写归属标记。缺失、其他归属或非空的初始库明确失败。`init-admin-db` 迁移仍是共享布局操作。Runtime/技能/飞书逻辑不变,删除 MPA 保留 PG 资源。见[设计与验证](../../../../prd-spec/features/mpa-name-preflight/2026-10-13-runtime-name-and-workspace-labels.zh.md)。 + ### 已有部署切换 旧共享注册库 URL 仍配置时,自动模式默认拒绝创建。如果新建任务可以舍弃旧 MPA 的资源关系,CLI 用户在私有 YAML 中设置 `managed.postgres.legacy-urls: ignore`;Studio 内置配置已采用该设置。即使 Studio 进程环境仍有 `SHARED_APIG_DATABASE_URL` 和 `DEPLOYMENT_DATABASE_ADMIN_URL`,该配置也不读取它们。新智能体从全新的管理与业务 Workspace 开始;旧智能体、数据库、Runtime 连接和记录都不修改或删除。不要用该设置以相同智能体 ID 继续未完成的旧创建任务。 @@ -78,7 +114,7 @@ AgentKit 返回的 Runtime 子网 ID 顺序可能不同。创建和重试接受 新执行 `veadk studio deploy` 后,托管创建会从服务端 VeFaaS 环境自动复用该 Studio 的 UserPool、客户端、Identity 地域和 `/oauth/callback`。Studio 无需创建 YAML,直接使用代码内置的北京地域 Runtime/worker 镜像及模型默认值,部署账号来自 STS;模型 API Key 在创建时使用部署凭据读取(见下文方舟 Key 自动发现)。独立 CLI YAML 若显式填写不同的 `user-pool-name`、`user-pool-client-name`、`identity-callback-url`、`identity-region` 或对应的 `managed.runtime.env` 值,配置检查会在云写入前失败。此前部署的 Studio 须重新部署才能获得这些值。没有 Studio 环境值的独立 `veadk mpa provision` 仍使用显式 YAML。共享 PostgreSQL Workspace 在后续创建 MPA 时才准备,并非部署时的 Identity 存储。 -选择**智能体 → MPA 智能体 → 创建 MPA 智能体**。三步依次填写基础信息、PostgreSQL 自动准备说明,以及可选的 OpenViking 服务地址/资源 ID/API Key。填写 Runtime 名称(4–64 个 ASCII 字母、数字、下划线或连字符)。服务端生成智能体 ID 并注入 Agent 和 Worker,不再显示 ID 输入框。新创建使用 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` 和 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`,不再显示镜像输入框。已提交任务重试保留原镜像选择。已有 Runtime 不会被重命名或自动升级。PG 步骤提供[火山引擎 AIDAP 控制台](https://console.volcengine.com/aidap/region:aidap+cn-beijing/)入口;服务端在提交后取得 Workspace 连接。OpenViking 步骤提供[上下文管理控制台](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default)入口;该页面地址不是要填写的服务地址。PG 凭据仍由服务端配置。同时填写 OpenViking 地址、资源 ID 和遮罩的 API Key 时,注入 `OPENVIKING_URL`、`OPENVIKING_RESOURCE_ID`、`OPENVIKING_API_KEY` 和 `OPENVIKING_USER=default`。三项全空时不注入这些变量,模板或参考 Runtime 中的旧值也不会继承。密钥不保存到浏览器草稿或任务 SQLite,浏览器重启后须重新填写。查看资源计划后在第三步提交。流程依次准备账号网络/APIG/IM Gateway、worker、独立业务库和 Skill Space,然后部署并检查 Runtime 和应用就绪状态。成功后刷新列表。 +选择**智能体 → MPA 智能体 → 创建 MPA 智能体**。三步依次填写基础信息、PostgreSQL 自动准备说明,以及 OpenViking 准备说明。填写 Runtime 名称(4–64 个 ASCII 字母、数字、下划线或连字符)。服务端生成智能体 ID 并注入 Agent 和 Worker,不再显示 ID 输入框。新创建使用 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` 和 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`,不再显示镜像输入框。已提交任务重试保留原镜像选择。已有 Runtime 不会被重命名或自动升级。PG 步骤提供[火山引擎 AIDAP 控制台](https://console.volcengine.com/aidap/region:aidap+cn-beijing/)入口;服务端在提交后取得 Workspace 连接。OpenViking 步骤提供[OpenViking 控制台](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/)入口。北京新请求使用默认 VLM/Embedding 模型自动创建独立企业库,等待 READY,再由服务端取得 default 用户 API Key。库是付费保留资源,不随 MPA 删除。重试复用已登记库;创建结果不确定时需要管理员核实。新 API 创建库是否接受默认模型仍需真实验证。PG 凭据仍由服务端配置。BytePlus 和已提交手动请求仍同时填写 OpenViking 地址、资源 ID 和遮罩的 API Key 时,注入 `OPENVIKING_URL`、`OPENVIKING_RESOURCE_ID`、`OPENVIKING_API_KEY` 和 `OPENVIKING_USER=default`。手动模式三项全空时不注入这些变量,模板或参考 Runtime 中的旧值也不会继承。密钥不保存到浏览器草稿或任务 SQLite,浏览器重启后须重新填写。查看资源计划后在第三步提交。流程依次准备账号网络/APIG/IM Gateway、worker、独立业务库和 Skill Space,然后部署并检查 Runtime 和应用就绪状态。成功后刷新列表。 最初的配置检查是本地校验,**不代表**真实权限或连通性已通过。提交后、创建资源前会检查云账号和数据库权限;后续各云步骤检查自身响应。关闭窗口可让创建继续,显式取消才停止编排。在同一浏览器会话重新打开可恢复进度。窗口支持键盘、多行中文输入、两种主题和窄窗口。 @@ -288,6 +324,55 @@ Ark 模式要求 `model-provider: openai` 和所选地域方舟 `/api/v3/` 地 ### BytePlus 托管创建 MPA -在服务端进程中设置 `BYTEPLUS_ACCESS_KEY` / `BYTEPLUS_SECRET_KEY`,使用 `uv run veadk studio --provider byteplus --open` 启动。MPA 创建目前面向 `ap-southeast-1`,沿用三步表单及共享管理/业务 Workspace 布局。平台由服务端决定,不复用国内凭据及恢复文件。角色部署时,显式设置 `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` 指向轮转凭据文件。默认模型为现有海外 Studio ModelArk 模型;方舟 Key 发现要求海外 ListApiKeys/GetRawApiKey 权限及一个已有可用 Key。 +在服务端进程中设置 `BYTEPLUS_ACCESS_KEY` / `BYTEPLUS_SECRET_KEY`,使用 `uv run veadk studio --provider byteplus --open` 启动。MPA 创建目前面向 `ap-southeast-1`,沿用三步表单及共享管理/业务 Workspace 布局。平台由服务端决定,不复用国内凭据及恢复文件。云端 `veadk studio deploy` 自动设置 `VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE` 指向挂载的轮转 IAM 凭据文件;其他角色托管方式仍需显式配置文件。默认模型为现有海外 Studio ModelArk 模型;方舟 Key 发现要求海外 ListApiKeys/GetRawApiKey 权限及一个已有可用 Key。 目前没有海外默认镜像,仍使用现有公开 MPA/Worker 镜像,可通过服务端 `VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE` / `VEADK_MPA_BYTEPLUS_WORKER_IMAGE` 覆盖;海外拉取及镜像兼容性需实际创建验证。`VEADK_MPA_BYTEPLUS_AIDAP_HOST` 可选指定部署对应的 AIDAP 主机名。服务开通、IAM 策略/API 可用性、配额及模型访问是账号前置条件;表单配置就绪不能证明这些资源可用。海外服务缺失时显式失败,不回退火山引擎。火山引擎默认配置及通用智能体聊天保持不变。 + +BytePlus Studio 创建使用部署凭据,向 `apmplus-server.ap-southeast-1.byteplusapi.com` 调用 `GetAppKey` 取得 APM AppKey,再注入 Runtime Envs 的 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY`,让内置 VeADK 跳过自动获取。部署凭据需要 `apmplus_server:GetAppKey`。恢复启用的应用和平台 APM 默认值,国内与 CLI 路径不变。复用可信配置中的有效显式 Runtime AppKey。获取采用有限临时重试和安全诊断,Key 不进入浏览器/任务/启动/部署记录。重启 Studio 并使用新的创建请求;已有 Runtime 不自动更新,保留未完成输入哈希检查。这不证明 OTLP 上报正常,也不修复 BytePlus 沙箱凭据发现。 + +### 显式 CLI 配置自动 OpenViking + +火山 `cn-beijing` 可通过 `managed.openviking.mode: auto` 显式启用,显式配置默认 `manual`。BytePlus 柔佛在后文单独说明。部署凭据需要 `vikingdb:CreateOpenVikingCollection`、`vikingdb:GetOpenVikingCollection`、`vikingdb:AccessOpenVikingApiKey` 权限。auto 不得与手动 OV 连接字段混用。自动创建使用 VLM `doubao-seed-2.0-lite` / `260428`、Embedding `doubao-embedding-vision` / `251215`,显式提供 Credentials Source=volcengine 及作为 EndpointID 的带版本模型标识。已解析的方舟模型 Key(CLI 可使用显式配置/模板 MODEL_AGENT_API_KEY)仅加到复制的创建请求,不保存在注册库。仅在明确拒绝、没有登记库及待完成 Runtime 操作时,才可修正完全匹配的旧无 Credentials 意图。未知/已登记意图不能自动替换。注册库仅保存意图和 ResourceID,重试重新读取 Key。部署 Runtime 前注入 `OPENVIKING_USER=default` 及其他三个 OV 变量。MPA 失败、取消或删除后保留 OV;创建结果不确定时,先核实再重试。 + + +### BytePlus 柔佛自动 OpenViking + +新的 BytePlus Studio 请求在 `ap-southeast-1` 自动准备个人版库,复用 MPA 创建流程解析的普通 ModelArk API Key。不再要求或读取额外的 `OV_MODEL_API_KEY` 或 Coding Plan 凭据。显式 CLI 配置通过 `managed.openviking.mode: auto` 启用;已提交手动任务保持原有行为。建库返回的 OV 库 Key 仍与模型推理 Key 区分。 + +适配器使用 `vikingdb.ap-southeast-1.byteplusapi.com`、POST `/api/openviking/{Action}`、签名地域 `ap-southeast-1`、API 版本 `2025-06-09`,及部署账号的 BytePlus AK/SK/STS。创建 `Version=developer`、`Source=volcengine`,VLM 为 `seed-2-0-lite`,Embedding 为 `skylark-embedding-vision`,不带 ModelVersion。每个模型凭据包含普通 ApiKey 和对应 EndpointID。READY 后不传 UserID 获取 default Key,注入已有四个变量,地址使用 `https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking`。重试复用绑定的 ResourceID,创建结果未知时阻止盲目重复创建,取消/删除后保留库。密钥不持久化到资源注册库。 + +个人库仅支持 default 用户。用户提供的海外契约要求数据请求使用 Bearer 鉴权和 `x-tt-env: pre`。本仓库负责准备资源;`agentkit-mpa-agent` 需单独实现上述语义,之后才能使用 OV 记忆。这些修改不证明云端实测可用,也不改变北京企业版创建流程。参见[设计](../../../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-automatic-creation.zh.md)。 + +BytePlus 推理 EndpointID 默认值(用户指定试用,海外尚未验证): + +| 模型 | 默认 EndpointID | 可选服务端覆盖变量 | +| --- | --- | --- | +| VLM | `doubao-seed-2-0-lite-260428` | `OV_VLM_ENDPOINT_ID` | +| Embedding | `doubao-embedding-vision-251215` | `OV_EMBEDDING_ENDPOINT_ID` | + +Key 必须有权调用两个接入点。覆盖值允许 1–128 位 ASCII 字母/数字/连字符/下划线/点,并以字母或数字开头。显式空值或非法覆盖值会在资源变更前失败。修改服务端配置后重启 Studio。国内参数不使用这些覆盖变量。流程不负责创建或发现推理接入点。服务端拒绝会明确报错,不回退 Coding Plan 或 AgentPlan。记录 OV 意图后重试必须使用相同接入点和来源;旧 Coding Plan 意图不能静默迁移或重新建库。见[推理凭据设计](../../../../prd-spec/features/mpa-byteplus-openviking/2026-10-14-inference-endpoints.zh.md)。 + + +### IAM 临时失败 + +运行角色准备对超时、连接失败、限流和服务不可用最多尝试四次,等待 1/2/4 秒,受已有 120 秒角色期限限制。每次重试先读取固定角色/策略名称,不会因响应丢失而盲目重新创建资源。权限、非法输入、未知错误及归属/信任/策略冲突立即失败。临时请求耗尽返回 `iamTemporaryFailure`;`iamPermissionDenied` 仍表示部署授权不足。取消会停止后续调用;已发送的 SDK 请求可能仍会完成。 + +经校验的 IAM 接口/类别/次数/结果及可选平台 Request ID 保存到 `task_diagnostics.request_id` 和服务端日志;旧记录通过增量迁移获得空值。原始消息、请求体和凭据不记录。Request ID 只允许 16–128 位十六进制字符/连字符,其他值忽略。旧四字段诊断协议继续有效。排查时可从受影响任务的诊断中查询 `operation, category, attempt, outcome, request_id`。重启 Studio 加载修改。见[IAM 恢复设计](../../../../prd-spec/bugfixes/mpa-iam-retry/2026-10-14-transient-errors.zh.md)。 + +OpenViking 失败时,若云端提供结构化元信息,Studio 后台日志及有数量上限的 task_diagnostics 记录会保留安全的 operation/category/errorCode/requestId。errorCode/requestId 为可选字段,传输异常可能没有这两个值。原始云端文案、请求/响应体和 API Key 均不记录。复现前须加载更新后的后端;已有不确定建库任务仍受保护,不会自动再次提交。历史错误元信息无法补回。 + +BytePlus Studio 在 ap-southeast-1 的新请求重新自动准备个人版 OV。已提交无 OV 请求重试保留原模式,要测试 OV 须“新建另一个智能体”。国内自动 OV 及已有绑定/不确定建库保护保持不变。 + +Runtime 创建/更新失败从结构化 SDK/HTTP 元信息及有界 JSON/SDK 字节串异常参数提取已验证的 errorCode/requestId(65,536 字节/字符,八个防循环 cause)。排除原始云端文案、响应体和凭证。复现前重启 Studio;重试保留原输入和 ClientToken,历史错误无法恢复。 + +新的 BytePlus Studio 创建还会注入 `OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT=http://apmplus-ap-southeast-1.bytepluses.com:4317`,用于 OTLP/gRPC 上报。此采集地址与 GetAppKey 控制面地址不同。可信的显式 Runtime 环境变量仍按既有优先级覆盖。新请求前需重启 Studio;已有 Runtime 及已提交任务快照不会更新。国内创建流程不变,实际 Trace 投递需单独云端验证。 + + +### 云端 Studio MPA IAM 凭据与 OpenViking 权限 + +BytePlus `veadk studio deploy` 自动设置 +`VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE=/var/run/secrets/iam/credential`,使用轮转的 +函数角色凭据,本地 AK/SK 用法不变。已有部署需重新部署以应用此设置并更新默认 Studio +角色策略,两个平台的策略均补齐三个 OV 准备操作。自定义角色需单独具备等价授权。 +凭据失败行为和前置条件见维护中的 +[云端 IAM 契约](../../../../specs/studio-mpa-creation/README.zh.md#云端-studio-mpa-iam-凭据与-openviking-权限)。 diff --git a/veadk/integrations/mpa/managed/apm_key.py b/veadk/integrations/mpa/managed/apm_key.py new file mode 100644 index 000000000..f6cefe653 --- /dev/null +++ b/veadk/integrations/mpa/managed/apm_key.py @@ -0,0 +1,120 @@ +# 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. + +"""Fetch a BytePlus APM AppKey for the managed Studio Runtime environment.""" + +from __future__ import annotations + +import asyncio + +from veadk.utils.volcengine_sign import volcengine_signed_request + +from .config import Profile +from .database import DeploymentError +from .diagnostics import CODE_CATEGORIES, classify_error, report +from .model_key import CredentialSource +from .openviking import exception_metadata, response_metadata + +RUNTIME_APM_KEY = "OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY" + + +class ApmKeyError(DeploymentError): + """A safe lookup error without provider text or credentials.""" + + +def _usable_key(value: object) -> bool: + return ( + isinstance(value, str) + and 0 < len(value) <= 4096 + and "*" not in value + and not any(c.isspace() or ord(c) < 32 or ord(c) == 127 for c in value) + ) + + +async def get_runtime_apm_key(profile: Profile, cloud: CredentialSource) -> str: + """Use deployment credentials; the caller holds the result only in memory.""" + if profile.provider != "byteplus": + return "" + explicit = profile.managed.runtime.env.get(RUNTIME_APM_KEY, "") + if explicit: + if not _usable_key(explicit): + report("get_apm_key", "protocol_error") + raise ApmKeyError("Configured APM AppKey is invalid") + return explicit + if profile.region != "ap-southeast-1": + raise ApmKeyError("APM AppKey lookup is unsupported in this BytePlus region") + for attempt in range(1, 4): + + def request(): + credential = cloud._credentials() + return volcengine_signed_request( + request_body={}, + ak=credential.access_key_id, + sk=credential.secret_access_key, + header={ + "X-Security-Token": credential.session_token or "", + "X-Apmplus-Region": profile.region.replace("-", "_"), + }, + service="apmplus_server", + region=profile.region, + host="apmplus-server.ap-southeast-1.byteplusapi.com", + path="/", + query={"Action": "GetAppKey", "Version": "2024-07-30"}, + timeout=(10, 30), + ) + + error_code, request_id = "", "" + try: + response = await asyncio.wait_for(asyncio.to_thread(request), timeout=45) + except Exception as error: + category = classify_error(error) + error_code, request_id = exception_metadata(error) + else: + category = "protocol_error" + if isinstance(response, dict): + error_code, request_id = response_metadata(response) + metadata = response.get("ResponseMetadata") or {} + data = response.get("data") + if isinstance(metadata, dict) and metadata.get("Error"): + category = "provider_error" + elif isinstance(metadata, dict) and isinstance(data, dict): + value = data.get("app_key") + if _usable_key(value): + return str(value) + if error_code: + category = ( + "timeout" + if error_code == "InternalServiceTimeout" + else CODE_CATEGORIES.get(error_code, category) + ) + retrying = attempt < 3 and category in { + "connection", + "timeout", + "throttled", + "unavailable", + } + report( + "get_apm_key", + category, + attempt=attempt, + outcome="retrying" if retrying else "failed", + error_code=error_code, + request_id=request_id, + ) + if not retrying: + raise ApmKeyError( + "APM AppKey lookup failed; check deployment APM read permissions and connectivity" + ) from None + await asyncio.sleep((0.2, 0.5)[attempt - 1]) + raise AssertionError("APM read retry loop exhausted") diff --git a/veadk/integrations/mpa/managed/config.py b/veadk/integrations/mpa/managed/config.py index 526c3bf56..59e543707 100644 --- a/veadk/integrations/mpa/managed/config.py +++ b/veadk/integrations/mpa/managed/config.py @@ -36,6 +36,11 @@ from sqlalchemy.engine import make_url from .network import NetworkOptions +from .openviking import ( + OpenVikingError, + byteplus_model_endpoints, + supports_auto_openviking, +) from .studio_profile import studio_profile_values ADMIN_DATABASE_NAME = "mpa_admin_db" @@ -119,6 +124,15 @@ def validate_creation_resources(values: dict[str, str]) -> dict[str, str]: raise ConfigurationError("Enter a valid PostgreSQL port") url, resource_id = selected["openvikingUrl"], selected["openvikingResourceId"] api_key = str(values.get("openvikingApiKey", "")) + mode = values.get("openvikingMode", "manual") + if ( + mode not in {"manual", "auto"} + or mode == "auto" + and any((url, resource_id, api_key)) + ): + raise ConfigurationError( + "Automatic OpenViking does not accept manual connection values" + ) if any((url, resource_id, api_key)) and not all( (url, resource_id, api_key.strip()) ): @@ -157,16 +171,22 @@ def validate_creation_resources(values: dict[str, str]) -> dict[str, str]: def validate_creation_tos(values: dict[str, str]) -> dict[str, str]: - """Validate optional per-creation TOS mount credentials.""" - selected = { - key: str(values.get(key, "")).strip() - for key in ("tosAccessKey", "tosSecretKey", "tosBucket") - } - if any(selected.values()) and not all(selected.values()): - raise ConfigurationError( - "TOS access key, secret key, and bucket are all required" - ) - return selected + """Validate the Studio bucket-only IAM mount request.""" + if any( + str(values.get(key, "")).strip() for key in ("tosAccessKey", "tosSecretKey") + ): + raise ConfigurationError("Studio TOS mounts use IAM Role, not access keys") + bucket = validate_tos_bucket_name(str(values.get("tosBucket", ""))) + if bucket and not bucket.startswith("agentkit-platform-"): + raise ConfigurationError("Select a bucket starting with agentkit-platform-") + return {"tosBucket": bucket} + + +def validate_tos_bucket_name(value: str) -> str: + bucket = value.strip() + if bucket and not re.fullmatch(r"[a-z0-9][a-z0-9-]{1,61}[a-z0-9]", bucket): + raise ConfigurationError("Select a valid TOS bucket") + return bucket def validate_runtime_name(value: str) -> str: @@ -217,9 +237,12 @@ class Worker(Options): tos_access_key: str = Field(default="", repr=False) tos_secret_key: str = Field(default="", repr=False) tos_bucket: str = "" + tos_credential_type: Literal["access_key", "iam_role"] = "access_key" @property def tos_mount_enabled(self) -> bool: + if self.tos_credential_type == "iam_role": + return bool(self.tos_bucket) return bool(self.tos_access_key and self.tos_secret_key and self.tos_bucket) @field_validator("tos_access_key", "tos_secret_key", "tos_bucket") @@ -243,9 +266,13 @@ def validate_source(self): if bool(self.existing_id) == bool(self.image): raise ValueError("Select an existing worker or a worker image") tos_values = (self.tos_access_key, self.tos_secret_key, self.tos_bucket) - if any(tos_values) and not all(tos_values): + if self.tos_credential_type == "iam_role": + validate_tos_bucket_name(self.tos_bucket) + if self.tos_access_key or self.tos_secret_key: + raise ValueError("IAM Role TOS mounts must not contain access keys") + elif any(tos_values) and not all(tos_values): raise ValueError("TOS access key, secret key, and bucket are all required") - if self.existing_id and all(tos_values): + if self.existing_id and self.tos_mount_enabled: raise ValueError("TOS mount settings require a newly created worker") if self.existing_id and self.env: raise ValueError("Environment settings require a newly created worker") @@ -308,6 +335,8 @@ def validate_scaling(self): class PostgresWorkspaces(Options): mode: Literal["manual", "auto"] = "manual" + business_workspace_mode: Literal["shared", "per-agent"] = "shared" + business_database_name: Literal["", "aidb"] = "" legacy_urls: Literal["reject", "ignore"] = "reject" admin_workspace_id: str = Field( default="", max_length=128, pattern=r"^[A-Za-z0-9_-]*$" @@ -319,7 +348,7 @@ class PostgresWorkspaces(Options): business_workspace_name: str = Field( default="mpa_business_workspace", min_length=1, - max_length=63, + max_length=128, pattern=r"^[A-Za-z0-9_-]+$", ) project_name: str = Field(default="default", min_length=1, max_length=128) @@ -331,6 +360,14 @@ class PostgresWorkspaces(Options): @model_validator(mode="after") def distinct_workspaces(self): + if self.business_database_name and self.business_workspace_mode != "per-agent": + raise ValueError("aidb requires a dedicated business Workspace") + if self.business_workspace_mode == "per-agent" and ( + self.mode != "auto" or self.business_workspace_id + ): + raise ValueError( + "Per-agent Workspaces require automatic PG without a business Workspace ID" + ) if self.mode != "auto" and self.legacy_urls != "reject": raise ValueError("Ignoring legacy URLs requires automatic PostgreSQL mode") if self.mode == "manual" and not ( @@ -351,6 +388,10 @@ class Iam(Options): mode: Literal["existing", "auto"] = "existing" +class OpenViking(Options): + mode: Literal["manual", "auto"] = "manual" + + class ModelKey(Options): mode: Literal["explicit", "ark"] = "explicit" api_key_id: str = Field(default="", max_length=128, pattern=r"^[A-Za-z0-9_-]*$") @@ -373,6 +414,7 @@ class Managed(Options): postgres: PostgresWorkspaces | None = None iam: Iam = Field(default_factory=Iam) model_key: ModelKey = Field(default_factory=ModelKey) + openviking: OpenViking = Field(default_factory=OpenViking) credential_file: str = "" from_runtime: str = "" template_file: str = "" @@ -409,6 +451,8 @@ class Profile: admin_url: str shared_url: str openviking_enabled: bool | None = None + openviking_auto_available: bool = False + per_agent_postgres_available: bool = False @property def provider(self): @@ -440,9 +484,33 @@ def summary(self): migration_required = auto and bool(self.shared_url) return { **self.image_defaults(), + **( + {"openvikingMode": "auto"} + if self.openviking_auto_available + or self.managed.openviking.mode == "auto" + else {} + ), "pgHost": (admin.host or "") if admin else "", "pgPort": str(admin.port or 5432) if admin else "", **({"postgresMode": "auto"} if auto else {}), + **( + { + "businessWorkspaceMode": "per-agent", + **( + {"businessDatabaseName": "aidb"} + if self.per_agent_postgres_available + or self.managed.postgres.business_database_name == "aidb" + else {} + ), + } + if auto + and self.managed.postgres is not None + and ( + self.per_agent_postgres_available + or self.managed.postgres.business_workspace_mode == "per-agent" + ) + else {} + ), **({"postgresMigrationRequired": True} if migration_required else {}), **( { @@ -481,9 +549,63 @@ def with_creation_images(profile: Profile, images: dict[str, str]) -> Profile: return replace(profile, managed=managed) +def with_creation_scaling(profile: Profile, maximum: int | None) -> Profile: + """Apply an explicit request limit without upgrading legacy profile defaults.""" + if maximum is None: + return profile + if type(maximum) is not int or not 1 <= maximum <= 2**53 - 1: + raise ConfigurationError("Maximum instances must be a positive safe integer") + minimum = profile.managed.runtime.min_instance + if minimum is not None and maximum < minimum: + raise ConfigurationError("Minimum instances exceed maximum instances") + managed = profile.managed.model_copy(deep=True) + managed.runtime.max_instance = maximum + return replace(profile, managed=managed) + + def with_creation_resources(profile: Profile, resources: dict[str, str]) -> Profile: selected = validate_creation_resources(resources) managed = profile.managed.model_copy(deep=True) + business_mode = resources.get("businessWorkspaceMode") + if business_mode is not None: + if business_mode not in {"shared", "per-agent"}: + raise ConfigurationError("Invalid business Workspace mode") + if managed.postgres is None or managed.postgres.mode != "auto": + raise ConfigurationError( + "Business Workspace selection requires automatic PG" + ) + if business_mode == "per-agent" and managed.postgres.business_workspace_id: + raise ConfigurationError( + "Per-agent mode does not accept a shared business Workspace ID" + ) + managed.postgres.business_workspace_mode = ( + "per-agent" if business_mode == "per-agent" else "shared" + ) + database = resources.get("businessDatabaseName") + if database is not None: + if database not in {"", "aidb"} or managed.postgres is None: + raise ConfigurationError("Invalid business database selection") + if database and ( + managed.postgres.mode != "auto" + or managed.postgres.business_workspace_mode != "per-agent" + ): + raise ConfigurationError("aidb requires automatic dedicated PostgreSQL") + managed.postgres.business_database_name = "aidb" if database else "" + mode = resources.get("openvikingMode", "manual") + if mode == "auto" and not supports_auto_openviking( + profile.provider, profile.region + ): + raise ConfigurationError( + "Automatic OpenViking is unavailable for this provider and region" + ) + if mode == "auto" and profile.provider == "byteplus": + try: + byteplus_model_endpoints() + except OpenVikingError: + raise ConfigurationError( + "Set valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID on the Studio server" + ) from None + managed.openviking.mode = "auto" if mode == "auto" else "manual" host, port = selected["pgHost"], selected["pgPort"] if ( profile.managed.postgres @@ -522,7 +644,9 @@ def with_creation_resources(profile: Profile, resources: dict[str, str]) -> Prof managed.runtime.env["OPENVIKING_API_KEY"] = resources["openvikingApiKey"] managed.runtime.env["OPENVIKING_USER"] = "default" return replace( - profile, managed=managed, openviking_enabled=bool(selected["openvikingUrl"]) + profile, + managed=managed, + openviking_enabled=mode == "auto" or bool(selected["openvikingUrl"]), ) @@ -533,9 +657,10 @@ def with_creation_tos(profile: Profile, values: dict[str, str]) -> Profile: managed = profile.managed.model_copy(deep=True) worker = managed.worker.model_dump() worker.update( - tos_access_key=selected["tosAccessKey"], - tos_secret_key=selected["tosSecretKey"], + tos_access_key="", + tos_secret_key="", tos_bucket=selected["tosBucket"], + tos_credential_type="iam_role", ) try: managed.worker = Worker.model_validate(worker) @@ -638,7 +763,14 @@ def _read_configuration_file(path: Path, *, template: bool = False) -> str: def load_studio_profile(*, region: str = "", provider: str = "volcengine") -> Profile: """Load the code-owned Studio profile without a configuration file.""" - return load_profile(None, region=region, provider=provider) + profile = load_profile(None, region=region, provider=provider) + return replace( + profile, + per_agent_postgres_available=True, + openviking_auto_available=supports_auto_openviking( + profile.provider, profile.region + ), + ) def load_profile( diff --git a/veadk/integrations/mpa/managed/database.py b/veadk/integrations/mpa/managed/database.py index 12d9b7a51..4c758e7ae 100644 --- a/veadk/integrations/mpa/managed/database.py +++ b/veadk/integrations/mpa/managed/database.py @@ -140,6 +140,16 @@ async def save(self, record): await self.conn.execute(query) await self.conn.commit() + async def other_records(self): + query = select(agent_deployments.c.record).where( + agent_deployments.c.account_id == self.keys["account_id"], + agent_deployments.c.region == self.keys["region"], + agent_deployments.c.agent_id != self.keys["agent_id"], + ) + records = (await self.conn.execute(query)).scalars().all() + await self.conn.commit() + return [dict(record) for record in records] + class AccountNetworkEntry: def __init__(self, conn, account, region): @@ -170,7 +180,16 @@ async def gateway(self): class AgentDatabaseProvisioner: - def __init__(self, *, admin_url: str, runtime_env: dict[str, str]): + def __init__( + self, + *, + admin_url: str, + runtime_env: dict[str, str], + business_database_name: str = "", + ): + if business_database_name not in {"", "aidb"}: + raise DeploymentError("Unsupported dedicated business database") + self.business_database_name = business_database_name self.admin_url = make_url(admin_url) self.env = dict(runtime_env) for key in ("PGHOST", "PGUSER", "PGPASSWORD"): @@ -225,7 +244,7 @@ async def check(self): ) async def ensure(self, entry, *, account: str, region: str, agent_id: str): - name = database_name(account, region, agent_id) + name = self.business_database_name or database_name(account, region, agent_id) marker = database_marker(account, region, agent_id) record = await entry.read() identity = { @@ -254,12 +273,18 @@ async def ensure(self, entry, *, account: str, region: str, agent_id: str): .first() ) if row: - if row["owner"] != self.env["PGUSER"] or row["marker"] != marker: + if ( + row["owner"] == self.env["PGUSER"] + and row["marker"] is None + and name == "aidb" + ): + await self.claim_initial_aidb(entry, record, identity, marker) + elif row["owner"] != self.env["PGUSER"] or row["marker"] != marker: raise DeploymentError( "Database name already exists without matching ownership; refusing to use it" ) else: - if record.get("database_ready"): + if record.get("database_ready") or name == "aidb": raise DeploymentError( "Registered business database is missing; restore it rather than create an empty replacement" ) @@ -280,6 +305,64 @@ async def ensure(self, entry, *, account: str, region: str, agent_id: str): await entry.save(record) return name + async def claim_initial_aidb(self, entry, record, identity, marker): + """Claim only the empty initial database of a verified dedicated Workspace.""" + if ( + record.get("business_workspace_mode") != "per-agent" + or not record.get("business_workspace_id") + or record.get("business_database_name") != "aidb" + or record.get("database_ready") + or record.get("runtime_id") + ): + raise DeploymentError("Unmarked aidb has no safe initial dedicated binding") + engine = postgres_engine(self.runtime_url("aidb"), connect_args={"timeout": 10}) + try: + async with engine.begin() as conn: + await conn.execute(text("SET LOCAL statement_timeout = '30s'")) + await conn.execute(text("SET LOCAL lock_timeout = '10s'")) + await conn.execute(text("SELECT pg_advisory_xact_lock(783435789213)")) + row = ( + ( + await conn.execute( + text( + "SELECT pg_get_userbyid(datdba) AS owner, shobj_description(oid, 'pg_database') AS marker FROM pg_database WHERE datname='aidb'" + ) + ) + ) + .mappings() + .first() + ) + if ( + not row + or row["owner"] != self.env["PGUSER"] + or row["marker"] not in (None, marker) + ): + raise DeploymentError( + "aidb ownership changed during initialization" + ) + if row["marker"] == marker: + return + nonempty = await conn.scalar( + text( + "SELECT EXISTS(SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace " + "WHERE n.nspname <> 'information_schema' AND left(n.nspname,3) <> 'pg_' " + "AND c.relkind IN ('r','p','v','m','f','S') " + "AND NOT EXISTS(SELECT 1 FROM pg_depend d WHERE d.classid='pg_class'::regclass " + "AND d.objid=c.oid AND d.deptype='e'))" + ) + ) + if nonempty is not False: + raise DeploymentError( + "Initial aidb contains user objects; refusing automatic adoption" + ) + record.update(identity, database_initialization_requested=True) + await entry.save(record) + await conn.execute( + text(f"COMMENT ON DATABASE {identifier('aidb')} IS '{marker}'") + ) + finally: + await engine.dispose() + async def mcp_token_secret(self, name: str, *, preferred: str = "") -> str: """Persist the signing secret before cloud creation, including retries.""" engine = postgres_engine(self.runtime_url(name)) diff --git a/veadk/integrations/mpa/managed/deletion.py b/veadk/integrations/mpa/managed/deletion.py new file mode 100644 index 000000000..2d5e806cd --- /dev/null +++ b/veadk/integrations/mpa/managed/deletion.py @@ -0,0 +1,271 @@ +# 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. + +"""Conservative, resumable cleanup of an MPA's exclusive managed resources.""" + +from __future__ import annotations + +from contextlib import asynccontextmanager +import logging +from typing import Any + +from .database import AgentDeploymentRegistry, DeploymentError, agent_suffix +from .diagnostics import classify_error +from .runtime import env_map +from .worker import WorkerCloud + + +class ResourceDeletionError(DeploymentError): + def __init__(self, stage: str, reason: str): + self.stage, self.reason = stage, reason + super().__init__( + f"MPA cleanup failed ({stage}): {reason}. Check resources and permissions, then retry." + ) + + +class OwnedResourceCleanup: + def __init__( + self, + *, + entry, + cloud, + account: str, + region: str, + agent_id: str, + runtime: dict, + worker=None, + ): + self.entry, self.cloud = entry, cloud + self.worker = worker if worker is not None else WorkerCloud(cloud) + self.account, self.region, self.agent_id, self.runtime = ( + account, + region, + agent_id, + runtime, + ) + + async def _plan(self): + logging.getLogger(__name__).info( + "MPA delete check stage=registry runtime_id=%s", + self.runtime.get("RuntimeId", ""), + ) + record = await self.entry.read() if self.entry is not None else {} + if record and record.get("runtime_id") != self.runtime.get("RuntimeId"): + raise ResourceDeletionError("ownership", "runtime_binding_conflict") + if record.get("pending"): + raise ResourceDeletionError("ownership", "active_deployment") + env = env_map(self.runtime) + if env.get("MPA_AGENT_ID") and env["MPA_AGENT_ID"] != self.agent_id: + raise ResourceDeletionError("ownership", "agent_binding_conflict") + if ( + self.runtime.get("ToolId") + and env.get("AGENTKIT_TOOL_ID") + and self.runtime["ToolId"] != env["AGENTKIT_TOOL_ID"] + ): + raise ResourceDeletionError("worker_template", "resource_binding_conflict") + resources = [ + ( + "worker_template", + "worker_id", + "worker_managed", + self.runtime.get("ToolId") or env.get("AGENTKIT_TOOL_ID", ""), + ), + ( + "skill_space", + "skill_space_id", + "skill_space_managed", + env.get("SKILL_SPACE_ID", ""), + ), + ] + plan, retained = [], [] + candidates = [] + progress = record.get("deletion") or {} + for stage, field, flag, bound in resources: + resource_id = record.get(field) or bound + if not resource_id: + continue + if bound and record.get(field) and bound != record[field]: + raise ResourceDeletionError(stage, "resource_binding_conflict") + if record.get(flag) is not True or not record.get(field): + retained.append( + {"stage": stage, "resourceId": resource_id, "reason": "unproven"} + ) + elif progress.get(stage) != "deleted": + candidates.append((stage, field, resource_id)) + if candidates: + assert self.entry is not None + try: + others = await self.entry.other_records() + logging.getLogger(__name__).info( + "MPA delete check stage=runtime_references runtime_id=%s", + self.runtime.get("RuntimeId", ""), + ) + runtimes = await self.cloud.list_runtimes() + except Exception as exc: + raise ResourceDeletionError("references", classify_error(exc)) from None + suffix = agent_suffix(self.account, self.region, self.agent_id) + for stage, field, resource_id in candidates: + shared = any( + other.get(field) == resource_id and other.get("state") != "deleted" + for other in others + ) + for runtime in runtimes: + values = env_map(runtime) + if runtime.get("RuntimeId") == self.runtime.get("RuntimeId"): + current_refs = ( + { + value + for value in ( + runtime.get("ToolId"), + values.get("AGENTKIT_TOOL_ID"), + ) + if value + } + if stage == "worker_template" + else {values["SKILL_SPACE_ID"]} + if values.get("SKILL_SPACE_ID") + else set() + ) + if current_refs and current_refs != {resource_id}: + raise ResourceDeletionError( + stage, "resource_binding_conflict" + ) + continue + references = ( + {runtime.get("ToolId"), values.get("AGENTKIT_TOOL_ID")} + if stage == "worker_template" + else {values.get("SKILL_SPACE_ID")} + ) + shared |= resource_id in references + if shared: + retained.append( + {"stage": stage, "resourceId": resource_id, "reason": "shared"} + ) + continue + try: + resource = ( + await self.worker.get(resource_id) + if stage == "worker_template" + else await self.cloud.get_skill_space(resource_id) + ) + except Exception as exc: + if classify_error(exc) == "not_found": + plan.append( + { + "stage": stage, + "resourceId": resource_id, + "description": stage, + "count": 1, + "missing": True, + } + ) + continue + raise ResourceDeletionError(stage, classify_error(exc)) from None + tags = { + item["Key"]: item.get("Value") + for item in resource.get("Tags") or [] + } + identity_key = "ToolId" if stage == "worker_template" else "Id" + if ( + resource.get(identity_key) != resource_id + or tags.get("managed_by") != "mpa-deployment" + or tags.get("mpa_agent_key") != suffix + or resource.get("ProjectName") + != (self.runtime.get("ProjectName") or "default") + ): + raise ResourceDeletionError(stage, "ownership_conflict") + if stage == "worker_template" and env_map(resource).get( + "MPA_AGENT_ID" + ) not in (None, "", self.agent_id): + raise ResourceDeletionError(stage, "agent_binding_conflict") + plan.append( + { + "stage": stage, + "resourceId": resource_id, + "description": stage, + "count": 1, + } + ) + return record, plan, retained + + async def preview(self) -> dict[str, Any]: + _, plan, retained = await self._plan() + return { + "cleanupPlan": [ + {k: v for k, v in item.items() if k != "missing"} for item in plan + ], + "retainedResources": retained, + } + + async def delete_resources(self): + # Revalidate both resources before the first destructive call. + record, plan, _ = await self._plan() + if self.entry is None or not record: + return + record["state"] = "deleting" + await self.entry.save(record) + for item in plan: + stage, resource_id = item["stage"], item["resourceId"] + record.setdefault("deletion", {})[stage] = "deleting" + await self.entry.save(record) + try: + if not item.get("missing"): + if stage == "worker_template": + await self.worker.delete(resource_id) + else: + await self.cloud.delete_skill_space(resource_id) + except Exception as exc: + if classify_error(exc) != "not_found": + raise ResourceDeletionError(stage, classify_error(exc)) from None + record["deletion"][stage] = "deleted" + await self.entry.save(record) + + async def mark_runtime_deleted(self): + if self.entry is not None: + record = await self.entry.read() + if record: + record.update(state="deleted", pending=False) + record.setdefault("deletion", {})["agentkit_runtime"] = "deleted" + await self.entry.save(record) + + +@asynccontextmanager +async def owned_resource_cleanup(*, runtime: dict, agent_id: str, region: str, cloud): + url = env_map(runtime).get("SHARED_APIG_DATABASE_URL", "") + if not url: + yield OwnedResourceCleanup( + entry=None, + cloud=cloud, + account="", + region=region, + agent_id=agent_id, + runtime=runtime, + ) + return + registry = None + try: + account = await cloud.account_id() + registry = AgentDeploymentRegistry(url) + async with registry.lock(account, region, agent_id) as entry: + yield OwnedResourceCleanup( + entry=entry, + cloud=cloud, + account=account, + region=region, + agent_id=agent_id, + runtime=runtime, + ) + finally: + if registry is not None: + await registry.close() diff --git a/veadk/integrations/mpa/managed/diagnostics.py b/veadk/integrations/mpa/managed/diagnostics.py index 78d69fd68..11b4cf85a 100644 --- a/veadk/integrations/mpa/managed/diagnostics.py +++ b/veadk/integrations/mpa/managed/diagnostics.py @@ -16,8 +16,11 @@ from __future__ import annotations +import ast import asyncio +import json import logging +import re from collections.abc import Awaitable, Callable, Iterator from contextlib import contextmanager from contextvars import ContextVar @@ -52,8 +55,30 @@ "protocol_error", } OPERATIONS = { + "create_runtime", + "update_runtime", + "iam_verify", + "iam_get_role", + "iam_create_role", + "iam_get_policy", + "iam_create_policy", + "iam_attach_role_policy", + "iam_list_attached_role_policies", + "create_openviking", + "get_openviking", + "get_openviking_key", "list_model_keys", "get_model_key", + "get_apm_key", + "aidap_describe_workspaces", + "aidap_describe_workspace_detail", + "aidap_create_workspace", + "aidap_describe_branches", + "aidap_describe_computes", + "aidap_describe_workspace_endpoint", + "aidap_describe_db_accounts", + "aidap_describe_databases", + "aidap_describe_db_account_connection", "get_reference_worker", "find_worker", "create_worker", @@ -86,17 +111,21 @@ "ThrottlingException": "throttled", "TooManyRequests": "throttled", "RequestLimitExceeded": "throttled", + "QuotaExceeded": "throttled", "InternalError": "unavailable", "InternalServerError": "unavailable", "ServiceUnavailable": "unavailable", "RequestTimeout": "timeout", } DEPLOYMENT_CATEGORIES = { + "runtimeNameTaken": "invalid_request", + "runtimeNameCheckFailed": "unavailable", "iamPermissionDenied": "permission", "iamTrustConflict": "ownership", "iamPolicyConflict": "ownership", "iamOwnershipConflict": "ownership", "iamVerificationFailed": "resource_failed", + "iamTemporaryFailure": "unavailable", "iamConfigurationConflict": "configuration_changed", "Worker ownership metadata is incomplete": "metadata_missing", "Worker ownership does not match this agent": "ownership", @@ -108,6 +137,7 @@ "Worker is not ready; inspect it and retry the same agent": "resource_failed", } Diagnostic = dict[str, str | int] +MAX_DIAGNOSTIC_ATTEMPT = 8 _sink: ContextVar[Callable[[Diagnostic], None] | None] = ContextVar( "mpa_diagnostic_sink", default=None ) @@ -159,13 +189,87 @@ def classify_error(error: BaseException) -> str: return "unknown" +def safe_request_id(value: object) -> str: + """Only provider hex/UUID identifiers may cross the diagnostic boundary.""" + return ( + value + if isinstance(value, str) and re.fullmatch(r"[0-9A-Fa-f-]{16,128}", value) + else "" + ) + + +def safe_error_code(value: object) -> str: + """Retain bounded provider identifiers, never free text or token-shaped values.""" + if ( + not isinstance(value, str) + or len(value) > 128 + or not re.fullmatch(r"[A-Z][A-Za-z0-9]*(?:[._][A-Za-z0-9]+)*", value) + or value.upper().startswith( + ("SK_", "AK_", "ARK_", "TOKEN_", "BEARER_", "SECRET_", "PASSWORD_") + ) + ): + return "" + return value + + +def sdk_argument_identifiers(value: object) -> tuple[str, str]: + """Decode bounded JSON or SDK bytes literals; never evaluate provider text.""" + from .openviking import response_metadata + + if not isinstance(value, (str, bytes)) or len(value) > 65536: + return "", "" + try: + if isinstance(value, str) and value.startswith(("b'", 'b"')): + value = ast.literal_eval(value) + if not isinstance(value, bytes) or len(value) > 65536: + return "", "" + return response_metadata(json.loads(value)) + except (ValueError, TypeError, SyntaxError, RecursionError): + return "", "" + + +def failure_identifiers(error: Exception) -> tuple[str, str]: + """Read bounded SDK metadata through a cycle-safe exception chain.""" + from .openviking import exception_metadata + + code, request_id = "", "" + cause: BaseException | None = error + seen: set[int] = set() + for _ in range(8): + if cause is None or id(cause) in seen: + break + seen.add(id(cause)) + code = code or safe_error_code(getattr(cause, "error_code", None)) + request_id = request_id or safe_request_id(getattr(cause, "request_id", None)) + if isinstance(cause, Exception): + try: + response_body = getattr( + getattr(cause, "response", None), "content", None + ) + if ( + isinstance(response_body, (str, bytes)) + and len(response_body) > 65536 + ): + body_code, body_request_id = "", "" + else: + body_code, body_request_id = exception_metadata(cause) + except RecursionError: + body_code, body_request_id = "", "" + code, request_id = code or body_code, request_id or body_request_id + if len(cause.args) == 1: + arg_code, arg_request_id = sdk_argument_identifiers(cause.args[0]) + code, request_id = code or arg_code, request_id or arg_request_id + cause = cause.__cause__ + return code, request_id + + def validate_diagnostic(value: object) -> Diagnostic | None: - if not isinstance(value, dict) or set(value) != { - "operation", - "category", - "attempt", - "outcome", - }: + required = {"operation", "category", "attempt", "outcome"} + if ( + not isinstance(value, dict) + or not required <= set(value) + or set(value) - required - {"requestId", "errorCode"} + ): return None if ( not isinstance(value["operation"], str) @@ -173,12 +277,19 @@ def validate_diagnostic(value: object) -> Diagnostic | None: or not isinstance(value["category"], str) or value["category"] not in CATEGORIES or type(value["attempt"]) is not int - or not 1 <= value["attempt"] <= 4 + or not 1 <= value["attempt"] <= MAX_DIAGNOSTIC_ATTEMPT or not isinstance(value["outcome"], str) or value["outcome"] not in {"retrying", "failed", "cancelled"} ): return None - return dict(value) + result = {key: value[key] for key in required} + request_id = safe_request_id(value.get("requestId")) + if request_id: + result["requestId"] = request_id + error_code = safe_error_code(value.get("errorCode")) + if error_code: + result["errorCode"] = error_code + return result @contextmanager @@ -191,10 +302,23 @@ def diagnostic_scope(sink: Callable[[Diagnostic], None]) -> Iterator[None]: def report( - operation: str, category: str, *, attempt: int = 1, outcome: str = "failed" + operation: str, + category: str, + *, + attempt: int = 1, + outcome: str = "failed", + request_id: str = "", + error_code: str = "", ) -> None: diagnostic = validate_diagnostic( - dict(operation=operation, category=category, attempt=attempt, outcome=outcome) + dict( + operation=operation, + category=category, + attempt=attempt, + outcome=outcome, + **({"requestId": request_id} if request_id else {}), + **({"errorCode": error_code} if error_code else {}), + ) ) if diagnostic is None: raise ValueError("Invalid internal diagnostic") @@ -212,7 +336,10 @@ async def retry_worker( try: return await call() except Exception as error: + error_code, request_id = failure_identifiers(error) category = classify_error(error) + if error_code and category in {"provider_error", "unknown"}: + category = CODE_CATEGORIES.get(error_code, category) recoverable = category in { "timeout", "connection", @@ -225,6 +352,8 @@ async def retry_worker( category, attempt=attempt, outcome="retrying" if retrying else "failed", + error_code=error_code, + request_id=request_id, ) if not retrying: raise diff --git a/veadk/integrations/mpa/managed/iam.py b/veadk/integrations/mpa/managed/iam.py index c212f7404..9c81dac94 100644 --- a/veadk/integrations/mpa/managed/iam.py +++ b/veadk/integrations/mpa/managed/iam.py @@ -17,11 +17,18 @@ from __future__ import annotations import asyncio +import hashlib import json import time from .database import DeploymentError -from .diagnostics import classify_error +from .diagnostics import ( + CATEGORIES, + CODE_CATEGORIES, + classify_error, + report, + safe_request_id, +) ROLE_NAME = "IDRoleForArkClawShareAgent" POLICY_NAME = "VeADKMPARuntimeAccessV1" @@ -74,7 +81,9 @@ "iamPolicyConflict", "iamOwnershipConflict", "iamVerificationFailed", + "iamTemporaryFailure", "iamConfigurationConflict", + "tosBucketUnavailable", } ) PERMISSION_CODES = { @@ -109,24 +118,107 @@ ) +TRANSIENT_CATEGORIES = {"timeout", "connection", "throttled", "unavailable"} +IAM_METHODS = { + "get_role", + "create_role", + "get_policy", + "create_policy", + "attach_role_policy", + "list_attached_role_policies", +} + + class IamError(DeploymentError): - """Only safe keys and recognized error codes survive the SDK boundary.""" + """Retain safe request metadata while excluding provider messages and payloads.""" - def __init__(self, code: str = "", *, key: str = "iamVerificationFailed"): - self.code = code if code in KNOWN_CODES else "" + def __init__( + self, + code: str = "", + *, + key: str = "iamVerificationFailed", + category: str = "", + operation: str = "", + request_id: str = "", + ): + self.code = code if isinstance(code, str) and code in KNOWN_CODES else "" + self.category = ( + "permission" + if self.code in PERMISSION_CODES + else CODE_CATEGORIES.get( + self.code, + category + if isinstance(category, str) and category in CATEGORIES + else "provider_error", + ) + ) + self.operation = ( + "iam_" + operation if operation in IAM_METHODS else "iam_verify" + ) + self.request_id = safe_request_id(request_id) self.key = ( "iamPermissionDenied" - if self.code in PERMISSION_CODES - else (key if key in ERROR_KEYS else "iamVerificationFailed") + if self.category == "permission" + else "iamTemporaryFailure" + if self.category in TRANSIENT_CATEGORIES + else key + if key in ERROR_KEYS + else "iamVerificationFailed" ) super().__init__(self.key) +def _metadata(value): + if not isinstance(value, dict): + return {} + result = value.get("ResponseMetadata", {}) + return result if isinstance(result, dict) else {} + + class IamCloud: def __init__(self, runtime): self.runtime = runtime + async def verify_tos_bucket(self, bucket: str) -> None: + """Only authorize a bucket owned by the verified deployment account.""" + + def run(): + import tos + + client = None + try: + credential = self.runtime._credentials() + client = tos.TosClientV2( + credential.access_key_id, + credential.secret_access_key, + f"https://tos-{self.runtime.region}.volces.com", + self.runtime.region, + security_token=credential.session_token, + connection_time=5, + socket_timeout=5, + max_retry_count=0, + ) + if not any( + item.name == bucket and item.location == self.runtime.region + for item in (client.list_buckets().buckets or []) + ): + raise IamError(key="tosBucketUnavailable") + except IamError: + raise + except Exception as error: + raise IamError( + "AccessDenied" if classify_error(error) == "permission" else "" + ) from None + finally: + if client is not None: + client.close() + + await asyncio.to_thread(run) + async def call(self, method: str, **params): + if method not in IAM_METHODS: + raise IamError(key="iamConfigurationConflict") + def run(): from volcengine.iam.IamService import IamService @@ -152,30 +244,49 @@ def run(): client.set_socket_timeout(5) response = getattr(client, method)(params) except Exception as error: - code = "" + metadata = {} try: - envelope = json.loads(str(error)) - code = ( - envelope.get("ResponseMetadata", {}) - .get("Error", {}) - .get("Code", "") - ) - except (ValueError, AttributeError, TypeError): - pass - if classify_error(error) == "permission": + metadata = _metadata(json.loads(str(error))) + except (ValueError, TypeError): + response = getattr(error, "response", None) + if response is not None: + try: + metadata = _metadata(response.json()) + except (ValueError, TypeError, AttributeError): + pass + category = classify_error(error) + provider_error = metadata.get("Error", {}) + code = ( + provider_error.get("Code", "") + if isinstance(provider_error, dict) + else "" + ) + if category == "permission": code = "AccessDenied" - raise IamError(code) from None + raise IamError( + code, + category=category, + operation=method, + request_id=metadata.get("RequestId", ""), + ) from None finally: if client is not None and hasattr(client, "session"): client.session.close() - if not isinstance(response, dict): - raise IamError() - error = response.get("ResponseMetadata", {}).get("Error") + metadata = _metadata(response) + error = metadata.get("Error") if error: - raise IamError(error.get("Code", "")) - result = response.get("Result", {}) + raise IamError( + error.get("Code", "") if isinstance(error, dict) else "", + operation=method, + request_id=metadata.get("RequestId", ""), + ) + result = response.get("Result", {}) if isinstance(response, dict) else None if not isinstance(result, dict): - raise IamError() + raise IamError( + category="protocol_error", + operation=method, + request_id=metadata.get("RequestId", ""), + ) return result return await asyncio.to_thread(run) @@ -201,11 +312,17 @@ def _canonical(value): return value -def _validate_role(result: dict, account: str): +def _validate_role( + result: dict, + account: str, + *, + role_name: str = ROLE_NAME, + required_services: tuple[str, ...] = ("vefaas", "apig"), +): role = result.get("Role", result) if ( - role.get("RoleName") != ROLE_NAME - or role.get("Trn") != f"trn:iam::{account}:role/{ROLE_NAME}" + role.get("RoleName") != role_name + or role.get("Trn") != f"trn:iam::{account}:role/{role_name}" ): raise IamError(key="iamOwnershipConflict") trust = _document(role.get("TrustPolicyDocument")) @@ -232,10 +349,119 @@ def _validate_role(result: dict, account: str): isinstance(item, str) for item in service ): services.update(service) - if not {"vefaas", "apig"} <= services: + if not set(required_services) <= services: raise IamError(key="iamTrustConflict") +async def ensure_tos_mount_permissions( + cloud, + account: str, + bucket: str, + *, + role_name: str = ROLE_NAME, + timeout: float = 120, + poll_interval: float = 2, +): + """Add one exact bucket policy without rewriting role or existing policies.""" + from .config import validate_tos_bucket_name + + bucket = validate_tos_bucket_name(bucket) + if not bucket: + raise IamError(key="iamConfigurationConflict") + name = "VeADKMPATosMountV1_" + hashlib.sha256(bucket.encode()).hexdigest()[:20] + document = { + "Statement": [ + { + "Effect": "Allow", + "Action": ["tos:HeadBucket", "tos:ListBucket"], + "Resource": [f"trn:tos:::{bucket}"], + }, + { + "Effect": "Allow", + "Action": [ + "tos:GetObject", + "tos:PutObject", + "tos:AbortMultipartUpload", + "tos:DeleteObject", + ], + "Resource": [f"trn:tos:::{bucket}/sandbox-session/*"], + }, + ] + } + + async def bindings(): + result = await cloud.call("list_attached_role_policies", RoleName=role_name) + return any( + item.get("PolicyName") == name + and item.get("PolicyType") == "Custom" + and any( + scope.get("PolicyScopeType") == "Global" + for scope in item.get("PolicyScope", []) + ) + for item in result.get("AttachedPolicyMetadata", []) + ) + + async def reconcile(): + await cloud.verify_tos_bucket(bucket) + deadline = time.monotonic() + timeout + while True: + try: + _validate_role( + await cloud.call("get_role", RoleName=role_name), + account, + role_name=role_name, + required_services=("vefaas",), + ) + query = {"PolicyName": name, "PolicyType": "Custom"} + try: + policy = await cloud.call("get_policy", **query) + except IamError as error: + if error.code != "PolicyNotExist": + raise + try: + await cloud.call( + "create_policy", + PolicyName=name, + PolicyDocument=json.dumps(document), + Description="MPA session output bucket access", + ) + except IamError as error: + if error.code != "PolicyAlreadyExist": + raise + policy = await cloud.call("get_policy", **query) + if _canonical( + _document(policy.get("Policy", policy).get("PolicyDocument")) + ) != _canonical(document): + raise IamError(key="iamPolicyConflict") + if not await bindings(): + try: + await cloud.call( + "attach_role_policy", RoleName=role_name, **query + ) + except IamError as error: + if error.code != "PolicyAttachConflict": + raise + if await bindings(): + _validate_role( + await cloud.call("get_role", RoleName=role_name), + account, + role_name=role_name, + required_services=("vefaas",), + ) + return + except IamError as error: + if error.code not in TRANSIENT_CODES | {"PolicyNotExist"}: + raise + if time.monotonic() >= deadline: + raise IamError() + await asyncio.sleep(poll_interval) + + try: + await asyncio.wait_for(reconcile(), timeout) + except asyncio.TimeoutError: + raise IamError() from None + + async def ensure_runtime_role( cloud, account: str, *, timeout: float = 120, poll_interval: float = 2 ): @@ -243,6 +469,7 @@ async def ensure_runtime_role( async def reconcile(): deadline = time.monotonic() + timeout + transient_attempt = 0 async def get_or_create(get, create, missing, collision, query, values): try: @@ -324,16 +551,32 @@ async def bindings(): if required <= await bindings(): return except IamError as error: - if error.code not in TRANSIENT_CODES | { - "RoleNotExist", - "PolicyNotExist", - }: + if error.category in TRANSIENT_CATEGORIES: + transient_attempt += 1 + retrying = transient_attempt < 4 + report( + error.operation, + error.category, + attempt=transient_attempt, + outcome="retrying" if retrying else "failed", + request_id=error.request_id, + ) + if not retrying: + raise + await asyncio.sleep(2 ** (transient_attempt - 1)) + continue + if error.code not in {"RoleNotExist", "PolicyNotExist"}: + report(error.operation, error.category, request_id=error.request_id) raise if time.monotonic() >= deadline: - raise IamError() + raise IamError(category="timeout") await asyncio.sleep(poll_interval) try: await asyncio.wait_for(reconcile(), timeout) except asyncio.TimeoutError: - raise IamError() from None + report("iam_verify", "timeout") + raise IamError(category="timeout") from None + except asyncio.CancelledError: + report("iam_verify", "cancelled", outcome="cancelled") + raise diff --git a/veadk/integrations/mpa/managed/names.py b/veadk/integrations/mpa/managed/names.py new file mode 100644 index 000000000..0d7aa1fe5 --- /dev/null +++ b/veadk/integrations/mpa/managed/names.py @@ -0,0 +1,144 @@ +# 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. + +"""Read-only, bounded MPA name checks before cloud prerequisites are purchased.""" + +from __future__ import annotations + +import asyncio + +from .config import ConfigurationError, validate_runtime_name +from .database import DeploymentError, agent_suffix +from .pg_bootstrap import ( + agent_business_scope, + named_business_workspace, + validate_workspace, +) +from .pg_cloud import PGCloud +from .runtime import env_map +from .worker import WorkerCloud + +ERROR_KEYS = {"runtimeNameTaken", "runtimeNameCheckFailed"} + + +class NameCheckError(DeploymentError): + def __init__(self, key="runtimeNameCheckFailed"): + self.key = key + super().__init__(key) + + +def tags(values): + return { + item.get("Key", item.get("key")): item.get("Value", item.get("value")) + for item in values or [] + } + + +async def check_creation_name( + profile, cloud, *, agent_id, name, owner="", verified_creation_account="" +): + """Return only verified account identity; never return matching resource details.""" + name = validate_runtime_name(name) + + async def check(): + account = await cloud.account_id() + expected = profile.values.get("account_id", "") + if expected and expected != account: + raise NameCheckError() + if verified_creation_account and verified_creation_account != account: + raise NameCheckError() + worker = WorkerCloud(cloud) + runtimes, workers = await asyncio.gather( + cloud.find_runtimes(name), worker.find(name) + ) + if len(runtimes) > 1 or len(workers) > 1: + raise NameCheckError("runtimeNameTaken") + for item in runtimes: + current = await cloud.get(item["RuntimeId"]) + listed = tags(item.get("Tags")) + detailed = tags(current.get("Tags")) + if any( + key in listed and key in detailed and listed[key] != detailed[key] + for key in ("veadk:owner", "veadk:mpa-instance-id") + ): + raise NameCheckError("runtimeNameTaken") + # GetRuntime's SDK shape omits Tags; matching list metadata owns them. + provenance = {**listed, **detailed} + if ( + env_map(current).get("MPA_AGENT_ID") != agent_id + or provenance.get("veadk:mpa-instance-id", agent_id) != agent_id + or owner + and provenance.get("veadk:owner") != owner + and not ( + bool(verified_creation_account) + and verified_creation_account == account + and not provenance.get("veadk:owner") + ) + ): + raise NameCheckError("runtimeNameTaken") + worker_owned = { + "managed_by": "mpa-deployment", + "mpa_agent_key": agent_suffix(account, profile.region, agent_id), + } + for item in workers: + current = await worker.get(item["ToolId"]) + provenance = tags(current.get("Tags")) + if env_map(current).get("MPA_AGENT_ID") != agent_id or any( + provenance.get(key) != value for key, value in worker_owned.items() + ): + raise NameCheckError("runtimeNameTaken") + settings = profile.managed.postgres + if settings and settings.business_database_name == "aidb": + pg = PGCloud( + region=profile.region, + credentials=cloud._credentials, + provider=profile.provider, + ) + workspaces = await pg.find( + settings.project_name, named_business_workspace(name) + ) + expected_tags = { + "veadk-pg-scope": agent_business_scope( + account, profile.region, settings.project_name, agent_id + ), + "veadk-pg-purpose": "business", + "veadk-pg-database": "aidb", + } + if len(workspaces) > 1: + raise NameCheckError("runtimeNameTaken") + for current in workspaces: + actual = tags(current.get("workspace_tags")) + if any( + actual.get(key) != value for key, value in expected_tags.items() + ): + raise NameCheckError("runtimeNameTaken") + validate_workspace( + current, + account=account, + region=profile.region, + project=settings.project_name, + name=named_business_workspace(name), + tags=expected_tags, + owned=True, + ) + return account + + try: + return await asyncio.wait_for(check(), timeout=30) + except (NameCheckError, ConfigurationError): + raise + except asyncio.CancelledError: + raise + except Exception: + raise NameCheckError() from None diff --git a/veadk/integrations/mpa/managed/openviking.py b/veadk/integrations/mpa/managed/openviking.py new file mode 100644 index 000000000..bb404148e --- /dev/null +++ b/veadk/integrations/mpa/managed/openviking.py @@ -0,0 +1,471 @@ +# 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. + +"""Prepare an owned OpenViking library without persisting data-plane secrets.""" + +from __future__ import annotations + +import asyncio +import copy +import json +import os +import re +import time + +from .database import DeploymentError, agent_suffix +from .diagnostics import ( + CODE_CATEGORIES, + classify_error, + report, + safe_error_code, + safe_request_id, +) + +ERROR_KEYS = frozenset( + { + "openvikingModelEndpointsInvalid", + "openvikingPermissionDenied", + "openvikingConfigurationConflict", + "openvikingCreateUnknown", + "openvikingNotReady", + "openvikingResourceFailed", + "openvikingResourceMissing", + "openvikingModelConfigurationRejected", + "openvikingUnavailable", + "openvikingInvalidResponse", + "openvikingQuotaExceeded", + } +) +DATA_URL = "https://api.vikingdb.cn-beijing.volces.com/openviking" + +BYTEPLUS_DATA_URL = "https://api.vikingdb.ap-southeast-1.bytepluses.com/openviking" + + +def supports_auto_openviking(provider, region): + return (provider, region) in { + ("volcengine", "cn-beijing"), + ("byteplus", "ap-southeast-1"), + } + + +def byteplus_model_endpoints() -> tuple[str, str]: + """Resolve nonsecret inference endpoints; defaults are operator-requested trials.""" + vlm = os.getenv("OV_VLM_ENDPOINT_ID", "seed-2-0-lite-260428") + embedding = os.getenv("OV_EMBEDDING_ENDPOINT_ID", "skylark-embedding-vision-251215") + validate_model_endpoints(vlm, embedding) + return vlm, embedding + + +def validate_model_endpoints(vlm, embedding): + for value in (vlm, embedding): + if not isinstance(value, str) or not re.fullmatch( + r"[A-Za-z0-9][A-Za-z0-9_.-]{0,127}", value + ): + raise OpenVikingError("openvikingModelEndpointsInvalid") + + +def validate_model_key(value): + """Reject unusable model credentials without including them in errors.""" + if ( + not isinstance(value, str) + or not value + or len(value) > 512 + or value.startswith("<") + or "*" in value + or any(character.isspace() for character in value) + ): + raise OpenVikingError("openvikingConfigurationConflict") + + +class OpenVikingError(DeploymentError): + """Allowlisted error; never carry provider response text or credentials.""" + + def __init__( + self, key: str, *, category: str = "deployment_error", rejected: bool = False + ): + self.key = key if key in ERROR_KEYS else "openvikingUnavailable" + self.category = category + self.rejected = rejected + super().__init__(self.key) + + +def response_metadata(response: object) -> tuple[str, str]: + """Extract identifiers only; provider messages and payloads never escape.""" + if not isinstance(response, dict): + return "", "" + metadata = response.get("ResponseMetadata") + if not isinstance(metadata, dict): + return "", "" + error = metadata.get("Error") + return ( + safe_error_code(error.get("Code")) if isinstance(error, dict) else "", + safe_request_id(metadata.get("RequestId")), + ) + + +def exception_metadata(error: Exception) -> tuple[str, str]: + """Inspect structured HTTP/SDK bodies without using exception text.""" + response = getattr(error, "response", None) + if response is not None: + try: + code, request_id = response_metadata(response.json()) + if code or request_id: + return code, request_id + except (ValueError, TypeError, AttributeError): + pass + body = getattr(error, "body", None) + if isinstance(body, (str, bytes)) and len(body) <= 65536: + try: + return response_metadata(json.loads(body)) + except (ValueError, TypeError): + pass + return "", "" + + +class OpenVikingCloud: + def __init__(self, source): + if not supports_auto_openviking(source.provider, source.region): + raise OpenVikingError("openvikingConfigurationConflict") + self.source = source + + async def _call(self, action: str, body: dict, operation: str, *, create=False): + for attempt in range(1, 2 if create else 4): + rejected = False + error_code, request_id = "", "" + + def request(): + credential = self.source._credentials() + if self.source.provider == "byteplus": + from .openviking_byteplus import signed_request + + return signed_request( + action=action, body=body, credential=credential + ) + from veadk.utils.volcengine_sign import volcengine_signed_request + + return volcengine_signed_request( + request_body=body, + ak=credential.access_key_id, + sk=credential.secret_access_key, + header={"X-Security-Token": credential.session_token or ""}, + service="vikingdb", + region="cn-beijing", + host="vikingdb.cn-beijing.volcengineapi.com", + path="/", + query={"Action": action, "Version": "2025-06-09"}, + timeout=(10, 30), + ) + + try: + response = await asyncio.to_thread(request) + except Exception as exc: + category = classify_error(exc) + error_code, request_id = exception_metadata(exc) + else: + error_code, request_id = response_metadata(response) + if self.source.provider == "byteplus" and isinstance(response, dict): + response = dict(response) + if "Result" not in response and isinstance( + response.get("result"), dict + ): + response["Result"] = response["result"] + metadata = ( + response.get("ResponseMetadata", {}) + if isinstance(response, dict) + else None + ) + error = metadata.get("Error") if isinstance(metadata, dict) else None + if isinstance(error, dict): + category = CODE_CATEGORIES.get( + str(error.get("Code", "")), "provider_error" + ) + if error.get("Code") == "ResourceNotExist": + category = "not_found" + elif error.get("Code") == "QuotaExceeded": + category = "throttled" + rejected = category in { + "permission", + "invalid_request", + "throttled", + } + elif ( + isinstance(response, dict) + and isinstance(metadata, dict) + and not error + and isinstance(response.get("Result"), dict) + ): + return response["Result"] + else: + category = "protocol_error" + retry = ( + not create + and attempt < 3 + and category in {"connection", "timeout", "throttled", "unavailable"} + ) + report( + operation, + category, + attempt=attempt, + outcome="retrying" if retry else "failed", + error_code=error_code, + request_id=request_id, + ) + if retry: + await asyncio.sleep((0.2, 0.5)[attempt - 1]) + continue + key = { + "permission": "openvikingPermissionDenied", + "not_found": "openvikingResourceMissing", + "invalid_request": "openvikingModelConfigurationRejected" + if create + else "openvikingConfigurationConflict", + "protocol_error": "openvikingInvalidResponse", + "throttled": "openvikingQuotaExceeded", + }.get(category, "openvikingUnavailable") + raise OpenVikingError(key, category=category, rejected=rejected) from None + raise AssertionError("OpenViking read retry exhausted") + + async def create(self, request, *, model_api_key): + validate_model_key(model_api_key) + wire = copy.deepcopy(request) + for field in ("VLM", "Embedding"): + for credential in wire[field]["Credentials"]: + credential["ApiKey"] = model_api_key + result = await self._call( + "CreateOpenVikingCollection", wire, "create_openviking", create=True + ) + ident = result.get("ResourceID") + if ( + ( + result.get("Success") is not True + if self.source.provider == "volcengine" + else result.get("Success", True) is not True + ) + or not isinstance(ident, str) + or not re.fullmatch(r"ov-[A-Za-z0-9_-]{1,125}", ident) + ): + raise OpenVikingError("openvikingCreateUnknown", category="protocol_error") + return ident + + async def get(self, ident): + return await self._call( + "GetOpenVikingCollection", {"ResourceID": ident}, "get_openviking" + ) + + async def api_key(self, ident): + result = await self._call( + "AccessOpenVikingApiKey", + { + "ResourceID": ident, + **( + {"UserID": "default"} + if self.source.provider == "volcengine" + else {} + ), + }, + "get_openviking_key", + ) + key = result.get("ApiKey") + if result.get("UserID", "default") != "default": + raise OpenVikingError( + "openvikingInvalidResponse", category="protocol_error" + ) + if not isinstance(key, str) or not key.strip() or len(key) > 4096 or "*" in key: + raise OpenVikingError( + "openvikingInvalidResponse", category="protocol_error" + ) + return key + + +def validate_library(row, ident, request): + if not isinstance(row, dict) or row.get("ResourceID") != ident: + raise OpenVikingError("openvikingResourceMissing") + if any( + row.get(key) != request[key] + for key in ("Name", "Description", "Project", "Version") + ): + raise OpenVikingError("openvikingConfigurationConflict") + if "Source" in request and row.get("Source") != request["Source"]: + raise OpenVikingError("openvikingConfigurationConflict") + for field in ("VLM", "Embedding"): + actual = row.get(field) + expected = request[field] + if ( + not isinstance(actual, dict) + or ( + "ModelVersion" in expected + and actual.get("ModelVersion") != expected["ModelVersion"] + ) + or str(actual.get("ModelName", "")).replace(".", "-") + != expected["ModelName"].replace(".", "-") + ): + raise OpenVikingError("openvikingConfigurationConflict") + credentials = actual.get("Credentials") + if ( + not isinstance(credentials, list) + or len(credentials) != len(expected["Credentials"]) + or any( + not isinstance(credential, dict) + or any( + credential.get(key) != desired[key] + for key in ("Source", "EndpointID") + if key in desired + ) + for credential, desired in zip(credentials, expected["Credentials"]) + ) + ): + raise OpenVikingError("openvikingConfigurationConflict") + + +async def ensure_openviking( + entry, + cloud, + *, + account, + region, + agent_id, + provider="volcengine", + model_api_key, + model_endpoints: tuple[str, str] | None = None, + project="default", + timeout=600, + progress=lambda stage: None, +): + """Caller holds the deployment lock; uncertain creates never repeat.""" + if not supports_auto_openviking(provider, region): + raise OpenVikingError("openvikingConfigurationConflict") + validate_model_key(model_api_key) + progress("openviking") + suffix = agent_suffix(account, region, agent_id) + request = { + "Name": "mpa_ov_" + suffix, + "Description": "mpa-openviking:v1:" + suffix, + "Project": project, + "Version": "enterprise", + "VLM": { + "ModelName": "doubao-seed-2.0-lite", + "ModelVersion": "260428", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "doubao-seed-2-0-lite-260428"} + ], + }, + "Embedding": { + "ModelName": "doubao-embedding-vision", + "ModelVersion": "251215", + "Credentials": [ + {"Source": "volcengine", "EndpointID": "doubao-embedding-vision-251215"} + ], + }, + } + data_url = DATA_URL + if provider == "byteplus": + data_url = BYTEPLUS_DATA_URL + vlm, embedding = ( + byteplus_model_endpoints() if model_endpoints is None else model_endpoints + ) + validate_model_endpoints(vlm, embedding) + request.update(Version="developer", Source="volcengine") + request["VLM"] = { + "ModelName": "seed-2-0-lite", + "Credentials": [{"Source": "volcengine", "EndpointID": vlm}], + } + request["Embedding"] = { + "ModelName": "skylark-embedding-vision", + "Credentials": [{"Source": "volcengine", "EndpointID": embedding}], + } + record = await entry.read() + if record.get("state") in {"deleting", "deleted"}: + raise OpenVikingError("openvikingConfigurationConflict") + ident = record.get("openviking_id", "") + if record.get("openviking_request") and record["openviking_request"] != request: + legacy_request = copy.deepcopy(request) + for field in ("VLM", "Embedding"): + legacy_request[field].pop("Credentials") + if not ( + not ident + and not record.get("pending") + and record.get("openviking_create_requested") is False + and record["openviking_request"] == legacy_request + ): + raise OpenVikingError("openvikingConfigurationConflict") + if ident: + if ( + record.get("openviking_managed") is not True + or record.get("openviking_request") != request + ): + raise OpenVikingError("openvikingConfigurationConflict") + else: + if record.get("pending"): + raise OpenVikingError("openvikingConfigurationConflict") + if record.get("openviking_create_requested"): + raise OpenVikingError("openvikingCreateUnknown") + record.update(openviking_request=request, openviking_create_requested=True) + await entry.save(record) + try: + ident = await cloud.create(request, model_api_key=model_api_key) + except Exception as exc: + if isinstance(exc, OpenVikingError) and ( + exc.rejected + or exc.category + in { + "permission", + "invalid_request", + } + ): + record["openviking_create_requested"] = False + await entry.save(record) + raise + raise OpenVikingError("openvikingCreateUnknown") from None + if not isinstance(ident, str) or not re.fullmatch( + r"ov-[A-Za-z0-9_-]{1,125}", ident + ): + raise OpenVikingError("openvikingCreateUnknown") + record.update( + openviking_id=ident, openviking_managed=True, openviking_url=data_url + ) + await entry.save(record) + deadline = time.monotonic() + timeout + while True: + remaining = deadline - time.monotonic() + if remaining <= 0: + raise OpenVikingError("openvikingNotReady", category="timeout") + try: + row = await asyncio.wait_for(cloud.get(ident), remaining) + except asyncio.TimeoutError: + raise OpenVikingError("openvikingNotReady", category="timeout") from None + validate_library(row, ident, request) + status = row.get("Status") + if status == "READY": + break + if status == "FAILED": + raise OpenVikingError( + "openvikingResourceFailed", category="resource_failed" + ) + if status != "INIT": + raise OpenVikingError( + "openvikingInvalidResponse", category="protocol_error" + ) + if time.monotonic() >= deadline: + raise OpenVikingError("openvikingNotReady", category="timeout") + await asyncio.sleep(2) + record["openviking_state"] = "READY" + await entry.save(record) + progress("openviking_key") + key = await cloud.api_key(ident) + return { + "OPENVIKING_URL": data_url, + "OPENVIKING_RESOURCE_ID": ident, + "OPENVIKING_API_KEY": key, + "OPENVIKING_USER": "default", + } diff --git a/veadk/integrations/mpa/managed/openviking_byteplus.py b/veadk/integrations/mpa/managed/openviking_byteplus.py new file mode 100644 index 000000000..a5085a602 --- /dev/null +++ b/veadk/integrations/mpa/managed/openviking_byteplus.py @@ -0,0 +1,91 @@ +# 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. + +"""BytePlus OV control-plane signing matching the Johor collection contract.""" + +import datetime +import hashlib +import hmac +import json +from urllib.parse import urlencode + +HOST = "vikingdb.ap-southeast-1.byteplusapi.com" +REGION = "ap-southeast-1" +SERVICE = "vikingdb" +VERSION = "2025-06-09" +ACTIONS = frozenset( + {"CreateOpenVikingCollection", "GetOpenVikingCollection", "AccessOpenVikingApiKey"} +) + + +def signed_request(*, action, body, credential): + """Keep the overseas signing contract independent of domestic callers.""" + import requests + + if action not in ACTIONS: + raise ValueError("Unsupported OpenViking action") + path = "/api/openviking/" + action + query = urlencode({"Action": action, "Version": VERSION}) + payload = json.dumps(body) + digest = hashlib.sha256(payload.encode()).hexdigest() + now = datetime.datetime.now(datetime.timezone.utc) + date = now.strftime("%Y%m%dT%H%M%SZ") + day = date[:8] + signed = { + "content-type": "application/json", + "host": HOST, + "x-content-sha256": digest, + "x-date": date, + } + if credential.session_token: + signed["x-security-token"] = credential.session_token + header_names = ";".join(sorted(signed)) + canonical_headers = "\n".join(f"{key}:{signed[key]}" for key in sorted(signed)) + canonical_request = "\n".join( + ["POST", path, query, canonical_headers, "", header_names, digest] + ) + scope = f"{day}/{REGION}/{SERVICE}/request" + to_sign = "\n".join( + [ + "HMAC-SHA256", + date, + scope, + hashlib.sha256(canonical_request.encode()).hexdigest(), + ] + ) + signing_key = credential.secret_access_key.encode() + for part in (day, REGION, SERVICE, "request"): + signing_key = hmac.new(signing_key, part.encode(), hashlib.sha256).digest() + signature = hmac.new(signing_key, to_sign.encode(), hashlib.sha256).hexdigest() + headers = { + **signed, + "Accept": "application/json", + "X-Top-Service": SERVICE, + "X-Top-Region": REGION, + "Authorization": f"HMAC-SHA256 Credential={credential.access_key_id}/{scope}, SignedHeaders={header_names}, Signature={signature}", + } + response = requests.post( + f"https://{HOST}{path}?{query}", data=payload, headers=headers, timeout=(10, 30) + ) + try: + result = response.json() + except ValueError: + response.raise_for_status() + raise ValueError("Invalid OpenViking response") from None + # Preserve structured provider errors for classification without exposing messages. + metadata = result.get("ResponseMetadata") if isinstance(result, dict) else None + if isinstance(metadata, dict) and isinstance(metadata.get("Error"), dict): + return result + response.raise_for_status() + return result diff --git a/veadk/integrations/mpa/managed/pg_bootstrap.py b/veadk/integrations/mpa/managed/pg_bootstrap.py index 374b715b2..72d52844b 100644 --- a/veadk/integrations/mpa/managed/pg_bootstrap.py +++ b/veadk/integrations/mpa/managed/pg_bootstrap.py @@ -29,8 +29,8 @@ from sqlalchemy.engine import make_url from .admin_database import initialize_admin_database -from .config import ADMIN_DATABASE_NAME, validate_postgres_layout -from .database import DeploymentError +from .config import ADMIN_DATABASE_NAME, validate_postgres_layout, validate_runtime_name +from .database import AgentDeploymentRegistry, DeploymentError, database_name from .pg_cloud import PGCloudError, PGNotReady, check_ready @@ -124,6 +124,16 @@ def retire_failed(self, scope, purpose, ident, *, clear_intent): ) +def agent_business_scope(account, region, project, agent_id): + return hashlib.sha256( + json.dumps([account, region, project, "business", agent_id]).encode() + ).hexdigest()[:32] + + +def named_business_workspace(runtime_name): + return "mpa_agent_" + validate_runtime_name(runtime_name) + + def validate_workspace(row, *, account, region, project, name, tags, owned): expected = { "account_id": account, @@ -170,7 +180,10 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo else settings.business_workspace_id ) tags = {"veadk-pg-scope": scope, "veadk-pg-purpose": purpose} - config = json.dumps([name, "PostgreSQL_17"]) + dedicated_aidb = purpose == "business" and settings.business_database_name == "aidb" + if dedicated_aidb: + tags["veadk-pg-database"] = "aidb" + config = json.dumps([name, "PostgreSQL_17", *(["aidb"] if dedicated_aidb else [])]) record = store.read(scope, purpose) if record and record[0] != config: raise DeploymentError( @@ -178,6 +191,9 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo ) ident = record[1] if record else "" owned = bool(record and record[2]) + agent_owned = ( + purpose == "business" and settings.business_workspace_mode == "per-agent" + ) if explicit and ident and explicit != ident: raise DeploymentError( "Configured Workspace ID differs from recorded bootstrap identity" @@ -205,10 +221,10 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo continue if row.get("workspace_status") == "CreateFailed": # Confirm terminal creation failure before changing local state. - validate_workspace(row, **validation, owned=False) + validate_workspace(row, **validation, owned=agent_owned) row = await cloud.detail(candidate_id) if row.get("workspace_status") == "CreateFailed": - validate_workspace(row, **validation, owned=False) + validate_workspace(row, **validation, owned=agent_owned) failed.append(row["workspace_id"]) else: candidates.append(row) @@ -226,7 +242,7 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo if candidates: row = candidates[0] try: - validate_workspace(row, **validation, owned=owned) + validate_workspace(row, **validation, owned=owned or agent_owned) except PGNotReady: # Owned discovery metadata is subject to the same readiness wait. if not row.get("workspace_id"): @@ -265,7 +281,7 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo if explicit and not (record and record[1]): # Validate adoption before pinning an operator-supplied identity. row = await cloud.detail(ident) - validate_workspace(row, **validation, owned=owned) + validate_workspace(row, **validation, owned=owned or agent_owned) store.save(scope, purpose, config, ident, owned) try: try: @@ -280,7 +296,7 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo ) from None raise if row.get("workspace_status") == "CreateFailed" and owned and not explicit: - validate_workspace(row, **validation, owned=False) + validate_workspace(row, **validation, owned=agent_owned) store.retire_failed(scope, purpose, ident, clear_intent=True) if dispatched: raise DeploymentError( @@ -289,7 +305,7 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo ident, record, owned = "", None, False continue try: - validate_workspace(row, **validation, owned=owned) + validate_workspace(row, **validation, owned=owned or agent_owned) except PGNotReady: # Terminal/unknown states cannot masquerade as delayed metadata. check_ready(row.get("workspace_status")) @@ -301,12 +317,36 @@ async def ensure_workspace(store, cloud, settings, scope, account, region, purpo await asyncio.sleep(3) +async def registered_business_binding(url, account, region, agent_id): + """Read existing bindings before allocating another business Workspace.""" + registry = AgentDeploymentRegistry(url) + try: + async with registry.lock(account, region, agent_id) as entry: + return await entry.read() + finally: + await registry.close() + + async def prepare_postgres( - profile, cloud, account, *, progress=lambda stage: None, source_url="" + profile, + cloud, + account, + *, + progress=lambda stage: None, + source_url="", + agent_id="", + runtime_name="", ): settings = profile.managed.postgres if settings is None or settings.mode != "auto": return profile + per_agent = settings.business_workspace_mode == "per-agent" + if per_agent and (not agent_id or settings.business_workspace_id or source_url): + raise DeploymentError( + "Per-agent PG requires a stable agent ID and no shared Workspace adoption or migration" + ) + if per_agent: + database_name(account, profile.region, agent_id) if profile.shared_url and not source_url: raise DeploymentError( "Legacy registry connection is configured; migrate with init-admin-db and remove the legacy registry URL before automatic provisioning" @@ -326,11 +366,108 @@ async def prepare(): admin_id, admin_connection = await ensure_workspace( store, cloud, settings, scope, account, profile.region, "admin" ) + admin = make_url(admin_connection) + shared_url = admin.set(database=ADMIN_DATABASE_NAME).render_as_string( + hide_password=False + ) + business_settings, business_scope, binding = settings, scope, {} + if per_agent: + progress("admin_database") + await initialize_admin_database( + replace(profile, shared_url=shared_url), + maintenance_url=admin_connection, + ) + binding = await registered_business_binding( + shared_url, account, profile.region, agent_id + ) + mode = ( + binding.get("business_workspace_mode", "shared") + if binding + else "per-agent" + ) + if binding and ( + binding.get("state") in {"deleted", "deleting"} + or binding.get("admin_workspace_id") != admin_id + or not binding.get("business_workspace_id") + or mode not in {"shared", "per-agent"} + ): + raise DeploymentError( + "Existing business Workspace binding cannot be safely reused" + ) + business_settings = settings.model_copy( + update={ + "business_workspace_mode": mode, + "business_database_name": ( + "aidb" + if binding.get("business_database_name") == "aidb" + or binding.get("database_name") == "aidb" + else "" + ) + if binding + else settings.business_database_name, + "business_workspace_id": binding.get( + "business_workspace_id", "" + ), + } + ) + if mode == "per-agent": + business_scope = agent_business_scope( + account, profile.region, settings.project_name, agent_id + ) + selected = store.read(business_scope, "business") + if selected: + previous = json.loads(selected[0]) + previous_database = ( + "aidb" + if len(previous) == 3 and previous[2] == "aidb" + else "" + ) + if ( + binding + and business_settings.business_database_name + != previous_database + ): + raise DeploymentError( + "Registered database layout differs from bootstrap" + ) + business_settings.business_workspace_name = previous[0] + business_settings.business_database_name = previous_database + elif binding: + detail = await cloud.detail(binding["business_workspace_id"]) + business_settings.business_workspace_name = binding.get( + "business_workspace_name" + ) or detail.get("workspace_name", "") + else: + business_settings.business_workspace_name = ( + named_business_workspace(runtime_name or agent_id) + if business_settings.business_database_name == "aidb" + else database_name(account, profile.region, agent_id) + ) + else: + business_settings.business_database_name = "" progress("business_workspace") business_id, business_connection = await ensure_workspace( - store, cloud, settings, scope, account, profile.region, "business" + store, + cloud, + business_settings, + business_scope, + account, + profile.region, + "business", ) - admin, business = make_url(admin_connection), make_url(business_connection) + business = make_url(business_connection) + if binding and ( + ( + "database_host" in binding + and str(binding["database_host"]).lower() + != (business.host or "").lower() + ) + or ( + "database_port" in binding + and binding["database_port"] != (business.port or 5432) + ) + ): + raise DeploymentError("Registered business database endpoint changed") if profile.admin_url: old = make_url(profile.admin_url) if ((old.host or "").lower(), old.port or 5432) != ( @@ -341,7 +478,7 @@ async def prepare(): "Existing business PostgreSQL endpoint changed; explicitly adopt or migrate before provisioning" ) managed = profile.managed.model_copy(deep=True) - managed.postgres = settings.model_copy( + managed.postgres = business_settings.model_copy( update={ "mode": "manual", "admin_workspace_id": admin_id, @@ -366,15 +503,14 @@ async def prepare(): managed=managed, values=values, admin_url=business_connection, - shared_url=admin.set(database=ADMIN_DATABASE_NAME).render_as_string( - hide_password=False - ), + shared_url=shared_url, ) validate_postgres_layout(resolved) - progress("admin_database") - await initialize_admin_database( - resolved, source_url=source_url, maintenance_url=admin_connection - ) + if not per_agent: + progress("admin_database") + await initialize_admin_database( + resolved, source_url=source_url, maintenance_url=admin_connection + ) return resolved try: diff --git a/veadk/integrations/mpa/managed/pg_cloud.py b/veadk/integrations/mpa/managed/pg_cloud.py index 74910adb8..715c90fea 100644 --- a/veadk/integrations/mpa/managed/pg_cloud.py +++ b/veadk/integrations/mpa/managed/pg_cloud.py @@ -24,6 +24,7 @@ from sqlalchemy.engine import URL from .database import DeploymentError +from .diagnostics import CODE_CATEGORIES, report, safe_error_code, safe_request_id def _debug_event(hypothesis: str, location: str, message: str, data: dict) -> None: @@ -55,8 +56,9 @@ def _debug_event(hypothesis: str, location: str, message: str, data: dict) -> No class PGCloudError(DeploymentError): - def __init__(self, method, code): + def __init__(self, method, code, *, request_id=""): self.code = code + self.request_id = request_id super().__init__( f"AIDAP {method} failed ({code}); check deployment permissions and connectivity" ) @@ -66,6 +68,43 @@ class PGNotReady(DeploymentError): """A discovered resource is still being prepared by AIDAP.""" +METHOD_OPERATIONS = { + "describe_workspaces": "aidap_describe_workspaces", + "describe_workspace_detail": "aidap_describe_workspace_detail", + "create_workspace": "aidap_create_workspace", + "describe_branches": "aidap_describe_branches", + "describe_computes": "aidap_describe_computes", + "describe_workspace_endpoint": "aidap_describe_workspace_endpoint", + "describe_db_accounts": "aidap_describe_db_accounts", + "describe_databases": "aidap_describe_databases", + "describe_db_account_connection": "aidap_describe_db_account_connection", +} +TRANSIENT_CATEGORIES = {"connection", "timeout", "throttled", "unavailable"} +READ_BACKOFF_SECONDS = (1, 2, 4, 8, 16, 30, 30) + + +def _provider_metadata(error: BaseException) -> tuple[str, str]: + try: + metadata = json.loads(getattr(error, "body", "") or "{}").get( + "ResponseMetadata", {} + ) + provider_error = metadata.get("Error", {}) + code = ( + provider_error.get("Code", "") if isinstance(provider_error, dict) else "" + ) + return safe_error_code(code), safe_request_id(metadata.get("RequestId")) + except (ValueError, TypeError, AttributeError): + return "", "" + + +def _category_for_code(code: str) -> str: + if code == "CloudRequestFailed": + return "unavailable" + if code == "InternalServiceTimeout": + return "timeout" + return CODE_CATEGORIES.get(code, "provider_error") + + def check_ready(status): value = str(status or "").strip().lower() if value in {"running", "ready", "available", "active", "normal"}: @@ -203,26 +242,47 @@ def run(): finally: client.rest_client.pool_manager.clear() - try: - return await asyncio.to_thread(run) - except DeploymentError: - raise - except Exception as exc: # noqa: BLE001 + attempts = 1 if method == "create_workspace" else len(READ_BACKOFF_SECONDS) + 1 + operation = METHOD_OPERATIONS.get(method, "provision") + for attempt in range(1, attempts + 1): try: - code = json.loads(getattr(exc, "body", "") or "{}")["ResponseMetadata"][ - "Error" - ]["Code"] - if not isinstance(code, str) or not code.replace(".", "").isalnum(): - raise ValueError - except (ValueError, TypeError, KeyError): - code = "CloudRequestFailed" - _debug_event( - "B-C", - "pg_cloud.py:call:error", - "[DEBUG] AIDAP request failed", - {"method": method, "code": code, "errorType": type(exc).__name__}, - ) - raise PGCloudError(method, code) from None + return await asyncio.to_thread(run) + except DeploymentError: + raise + except Exception as exc: # noqa: BLE001 + code, request_id = _provider_metadata(exc) + if not code: + code = "CloudRequestFailed" + category = _category_for_code(code) + retrying = ( + method != "create_workspace" + and attempt < attempts + and category in TRANSIENT_CATEGORIES + ) + report( + operation, + category, + attempt=attempt, + outcome="retrying" if retrying else "failed", + error_code=code, + request_id=request_id, + ) + _debug_event( + "B-C", + "pg_cloud.py:call:error", + "[DEBUG] AIDAP request failed", + { + "method": method, + "code": code, + "errorType": type(exc).__name__, + "attempt": attempt, + "retrying": retrying, + }, + ) + if not retrying: + raise PGCloudError(method, code, request_id=request_id) from None + await asyncio.sleep(READ_BACKOFF_SECONDS[attempt - 1]) + raise AssertionError("AIDAP retry loop exhausted") async def listing(self, method, request, collection, **params): rows = [] diff --git a/veadk/integrations/mpa/managed/runner.py b/veadk/integrations/mpa/managed/runner.py index 53b63d89b..e9dedccd8 100644 --- a/veadk/integrations/mpa/managed/runner.py +++ b/veadk/integrations/mpa/managed/runner.py @@ -22,10 +22,13 @@ load_profile, with_creation_images, with_creation_resources, + with_creation_scaling, with_creation_tos, ) from .diagnostics import classify_error, diagnostic_scope, report from .iam import IamError +from .openviking import OpenVikingError +from .names import NameCheckError from .service import provision @@ -46,6 +49,7 @@ def run(): region=data["region"], provider=data.get("provider", "volcengine"), ) + profile = with_creation_scaling(profile, data.get("maxInstance")) profile = with_creation_images(profile, data.get("images", {})) profile = with_creation_resources(profile, data.get("resources", {})) profile = with_creation_tos(profile, data.get("tos", {})) @@ -55,6 +59,7 @@ def run(): profile, agent_id=data["agentId"], runtime_name=data.get("name", ""), + expected_account=data.get("expectedAccount", ""), owner=data["owner"], studio_runtime_owner=data.get("studioRuntimeOwner"), description=data["description"], @@ -80,7 +85,11 @@ def run(): except Exception as error: report("provision", classify_error(error)) # Error text can contain SDK request payloads, URLs and credentials. - emit(error=error.key if isinstance(error, IamError) else "creationFailed") + emit( + error=error.key + if isinstance(error, (IamError, OpenVikingError, NameCheckError)) + else "creationFailed" + ) return 1 diff --git a/veadk/integrations/mpa/managed/runtime.py b/veadk/integrations/mpa/managed/runtime.py index 9ab10c9c2..a6b504888 100644 --- a/veadk/integrations/mpa/managed/runtime.py +++ b/veadk/integrations/mpa/managed/runtime.py @@ -20,12 +20,20 @@ import copy import hashlib import json +import logging +import threading import time +from contextlib import nullcontext import httpx from sqlalchemy.engine import make_url from veadk.integrations.mpa.managed.database import DeploymentError, agent_suffix +from veadk.integrations.mpa.managed.diagnostics import ( + classify_error, + failure_identifiers, + report, +) from veadk.integrations.mpa.managed.network import ( AccountNetworkProvisioner, NetworkOptions, @@ -49,10 +57,22 @@ def asyncpg_registry_url(url: str) -> str: class RuntimeCloud: - def __init__(self, *, region: str, credential_file: str, provider="volcengine"): + def __init__( + self, + *, + region: str, + credential_file: str, + provider="volcengine", + credentials=None, + cache_identity: bool = False, + ): self.region, self.credential_file = region, credential_file self.account = "" self.provider = provider + self.credentials = credentials + self.cache_identity = cache_identity + self._verified_credential: object | None = None + self._identity_lock = threading.Lock() self.network = NetworkCloud( region=region, credentials=self._credentials, provider=provider ) @@ -68,28 +88,37 @@ def _credentials(self): from .provider import managed_host credential = ( - load_volcengine_credentials(self.credential_file) - if self.provider == "volcengine" - else load_provider_credentials(self.provider, self.credential_file) - ) - account = str( - get_caller_identity( - credential.access_key_id, - credential.secret_access_key, - credential.session_token, - region=self.region, - host=managed_host("sts", self.region, self.provider) - if self.provider == "byteplus" - else None, - ).get("AccountId") - or "" + self.credentials() + if self.credentials is not None + else ( + load_volcengine_credentials(self.credential_file) + if self.provider == "volcengine" + else load_provider_credentials(self.provider, self.credential_file) + ) ) - if not account or self.account and account != self.account: - raise DeploymentError( - "Cloud credentials changed accounts during deployment" + with self._identity_lock if self.cache_identity else nullcontext(): + if self.cache_identity and credential == self._verified_credential: + return credential + account = str( + get_caller_identity( + credential.access_key_id, + credential.secret_access_key, + credential.session_token, + region=self.region, + host=managed_host("sts", self.region, self.provider) + if self.provider == "byteplus" + else None, + ).get("AccountId") + or "" ) - self.account = account - return credential + if not account or self.account and account != self.account: + raise DeploymentError( + "Cloud credentials changed accounts during deployment" + ) + self.account = account + if self.cache_identity: + self._verified_credential = credential + return credential def _client(self, *, skills=False): from agentkit.sdk.runtime.client import AgentkitRuntimeClient @@ -117,7 +146,18 @@ def run(): by_alias=True, exclude_none=True ) - return await asyncio.to_thread(run) + try: + return await asyncio.to_thread(run) + except Exception as error: + if method in {"create_runtime", "update_runtime"}: + code, request_id = failure_identifiers(error) + report( + method, + classify_error(error), + error_code=code, + request_id=request_id, + ) + raise async def get_skill_space(self, space_id): from agentkit.sdk.skills.types import GetSkillSpaceRequest @@ -126,6 +166,77 @@ async def get_skill_space(self, space_id): "get_skill_space", GetSkillSpaceRequest(Id=space_id), skills=True ) + async def delete_skill_space(self, space_id): + from agentkit.sdk.skills.types import DeleteSkillSpaceRequest + + await self.call( + "delete_skill_space", DeleteSkillSpaceRequest(Id=space_id), skills=True + ) + + async def list_runtimes(self): + from agentkit.sdk.runtime.types import ListRuntimesRequest + + items, seen = [], set() + token = None + for _ in range(1000): + result = await self.call( + "list_runtimes", ListRuntimesRequest(PageSize=100, NextToken=token) + ) + items.extend(result.get("AgentKitRuntimes") or []) + token = result.get("NextToken") + if not token: + # List responses may omit environments and Tool bindings. + logging.getLogger(__name__).info( + "MPA deletion reference scan runtime_count=%d concurrency=4", + len(items), + ) + details = [] + for offset in range(0, len(items), 4): + batch = await asyncio.gather( + *( + self.get(item["RuntimeId"]) + for item in items[offset : offset + 4] + ), + return_exceptions=True, + ) + for result in batch: + if isinstance(result, BaseException): + raise result + details.append(result) + return details + if token in seen: + raise DeploymentError("Runtime discovery repeated pagination token") + seen.add(token) + raise DeploymentError("Runtime discovery exceeded pagination limit") + + async def find_runtimes(self, name): + """Find exact names without loading unrelated Runtime environments.""" + from agentkit.sdk.runtime.types import ListRuntimesRequest + + matches, tokens, identifiers = [], set(), set() + token = None + for _ in range(1000): + result = await self.call( + "list_runtimes", ListRuntimesRequest(PageSize=100, NextToken=token) + ) + for item in result.get("AgentKitRuntimes") or []: + if not item.get("Name") or not item.get("RuntimeId"): + raise DeploymentError( + "Runtime name discovery returned incomplete metadata" + ) + if item["Name"] == name and item["RuntimeId"] not in identifiers: + matches.append(item) + identifiers.add(item["RuntimeId"]) + token = result.get("NextToken") + if not token: + return matches + if token in tokens: + raise DeploymentError( + "Runtime name discovery repeated pagination token" + ) + tokens.add(token) + raise DeploymentError("Runtime name discovery exceeded pagination limit") + async def create_skill_space(self, request): from agentkit.sdk.skills.types import CreateSkillSpaceRequest @@ -393,6 +504,8 @@ async def deploy( await self.registry.initialize() async with self.registry.lock(account, self.region, agent_id) as entry: record = await entry.read() + if record.get("state") in {"deleting", "deleted"}: + raise DeploymentError("Agent deletion has started; use a new agent ID") if runtime_id and record.get("runtime_id") not in (None, "", runtime_id): raise DeploymentError( "Agent already has another Runtime; explicit migration is required" @@ -401,7 +514,9 @@ async def deploy( current = await self.cloud.get(runtime_id) if runtime_id else None from veadk.integrations.mpa.managed.database import database_name - name = database_name(account, self.region, agent_id) + name = getattr( + self.databases, "business_database_name", "" + ) or database_name(account, self.region, agent_id) if current: # Check agent/database/role before even adopting network resources. identity_template = { diff --git a/veadk/integrations/mpa/managed/service.py b/veadk/integrations/mpa/managed/service.py index e4e638f69..f61930720 100644 --- a/veadk/integrations/mpa/managed/service.py +++ b/veadk/integrations/mpa/managed/service.py @@ -36,13 +36,28 @@ ) from veadk.integrations.ve_identity.identity_client import IdentityClient +from .apm_key import ApmKeyError, RUNTIME_APM_KEY, get_runtime_apm_key from .config import ConfigurationError, Profile, Runtime, validate_postgres_layout from .database import AgentDatabaseProvisioner, AgentDeploymentRegistry, DeploymentError from .gateway import SharedAPIGService from .gateway_cloud import GatewayCloud -from .iam import ROLE_NAME, IamCloud, IamError, ensure_runtime_role +from .iam import ( + ROLE_NAME, + IamCloud, + IamError, + ensure_runtime_role, + ensure_tos_mount_permissions, +) from .model_key import resolve_model_key +from .names import check_creation_name from .network import AccountNetworkProvisioner, NetworkOptions +from .openviking import ( + OpenVikingCloud, + OpenVikingError, + byteplus_model_endpoints, + ensure_openviking, + supports_auto_openviking, +) from .runtime import AgentRuntimeDeployer, RuntimeCloud, env_map, template_from_runtime from .worker import WorkerCloud, ensure_worker @@ -59,6 +74,11 @@ def bind_postgres_workspaces(profile: Profile, record: dict): } if any(key in record and record[key] != value for key, value in binding.items()): raise DeploymentError("Registered Workspace binding differs from configuration") + mode = settings.business_workspace_mode + if record.get("business_workspace_mode", mode) != mode: + raise DeploymentError( + "Registered business Workspace mode differs from configuration" + ) business = make_url(profile.admin_url) if ( "database_host" in record @@ -69,7 +89,17 @@ def bind_postgres_workspaces(profile: Profile, record: dict): raise DeploymentError( "Registered business database endpoint differs from configuration" ) - record.update(binding) + if mode == "per-agent": + layout = { + "business_workspace_name": settings.business_workspace_name, + "business_database_name": settings.business_database_name, + } + if any(key in record and record[key] != value for key, value in layout.items()): + raise DeploymentError( + "Registered business Workspace layout differs from configuration" + ) + binding.update(layout) + record.update(binding, business_workspace_mode=mode) def fresh_template(profile, agent_id, account): @@ -193,11 +223,11 @@ def apply_identity_settings(template: dict, values: dict): template["Envs"] = [{"Key": key, "Value": value} for key, value in env.items()] -def apply_tos_runtime_env(env: dict[str, str], worker) -> None: +def apply_tos_runtime_env(env: dict[str, str], worker, *, enabled: bool = True) -> None: """Set provisioner-owned, non-secret TOS Session mount metadata.""" env.pop("MPA_CODEX_WORKER_TOS_MOUNT_ENABLED", None) env.pop("MPA_CODEX_WORKER_TOS_BUCKET", None) - if worker.tos_mount_enabled: + if enabled and worker.tos_mount_enabled: env["MPA_CODEX_WORKER_TOS_MOUNT_ENABLED"] = "true" env["MPA_CODEX_WORKER_TOS_BUCKET"] = worker.tos_bucket @@ -210,6 +240,7 @@ async def provision( studio_runtime_owner: str | None = None, description: str = "", runtime_name: str = "", + expected_account: str = "", progress=lambda stage: None, ): if not re.fullmatch(r"[a-z0-9][a-z0-9_-]{0,63}", agent_id) or not owner: @@ -227,6 +258,12 @@ async def provision( else None ) validate_postgres_layout(profile) + ov_model_endpoints = None + if profile.managed.openviking.mode == "auto": + if not supports_auto_openviking(profile.provider, profile.region): + raise OpenVikingError("openvikingConfigurationConflict") + if profile.provider == "byteplus": + ov_model_endpoints = byteplus_model_endpoints() cloud = RuntimeCloud( region=profile.region, credential_file=profile.managed.credential_file, @@ -237,7 +274,31 @@ async def provision( expected = str(profile.values.get("account_id", "")) if expected and account != expected: raise DeploymentError("Deployment credentials differ from the expected account") + if expected_account and expected_account != account: + raise DeploymentError( + "Deployment credentials differ from the creation account snapshot" + ) + if ( + not expected_account + and profile.managed.postgres + and profile.managed.postgres.business_database_name == "aidb" + ): + await check_creation_name( + profile, + cloud, + agent_id=agent_id, + name=runtime_name or agent_id, + owner=studio_runtime_owner or "", + verified_creation_account=expected_account, + ) profile = await resolve_model_key(profile, cloud) + apm_key = "" + if studio_runtime_owner is not None and profile.provider == "byteplus": + try: + apm_key = await get_runtime_apm_key(profile, cloud) + except ApmKeyError: + if profile.managed.runtime.env.get(RUNTIME_APM_KEY, ""): + raise if profile.managed.iam.mode == "auto": if ( profile.managed.runtime.role_name @@ -246,6 +307,12 @@ async def provision( raise IamError(key="iamConfigurationConflict") progress("iam_role") await ensure_runtime_role(IamCloud(cloud), account) + worker = profile.managed.worker + if worker.tos_mount_enabled and worker.tos_credential_type == "iam_role": + progress("iam_role") + await ensure_tos_mount_permissions( + IamCloud(cloud), account, worker.tos_bucket, role_name=worker.role_name + ) identity = await ensure_workload_identity(profile, cloud, agent_id) if profile.managed.postgres and profile.managed.postgres.mode == "auto": from .pg_bootstrap import prepare_postgres @@ -260,6 +327,8 @@ async def provision( ), account, progress=progress, + agent_id=agent_id, + runtime_name=runtime_name, ) if profile.managed.from_runtime: template = template_from_runtime( @@ -278,6 +347,8 @@ async def provision( studio_runtime_tags, ) env = env_map(template) + if apm_key: + env[RUNTIME_APM_KEY] = apm_key if profile.openviking_enabled is not None: selected_openviking = ( { @@ -332,7 +403,15 @@ async def provision( CreateRuntimeRequest.model_validate({**template, "Name": "validation-only"}) options = NetworkOptions(network.vpc_cidr, network.subnet_prefix, network.zone) - databases = AgentDatabaseProvisioner(admin_url=profile.admin_url, runtime_env=env) + database_options = {} + if ( + profile.managed.postgres + and profile.managed.postgres.business_database_name == "aidb" + ): + database_options["business_database_name"] = "aidb" + databases = AgentDatabaseProvisioner( + admin_url=profile.admin_url, runtime_env=env, **database_options + ) registry = AgentDeploymentRegistry(profile.shared_url) gateway_cloud = GatewayCloud(cloud) try: @@ -340,6 +419,8 @@ async def provision( await registry.initialize() async with registry.lock(account, profile.region, agent_id) as entry: record = await entry.read() + if record.get("state") in {"deleting", "deleted"}: + raise DeploymentError("Agent deletion has started; use a new agent ID") if record and record.get("studio_owner") != owner: raise DeploymentError( "Agent belongs to another owner; use a new agent ID" @@ -401,6 +482,29 @@ async def provision( project=template.get("ProjectName") or "default", runtime_name=runtime_name, ) + worker_record = await entry.read() + apply_tos_runtime_env( + env, + profile.managed.worker, + enabled=not bool(worker_record.get("worker_tos_mount_disabled")), + ) + if profile.managed.openviking.mode == "auto": + env.update( + await ensure_openviking( + entry, + OpenVikingCloud(cloud), + account=account, + region=profile.region, + agent_id=agent_id, + provider=profile.provider, + model_endpoints=ov_model_endpoints, + model_api_key=profile.values.get("model_api_key") + or env.get("MODEL_AGENT_API_KEY", ""), + project=template.get("ProjectName") or "default", + timeout=min(600, profile.managed.timeout_seconds), + progress=progress, + ) + ) env.update(AGENTKIT_TOOL_ID=tool_id, AGENTKIT_TOOL_REGION=profile.region) template["ToolId"] = tool_id template["Envs"] = [{"Key": k, "Value": v} for k, v in env.items()] diff --git a/veadk/integrations/mpa/managed/skills.py b/veadk/integrations/mpa/managed/skills.py index 3d44cf7bc..8ad1d1db3 100644 --- a/veadk/integrations/mpa/managed/skills.py +++ b/veadk/integrations/mpa/managed/skills.py @@ -40,6 +40,8 @@ async def ensure_skill_space( if runtime_name: runtime_name = validate_runtime_name(runtime_name) record = await entry.read() + if record.get("state") in {"deleting", "deleted"}: + raise DeploymentError("Agent deletion has started; use a new agent ID") registered_id = record.get("skill_space_id", "") ids = {value for value in (registered_id, configured_id, current_id) if value} if len(ids) > 1: diff --git a/veadk/integrations/mpa/managed/studio_profile.py b/veadk/integrations/mpa/managed/studio_profile.py index ada0924b7..b5f73b25c 100644 --- a/veadk/integrations/mpa/managed/studio_profile.py +++ b/veadk/integrations/mpa/managed/studio_profile.py @@ -122,13 +122,17 @@ def studio_profile_values(provider: str = "volcengine") -> dict: managed["postgres"]["bootstrap-path"] = ( "/tmp/veadk-studio/mpa-pg-bootstrap-byteplus.sqlite3" ) + byteplus_registry = ( + "agentkit-platform-3001037806-ap-southeast-1.cr.bytepluses.com/mpa" + ) runtime = managed["runtime"] runtime["image"] = ( - os.getenv("VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE", "").strip() or runtime["image"] + os.getenv("VEADK_MPA_BYTEPLUS_RUNTIME_IMAGE", "").strip() + or f"{byteplus_registry}/mpa_agent:latest" ) managed["worker"]["image"] = ( os.getenv("VEADK_MPA_BYTEPLUS_WORKER_IMAGE", "").strip() - or managed["worker"]["image"] + or f"{byteplus_registry}/mpa_codex_worker:latest" ) runtime["env"].update( { @@ -140,6 +144,9 @@ def studio_profile_values(provider: str = "volcengine") -> dict: "MPA_CODEX_WORKER_DEFAULT_MODEL": model, "MPA_SELECTABLE_MODELS": model, "APIG_TOP_ENDPOINT": managed_host("apig", region, provider), + "OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT": ( + "http://apmplus-ap-southeast-1.bytepluses.com:4317" + ), } ) # The Worker SDK must resolve overseas services in the same way as Runtime. diff --git a/veadk/integrations/mpa/managed/tasks.py b/veadk/integrations/mpa/managed/tasks.py index e23099b6a..0efe54a7f 100644 --- a/veadk/integrations/mpa/managed/tasks.py +++ b/veadk/integrations/mpa/managed/tasks.py @@ -31,8 +31,11 @@ from .diagnostics import classify_error, validate_diagnostic from .iam import ERROR_KEYS +from .openviking import ERROR_KEYS as OPENVIKING_ERROR_KEYS +from .names import ERROR_KEYS as NAME_ERROR_KEYS, NameCheckError logger = logging.getLogger(__name__) +ERROR_KEYS = ERROR_KEYS | OPENVIKING_ERROR_KEYS | NAME_ERROR_KEYS STAGES = { "queued", @@ -46,6 +49,8 @@ "database", "skills", "worker", + "openviking", + "openviking_key", "deploying", "verifying", } @@ -56,6 +61,49 @@ class TaskError(ValueError): pass +def _changed_payload_fields(original: str, current: str) -> str: + try: + before = json.loads(original) + after = json.loads(current) + except (TypeError, ValueError): + return "" + if not isinstance(before, dict) or not isinstance(after, dict): + return "" + if "tosBucket" not in before: + after = dict(after) + after.pop("tosBucket", None) + changed = sorted( + key for key in set(before) | set(after) if before.get(key) != after.get(key) + ) + safe = [ + key + for key in changed + if key + not in { + "openvikingApiKey", + "tosAccessKey", + "tosSecretKey", + } + ] + return ", ".join(safe[:8]) + + +def _payloads_match(original: str, current: str) -> bool: + if original == current: + return True + try: + before = json.loads(original) + after = json.loads(current) + except (TypeError, ValueError): + return False + if not isinstance(before, dict) or not isinstance(after, dict): + return False + if "tosBucket" not in before: + after = dict(after) + after.pop("tosBucket", None) + return before == after + + class CreationTasks: def __init__(self, path: Path): path.parent.mkdir(parents=True, exist_ok=True, mode=0o700) @@ -71,9 +119,27 @@ def __init__(self, path: Path): db.execute( "ALTER TABLE tasks ADD COLUMN images TEXT NOT NULL DEFAULT '{}'" ) + if "name_scope" not in { + row[1] for row in db.execute("PRAGMA table_info(tasks)") + }: + db.execute( + "ALTER TABLE tasks ADD COLUMN name_scope TEXT NOT NULL DEFAULT '{}'" + ) db.execute( "CREATE TABLE IF NOT EXISTS task_diagnostics (id INTEGER PRIMARY KEY, task_id TEXT NOT NULL, stage TEXT NOT NULL, operation TEXT NOT NULL, category TEXT NOT NULL, attempt INTEGER NOT NULL, outcome TEXT NOT NULL, created REAL NOT NULL)" ) + if "request_id" not in { + row[1] for row in db.execute("PRAGMA table_info(task_diagnostics)") + }: + db.execute( + "ALTER TABLE task_diagnostics ADD COLUMN request_id TEXT NOT NULL DEFAULT ''" + ) + if "error_code" not in { + row[1] for row in db.execute("PRAGMA table_info(task_diagnostics)") + }: + db.execute( + "ALTER TABLE task_diagnostics ADD COLUMN error_code TEXT NOT NULL DEFAULT ''" + ) db.execute( "CREATE INDEX IF NOT EXISTS task_diagnostics_task ON task_diagnostics(task_id,id)" ) @@ -117,7 +183,7 @@ def record_diagnostic(self, task_id, value): stage = row["stage"] if row["stage"] in STAGES else "queued" created = time.time() db.execute( - "INSERT INTO task_diagnostics (task_id,stage,operation,category,attempt,outcome,created) VALUES (?,?,?,?,?,?,?)", + "INSERT INTO task_diagnostics (task_id,stage,operation,category,attempt,outcome,created,request_id,error_code) VALUES (?,?,?,?,?,?,?,?,?)", ( task_id, stage, @@ -126,6 +192,8 @@ def record_diagnostic(self, task_id, value): diagnostic["attempt"], diagnostic["outcome"], created, + diagnostic.get("requestId", ""), + diagnostic.get("errorCode", ""), ), ) db.execute( @@ -166,9 +234,49 @@ def get(self, owner, task_id): "result": json.loads(row["result"]), "error": row["error"], "images": json.loads(row["images"]), + **self._latest_diagnostic(task_id), **json.loads(row["payload"]), } + def _latest_diagnostic(self, task_id): + with self.db() as db: + row = db.execute( + "SELECT stage,operation,category,attempt,outcome,request_id,error_code " + "FROM task_diagnostics WHERE task_id=? ORDER BY id DESC LIMIT 1", + (task_id,), + ).fetchone() + if row is None: + return {} + return { + "latestDiagnostic": { + "stage": row["stage"], + "operation": row["operation"], + "category": row["category"], + "attempt": row["attempt"], + "outcome": row["outcome"], + **({"requestId": row["request_id"]} if row["request_id"] else {}), + **({"errorCode": row["error_code"]} if row["error_code"] else {}), + } + } + + def list(self, owner, *, region="", limit=10): + with self.db() as db: + rows = db.execute( + "SELECT id,payload FROM tasks WHERE owner=? " + "ORDER BY updated DESC LIMIT ?", + (owner, max(1, min(int(limit), 50))), + ).fetchall() + tasks = [] + for row in rows: + payload = json.loads(row["payload"]) + if region and payload.get("region") != region: + continue + try: + tasks.append(self.get(owner, row["id"])) + except TaskError: + continue + return tasks + async def start( self, owner, @@ -180,6 +288,7 @@ async def start( secrets=None, studio_runtime_owner=None, tos=None, + name_scope=None, ): if "openvikingApiKey" in payload: raise TaskError("Secrets must not be included in stored task inputs") @@ -193,6 +302,14 @@ async def start( if owner_key(studio_runtime_owner) != owner: raise TaskError("Studio Runtime owner does not match task owner") encoded = json.dumps(payload, sort_keys=True) + if name_scope is not None and ( + set(name_scope) != {"provider", "account", "region"} + or not all( + isinstance(value, str) and value and len(value) <= 128 + for value in name_scope.values() + ) + ): + raise TaskError("Invalid creation name scope") # Reconcile stopped supervisors before acquiring the write transaction. # get() may write interrupted status and must not nest a SQLite writer. with self.db() as db: @@ -207,10 +324,27 @@ async def start( "SELECT * FROM tasks WHERE owner=? AND request=?", (owner, payload["requestId"]), ).fetchone() - if row and row["payload"] != encoded: - raise TaskError("Request identity already has different inputs") + if row and not _payloads_match(row["payload"], encoded): + fields = _changed_payload_fields(row["payload"], encoded) + detail = f": {fields}" if fields else "" + raise TaskError( + "Request identity already has different inputs" + detail + ) + if ( + row + and json.loads(row["name_scope"]) + and name_scope is not None + and json.loads(row["name_scope"]) != name_scope + ): + raise TaskError( + "Creation account snapshot differs; restore the original deployment credentials" + ) if row and row["state"] in ACTIVE | {"succeeded"}: return self.get(owner, row["id"]) + if name_scope is not None and self._name_taken( + db, owner, payload, name_scope + ): + raise NameCheckError("runtimeNameTaken") selected_images = json.loads(row["images"]) if row else dict(images or {}) count = db.execute( "SELECT COUNT(*) FROM tasks WHERE state IN ('running','cancelling')" @@ -223,7 +357,7 @@ async def start( raise TaskError("Another creation is running; wait or cancel it") task_id = row["id"] if row else str(uuid.uuid4()) db.execute( - "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,images) VALUES (?,?,?,?,?,?,?,?,?) ON CONFLICT(id) DO UPDATE SET state='running', stage='queued', result='{}', error='', supervisor=excluded.supervisor, updated=excluded.updated", + "INSERT INTO tasks (id,owner,request,payload,state,stage,supervisor,updated,images,name_scope) VALUES (?,?,?,?,?,?,?,?,?,?) ON CONFLICT(id) DO UPDATE SET state='running', stage='queued', result='{}', error='', supervisor=excluded.supervisor, updated=excluded.updated, name_scope=excluded.name_scope", ( task_id, owner, @@ -234,6 +368,9 @@ async def start( os.getpid(), time.time(), json.dumps(selected_images), + json.dumps( + name_scope or (json.loads(row["name_scope"]) if row else {}) + ), ), ) task = asyncio.create_task( @@ -252,6 +389,66 @@ async def start( task.add_done_callback(lambda _: self.running.pop(task_id, None)) return self.get(owner, task_id) + def _name_taken(self, db, owner, payload, scope): + for row in db.execute( + "SELECT owner,request,payload,name_scope FROM tasks WHERE state IN ('running','cancelling')" + ): + if row["owner"] == owner and row["request"] == payload["requestId"]: + continue + other = json.loads(row["payload"]) + other_scope = json.loads(row["name_scope"]) + if other_scope and other_scope != scope: + continue + if not other_scope and ( + other.get("provider", "volcengine") != scope["provider"] + or other["region"] != scope["region"] + ): + continue + if other.get("name", other.get("agentId")) == payload["name"]: + return True + return False + + def name_scope_for_request(self, owner, payload): + """Prove an original accepted intent without exposing private task data.""" + with self.db() as db: + row = db.execute( + "SELECT payload,name_scope FROM tasks WHERE owner=? AND request=?", + (owner, payload["requestId"]), + ).fetchone() + if row is None: + return None + encoded = json.dumps(payload, sort_keys=True) + if not _payloads_match(row["payload"], encoded): + fields = _changed_payload_fields(row["payload"], encoded) + detail = f": {fields}" if fields else "" + raise TaskError("Request identity already has different inputs" + detail) + scope = json.loads(row["name_scope"]) + if not scope: + return None + if ( + not isinstance(scope, dict) + or set(scope) != {"provider", "account", "region"} + or not all( + isinstance(value, str) and value and len(value) <= 128 + for value in scope.values() + ) + or scope["provider"] != payload.get("provider", "volcengine") + or scope["region"] != payload["region"] + ): + raise TaskError("Invalid creation account snapshot") + return scope + + def check_name(self, owner, payload, scope): + with self.db() as db: + active = db.execute( + "SELECT owner,id FROM tasks WHERE state IN ('running','cancelling')" + ).fetchall() + for row in active: + self.get(row["owner"], row["id"]) + with self.db() as db: + if self._name_taken(db, owner, payload, scope): + raise NameCheckError("runtimeNameTaken") + async def _run( self, task_id, @@ -295,10 +492,23 @@ async def _run( "pgPort", "openvikingUrl", "openvikingResourceId", + "openvikingMode", + "businessWorkspaceMode", + "businessDatabaseName", ) if key in payload }, } + if "maxInstance" in payload: + data["maxInstance"] = payload["maxInstance"] + with self.db() as db: + snapshot = json.loads( + db.execute( + "SELECT name_scope FROM tasks WHERE id=?", (task_id,) + ).fetchone()[0] + ) + if snapshot: + data["expectedAccount"] = snapshot["account"] if payload.get("provider") == "byteplus": data["provider"] = "byteplus" if studio_runtime_owner is not None: diff --git a/veadk/integrations/mpa/managed/worker.py b/veadk/integrations/mpa/managed/worker.py index 5cb77333d..007e5fe57 100644 --- a/veadk/integrations/mpa/managed/worker.py +++ b/veadk/integrations/mpa/managed/worker.py @@ -24,7 +24,7 @@ from ..mpa_tool import build_tos_mount_config from .config import WORKER_RESERVED_ENV_KEYS, validate_runtime_name from .database import DeploymentError, agent_suffix -from .diagnostics import report, retry_worker +from .diagnostics import failure_identifiers, report, retry_worker class WorkerCloud: @@ -58,6 +58,9 @@ def run(): async def get(self, tool_id): return await self.call("get_tool", "GetToolRequest", ToolId=tool_id) + async def delete(self, tool_id): + await self.call("delete_tool", "DeleteToolRequest", ToolId=tool_id) + async def create(self, request): return (await self.call("create_tool", "CreateToolRequest", **request)).get( "ToolId", "" @@ -130,23 +133,27 @@ async def _ensure_worker( entry, cloud, options, *, account, region, agent_id, project, runtime_name ): record = await entry.read() + if record.get("state") in {"deleting", "deleted"}: + raise DeploymentError("Agent deletion has started; use a new agent ID") suffix = agent_suffix(account, region, agent_id) owned = {"managed_by": "mpa-deployment", "mpa_agent_key": suffix} tool_id = record.get("worker_id") or options.existing_id expected_tos = None - if options.tos_mount_enabled: + tos_mount_disabled = bool(record.get("worker_tos_mount_disabled")) + if options.tos_mount_enabled and not tos_mount_disabled: expected_tos = build_tos_mount_config( tos_access_key=options.tos_access_key, tos_secret_key=options.tos_secret_key, tos_bucket=options.tos_bucket, region=region, + tos_credential_type=options.tos_credential_type, ).model_dump(by_alias=True, exclude_none=True, mode="json") if ( getattr(getattr(cloud, "runtime", None), "provider", "volcengine") == "byteplus" ): for mount in expected_tos["MountPoints"]: - mount["Endpoint"] = f"https://tos-{region}.bytepluses.com" + mount["Endpoint"] = f"http://tos-{region}.bytepluses.com" if ( record.get("worker_id") and options.existing_id @@ -197,29 +204,68 @@ async def _ensure_worker( json.dumps(request, sort_keys=True).encode() ).hexdigest() if record.get("worker_hash") and record["worker_hash"] != digest: - # Preserve the exact pre-upgrade payload for an unfinished intent. - if record.get("worker_name"): - raise DeploymentError( - "Unfinished worker configuration changed; resume original inputs" + legacy_byteplus_tos = _legacy_byteplus_tos_endpoint_requests( + request, region=region + ) + if ( + legacy_byteplus_tos + and not record.get("worker_id") + and any( + record["worker_hash"] + == hashlib.sha256( + json.dumps(legacy_request, sort_keys=True).encode() + ).hexdigest() + for legacy_request in legacy_byteplus_tos ) - for legacy_name in ( - agent_id.strip().replace("-", "_"), - "mpa_worker_" + suffix, ): - legacy_request = {**request, "Name": legacy_name} - legacy_digest = hashlib.sha256( - json.dumps(legacy_request, sort_keys=True).encode() - ).hexdigest() - if record["worker_hash"] == legacy_digest: - request, digest = legacy_request, legacy_digest - break - else: + record["worker_hash"] = digest + await entry.save(record) + elif ( + not expected_tos + and _matches_legacy_byteplus_tos_mount( + request, + record["worker_hash"], + cloud=cloud, + account=account, + region=region, + ) + and not record.get("worker_id") + ): + record.update( + worker_hash=digest, + worker_tos_mount_disabled=True, + worker_tos_mount_disabled_reason="InvalidParameter.TosEndpoint", + ) + await entry.save(record) + elif record.get("worker_name"): raise DeploymentError( "Unfinished worker configuration changed; resume original inputs" ) + # Preserve the exact pre-upgrade payload for an unfinished intent. + else: + for legacy_name in ( + agent_id.strip().replace("-", "_"), + "mpa_worker_" + suffix, + ): + legacy_request = {**request, "Name": legacy_name} + legacy_digest = hashlib.sha256( + json.dumps(legacy_request, sort_keys=True).encode() + ).hexdigest() + if record["worker_hash"] == legacy_digest: + request, digest = legacy_request, legacy_digest + break + else: + raise DeploymentError( + "Unfinished worker configuration changed; resume original inputs" + ) + matches = await retry_worker("find_worker", lambda: cloud.find(request["Name"])) if matches: if len(matches) != 1 or not record.get("worker_token"): + if record.get("business_database_name") == "aidb": + from .names import NameCheckError + + raise NameCheckError("runtimeNameTaken") raise DeploymentError( "Worker name collision without a recorded creation intent" ) @@ -232,9 +278,42 @@ async def _ensure_worker( record.update(worker_hash=digest, worker_managed=True) await entry.save(record) create_request = {**request, "ClientToken": record["worker_token"]} - tool_id = await retry_worker( - "create_worker", lambda: cloud.create(create_request) - ) + try: + tool_id = await retry_worker( + "create_worker", lambda: cloud.create(create_request) + ) + except Exception as error: + if not _can_fallback_without_tos(cloud, expected_tos, error): + raise + report( + "create_worker", + "invalid_request", + outcome="retrying", + error_code="InvalidParameter.TosEndpoint", + ) + fallback_request = { + key: value + for key, value in request.items() + if key != "TosMountConfig" + } + fallback_digest = hashlib.sha256( + json.dumps(fallback_request, sort_keys=True).encode() + ).hexdigest() + record.update( + worker_hash=fallback_digest, + worker_managed=True, + worker_tos_mount_disabled=True, + worker_tos_mount_disabled_reason="InvalidParameter.TosEndpoint", + worker_token=str(uuid.uuid4()), + ) + await entry.save(record) + tool_id = await retry_worker( + "create_worker", + lambda: cloud.create( + {**fallback_request, "ClientToken": record["worker_token"]} + ), + ) + expected_tos = None if not tool_id: raise DeploymentError( "Worker creation outcome unknown; resume the same agent" @@ -260,6 +339,7 @@ async def _ensure_worker( agent_id=agent_id, managed=bool(record.get("worker_managed")), expected_tos=expected_tos, + expected_role=options.role_name, ) status = tool.get("Status") if status in {"Failed", "Error", "Deleted", "Deleting"}: @@ -301,14 +381,89 @@ async def _ensure_worker( await asyncio.sleep(5) +def _legacy_byteplus_tos_endpoint_requests(request, *, region): + tos = request.get("TosMountConfig") + if not isinstance(tos, dict): + return [] + host = f"tos-{region}.bytepluses.com" + legacy_requests = [] + for endpoint in ("", host, f"https://{host}"): + legacy = json.loads(json.dumps(request)) + mounts = (legacy.get("TosMountConfig") or {}).get("MountPoints") or [] + changed = False + for mount in mounts: + if endpoint: + mount["Endpoint"] = endpoint + changed = True + elif mount.pop("Endpoint", None) is not None: + changed = True + if changed: + legacy_requests.append(legacy) + return legacy_requests + + +def _can_fallback_without_tos(cloud, expected_tos, error): + if not expected_tos: + return False + if getattr(getattr(cloud, "runtime", None), "provider", "volcengine") != "byteplus": + return False + error_code, _ = failure_identifiers(error) + return error_code == "InvalidParameter.TosEndpoint" + + +def _matches_legacy_byteplus_tos_mount(request, worker_hash, *, cloud, account, region): + if getattr(getattr(cloud, "runtime", None), "provider", "volcengine") != "byteplus": + return False + buckets = [f"agentkit-platform-{account}"] + for bucket in buckets: + expected_tos = build_tos_mount_config( + tos_bucket=bucket, + region=region, + tos_credential_type="iam_role", + ).model_dump(by_alias=True, exclude_none=True, mode="json") + for endpoint in ( + f"http://tos-{region}.bytepluses.com", + "", + f"tos-{region}.bytepluses.com", + f"https://tos-{region}.bytepluses.com", + ): + candidate = json.loads(json.dumps(request)) + candidate["TosMountConfig"] = json.loads(json.dumps(expected_tos)) + for mount in candidate["TosMountConfig"]["MountPoints"]: + if endpoint: + mount["Endpoint"] = endpoint + else: + mount.pop("Endpoint", None) + digest = hashlib.sha256( + json.dumps(candidate, sort_keys=True).encode() + ).hexdigest() + if worker_hash == digest: + return True + return False + + def _missing_worker_metadata( - tool, *, tool_id, project, owned, agent_id, managed, expected_tos=None + tool, + *, + tool_id, + project, + owned, + agent_id, + managed, + expected_tos=None, + expected_role=None, ): """Reject any present conflict before considering incomplete metadata.""" tags = {t["Key"]: t.get("Value") for t in tool.get("Tags") or []} env = {t["Key"]: t.get("Value") for t in tool.get("Envs") or []} if expected_tos: actual = tool.get("TosMountConfig") or {} + if expected_tos.get("CredentialType") == "TOS_CREDENTIAL_TYPE_IAM_ROLE" and ( + actual.get("CredentialType") != "TOS_CREDENTIAL_TYPE_IAM_ROLE" + or actual.get("Credentials") + or tool.get("RoleName") != expected_role + ): + raise DeploymentError("Worker TOS IAM role metadata conflicts") actual_mounts = actual.get("MountPoints") or [] expected_mount = expected_tos["MountPoints"][0] if not actual.get("EnableTos") or not any( diff --git a/veadk/integrations/mpa/mpa_tool.py b/veadk/integrations/mpa/mpa_tool.py index 4690931bc..383f782a2 100644 --- a/veadk/integrations/mpa/mpa_tool.py +++ b/veadk/integrations/mpa/mpa_tool.py @@ -62,23 +62,36 @@ def tos_mount_enabled( def build_tos_mount_config( - *, tos_access_key: str, tos_secret_key: str, tos_bucket: str, region: str + *, + tos_access_key: str = "", + tos_secret_key: str = "", + tos_bucket: str, + region: str, + tos_credential_type: str = "access_key", ) -> Any: """Build the Tool-level TOS configuration for per-session output paths.""" from agentkit.sdk.tools import types as t + from agentkit.toolkit.cli.sandbox.tos_config import ( + DEFAULT_TOS_BUCKET_PATH, + normalize_tos_credential_type, + ) from agentkit.toolkit.volcengine.services.tos_service import TOSService + credential_type = normalize_tos_credential_type(tos_credential_type) + iam_role = credential_type == t.CredentialType.TOS_CREDENTIAL_TYPE_IAM_ROLE return t.TosMountForCreateTool( EnableTos=True, - CredentialType=t.CredentialType.TOS_CREDENTIAL_TYPE_ACCESS_KEY, - Credentials=t.TosMountCredentialsForCreateTool( + CredentialType=credential_type, + Credentials=None + if iam_role + else t.TosMountCredentialsForCreateTool( AccessKeyId=tos_access_key.strip(), SecretAccessKey=tos_secret_key.strip(), ), MountPoints=[ t.TosMountMountPointsItemForCreateTool( BucketName=tos_bucket.strip(), - BucketPath=TOS_MOUNT_BASE_PATH, + BucketPath=DEFAULT_TOS_BUCKET_PATH if iam_role else TOS_MOUNT_BASE_PATH, Endpoint=TOSService.build_mount_endpoint(region.strip()), LocalMountPath=TOS_MOUNT_LOCAL_PATH, ReadOnly=False, diff --git a/veadk/utils/cloud_provider.py b/veadk/utils/cloud_provider.py index 3b0b38ede..855dcbbdb 100644 --- a/veadk/utils/cloud_provider.py +++ b/veadk/utils/cloud_provider.py @@ -121,6 +121,13 @@ def identity_openapi_host(region: str, provider: CloudProvider) -> str: return "open.volcengineapi.com" +def tag_openapi_host(provider: CloudProvider) -> str: + """Return the Tag OpenAPI host for a provider.""" + if provider == "byteplus": + return "open.byteplusapi.com" + return "open.volcengineapi.com" + + def configure_openapi_tls(configuration: Any) -> None: """Apply explicit TLS settings to a Volcengine generated SDK config. diff --git a/veadk/webui/assets/app/index-ClHtQ9mm.js b/veadk/webui/assets/app/index-BIS1-cw9.js similarity index 57% rename from veadk/webui/assets/app/index-ClHtQ9mm.js rename to veadk/webui/assets/app/index-BIS1-cw9.js index 3ace9a185..f3201753d 100644 --- a/veadk/webui/assets/app/index-ClHtQ9mm.js +++ b/veadk/webui/assets/app/index-BIS1-cw9.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-BCOT9Ja2.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-BNeSUDlW.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-Dsg-kvw3.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); -var Fze=Object.defineProperty;var IG=e=>{throw TypeError(e)};var Bze=(e,t,n)=>t in e?Fze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>Bze(e,typeof t!="symbol"?t+"":t,n),PG=(e,t,n)=>t.has(e)||IG("Cannot "+n);var kl=(e,t,n)=>(PG(e,t,"read from private field"),n?n.call(e):t.get(e)),DG=(e,t,n)=>t.has(e)?IG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),O5=(e,t,n,i)=>(PG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Uze(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 o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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 ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _ue={exports:{}},XP={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Xn0bMahe.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-Duc3_Vyj.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-CP2k798F.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +var Bze=Object.defineProperty;var MG=e=>{throw TypeError(e)};var Uze=(e,t,n)=>t in e?Bze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>Uze(e,typeof t!="symbol"?t+"":t,n),LG=(e,t,n)=>t.has(e)||MG("Cannot "+n);var kl=(e,t,n)=>(LG(e,t,"read from private field"),n?n.call(e):t.get(e)),$G=(e,t,n)=>t.has(e)?MG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(LG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Qze(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 o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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 lg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rue={exports:{}},KP={};/** * @license React * react-jsx-runtime.production.js * @@ -7,53 +7,53 @@ var Fze=Object.defineProperty;var IG=e=>{throw TypeError(e)};var Bze=(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 Qze=Symbol.for("react.transitional.element"),zze=Symbol.for("react.fragment");function jue(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:Qze,type:e,key:i,ref:t!==void 0?t:null,props:n}}XP.Fragment=zze;XP.jsx=jue;XP.jsxs=jue;_ue.exports=XP;var a=_ue.exports;const Nue={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}})"},Rue={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."},Iue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Pue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Due={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Mue={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Lue={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: ",copySecretFailed:"Failed to copy the secret value"},$ue={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"},Fue={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"},Bue={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"},Uue={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}}"},Que={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."},zue={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"},Vue={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"},Hue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},que={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}})"},Wue={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."},Kue={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"}},Gue={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."},Xue={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} + */var zze=Symbol.for("react.transitional.element"),Vze=Symbol.for("react.fragment");function Iue(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:zze,type:e,key:i,ref:t!==void 0?t:null,props:n}}KP.Fragment=Vze;KP.jsx=Iue;KP.jsxs=Iue;Rue.exports=KP;var a=Rue.exports;const Pue={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}})"},Due={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."},Mue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Lue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},$ue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Fue={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Bue={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: ",copySecretFailed:"Failed to copy the secret value"},Uue={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"},Que={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"},zue={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"},Vue={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}}"},Hue={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."},que={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"},Wue={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"},Kue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},Gue={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}})"},Xue={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."},Yue={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"}},Zue={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."},Jue={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}} 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",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",listSessionsFailed:"Failed to load sessions",mpaOperationFailed:"Failed to apply the MPA Runtime profile",mpaOperationLoadFailed:"Failed to load MPA Runtime operations",mpaRuntimeLegacyAuthUnsupported:`This MPA Runtime uses an older authentication adapter and cannot list Studio sessions. Update the Runtime image to the current MPA AgentKit build, then refresh this Agent. -{{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",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}} +{{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",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",mpaDeleteUnconfirmed:"The deletion request timed out and Runtime deletion is not confirmed. Cleanup may still be running; refresh and check again later.",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)"},Yue={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},Zue={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},Jue={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"},ede={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."},tde={common:Nue,agentkitCli:Rue,cloudRegion:Iue,connections:Pue,feishuBot:Due,requestError:Mue,runSse:Lue,runtimeLogs:$ue,search:Fue,skills:Bue,sse:Uue,identity:Que,github:zue,video:Vue,websiteIntegration:Hue,knowledge:que,intelligentDevelopment:Wue,migrations:Kue,sandbox:Gue,client:Xue,newChatCapabilities:Yue,jsonResponse:Zue,workspaceProjects:Jue,developmentRuns:ede},Vze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Rue,client:Xue,cloudRegion:Iue,common:Nue,connections:Pue,default:tde,developmentRuns:ede,feishuBot:Due,github:zue,identity:Que,intelligentDevelopment:Wue,jsonResponse:Zue,knowledge:que,migrations:Kue,newChatCapabilities:Yue,requestError:Mue,runSse:Lue,runtimeLogs:$ue,sandbox:Gue,search:Fue,skills:Bue,sse:Uue,video:Vue,websiteIntegration:Hue,workspaceProjects:Jue},Symbol.toStringTag,{value:"Module"})),nde="Agent reviews",ide="Request access for everyone in your organization",rde="Close",sde="Refresh",ade="Status",ode="Applicant",lde="Submitted",cde="Current version",ude="Model",dde="Returned by",fde="Approved by",hde="Reviewed",pde="Agent description",mde="Application notes",gde="Return reason",bde="Review comment",yde="Return reason (required)",vde="Content changed after submission; return and submit again",xde="Withdraw to edit this Agent, then submit a new request to publish it",wde="Other users will lose access to this Agent. Unpublish it?",Ode="Cancel",kde="Confirm",Sde="Saving",Ede="Unpublish",Cde="Withdraw request",Ade="Approve",Tde="Publish for everyone",_de="Request publication",jde="Everyone",Nde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Rde="Search agents or applicants",Ide="Region",Pde="All statuses",Dde="Agent",Mde="Actions",Lde="Review application",$de="Application details",Fde="No matching applications",Bde="No Agent review requests",Ude="{{count}} / {{limit}} characters",Hze={title:nde,dialogDescription:ide,close:rde,refresh:sde,statusTitle:ade,submitter:ode,submittedAt:lde,version:cde,model:ude,returnedBy:dde,approvedBy:fde,reviewedAt:hde,description:pde,message:mde,reason:gde,comment:bde,reasonRequired:yde,contentChanged:vde,withdrawConfirm:xde,unpublishConfirm:wde,cancel:Ode,confirm:kde,saving:Sde,unpublish:Ede,withdraw:Cde,return:"Return",approve:Ade,publish:Tde,submit:_de,private:"Private",enterprise:jde,status:Nde,search:Rde,region:Ide,all:Pde,agent:Dde,actions:Mde,review:Lde,details:$de,noMatches:Fde,empty:Bde,textCount:Ude},qze=Object.freeze(Object.defineProperty({__proto__:null,actions:Mde,agent:Dde,all:Pde,approve:Ade,approvedBy:fde,cancel:Ode,close:rde,comment:bde,confirm:kde,contentChanged:vde,default:Hze,description:pde,details:$de,dialogDescription:ide,empty:Bde,enterprise:jde,message:mde,model:ude,noMatches:Fde,publish:Tde,reason:gde,reasonRequired:yde,refresh:sde,region:Ide,returnedBy:dde,review:Lde,reviewedAt:hde,saving:Sde,search:Rde,status:Nde,statusTitle:ade,submit:_de,submittedAt:lde,submitter:ode,textCount:Ude,title:nde,unpublish:Ede,unpublishConfirm:wde,version:cde,withdraw:Cde,withdrawConfirm:xde},Symbol.toStringTag,{value:"Module"})),Qde={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},zde={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."}},Vde={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"}},Hde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},qde={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."},Wde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Kde={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"}},Gde={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."},Xde={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},Yde={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"},Zde={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Jde={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."},efe={volcengine:"Volcengine"},tfe={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"},nfe={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"},ife={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},rfe={actions:Qde,addAgent:zde,approval:Vde,common:Hde,conversation:qde,credentials:Wde,dialogs:Kde,errors:Gde,feedback:Xde,greetings:Yde,loading:Zde,oauth:Jde,providers:efe,sandbox:tfe,titles:nfe,workspaceProjectEntry:ife},Wze=Object.freeze(Object.defineProperty({__proto__:null,actions:Qde,addAgent:zde,approval:Vde,common:Hde,conversation:qde,credentials:Wde,default:rfe,dialogs:Kde,errors:Gde,feedback:Xde,greetings:Yde,loading:Zde,oauth:Jde,providers:efe,sandbox:tfe,titles:nfe,workspaceProjectEntry:ife},Symbol.toStringTag,{value:"Module"})),sfe="Automations",afe="Connect development tools and extend your Agents with automated workflows",ofe="Search automations",lfe="Automation categories",cfe={development:"Development",channels:"Messaging channels"},ufe="{{category}} automations",dfe="Open {{name}}",ffe="Available only in local deployments",hfe="No matching automations",pfe="Try searching for another name",mfe="Back to automations",gfe={"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."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},bfe={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"}}},yfe={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."}},vfe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},xfe={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."}},wfe={title:sfe,description:afe,search:ofe,categoriesLabel:lfe,categories:cfe,resultsLabel:ufe,open:dfe,localOnly:ffe,emptyTitle:hfe,emptyDescription:pfe,backToAutomations:mfe,cards:gfe,github:bfe,codingAgents:yfe,mpaChannels:vfe,feishu:xfe},Kze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:mfe,cards:gfe,categories:cfe,categoriesLabel:lfe,codingAgents:yfe,default:wfe,description:afe,emptyDescription:pfe,emptyTitle:hfe,feishu:xfe,github:bfe,localOnly:ffe,mpaChannels:vfe,open:dfe,resultsLabel:ufe,search:ofe,title:sfe},Symbol.toStringTag,{value:"Module"})),Ofe={"zh-CN":"简体中文","en-US":"English"},Gze={languageNames:Ofe},Xze=Object.freeze(Object.defineProperty({__proto__:null,default:Gze,languageNames:Ofe},Symbol.toStringTag,{value:"Module"})),kfe={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"},Sfe={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}}"},Efe={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.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},Cfe={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"},Afe={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}}"},Tfe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",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"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},_fe={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",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},jfe={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"},Nfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Rfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Ife={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"},Pfe={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Dfe={annotation:kfe,media:Sfe,runtimeLogs:Efe,trace:Cfe,share:Afe,blocks:Tfe,tokenUsage:_fe,addAgentKit:jfe,composer:Nfe,invocation:Rfe,visualization:Ife,markdown:Pfe},Yze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:jfe,annotation:kfe,blocks:Tfe,composer:Nfe,default:Dfe,invocation:Rfe,markdown:Pfe,media:Sfe,runtimeLogs:Efe,share:Afe,tokenUsage:_fe,trace:Cfe,visualization:Ife},Symbol.toStringTag,{value:"Module"})),Mfe={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"},Lfe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},$fe={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"}},Ffe={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)"},ede={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},tde={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},nde={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"},ide={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."},rde={common:Pue,agentkitCli:Due,cloudRegion:Mue,connections:Lue,feishuBot:$ue,requestError:Fue,runSse:Bue,runtimeLogs:Uue,search:Que,skills:zue,sse:Vue,identity:Hue,github:que,video:Wue,websiteIntegration:Kue,knowledge:Gue,intelligentDevelopment:Xue,migrations:Yue,sandbox:Zue,client:Jue,newChatCapabilities:ede,jsonResponse:tde,workspaceProjects:nde,developmentRuns:ide},Hze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Due,client:Jue,cloudRegion:Mue,common:Pue,connections:Lue,default:rde,developmentRuns:ide,feishuBot:$ue,github:que,identity:Hue,intelligentDevelopment:Xue,jsonResponse:tde,knowledge:Gue,migrations:Yue,newChatCapabilities:ede,requestError:Fue,runSse:Bue,runtimeLogs:Uue,sandbox:Zue,search:Que,skills:zue,sse:Vue,video:Wue,websiteIntegration:Kue,workspaceProjects:nde},Symbol.toStringTag,{value:"Module"})),sde="Agent reviews",ade="Request access for everyone in your organization",ode="Close",lde="Refresh",cde="Status",ude="Applicant",dde="Submitted",fde="Current version",hde="Model",pde="Returned by",mde="Approved by",gde="Reviewed",bde="Agent description",yde="Application notes",vde="Return reason",xde="Review comment",wde="Return reason (required)",kde="Content changed after submission; return and submit again",Ode="Withdraw to edit this Agent, then submit a new request to publish it",Sde="Other users will lose access to this Agent. Unpublish it?",Ede="Cancel",Cde="Confirm",Ade="Saving",Tde="Unpublish",_de="Withdraw request",jde="Approve",Nde="Publish for everyone",Rde="Request publication",Ide="Everyone",Pde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Dde="Search agents or applicants",Mde="Region",Lde="All statuses",$de="Agent",Fde="Actions",Bde="Review application",Ude="Application details",Qde="No matching applications",zde="No Agent review requests",Vde="{{count}} / {{limit}} characters",qze={title:sde,dialogDescription:ade,close:ode,refresh:lde,statusTitle:cde,submitter:ude,submittedAt:dde,version:fde,model:hde,returnedBy:pde,approvedBy:mde,reviewedAt:gde,description:bde,message:yde,reason:vde,comment:xde,reasonRequired:wde,contentChanged:kde,withdrawConfirm:Ode,unpublishConfirm:Sde,cancel:Ede,confirm:Cde,saving:Ade,unpublish:Tde,withdraw:_de,return:"Return",approve:jde,publish:Nde,submit:Rde,private:"Private",enterprise:Ide,status:Pde,search:Dde,region:Mde,all:Lde,agent:$de,actions:Fde,review:Bde,details:Ude,noMatches:Qde,empty:zde,textCount:Vde},Wze=Object.freeze(Object.defineProperty({__proto__:null,actions:Fde,agent:$de,all:Lde,approve:jde,approvedBy:mde,cancel:Ede,close:ode,comment:xde,confirm:Cde,contentChanged:kde,default:qze,description:bde,details:Ude,dialogDescription:ade,empty:zde,enterprise:Ide,message:yde,model:hde,noMatches:Qde,publish:Nde,reason:vde,reasonRequired:wde,refresh:lde,region:Mde,returnedBy:pde,review:Bde,reviewedAt:gde,saving:Ade,search:Dde,status:Pde,statusTitle:cde,submit:Rde,submittedAt:dde,submitter:ude,textCount:Vde,title:sde,unpublish:Tde,unpublishConfirm:Sde,version:fde,withdraw:_de,withdrawConfirm:Ode},Symbol.toStringTag,{value:"Module"})),Hde={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},qde={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."}},Wde={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"}},Kde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},Gde={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."},Xde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Yde={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"}},Zde={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."},Jde={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},efe={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"},tfe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},nfe={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."},ife={volcengine:"Volcengine"},rfe={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"},sfe={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"},afe={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},ofe={actions:Hde,addAgent:qde,approval:Wde,common:Kde,conversation:Gde,credentials:Xde,dialogs:Yde,errors:Zde,feedback:Jde,greetings:efe,loading:tfe,oauth:nfe,providers:ife,sandbox:rfe,titles:sfe,workspaceProjectEntry:afe},Kze=Object.freeze(Object.defineProperty({__proto__:null,actions:Hde,addAgent:qde,approval:Wde,common:Kde,conversation:Gde,credentials:Xde,default:ofe,dialogs:Yde,errors:Zde,feedback:Jde,greetings:efe,loading:tfe,oauth:nfe,providers:ife,sandbox:rfe,titles:sfe,workspaceProjectEntry:afe},Symbol.toStringTag,{value:"Module"})),lfe="Automations",cfe="Connect development tools and extend your Agents with automated workflows",ufe="Search automations",dfe="Automation categories",ffe={development:"Development",channels:"Messaging channels"},hfe="{{category}} automations",pfe="Open {{name}}",mfe="Available only in local deployments",gfe="No matching automations",bfe="Try searching for another name",yfe="Back to automations",vfe={"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."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},xfe={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"}}},wfe={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."}},kfe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},Ofe={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."}},Sfe={title:lfe,description:cfe,search:ufe,categoriesLabel:dfe,categories:ffe,resultsLabel:hfe,open:pfe,localOnly:mfe,emptyTitle:gfe,emptyDescription:bfe,backToAutomations:yfe,cards:vfe,github:xfe,codingAgents:wfe,mpaChannels:kfe,feishu:Ofe},Gze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:yfe,cards:vfe,categories:ffe,categoriesLabel:dfe,codingAgents:wfe,default:Sfe,description:cfe,emptyDescription:bfe,emptyTitle:gfe,feishu:Ofe,github:xfe,localOnly:mfe,mpaChannels:kfe,open:pfe,resultsLabel:hfe,search:ufe,title:lfe},Symbol.toStringTag,{value:"Module"})),Efe={"zh-CN":"简体中文","en-US":"English"},Xze={languageNames:Efe},Yze=Object.freeze(Object.defineProperty({__proto__:null,default:Xze,languageNames:Efe},Symbol.toStringTag,{value:"Module"})),Cfe={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"},Afe={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}}"},Tfe={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.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},_fe={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"},jfe={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}}"},Nfe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",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"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},Rfe={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",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},Ife={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"},Pfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Dfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Mfe={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"},Lfe={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},$fe={annotation:Cfe,media:Afe,runtimeLogs:Tfe,trace:_fe,share:jfe,blocks:Nfe,tokenUsage:Rfe,addAgentKit:Ife,composer:Pfe,invocation:Dfe,visualization:Mfe,markdown:Lfe},Zze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Ife,annotation:Cfe,blocks:Nfe,composer:Pfe,default:$fe,invocation:Dfe,markdown:Lfe,media:Afe,runtimeLogs:Tfe,share:jfe,tokenUsage:Rfe,trace:_fe,visualization:Mfe},Symbol.toStringTag,{value:"Module"})),Ffe={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"},Bfe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},Ufe={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"}},Qfe={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.`},Bfe={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"}},Ufe={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}}"}},Qfe={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."}},zfe={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"}},Vfe={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"}}},Hfe={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"}},qfe={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"}}},Wfe={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"}},Kfe={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."}},Gfe={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"}},Xfe={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",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},Yfe={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",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},Zfe={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"}},Jfe={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:", "},ehe={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"}},the={common:Mfe,yaml:Lfe,validation:$fe,defaults:Ffe,helpers:Bfe,intelligentDeployment:Ufe,codePackage:Qfe,buildCanvas:zfe,intelligent:Vfe,projectLibrary:Hfe,modePicker:qfe,promptEditor:Wfe,skills:Kfe,workflow:Gfe,workbench:Xfe,traditional:Yfe,template:Zfe,workspace:Jfe,modelApiKey:ehe},Zze=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:zfe,codePackage:Qfe,common:Mfe,default:the,defaults:Ffe,helpers:Bfe,intelligent:Vfe,intelligentDeployment:Ufe,modePicker:qfe,modelApiKey:ehe,projectLibrary:Hfe,promptEditor:Wfe,skills:Kfe,template:Zfe,traditional:Yfe,validation:$fe,workbench:Xfe,workflow:Gfe,workspace:Jfe,yaml:Lfe},Symbol.toStringTag,{value:"Module"})),nhe={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},ihe={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"},rhe={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?"},she={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},ahe={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},ohe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},lhe={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"},che={all:"All"},uhe={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"},dhe={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."},fhe={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"},hhe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},phe={daily:"Daily",once:"Once",weekly:"Weekly"},mhe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},ghe={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."},bhe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Jze={mpa:nhe,actions:ihe,confirm:rhe,detail:she,drawer:ahe,duration:ohe,fields:lhe,filters:che,history:uhe,notices:dhe,page:fhe,schedule:hhe,scheduleTypes:phe,status:mhe,validation:ghe,weekdays:bhe},eVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ihe,confirm:rhe,default:Jze,detail:she,drawer:ahe,duration:ohe,fields:lhe,filters:che,history:uhe,mpa:nhe,notices:dhe,page:fhe,schedule:hhe,scheduleTypes:phe,status:mhe,validation:ghe,weekdays:bhe},Symbol.toStringTag,{value:"Module"})),yhe="Quick-create Agent",vhe="Agent type",xhe="Close",whe="Deploy",Ohe="Preview",khe="Configuration download started",She="Download failed — try again",Ehe="Review {{count}} configuration issues",Che="Custom",Ahe="Custom {{field}}",The="Enter a custom value",_he="This model declares no reasoning levels; the service settings apply",jhe="Add a model to this provider first",Nhe="Select a provider first",Rhe="Select an option",Ihe="Optional",Phe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",Dhe="Enter an environment variable name only; supply its secret value at deployment",Mhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Lhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",$he="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",Fhe="Covers common native settings. Other plugin parameters and preset files are not included yet",Bhe="Native configuration reference",Uhe="Provider {{index}}",Qhe="Model {{index}}",zhe="Add provider",Vhe="Remove provider {{index}}",Hhe="Add model",qhe="Remove model {{index}}",Whe="Add allowed model",Khe="Remove allowed model {{index}}",Ghe="Remove",Xhe="Enter the service’s model ID",Yhe={provider:"Provider {{index}}",model:"Model {{index}}"},Zhe={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"},Jhe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},epe={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"},tpe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},npe={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"},ipe={"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"},rpe="Cancel",spe="Back to creation methods",ape="DeepSeek Harness configuration",tVe={title:yhe,agentType:vhe,close:xhe,continue:"Continue",deploy:whe,preview:Ohe,export:"Export configuration",downloaded:khe,downloadFailed:She,validationSummary:Ehe,customValue:Che,customField:Ahe,enterCustomValue:The,reasoningUnavailable:_he,modelsUnavailable:jhe,selectProviderFirst:Nhe,selectOption:Rhe,optional:Ihe,defaultsHelp:Phe,credentialHelp:Dhe,permissionHelp:Mhe,routesHelp:Lhe,providersHelp:$he,coverage:Fhe,source:Bhe,provider:Uhe,model:Qhe,addProvider:zhe,removeProvider:Vhe,addModel:Hhe,removeModel:qhe,addRoute:Whe,removeRoute:Khe,remove:Ghe,modelIdPlaceholder:Xhe,route:Yhe,sections:Zhe,providerFields:Jhe,providerPlaceholders:epe,modelFields:tpe,errors:npe,fields:ipe,cancel:rpe,back:spe,pageTitle:ape},nVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Hhe,addProvider:zhe,addRoute:Whe,agentType:vhe,back:spe,cancel:rpe,close:xhe,coverage:Fhe,credentialHelp:Dhe,customField:Ahe,customValue:Che,default:tVe,defaultsHelp:Phe,deploy:whe,downloadFailed:She,downloaded:khe,enterCustomValue:The,errors:npe,fields:ipe,model:Qhe,modelFields:tpe,modelIdPlaceholder:Xhe,modelsUnavailable:jhe,optional:Ihe,pageTitle:ape,permissionHelp:Mhe,preview:Ohe,provider:Uhe,providerFields:Jhe,providerPlaceholders:epe,providersHelp:$he,reasoningUnavailable:_he,remove:Ghe,removeModel:qhe,removeProvider:Vhe,removeRoute:Khe,route:Yhe,routesHelp:Lhe,sections:Zhe,selectOption:Rhe,selectProviderFirst:Nhe,source:Bhe,title:yhe,validationSummary:Ehe},Symbol.toStringTag,{value:"Module"})),ope="Report an issue",lpe="Description",cpe="Common issues",upe="Cancel",dpe="Done",fpe="Submit feedback",hpe="Submitting…",ppe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},mpe={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"}},gpe={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."},iVe={title:ope,descriptionLabel:lpe,commonIssues:cpe,cancel:upe,done:dpe,submit:fpe,submitting:hpe,success:ppe,dialog:mpe,page:gpe},rVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:upe,commonIssues:cpe,default:iVe,descriptionLabel:lpe,dialog:mpe,done:dpe,page:gpe,submit:fpe,submitting:hpe,success:ppe,title:ope},Symbol.toStringTag,{value:"Module"})),bpe={back:"Back",close:"Close"},ype={title:"Optimize migrated project",closeAria:"Close optimization dialog"},vpe={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."},xpe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},wpe={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"},Ope={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"},kpe={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."},Spe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Epe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},Cpe={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"},Ape={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Tpe={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."},_pe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},jpe={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"},Npe={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…"},Rpe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Ipe={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}}"},Ppe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},Dpe={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"},Mpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Lpe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},$pe={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."},Fpe={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"},Bpe={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"},Upe={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"},Qpe={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:", "}},zpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Vpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},sVe={common:bpe,optimization:ype,projects:vpe,framework:xpe,state:wpe,historyStatus:Ope,task:kpe,verification:Spe,transfer:Epe,validation:Cpe,duration:Ape,expiry:Tpe,analysis:_pe,activity:jpe,artifact:Npe,model:Rpe,upload:Ipe,deployment:Ppe,workspace:Dpe,actions:Mpe,capability:Lpe,conversation:$pe,questions:Fpe,pendingInput:Bpe,confirmation:Upe,evaluation:Qpe,errors:zpe,stopDialog:Vpe},aVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Mpe,activity:jpe,analysis:_pe,artifact:Npe,capability:Lpe,common:bpe,confirmation:Upe,conversation:$pe,default:sVe,deployment:Ppe,duration:Ape,errors:zpe,evaluation:Qpe,expiry:Tpe,framework:xpe,historyStatus:Ope,model:Rpe,optimization:ype,pendingInput:Bpe,projects:vpe,questions:Fpe,state:wpe,stopDialog:Vpe,task:kpe,transfer:Epe,upload:Ipe,validation:Cpe,verification:Spe,workspace:Dpe},Symbol.toStringTag,{value:"Module"})),Hpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},qpe={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."}},Wpe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Kpe={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"},Gpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA 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."},Xpe={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"},Ype={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"}},Zpe={compactSelect:Hpe,featureNotice:qpe,workspace:Wpe,mode:Kpe,agentPicker:Gpe,skill:Xpe,video:Ype},oVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Gpe,compactSelect:Hpe,default:Zpe,featureNotice:qpe,mode:Kpe,skill:Xpe,video:Ype,workspace:Wpe},Symbol.toStringTag,{value:"Module"})),Jpe="Review center",eme="Resource type to review",tme="Only administrators can access the review center",nme="Search name, submitter or version",ime="Review status",rme="Pending: {{count}}",sme="Requests: {{count}}",ame={skill:"Skills",agent:"Agents"},ome={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},lme={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},cme={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"},ume={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"},dme={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"},fme={failed:"The review space is unavailable",retry:"Retry"},hme={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"},pme={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"},lVe={title:Jpe,category:eme,adminOnly:tme,search:nme,filterStatus:ime,pendingCount:rme,total:sme,kind:ame,status:ome,columns:lme,actions:cme,empty:ume,detail:dme,space:fme,decision:hme,score:pme},cVe=Object.freeze(Object.defineProperty({__proto__:null,actions:cme,adminOnly:tme,category:eme,columns:lme,decision:hme,default:lVe,detail:dme,empty:ume,filterStatus:ime,kind:ame,pendingCount:rme,score:pme,search:nme,space:fme,status:ome,title:Jpe,total:sme},Symbol.toStringTag,{value:"Module"})),mme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},gme={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}}"},bme={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"},yme={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."}}},vme={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"},xme={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"},wme={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…"},Ome={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"},kme={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"}},Sme={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"},Eme={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"},Cme={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.`},zfe={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"}},Vfe={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}}"}},Hfe={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."}},qfe={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"}},Wfe={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"}}},Kfe={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"}},Gfe={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"}}},Xfe={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"}},Yfe={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."}},Zfe={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"}},Jfe={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",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},ehe={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",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},the={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"}},nhe={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:", "},ihe={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"}},rhe={common:Ffe,yaml:Bfe,validation:Ufe,defaults:Qfe,helpers:zfe,intelligentDeployment:Vfe,codePackage:Hfe,buildCanvas:qfe,intelligent:Wfe,projectLibrary:Kfe,modePicker:Gfe,promptEditor:Xfe,skills:Yfe,workflow:Zfe,workbench:Jfe,traditional:ehe,template:the,workspace:nhe,modelApiKey:ihe},Jze=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:qfe,codePackage:Hfe,common:Ffe,default:rhe,defaults:Qfe,helpers:zfe,intelligent:Wfe,intelligentDeployment:Vfe,modePicker:Gfe,modelApiKey:ihe,projectLibrary:Kfe,promptEditor:Xfe,skills:Yfe,template:the,traditional:ehe,validation:Ufe,workbench:Jfe,workflow:Zfe,workspace:nhe,yaml:Bfe},Symbol.toStringTag,{value:"Module"})),she={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},ahe={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"},ohe={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?"},lhe={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},che={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},uhe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},dhe={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"},fhe={all:"All"},hhe={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"},phe={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."},mhe={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"},ghe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},bhe={daily:"Daily",once:"Once",weekly:"Weekly"},yhe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},vhe={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."},xhe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},eVe={mpa:she,actions:ahe,confirm:ohe,detail:lhe,drawer:che,duration:uhe,fields:dhe,filters:fhe,history:hhe,notices:phe,page:mhe,schedule:ghe,scheduleTypes:bhe,status:yhe,validation:vhe,weekdays:xhe},tVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ahe,confirm:ohe,default:eVe,detail:lhe,drawer:che,duration:uhe,fields:dhe,filters:fhe,history:hhe,mpa:she,notices:phe,page:mhe,schedule:ghe,scheduleTypes:bhe,status:yhe,validation:vhe,weekdays:xhe},Symbol.toStringTag,{value:"Module"})),whe="Quick-create Agent",khe="Agent type",Ohe="Close",She="Deploy",Ehe="Preview",Che="Configuration download started",Ahe="Download failed — try again",The="Review {{count}} configuration issues",_he="Custom",jhe="Custom {{field}}",Nhe="Enter a custom value",Rhe="This model declares no reasoning levels; the service settings apply",Ihe="Add a model to this provider first",Phe="Select a provider first",Dhe="Select an option",Mhe="Optional",Lhe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",$he="Enter an environment variable name only; supply its secret value at deployment",Fhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Bhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Uhe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",Qhe="Covers common native settings. Other plugin parameters and preset files are not included yet",zhe="Native configuration reference",Vhe="Provider {{index}}",Hhe="Model {{index}}",qhe="Add provider",Whe="Remove provider {{index}}",Khe="Add model",Ghe="Remove model {{index}}",Xhe="Add allowed model",Yhe="Remove allowed model {{index}}",Zhe="Remove",Jhe="Enter the service’s model ID",epe={provider:"Provider {{index}}",model:"Model {{index}}"},tpe={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"},npe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},ipe={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"},rpe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},spe={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"},ape={"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"},ope="Cancel",lpe="Back to creation methods",cpe="DeepSeek Harness configuration",nVe={title:whe,agentType:khe,close:Ohe,continue:"Continue",deploy:She,preview:Ehe,export:"Export configuration",downloaded:Che,downloadFailed:Ahe,validationSummary:The,customValue:_he,customField:jhe,enterCustomValue:Nhe,reasoningUnavailable:Rhe,modelsUnavailable:Ihe,selectProviderFirst:Phe,selectOption:Dhe,optional:Mhe,defaultsHelp:Lhe,credentialHelp:$he,permissionHelp:Fhe,routesHelp:Bhe,providersHelp:Uhe,coverage:Qhe,source:zhe,provider:Vhe,model:Hhe,addProvider:qhe,removeProvider:Whe,addModel:Khe,removeModel:Ghe,addRoute:Xhe,removeRoute:Yhe,remove:Zhe,modelIdPlaceholder:Jhe,route:epe,sections:tpe,providerFields:npe,providerPlaceholders:ipe,modelFields:rpe,errors:spe,fields:ape,cancel:ope,back:lpe,pageTitle:cpe},iVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Khe,addProvider:qhe,addRoute:Xhe,agentType:khe,back:lpe,cancel:ope,close:Ohe,coverage:Qhe,credentialHelp:$he,customField:jhe,customValue:_he,default:nVe,defaultsHelp:Lhe,deploy:She,downloadFailed:Ahe,downloaded:Che,enterCustomValue:Nhe,errors:spe,fields:ape,model:Hhe,modelFields:rpe,modelIdPlaceholder:Jhe,modelsUnavailable:Ihe,optional:Mhe,pageTitle:cpe,permissionHelp:Fhe,preview:Ehe,provider:Vhe,providerFields:npe,providerPlaceholders:ipe,providersHelp:Uhe,reasoningUnavailable:Rhe,remove:Zhe,removeModel:Ghe,removeProvider:Whe,removeRoute:Yhe,route:epe,routesHelp:Bhe,sections:tpe,selectOption:Dhe,selectProviderFirst:Phe,source:zhe,title:whe,validationSummary:The},Symbol.toStringTag,{value:"Module"})),upe="Report an issue",dpe="Description",fpe="Common issues",hpe="Cancel",ppe="Done",mpe="Submit feedback",gpe="Submitting…",bpe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},ype={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"}},vpe={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."},rVe={title:upe,descriptionLabel:dpe,commonIssues:fpe,cancel:hpe,done:ppe,submit:mpe,submitting:gpe,success:bpe,dialog:ype,page:vpe},sVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:hpe,commonIssues:fpe,default:rVe,descriptionLabel:dpe,dialog:ype,done:ppe,page:vpe,submit:mpe,submitting:gpe,success:bpe,title:upe},Symbol.toStringTag,{value:"Module"})),xpe={back:"Back",close:"Close"},wpe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},kpe={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."},Ope={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Spe={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"},Epe={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"},Cpe={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."},Ape={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Tpe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},_pe={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"},jpe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Npe={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."},Rpe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},Ipe={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"},Ppe={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…"},Dpe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Mpe={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}}"},Lpe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},$pe={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"},Fpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Bpe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Upe={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."},Qpe={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"},zpe={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"},Vpe={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"},Hpe={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:", "}},qpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Wpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},aVe={common:xpe,optimization:wpe,projects:kpe,framework:Ope,state:Spe,historyStatus:Epe,task:Cpe,verification:Ape,transfer:Tpe,validation:_pe,duration:jpe,expiry:Npe,analysis:Rpe,activity:Ipe,artifact:Ppe,model:Dpe,upload:Mpe,deployment:Lpe,workspace:$pe,actions:Fpe,capability:Bpe,conversation:Upe,questions:Qpe,pendingInput:zpe,confirmation:Vpe,evaluation:Hpe,errors:qpe,stopDialog:Wpe},oVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fpe,activity:Ipe,analysis:Rpe,artifact:Ppe,capability:Bpe,common:xpe,confirmation:Vpe,conversation:Upe,default:aVe,deployment:Lpe,duration:jpe,errors:qpe,evaluation:Hpe,expiry:Npe,framework:Ope,historyStatus:Epe,model:Dpe,optimization:wpe,pendingInput:zpe,projects:kpe,questions:Qpe,state:Spe,stopDialog:Wpe,task:Cpe,transfer:Tpe,upload:Mpe,validation:_pe,verification:Ape,workspace:$pe},Symbol.toStringTag,{value:"Module"})),Kpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Gpe={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."}},Xpe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Ype={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"},Zpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA 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."},Jpe={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"},eme={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"}},tme={compactSelect:Kpe,featureNotice:Gpe,workspace:Xpe,mode:Ype,agentPicker:Zpe,skill:Jpe,video:eme},lVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Zpe,compactSelect:Kpe,default:tme,featureNotice:Gpe,mode:Ype,skill:Jpe,video:eme,workspace:Xpe},Symbol.toStringTag,{value:"Module"})),nme="Review center",ime="Resource type to review",rme="Only administrators can access the review center",sme="Search name, submitter or version",ame="Review status",ome="Pending: {{count}}",lme="Requests: {{count}}",cme={skill:"Skills",agent:"Agents"},ume={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},dme={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},fme={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"},hme={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"},pme={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"},mme={failed:"The review space is unavailable",retry:"Retry"},gme={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"},bme={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"},cVe={title:nme,category:ime,adminOnly:rme,search:sme,filterStatus:ame,pendingCount:ome,total:lme,kind:cme,status:ume,columns:dme,actions:fme,empty:hme,detail:pme,space:mme,decision:gme,score:bme},uVe=Object.freeze(Object.defineProperty({__proto__:null,actions:fme,adminOnly:rme,category:ime,columns:dme,decision:gme,default:cVe,detail:pme,empty:hme,filterStatus:ame,kind:cme,pendingCount:ome,score:bme,search:sme,space:mme,status:ume,title:nme,total:lme},Symbol.toStringTag,{value:"Module"})),yme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},vme={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}}"},xme={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"},wme={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."}}},kme={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"},Ome={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"},Sme={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…"},Eme={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"},Cme={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"}},Ame={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"},Tme={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"},_me={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"}},Ame={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"}},Tme={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."},_me={common:mme,tool:gme,threads:bme,permissions:yme,workspace:vme,approval:xme,composer:wme,launch:Ome,session:kme,agentDetails:Sme,agentWorkspace:Eme,handoff:Cme,commands:Ame,taskNotice:Tme},uVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Sme,agentWorkspace:Eme,approval:xme,commands:Ame,common:mme,composer:wme,default:_me,handoff:Cme,launch:Ome,permissions:yme,session:kme,taskNotice:Tme,threads:bme,tool:gme,workspace:vme},Symbol.toStringTag,{value:"Module"})),jme={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."},Nme={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"},Rme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Ime={cancel:"Cancel",close:"Close confirmation dialog"},dVe={login:jme,authExpired:Nme,navbar:Rme,confirm:Ime},fVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Nme,confirm:Ime,default:dVe,login:jme,navbar:Rme},Symbol.toStringTag,{value:"Module"})),Pme={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"}},Dme={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"},Mme={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"},hVe={account:Pme,navigation:Dme,history:Mme},pVe=Object.freeze(Object.defineProperty({__proto__:null,account:Pme,default:hVe,history:Mme,navigation:Dme},Symbol.toStringTag,{value:"Module"})),Lme={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."},$me={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Fme={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},Bme={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"},Ume={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)"},Qme={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."},zme={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"},Vme={configSelect:Lme,conversation:$me,errorDetails:Fme,fileTree:Bme,management:Ume,generation:Qme,api:zme},mVe=Object.freeze(Object.defineProperty({__proto__:null,api:zme,configSelect:Lme,conversation:$me,default:Vme,errorDetails:Fme,fileTree:Bme,generation:Qme,management:Ume},Symbol.toStringTag,{value:"Module"})),Hme={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"},qme={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"},Wme={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"},Kme={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",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},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",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},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",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},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",retryOperation:"Retry operation",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"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},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",loadMpaDeletePreview:"Unable to load MPA delete preview",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",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",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"}},Gme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",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."}},Xme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Yme={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Zme={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"},Jme={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."},ege={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"},tge={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"},nge={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."},ige={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"},rge={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.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",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",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},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}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",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."}},sge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",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"},age={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},oge={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"}},lge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},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"},cge={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"}},uge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA 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.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},dge={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}}"},fge={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"}},hge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot."},gVe={common:Hme,agentKitPromo:qme,systemInfo:Wme,agentWorkspace:Kme,environmentCenter:Gme,deploymentSelect:Xme,deploymentError:Yme,studioBuildProgress:Zme,cloudEnvironment:Jme,githubCicd:ege,feishuDeployment:tge,deploymentResources:nge,studioUpdate:ige,projectPreview:rge,workspace:sge,resourceCollection:age,skillSourcePicker:oge,composer:lge,agentSelector:cge,myAgents:uge,skillCenter:dge,knowledge:fge,channels:hge},bVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:qme,agentSelector:cge,agentWorkspace:Kme,channels:hge,cloudEnvironment:Jme,common:Hme,composer:lge,default:gVe,deploymentError:Yme,deploymentResources:nge,deploymentSelect:Xme,environmentCenter:Gme,feishuDeployment:tge,githubCicd:ege,knowledge:fge,myAgents:uge,projectPreview:rge,resourceCollection:age,skillCenter:dge,skillSourcePicker:oge,studioBuildProgress:Zme,studioUpdate:ige,systemInfo:Wme,workspace:sge},Symbol.toStringTag,{value:"Module"})),pge="User management",mge="{{count}} members",gge="User",bge="Role",yge="Account status",vge="Last sign-in",xge="Actions",wge="Change role",Oge="Close",kge="Save role",Sge="Saving…",Ege="Cancel",Cge="Back",Age="User pool",Tge="Volcengine Identity",_ge="Search name, email or user ID",jge="Search",Nge="Filter by role",Rge="All roles",Ige="Refresh",Pge="Loading users…",Dge="Updated at {{time}}",Mge="{{name}} is now {{role}}",Lge="Retry",$ge="You",Fge="Initial super administrator",Bge="The initial super administrator cannot be demoted here",Uge="The new permissions apply when the user refreshes Studio",Qge="Role needs confirmation",zge="No matching users",Vge="Try another search or role",Hge="Users appear here after signing in or joining this user pool",qge="{{count}} users",Wge="Previous",Kge="Next",Gge="Not signed in yet",Xge="Not provided",Yge={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Zge={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"},Jge={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"},ebe={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"},yVe={title:pge,memberCount:mge,user:gge,role:bge,status:yge,lastLogin:vge,actions:xge,changeRole:wge,close:Oge,save:kge,saving:Sge,cancel:Ege,back:Cge,pool:Age,volcengineIdentity:Tge,searchPlaceholder:_ge,search:jge,filterRole:Nge,allRoles:Rge,refresh:Ige,loading:Pge,updatedAt:Dge,saved:Mge,retry:Lge,you:$ge,initialAdministrator:Fge,protectedExplanation:Bge,effectiveAfterRefresh:Uge,roleConflict:Qge,noUsers:zge,tryAnotherSearch:Vge,poolEmpty:Hge,resultCount:qge,previous:Wge,next:Kge,neverLoggedIn:Gge,unknown:Xge,roles:Yge,descriptions:Zge,states:Jge,errors:ebe},vVe=Object.freeze(Object.defineProperty({__proto__:null,actions:xge,allRoles:Rge,back:Cge,cancel:Ege,changeRole:wge,close:Oge,default:yVe,descriptions:Zge,effectiveAfterRefresh:Uge,errors:ebe,filterRole:Nge,initialAdministrator:Fge,lastLogin:vge,loading:Pge,memberCount:mge,neverLoggedIn:Gge,next:Kge,noUsers:zge,pool:Age,poolEmpty:Hge,previous:Wge,protectedExplanation:Bge,refresh:Ige,resultCount:qge,retry:Lge,role:bge,roleConflict:Qge,roles:Yge,save:kge,saved:Mge,saving:Sge,search:jge,searchPlaceholder:_ge,states:Jge,status:yge,title:pge,tryAnotherSearch:Vge,unknown:Xge,updatedAt:Dge,user:gge,volcengineIdentity:Tge,you:$ge},Symbol.toStringTag,{value:"Module"})),tbe="Website integration",nbe="Embed an AgentKit Runtime on your website as a floating chat window",ibe="Back to automations",rbe="Add website",sbe="Loading Runtime",abe="Select Runtime",obe="Website domain",lbe="For example, xxxx.com or localhost:5173",cbe="Generating",ube="Generate token",dbe="Added websites",fbe="{{count}} website",hbe="{{count}} websites",pbe="Loading website integrations",mbe="No website integrations yet",gbe="Select a Runtime and enter a website domain to generate a token",bbe="Embed instructions",ybe="Place this code before the closing body tag on your website",vbe="Copied",xbe="Copy code",wbe="Embed code will appear here after you add a website.",Obe="Delete the website integration for {{domain}}?",kbe={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"},Sbe={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"},xVe={title:tbe,description:nbe,backToAutomations:ibe,addWebsite:rbe,loadingRuntime:sbe,selectRuntime:abe,websiteDomain:obe,domainPlaceholder:lbe,generating:cbe,generateToken:ube,addedWebsites:dbe,websiteCount_one:fbe,websiteCount_other:hbe,loadingIntegrations:pbe,delete:"Delete",emptyTitle:mbe,emptyDescription:gbe,embedMethod:bbe,embedInstructions:ybe,copied:vbe,copyCode:xbe,embedHint:wbe,confirmDelete:Obe,errors:kbe,widget:Sbe},wVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:rbe,addedWebsites:dbe,backToAutomations:ibe,confirmDelete:Obe,copied:vbe,copyCode:xbe,default:xVe,description:nbe,domainPlaceholder:lbe,embedHint:wbe,embedInstructions:ybe,embedMethod:bbe,emptyDescription:gbe,emptyTitle:mbe,errors:kbe,generateToken:ube,generating:cbe,loadingIntegrations:pbe,loadingRuntime:sbe,selectRuntime:abe,title:tbe,websiteCount_one:fbe,websiteCount_other:hbe,websiteDomain:obe,widget:Sbe},Symbol.toStringTag,{value:"Module"})),Ebe={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"}},Cbe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Abe={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"},Tbe={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"},_be={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}}"},jbe={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}}"}},Nbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Rbe={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 is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",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)"},Ibe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",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",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},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.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Pbe={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."},Dbe={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"},Mbe={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"},Lbe={artifactLibrary:Ebe,resourceMetadata:Cbe,artifactEdit:Abe,codeBrowser:Tbe,search:_be,developerResources:jbe,library:Nbe,manageAgents:Rbe,agentTopology:Ibe,sessionEnvironment:Pbe,agentKitCli:Dbe,studioTools:Mbe},OVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Dbe,agentTopology:Ibe,artifactEdit:Abe,artifactLibrary:Ebe,codeBrowser:Tbe,default:Lbe,developerResources:jbe,library:Nbe,manageAgents:Rbe,resourceMetadata:Cbe,search:_be,sessionEnvironment:Pbe,studioTools:Mbe},Symbol.toStringTag,{value:"Module"})),$be={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Fbe={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 返回了无效的终端地址。"},Bbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Ube={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Qbe={autoConfigureFailed:"飞书机器人自动配置失败"},zbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Vbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Hbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},qbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Wbe={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:"上传技能新版本失败"},Kbe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Gbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Xbe={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"},Ybe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},Zbe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Jbe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},eye={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},tye={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:"分析问题选项"}},nye={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}} 返回了不安全的地址。"},iye={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"}},jme={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"}},Nme={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."},Rme={common:yme,tool:vme,threads:xme,permissions:wme,workspace:kme,approval:Ome,composer:Sme,launch:Eme,session:Cme,agentDetails:Ame,agentWorkspace:Tme,handoff:_me,commands:jme,taskNotice:Nme},dVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Ame,agentWorkspace:Tme,approval:Ome,commands:jme,common:yme,composer:Sme,default:Rme,handoff:_me,launch:Eme,permissions:wme,session:Cme,taskNotice:Nme,threads:xme,tool:vme,workspace:kme},Symbol.toStringTag,{value:"Module"})),Ime={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."},Pme={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"},Dme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Mme={cancel:"Cancel",close:"Close confirmation dialog"},fVe={login:Ime,authExpired:Pme,navbar:Dme,confirm:Mme},hVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Pme,confirm:Mme,default:fVe,login:Ime,navbar:Dme},Symbol.toStringTag,{value:"Module"})),Lme={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"}},$me={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"},Fme={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"},pVe={account:Lme,navigation:$me,history:Fme},mVe=Object.freeze(Object.defineProperty({__proto__:null,account:Lme,default:pVe,history:Fme,navigation:$me},Symbol.toStringTag,{value:"Module"})),Bme={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."},Ume={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Qme={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},zme={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"},Vme={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)"},Hme={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."},qme={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"},Wme={configSelect:Bme,conversation:Ume,errorDetails:Qme,fileTree:zme,management:Vme,generation:Hme,api:qme},gVe=Object.freeze(Object.defineProperty({__proto__:null,api:qme,configSelect:Bme,conversation:Ume,default:Wme,errorDetails:Qme,fileTree:zme,generation:Hme,management:Vme},Symbol.toStringTag,{value:"Module"})),Kme={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"},Gme={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"},Xme={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"},Yme={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",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},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",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},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",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},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",retryOperation:"Retry operation",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"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},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",loadMpaDeletePreview:"Unable to load MPA delete preview",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",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",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"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},Zme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",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."}},Jme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},ege={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},tge={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"},nge={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."},ige={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"},rge={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"},sge={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."},age={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"},oge={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.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",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",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},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}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",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."}},lge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",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"},cge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},uge={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"}},dge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},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"},fge={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"}},hge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA 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.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},pge={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}}"},mge={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"}},gge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},bVe={common:Kme,agentKitPromo:Gme,systemInfo:Xme,agentWorkspace:Yme,environmentCenter:Zme,deploymentSelect:Jme,deploymentError:ege,studioBuildProgress:tge,cloudEnvironment:nge,githubCicd:ige,feishuDeployment:rge,deploymentResources:sge,studioUpdate:age,projectPreview:oge,workspace:lge,resourceCollection:cge,skillSourcePicker:uge,composer:dge,agentSelector:fge,myAgents:hge,skillCenter:pge,knowledge:mge,channels:gge},yVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Gme,agentSelector:fge,agentWorkspace:Yme,channels:gge,cloudEnvironment:nge,common:Kme,composer:dge,default:bVe,deploymentError:ege,deploymentResources:sge,deploymentSelect:Jme,environmentCenter:Zme,feishuDeployment:rge,githubCicd:ige,knowledge:mge,myAgents:hge,projectPreview:oge,resourceCollection:cge,skillCenter:pge,skillSourcePicker:uge,studioBuildProgress:tge,studioUpdate:age,systemInfo:Xme,workspace:lge},Symbol.toStringTag,{value:"Module"})),bge="User management",yge="{{count}} members",vge="User",xge="Role",wge="Account status",kge="Last sign-in",Oge="Actions",Sge="Change role",Ege="Close",Cge="Save role",Age="Saving…",Tge="Cancel",_ge="Back",jge="User pool",Nge="Volcengine Identity",Rge="Search name, email or user ID",Ige="Search",Pge="Filter by role",Dge="All roles",Mge="Refresh",Lge="Loading users…",$ge="Updated at {{time}}",Fge="{{name}} is now {{role}}",Bge="Retry",Uge="You",Qge="Initial super administrator",zge="The initial super administrator cannot be demoted here",Vge="The new permissions apply when the user refreshes Studio",Hge="Role needs confirmation",qge="No matching users",Wge="Try another search or role",Kge="Users appear here after signing in or joining this user pool",Gge="{{count}} users",Xge="Previous",Yge="Next",Zge="Not signed in yet",Jge="Not provided",ebe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},tbe={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"},nbe={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"},ibe={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"},vVe={title:bge,memberCount:yge,user:vge,role:xge,status:wge,lastLogin:kge,actions:Oge,changeRole:Sge,close:Ege,save:Cge,saving:Age,cancel:Tge,back:_ge,pool:jge,volcengineIdentity:Nge,searchPlaceholder:Rge,search:Ige,filterRole:Pge,allRoles:Dge,refresh:Mge,loading:Lge,updatedAt:$ge,saved:Fge,retry:Bge,you:Uge,initialAdministrator:Qge,protectedExplanation:zge,effectiveAfterRefresh:Vge,roleConflict:Hge,noUsers:qge,tryAnotherSearch:Wge,poolEmpty:Kge,resultCount:Gge,previous:Xge,next:Yge,neverLoggedIn:Zge,unknown:Jge,roles:ebe,descriptions:tbe,states:nbe,errors:ibe},xVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Oge,allRoles:Dge,back:_ge,cancel:Tge,changeRole:Sge,close:Ege,default:vVe,descriptions:tbe,effectiveAfterRefresh:Vge,errors:ibe,filterRole:Pge,initialAdministrator:Qge,lastLogin:kge,loading:Lge,memberCount:yge,neverLoggedIn:Zge,next:Yge,noUsers:qge,pool:jge,poolEmpty:Kge,previous:Xge,protectedExplanation:zge,refresh:Mge,resultCount:Gge,retry:Bge,role:xge,roleConflict:Hge,roles:ebe,save:Cge,saved:Fge,saving:Age,search:Ige,searchPlaceholder:Rge,states:nbe,status:wge,title:bge,tryAnotherSearch:Wge,unknown:Jge,updatedAt:$ge,user:vge,volcengineIdentity:Nge,you:Uge},Symbol.toStringTag,{value:"Module"})),rbe="Website integration",sbe="Embed an AgentKit Runtime on your website as a floating chat window",abe="Back to automations",obe="Add website",lbe="Loading Runtime",cbe="Select Runtime",ube="Website domain",dbe="For example, xxxx.com or localhost:5173",fbe="Generating",hbe="Generate token",pbe="Added websites",mbe="{{count}} website",gbe="{{count}} websites",bbe="Loading website integrations",ybe="No website integrations yet",vbe="Select a Runtime and enter a website domain to generate a token",xbe="Embed instructions",wbe="Place this code before the closing body tag on your website",kbe="Copied",Obe="Copy code",Sbe="Embed code will appear here after you add a website.",Ebe="Delete the website integration for {{domain}}?",Cbe={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"},Abe={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"},wVe={title:rbe,description:sbe,backToAutomations:abe,addWebsite:obe,loadingRuntime:lbe,selectRuntime:cbe,websiteDomain:ube,domainPlaceholder:dbe,generating:fbe,generateToken:hbe,addedWebsites:pbe,websiteCount_one:mbe,websiteCount_other:gbe,loadingIntegrations:bbe,delete:"Delete",emptyTitle:ybe,emptyDescription:vbe,embedMethod:xbe,embedInstructions:wbe,copied:kbe,copyCode:Obe,embedHint:Sbe,confirmDelete:Ebe,errors:Cbe,widget:Abe},kVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:obe,addedWebsites:pbe,backToAutomations:abe,confirmDelete:Ebe,copied:kbe,copyCode:Obe,default:wVe,description:sbe,domainPlaceholder:dbe,embedHint:Sbe,embedInstructions:wbe,embedMethod:xbe,emptyDescription:vbe,emptyTitle:ybe,errors:Cbe,generateToken:hbe,generating:fbe,loadingIntegrations:bbe,loadingRuntime:lbe,selectRuntime:cbe,title:rbe,websiteCount_one:mbe,websiteCount_other:gbe,websiteDomain:ube,widget:Abe},Symbol.toStringTag,{value:"Module"})),Tbe={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"}},_be={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},jbe={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"},Nbe={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"},Rbe={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}}"},Ibe={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}}"}},Pbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Dbe={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 is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",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)"},Mbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",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",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},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.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Lbe={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."},$be={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"},Fbe={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"},Bbe={artifactLibrary:Tbe,resourceMetadata:_be,artifactEdit:jbe,codeBrowser:Nbe,search:Rbe,developerResources:Ibe,library:Pbe,manageAgents:Dbe,agentTopology:Mbe,sessionEnvironment:Lbe,agentKitCli:$be,studioTools:Fbe},OVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:$be,agentTopology:Mbe,artifactEdit:jbe,artifactLibrary:Tbe,codeBrowser:Nbe,default:Bbe,developerResources:Ibe,library:Pbe,manageAgents:Dbe,resourceMetadata:_be,search:Rbe,sessionEnvironment:Lbe,studioTools:Fbe},Symbol.toStringTag,{value:"Module"})),Ube={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Qbe={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 返回了无效的终端地址。"},zbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Vbe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Hbe={autoConfigureFailed:"飞书机器人自动配置失败"},qbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Wbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Kbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Gbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Xbe={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:"上传技能新版本失败"},Ybe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Zbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Jbe={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"},eye={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},tye={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},nye={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},iye={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},rye={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:"分析问题选项"}},sye={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}} 返回了不安全的地址。"},aye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 响应详情: {{response}}`,errorWithRawResponse:`{{context}} 响应详情: {{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"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 配置",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",listSessionsFailed:"加载 Session 失败",mpaOperationFailed:"应用 MPA Runtime 配置失败",mpaOperationLoadFailed:"加载 MPA Runtime 操作失败",mpaRuntimeLegacyAuthUnsupported:`该 MPA Runtime 使用旧版鉴权适配,当前无法读取 Studio Session。请将 Runtime 镜像更新到最新 MPA AgentKit 版本后刷新此 Agent。 -{{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",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}} +{{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",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 认证信息格式无效",mpaDeleteUnconfirmed:"删除请求超时,尚未确认 Runtime 已删除。后台可能仍在清理,请稍后刷新并检查。",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:"(响应正文为空)"},rye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},sye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},aye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},oye={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:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},jU={common:$be,agentkitCli:Fbe,cloudRegion:Bbe,connections:Ube,feishuBot:Qbe,requestError:zbe,runSse:Vbe,runtimeLogs:Hbe,search:qbe,skills:Wbe,sse:Kbe,identity:Gbe,github:Xbe,video:Ybe,websiteIntegration:Zbe,knowledge:Jbe,intelligentDevelopment:eye,migrations:tye,sandbox:nye,client:iye,newChatCapabilities:rye,jsonResponse:sye,workspaceProjects:aye,developmentRuns:oye},kVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Fbe,client:iye,cloudRegion:Bbe,common:$be,connections:Ube,default:jU,developmentRuns:oye,feishuBot:Qbe,github:Xbe,identity:Gbe,intelligentDevelopment:eye,jsonResponse:sye,knowledge:Jbe,migrations:tye,newChatCapabilities:rye,requestError:zbe,runSse:Vbe,runtimeLogs:Hbe,sandbox:nye,search:qbe,skills:Wbe,sse:Kbe,video:Ybe,websiteIntegration:Zbe,workspaceProjects:aye},Symbol.toStringTag,{value:"Module"})),lye="智能体审核",cye="申请企业内全员使用,审批后生效",uye="关闭",dye="刷新",fye="状态",hye="申请人",pye="申请时间",mye="当前版本",gye="模型",bye="退回人",yye="通过人",vye="审批时间",xye="智能体描述",wye="申请说明",Oye="退回理由",kye="审批意见",Sye="退回理由(必填)",Eye="提交后内容已变化,请退回并重新申请",Cye="撤回后可以修改 Agent,需要公开时重新申请",Aye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Tye="取消",_ye="确认",jye="正在保存",Nye="取消公开",Rye="撤回申请",Iye="通过",Pye="直接公开",Dye="申请公开",Mye="全员可见",Lye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},$ye="搜索智能体或申请人",Fye="地域",Bye="全部状态",Uye="智能体",Qye="操作",zye="查看并审批",Vye="申请详情",Hye="没有符合条件的申请",qye="暂无智能体审核申请",Wye="{{count}} / {{limit}} 字",SVe={title:lye,dialogDescription:cye,close:uye,refresh:dye,statusTitle:fye,submitter:hye,submittedAt:pye,version:mye,model:gye,returnedBy:bye,approvedBy:yye,reviewedAt:vye,description:xye,message:wye,reason:Oye,comment:kye,reasonRequired:Sye,contentChanged:Eye,withdrawConfirm:Cye,unpublishConfirm:Aye,cancel:Tye,confirm:_ye,saving:jye,unpublish:Nye,withdraw:Rye,return:"退回",approve:Iye,publish:Pye,submit:Dye,private:"仅自己可见",enterprise:Mye,status:Lye,search:$ye,region:Fye,all:Bye,agent:Uye,actions:Qye,review:zye,details:Vye,noMatches:Hye,empty:qye,textCount:Wye},EVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Qye,agent:Uye,all:Bye,approve:Iye,approvedBy:yye,cancel:Tye,close:uye,comment:kye,confirm:_ye,contentChanged:Eye,default:SVe,description:xye,details:Vye,dialogDescription:cye,empty:qye,enterprise:Mye,message:wye,model:gye,noMatches:Hye,publish:Pye,reason:Oye,reasonRequired:Sye,refresh:dye,region:Fye,returnedBy:bye,review:zye,reviewedAt:vye,saving:jye,search:$ye,status:Lye,statusTitle:fye,submit:Dye,submittedAt:pye,submitter:hye,textCount:Wye,title:lye,unpublish:Nye,unpublishConfirm:Aye,version:mye,withdraw:Rye,withdrawConfirm:Cye},Symbol.toStringTag,{value:"Module"})),Kye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Gye={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。"}},Xye={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Yye={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Zye={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Jye={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},e0e={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},t0e={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},n0e={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},i0e={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},r0e={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},s0e={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},a0e={volcengine:"火山引擎"},o0e={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:"已更新工作空间"},l0e={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},c0e={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},u0e={actions:Kye,addAgent:Gye,approval:Xye,common:Yye,conversation:Zye,credentials:Jye,dialogs:e0e,errors:t0e,feedback:n0e,greetings:i0e,loading:r0e,oauth:s0e,providers:a0e,sandbox:o0e,titles:l0e,workspaceProjectEntry:c0e},CVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Kye,addAgent:Gye,approval:Xye,common:Yye,conversation:Zye,credentials:Jye,default:u0e,dialogs:e0e,errors:t0e,feedback:n0e,greetings:i0e,loading:r0e,oauth:s0e,providers:a0e,sandbox:o0e,titles:l0e,workspaceProjectEntry:c0e},Symbol.toStringTag,{value:"Module"})),d0e="自动化",f0e="连接研发工具,为智能体扩展自动化工作流",h0e="搜索自动化",p0e="自动化分类",m0e={development:"研发",channels:"消息渠道"},g0e="{{category}}自动化列表",b0e="打开{{name}}",y0e="仅本地部署可用",v0e="没有匹配的自动化",x0e="请尝试搜索其他名称",w0e="返回自动化列表",O0e={"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。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},k0e={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 个字符"}}},S0e={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:"没有可预览的文件。"}},E0e={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},C0e={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},A0e={title:d0e,description:f0e,search:h0e,categoriesLabel:p0e,categories:m0e,resultsLabel:g0e,open:b0e,localOnly:y0e,emptyTitle:v0e,emptyDescription:x0e,backToAutomations:w0e,cards:O0e,github:k0e,codingAgents:S0e,mpaChannels:E0e,feishu:C0e},AVe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:w0e,cards:O0e,categories:m0e,categoriesLabel:p0e,codingAgents:S0e,default:A0e,description:f0e,emptyDescription:x0e,emptyTitle:v0e,feishu:C0e,github:k0e,localOnly:y0e,mpaChannels:E0e,open:b0e,resultsLabel:g0e,search:h0e,title:d0e},Symbol.toStringTag,{value:"Module"})),T0e={"zh-CN":"简体中文","en-US":"English"},TVe={languageNames:T0e},_Ve=Object.freeze(Object.defineProperty({__proto__:null,default:TVe,languageNames:T0e},Symbol.toStringTag,{value:"Module"})),_0e={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},j0e={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},N0e={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:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},R0e={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:"选择左侧的一个调用查看详情"},I0e={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}}"},P0e={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",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 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},D0e={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:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},M0e={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:"连接并添加"},L0e={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},$0e={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},F0e={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},B0e={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},U0e={annotation:_0e,media:j0e,runtimeLogs:N0e,trace:R0e,share:I0e,blocks:P0e,tokenUsage:D0e,addAgentKit:M0e,composer:L0e,invocation:$0e,visualization:F0e,markdown:B0e},jVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:M0e,annotation:_0e,blocks:P0e,composer:L0e,default:U0e,invocation:$0e,markdown:B0e,media:j0e,runtimeLogs:N0e,share:I0e,tokenUsage:D0e,trace:R0e,visualization:F0e},Symbol.toStringTag,{value:"Module"})),Q0e={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},z0e={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},V0e={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},H0e={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,emptyCloudResponse:"(响应正文为空)"},oye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},lye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},cye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},uye={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:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},jU={common:Ube,agentkitCli:Qbe,cloudRegion:zbe,connections:Vbe,feishuBot:Hbe,requestError:qbe,runSse:Wbe,runtimeLogs:Kbe,search:Gbe,skills:Xbe,sse:Ybe,identity:Zbe,github:Jbe,video:eye,websiteIntegration:tye,knowledge:nye,intelligentDevelopment:iye,migrations:rye,sandbox:sye,client:aye,newChatCapabilities:oye,jsonResponse:lye,workspaceProjects:cye,developmentRuns:uye},SVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Qbe,client:aye,cloudRegion:zbe,common:Ube,connections:Vbe,default:jU,developmentRuns:uye,feishuBot:Hbe,github:Jbe,identity:Zbe,intelligentDevelopment:iye,jsonResponse:lye,knowledge:nye,migrations:rye,newChatCapabilities:oye,requestError:qbe,runSse:Wbe,runtimeLogs:Kbe,sandbox:sye,search:Gbe,skills:Xbe,sse:Ybe,video:eye,websiteIntegration:tye,workspaceProjects:cye},Symbol.toStringTag,{value:"Module"})),dye="智能体审核",fye="申请企业内全员使用,审批后生效",hye="关闭",pye="刷新",mye="状态",gye="申请人",bye="申请时间",yye="当前版本",vye="模型",xye="退回人",wye="通过人",kye="审批时间",Oye="智能体描述",Sye="申请说明",Eye="退回理由",Cye="审批意见",Aye="退回理由(必填)",Tye="提交后内容已变化,请退回并重新申请",_ye="撤回后可以修改 Agent,需要公开时重新申请",jye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Nye="取消",Rye="确认",Iye="正在保存",Pye="取消公开",Dye="撤回申请",Mye="通过",Lye="直接公开",$ye="申请公开",Fye="全员可见",Bye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Uye="搜索智能体或申请人",Qye="地域",zye="全部状态",Vye="智能体",Hye="操作",qye="查看并审批",Wye="申请详情",Kye="没有符合条件的申请",Gye="暂无智能体审核申请",Xye="{{count}} / {{limit}} 字",EVe={title:dye,dialogDescription:fye,close:hye,refresh:pye,statusTitle:mye,submitter:gye,submittedAt:bye,version:yye,model:vye,returnedBy:xye,approvedBy:wye,reviewedAt:kye,description:Oye,message:Sye,reason:Eye,comment:Cye,reasonRequired:Aye,contentChanged:Tye,withdrawConfirm:_ye,unpublishConfirm:jye,cancel:Nye,confirm:Rye,saving:Iye,unpublish:Pye,withdraw:Dye,return:"退回",approve:Mye,publish:Lye,submit:$ye,private:"仅自己可见",enterprise:Fye,status:Bye,search:Uye,region:Qye,all:zye,agent:Vye,actions:Hye,review:qye,details:Wye,noMatches:Kye,empty:Gye,textCount:Xye},CVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Hye,agent:Vye,all:zye,approve:Mye,approvedBy:wye,cancel:Nye,close:hye,comment:Cye,confirm:Rye,contentChanged:Tye,default:EVe,description:Oye,details:Wye,dialogDescription:fye,empty:Gye,enterprise:Fye,message:Sye,model:vye,noMatches:Kye,publish:Lye,reason:Eye,reasonRequired:Aye,refresh:pye,region:Qye,returnedBy:xye,review:qye,reviewedAt:kye,saving:Iye,search:Uye,status:Bye,statusTitle:mye,submit:$ye,submittedAt:bye,submitter:gye,textCount:Xye,title:dye,unpublish:Pye,unpublishConfirm:jye,version:yye,withdraw:Dye,withdrawConfirm:_ye},Symbol.toStringTag,{value:"Module"})),Yye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Zye={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。"}},Jye={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},eve={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},tve={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},nve={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},ive={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},rve={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},sve={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},ave={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},ove={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},lve={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},cve={volcengine:"火山引擎"},uve={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:"已更新工作空间"},dve={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},fve={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},hve={actions:Yye,addAgent:Zye,approval:Jye,common:eve,conversation:tve,credentials:nve,dialogs:ive,errors:rve,feedback:sve,greetings:ave,loading:ove,oauth:lve,providers:cve,sandbox:uve,titles:dve,workspaceProjectEntry:fve},AVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Yye,addAgent:Zye,approval:Jye,common:eve,conversation:tve,credentials:nve,default:hve,dialogs:ive,errors:rve,feedback:sve,greetings:ave,loading:ove,oauth:lve,providers:cve,sandbox:uve,titles:dve,workspaceProjectEntry:fve},Symbol.toStringTag,{value:"Module"})),pve="自动化",mve="连接研发工具,为智能体扩展自动化工作流",gve="搜索自动化",bve="自动化分类",yve={development:"研发",channels:"消息渠道"},vve="{{category}}自动化列表",xve="打开{{name}}",wve="仅本地部署可用",kve="没有匹配的自动化",Ove="请尝试搜索其他名称",Sve="返回自动化列表",Eve={"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。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},Cve={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 个字符"}}},Ave={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:"没有可预览的文件。"}},Tve={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},_ve={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},jve={title:pve,description:mve,search:gve,categoriesLabel:bve,categories:yve,resultsLabel:vve,open:xve,localOnly:wve,emptyTitle:kve,emptyDescription:Ove,backToAutomations:Sve,cards:Eve,github:Cve,codingAgents:Ave,mpaChannels:Tve,feishu:_ve},TVe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:Sve,cards:Eve,categories:yve,categoriesLabel:bve,codingAgents:Ave,default:jve,description:mve,emptyDescription:Ove,emptyTitle:kve,feishu:_ve,github:Cve,localOnly:wve,mpaChannels:Tve,open:xve,resultsLabel:vve,search:gve,title:pve},Symbol.toStringTag,{value:"Module"})),Nve={"zh-CN":"简体中文","en-US":"English"},_Ve={languageNames:Nve},jVe=Object.freeze(Object.defineProperty({__proto__:null,default:_Ve,languageNames:Nve},Symbol.toStringTag,{value:"Module"})),Rve={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},Ive={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},Pve={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:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},Dve={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:"选择左侧的一个调用查看详情"},Mve={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}}"},Lve={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",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 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},$ve={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:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},Fve={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:"连接并添加"},Bve={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},Uve={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},Qve={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},zve={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},Vve={annotation:Rve,media:Ive,runtimeLogs:Pve,trace:Dve,share:Mve,blocks:Lve,tokenUsage:$ve,addAgentKit:Fve,composer:Bve,invocation:Uve,visualization:Qve,markdown:zve},NVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Fve,annotation:Rve,blocks:Lve,composer:Bve,default:Vve,invocation:Uve,markdown:zve,media:Ive,runtimeLogs:Pve,share:Mve,tokenUsage:$ve,trace:Dve,visualization:Qve},Symbol.toStringTag,{value:"Module"})),Hve={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},qve={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Wve={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},Kve={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},q0e={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 解压后的内容过大"}},W0e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},K0e={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 中声明已有入口。"}},G0e={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:"添加到最后"}},X0e={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:"已停止"}}},Y0e={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:"删除版本"}},Z0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},J0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},eve={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 中心暂无技能。"}},tve={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}} 条连线"}},nve={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:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},ive={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:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},rve={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:"长期"}},sve={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:","},ave={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},ove={common:Q0e,yaml:z0e,validation:V0e,defaults:H0e,helpers:q0e,intelligentDeployment:W0e,codePackage:K0e,buildCanvas:G0e,intelligent:X0e,projectLibrary:Y0e,modePicker:Z0e,promptEditor:J0e,skills:eve,workflow:tve,workbench:nve,traditional:ive,template:rve,workspace:sve,modelApiKey:ave},NVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:G0e,codePackage:K0e,common:Q0e,default:ove,defaults:H0e,helpers:q0e,intelligent:X0e,intelligentDeployment:W0e,modePicker:Z0e,modelApiKey:ave,projectLibrary:Y0e,promptEditor:J0e,skills:eve,template:rve,traditional:ive,validation:V0e,workbench:nve,workflow:tve,workspace:sve,yaml:z0e},Symbol.toStringTag,{value:"Module"})),lve={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},cve={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:"查看详情"},uve={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},dve={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},fve={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},hve={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},pve={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},mve={all:"全部"},gve={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},bve={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},yve={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},vve={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},xve={daily:"每天",once:"一次性",weekly:"每周"},wve={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Ove={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},kve={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},RVe={mpa:lve,actions:cve,confirm:uve,detail:dve,drawer:fve,duration:hve,fields:pve,filters:mve,history:gve,notices:bve,page:yve,schedule:vve,scheduleTypes:xve,status:wve,validation:Ove,weekdays:kve},IVe=Object.freeze(Object.defineProperty({__proto__:null,actions:cve,confirm:uve,default:RVe,detail:dve,drawer:fve,duration:hve,fields:pve,filters:mve,history:gve,mpa:lve,notices:bve,page:yve,schedule:vve,scheduleTypes:xve,status:wve,validation:Ove,weekdays:kve},Symbol.toStringTag,{value:"Module"})),Sve="快速创建 Agent",Eve="Agent 类型",Cve="关闭",Ave="部署",Tve="预览配置",_ve="已发起配置包下载",jve="下载失败,请重试",Nve="有 {{count}} 处配置需要修改",Rve="自定义",Ive="自定义{{field}}",Pve="输入自定义值",Dve="该模型未声明推理强度,使用服务端设置",Mve="请先为该提供方添加模型",Lve="请先选择提供方",$ve="请选择",Fve="可选",Bve="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",Uve="仅填写环境变量名称,实际密钥由部署环境提供",Qve="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",zve="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",Vve="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",Hve="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",qve="查看原生配置文档",Wve="模型提供方 {{index}}",Kve="模型 {{index}}",Gve="添加模型提供方",Xve="移除提供方 {{index}}",Yve="添加模型",Zve="移除模型 {{index}}",Jve="添加可选模型",exe="移除可选模型 {{index}}",txe="移除",nxe="填写服务端的模型 ID",ixe={provider:"提供方 {{index}}",model:"模型 {{index}}"},rxe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},sxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},axe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},oxe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},lxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},cxe={"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":"搜索次数上限"},uxe="取消",dxe="返回创建方式",fxe="DeepSeek Harness 配置",PVe={title:Sve,agentType:Eve,close:Cve,continue:"继续配置",deploy:Ave,preview:Tve,export:"导出配置",downloaded:_ve,downloadFailed:jve,validationSummary:Nve,customValue:Rve,customField:Ive,enterCustomValue:Pve,reasoningUnavailable:Dve,modelsUnavailable:Mve,selectProviderFirst:Lve,selectOption:$ve,optional:Fve,defaultsHelp:Bve,credentialHelp:Uve,permissionHelp:Qve,routesHelp:zve,providersHelp:Vve,coverage:Hve,source:qve,provider:Wve,model:Kve,addProvider:Gve,removeProvider:Xve,addModel:Yve,removeModel:Zve,addRoute:Jve,removeRoute:exe,remove:txe,modelIdPlaceholder:nxe,route:ixe,sections:rxe,providerFields:sxe,providerPlaceholders:axe,modelFields:oxe,errors:lxe,fields:cxe,cancel:uxe,back:dxe,pageTitle:fxe},DVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Yve,addProvider:Gve,addRoute:Jve,agentType:Eve,back:dxe,cancel:uxe,close:Cve,coverage:Hve,credentialHelp:Uve,customField:Ive,customValue:Rve,default:PVe,defaultsHelp:Bve,deploy:Ave,downloadFailed:jve,downloaded:_ve,enterCustomValue:Pve,errors:lxe,fields:cxe,model:Kve,modelFields:oxe,modelIdPlaceholder:nxe,modelsUnavailable:Mve,optional:Fve,pageTitle:fxe,permissionHelp:Qve,preview:Tve,provider:Wve,providerFields:sxe,providerPlaceholders:axe,providersHelp:Vve,reasoningUnavailable:Dve,remove:txe,removeModel:Zve,removeProvider:Xve,removeRoute:exe,route:ixe,routesHelp:zve,sections:rxe,selectOption:$ve,selectProviderFirst:Lve,source:qve,title:Sve,validationSummary:Nve},Symbol.toStringTag,{value:"Module"})),hxe="问题反馈",pxe="问题描述",mxe="常见问题",gxe="取消",bxe="完成",yxe="提交反馈",vxe="正在上报…",xxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},wxe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},Oxe={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 团队,请注意隐私保护。"},MVe={title:hxe,descriptionLabel:pxe,commonIssues:mxe,cancel:gxe,done:bxe,submit:yxe,submitting:vxe,success:xxe,dialog:wxe,page:Oxe},LVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:gxe,commonIssues:mxe,default:MVe,descriptionLabel:pxe,dialog:wxe,done:bxe,page:Oxe,submit:yxe,submitting:vxe,success:xxe,title:hxe},Symbol.toStringTag,{value:"Module"})),kxe={back:"返回",close:"关闭"},Sxe={title:"优化迁移项目",closeAria:"关闭优化窗口"},Exe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},Cxe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},Axe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Txe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},_xe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},jxe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},Nxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Rxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Ixe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},Pxe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},Dxe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Mxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Lxe={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:"正在读取迁移产物…"},$xe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Fxe={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}}"},Bxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Uxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},Qxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},zxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Vxe={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Hxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},qxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},Wxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Kxe={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:"、"}},Gxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Xxe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},$Ve={common:kxe,optimization:Sxe,projects:Exe,framework:Cxe,state:Axe,historyStatus:Txe,task:_xe,verification:jxe,transfer:Nxe,validation:Rxe,duration:Ixe,expiry:Pxe,analysis:Dxe,activity:Mxe,artifact:Lxe,model:$xe,upload:Fxe,deployment:Bxe,workspace:Uxe,actions:Qxe,capability:zxe,conversation:Vxe,questions:Hxe,pendingInput:qxe,confirmation:Wxe,evaluation:Kxe,errors:Gxe,stopDialog:Xxe},FVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Qxe,activity:Mxe,analysis:Dxe,artifact:Lxe,capability:zxe,common:kxe,confirmation:Wxe,conversation:Vxe,default:$Ve,deployment:Bxe,duration:Ixe,errors:Gxe,evaluation:Kxe,expiry:Pxe,framework:Cxe,historyStatus:Txe,model:$xe,optimization:Sxe,pendingInput:qxe,projects:Exe,questions:Hxe,state:Axe,stopDialog:Xxe,task:_xe,transfer:Nxe,upload:Fxe,validation:Rxe,verification:jxe,workspace:Uxe},Symbol.toStringTag,{value:"Module"})),Yxe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Zxe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Jxe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},ewe={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:"暂不可用"},twe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。"},nwe={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"},iwe={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}}秒"}},rwe={compactSelect:Yxe,featureNotice:Zxe,workspace:Jxe,mode:ewe,agentPicker:twe,skill:nwe,video:iwe},BVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:twe,compactSelect:Yxe,default:rwe,featureNotice:Zxe,mode:ewe,skill:nwe,video:iwe,workspace:Jxe},Symbol.toStringTag,{value:"Module"})),swe="审核中心",awe="审核资源类型",owe="仅管理员可以访问审核中心",lwe="搜索申请名称、提交人或版本",cwe="审核状态",uwe="{{count}} 条待审核",dwe="共 {{count}} 条申请",fwe={skill:"技能",agent:"智能体"},hwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},pwe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},mwe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},gwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},bwe={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}}确认通过,等待完成发布"},ywe={failed:"待审核空间暂不可用",retry:"重试"},vwe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},xwe={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:"云端原始错误"},UVe={title:swe,category:awe,adminOnly:owe,search:lwe,filterStatus:cwe,pendingCount:uwe,total:dwe,kind:fwe,status:hwe,columns:pwe,actions:mwe,empty:gwe,detail:bwe,space:ywe,decision:vwe,score:xwe},QVe=Object.freeze(Object.defineProperty({__proto__:null,actions:mwe,adminOnly:owe,category:awe,columns:pwe,decision:vwe,default:UVe,detail:bwe,empty:gwe,filterStatus:cwe,kind:fwe,pendingCount:uwe,score:xwe,search:lwe,space:ywe,status:hwe,title:swe,total:dwe},Symbol.toStringTag,{value:"Module"})),wwe={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}} 打开失败"},kwe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Swe={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 自动审查流程处理审批请求。"}}},Ewe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Cwe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Awe={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:"可继续追加要求,或随时停止任务…"},Twe={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:"重新尝试"},_we={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:"推理输出"}},jwe={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"},Nwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Rwe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Gve={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 解压后的内容过大"}},Xve={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Yve={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 中声明已有入口。"}},Zve={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:"添加到最后"}},Jve={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:"已停止"}}},e0e={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:"删除版本"}},t0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},n0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},i0e={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 中心暂无技能。"}},r0e={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}} 条连线"}},s0e={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:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},a0e={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:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},o0e={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:"长期"}},l0e={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:","},c0e={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},u0e={common:Hve,yaml:qve,validation:Wve,defaults:Kve,helpers:Gve,intelligentDeployment:Xve,codePackage:Yve,buildCanvas:Zve,intelligent:Jve,projectLibrary:e0e,modePicker:t0e,promptEditor:n0e,skills:i0e,workflow:r0e,workbench:s0e,traditional:a0e,template:o0e,workspace:l0e,modelApiKey:c0e},RVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Zve,codePackage:Yve,common:Hve,default:u0e,defaults:Kve,helpers:Gve,intelligent:Jve,intelligentDeployment:Xve,modePicker:t0e,modelApiKey:c0e,projectLibrary:e0e,promptEditor:n0e,skills:i0e,template:o0e,traditional:a0e,validation:Wve,workbench:s0e,workflow:r0e,workspace:l0e,yaml:qve},Symbol.toStringTag,{value:"Module"})),d0e={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},f0e={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:"查看详情"},h0e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},p0e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},m0e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},g0e={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},b0e={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},y0e={all:"全部"},v0e={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},x0e={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},w0e={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},k0e={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},O0e={daily:"每天",once:"一次性",weekly:"每周"},S0e={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},E0e={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},C0e={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},IVe={mpa:d0e,actions:f0e,confirm:h0e,detail:p0e,drawer:m0e,duration:g0e,fields:b0e,filters:y0e,history:v0e,notices:x0e,page:w0e,schedule:k0e,scheduleTypes:O0e,status:S0e,validation:E0e,weekdays:C0e},PVe=Object.freeze(Object.defineProperty({__proto__:null,actions:f0e,confirm:h0e,default:IVe,detail:p0e,drawer:m0e,duration:g0e,fields:b0e,filters:y0e,history:v0e,mpa:d0e,notices:x0e,page:w0e,schedule:k0e,scheduleTypes:O0e,status:S0e,validation:E0e,weekdays:C0e},Symbol.toStringTag,{value:"Module"})),A0e="快速创建 Agent",T0e="Agent 类型",_0e="关闭",j0e="部署",N0e="预览配置",R0e="已发起配置包下载",I0e="下载失败,请重试",P0e="有 {{count}} 处配置需要修改",D0e="自定义",M0e="自定义{{field}}",L0e="输入自定义值",$0e="该模型未声明推理强度,使用服务端设置",F0e="请先为该提供方添加模型",B0e="请先选择提供方",U0e="请选择",Q0e="可选",z0e="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",V0e="仅填写环境变量名称,实际密钥由部署环境提供",H0e="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",q0e="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",W0e="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",K0e="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",G0e="查看原生配置文档",X0e="模型提供方 {{index}}",Y0e="模型 {{index}}",Z0e="添加模型提供方",J0e="移除提供方 {{index}}",exe="添加模型",txe="移除模型 {{index}}",nxe="添加可选模型",ixe="移除可选模型 {{index}}",rxe="移除",sxe="填写服务端的模型 ID",axe={provider:"提供方 {{index}}",model:"模型 {{index}}"},oxe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},lxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},cxe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},uxe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},dxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},fxe={"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":"搜索次数上限"},hxe="取消",pxe="返回创建方式",mxe="DeepSeek Harness 配置",DVe={title:A0e,agentType:T0e,close:_0e,continue:"继续配置",deploy:j0e,preview:N0e,export:"导出配置",downloaded:R0e,downloadFailed:I0e,validationSummary:P0e,customValue:D0e,customField:M0e,enterCustomValue:L0e,reasoningUnavailable:$0e,modelsUnavailable:F0e,selectProviderFirst:B0e,selectOption:U0e,optional:Q0e,defaultsHelp:z0e,credentialHelp:V0e,permissionHelp:H0e,routesHelp:q0e,providersHelp:W0e,coverage:K0e,source:G0e,provider:X0e,model:Y0e,addProvider:Z0e,removeProvider:J0e,addModel:exe,removeModel:txe,addRoute:nxe,removeRoute:ixe,remove:rxe,modelIdPlaceholder:sxe,route:axe,sections:oxe,providerFields:lxe,providerPlaceholders:cxe,modelFields:uxe,errors:dxe,fields:fxe,cancel:hxe,back:pxe,pageTitle:mxe},MVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:exe,addProvider:Z0e,addRoute:nxe,agentType:T0e,back:pxe,cancel:hxe,close:_0e,coverage:K0e,credentialHelp:V0e,customField:M0e,customValue:D0e,default:DVe,defaultsHelp:z0e,deploy:j0e,downloadFailed:I0e,downloaded:R0e,enterCustomValue:L0e,errors:dxe,fields:fxe,model:Y0e,modelFields:uxe,modelIdPlaceholder:sxe,modelsUnavailable:F0e,optional:Q0e,pageTitle:mxe,permissionHelp:H0e,preview:N0e,provider:X0e,providerFields:lxe,providerPlaceholders:cxe,providersHelp:W0e,reasoningUnavailable:$0e,remove:rxe,removeModel:txe,removeProvider:J0e,removeRoute:ixe,route:axe,routesHelp:q0e,sections:oxe,selectOption:U0e,selectProviderFirst:B0e,source:G0e,title:A0e,validationSummary:P0e},Symbol.toStringTag,{value:"Module"})),gxe="问题反馈",bxe="问题描述",yxe="常见问题",vxe="取消",xxe="完成",wxe="提交反馈",kxe="正在上报…",Oxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},Sxe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},Exe={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 团队,请注意隐私保护。"},LVe={title:gxe,descriptionLabel:bxe,commonIssues:yxe,cancel:vxe,done:xxe,submit:wxe,submitting:kxe,success:Oxe,dialog:Sxe,page:Exe},$Ve=Object.freeze(Object.defineProperty({__proto__:null,cancel:vxe,commonIssues:yxe,default:LVe,descriptionLabel:bxe,dialog:Sxe,done:xxe,page:Exe,submit:wxe,submitting:kxe,success:Oxe,title:gxe},Symbol.toStringTag,{value:"Module"})),Cxe={back:"返回",close:"关闭"},Axe={title:"优化迁移项目",closeAria:"关闭优化窗口"},Txe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},_xe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},jxe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Nxe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},Rxe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},Ixe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},Pxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Dxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Mxe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},Lxe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},$xe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Fxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Bxe={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:"正在读取迁移产物…"},Uxe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Qxe={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}}"},zxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Vxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},Hxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},qxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Wxe={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Kxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Gxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},Xxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Yxe={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:"、"}},Zxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Jxe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},FVe={common:Cxe,optimization:Axe,projects:Txe,framework:_xe,state:jxe,historyStatus:Nxe,task:Rxe,verification:Ixe,transfer:Pxe,validation:Dxe,duration:Mxe,expiry:Lxe,analysis:$xe,activity:Fxe,artifact:Bxe,model:Uxe,upload:Qxe,deployment:zxe,workspace:Vxe,actions:Hxe,capability:qxe,conversation:Wxe,questions:Kxe,pendingInput:Gxe,confirmation:Xxe,evaluation:Yxe,errors:Zxe,stopDialog:Jxe},BVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Hxe,activity:Fxe,analysis:$xe,artifact:Bxe,capability:qxe,common:Cxe,confirmation:Xxe,conversation:Wxe,default:FVe,deployment:zxe,duration:Mxe,errors:Zxe,evaluation:Yxe,expiry:Lxe,framework:_xe,historyStatus:Nxe,model:Uxe,optimization:Axe,pendingInput:Gxe,projects:Txe,questions:Kxe,state:jxe,stopDialog:Jxe,task:Rxe,transfer:Pxe,upload:Qxe,validation:Dxe,verification:Ixe,workspace:Vxe},Symbol.toStringTag,{value:"Module"})),ewe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},twe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},nwe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},iwe={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:"暂不可用"},rwe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。"},swe={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"},awe={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}}秒"}},owe={compactSelect:ewe,featureNotice:twe,workspace:nwe,mode:iwe,agentPicker:rwe,skill:swe,video:awe},UVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:rwe,compactSelect:ewe,default:owe,featureNotice:twe,mode:iwe,skill:swe,video:awe,workspace:nwe},Symbol.toStringTag,{value:"Module"})),lwe="审核中心",cwe="审核资源类型",uwe="仅管理员可以访问审核中心",dwe="搜索申请名称、提交人或版本",fwe="审核状态",hwe="{{count}} 条待审核",pwe="共 {{count}} 条申请",mwe={skill:"技能",agent:"智能体"},gwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},bwe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},ywe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},vwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},xwe={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}}确认通过,等待完成发布"},wwe={failed:"待审核空间暂不可用",retry:"重试"},kwe={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:"云端原始错误"},QVe={title:lwe,category:cwe,adminOnly:uwe,search:dwe,filterStatus:fwe,pendingCount:hwe,total:pwe,kind:mwe,status:gwe,columns:bwe,actions:ywe,empty:vwe,detail:xwe,space:wwe,decision:kwe,score:Owe},zVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ywe,adminOnly:uwe,category:cwe,columns:bwe,decision:kwe,default:QVe,detail:xwe,empty:vwe,filterStatus:fwe,kind:mwe,pendingCount:hwe,score:Owe,search:dwe,space:wwe,status:gwe,title:lwe,total:pwe},Symbol.toStringTag,{value:"Module"})),Swe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Ewe={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:"暂无可恢复的对话"},Awe={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 自动审查流程处理审批请求。"}}},Twe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},_we={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},jwe={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:"可继续追加要求,或随时停止任务…"},Nwe={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:"重新尝试"},Rwe={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:"推理输出"}},Iwe={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"},Pwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Dwe={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:"接力失败"}},Iwe={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 快捷命令"}},Pwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Dwe={common:wwe,tool:Owe,threads:kwe,permissions:Swe,workspace:Ewe,approval:Cwe,composer:Awe,launch:Twe,session:_we,agentDetails:jwe,agentWorkspace:Nwe,handoff:Rwe,commands:Iwe,taskNotice:Pwe},zVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jwe,agentWorkspace:Nwe,approval:Cwe,commands:Iwe,common:wwe,composer:Awe,default:Dwe,handoff:Rwe,launch:Twe,permissions:Swe,session:_we,taskNotice:Pwe,threads:kwe,tool:Owe,workspace:Ewe},Symbol.toStringTag,{value:"Module"})),Mwe={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。保留所有权利。"},Lwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},$we={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Fwe={cancel:"取消",close:"关闭确认框"},VVe={login:Mwe,authExpired:Lwe,navbar:$we,confirm:Fwe},HVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Lwe,confirm:Fwe,default:VVe,login:Mwe,navbar:$we},Symbol.toStringTag,{value:"Module"})),Bwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Uwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Qwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},qVe={account:Bwe,navigation:Uwe,history:Qwe},WVe=Object.freeze(Object.defineProperty({__proto__:null,account:Bwe,default:qVe,history:Qwe,navigation:Uwe},Symbol.toStringTag,{value:"Module"})),zwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Vwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Hwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},qwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Wwe={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}} 个文件"},Kwe={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:"所有方案均创建失败,可分别重试。"},Gwe={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 失败"},Xwe={configSelect:zwe,conversation:Vwe,errorDetails:Hwe,fileTree:qwe,management:Wwe,generation:Kwe,api:Gwe},KVe=Object.freeze(Object.defineProperty({__proto__:null,api:Gwe,configSelect:zwe,conversation:Vwe,default:Xwe,errorDetails:Hwe,fileTree:qwe,generation:Kwe,management:Wwe},Symbol.toStringTag,{value:"Module"})),Ywe={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:"无"},Zwe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Jwe={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 未配置用户池"},e1e={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:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},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:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},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:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",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 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},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:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},t1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",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,不要重复填写镜像仓库路径。"}},n1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},i1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},r1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},s1e={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:"当前没有可选择的自定义环境。"},a1e={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:"日志"},o1e={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"},l1e={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 名称一致。"},c1e={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:"重新尝试"},u1e={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 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",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:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},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}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},d1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",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:"代码项目"},f1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},h1e={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"}},p1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},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:"查看日志"},m1e={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:"已删除"}},g1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},b1e={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}}"},y1e={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:"删除知识失败"}},v1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。"},GVe={common:Ywe,agentKitPromo:Zwe,systemInfo:Jwe,agentWorkspace:e1e,environmentCenter:t1e,deploymentSelect:n1e,deploymentError:i1e,studioBuildProgress:r1e,cloudEnvironment:s1e,githubCicd:a1e,feishuDeployment:o1e,deploymentResources:l1e,studioUpdate:c1e,projectPreview:u1e,workspace:d1e,resourceCollection:f1e,skillSourcePicker:h1e,composer:p1e,agentSelector:m1e,myAgents:g1e,skillCenter:b1e,knowledge:y1e,channels:v1e},XVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Zwe,agentSelector:m1e,agentWorkspace:e1e,channels:v1e,cloudEnvironment:s1e,common:Ywe,composer:p1e,default:GVe,deploymentError:i1e,deploymentResources:l1e,deploymentSelect:n1e,environmentCenter:t1e,feishuDeployment:o1e,githubCicd:a1e,knowledge:y1e,myAgents:g1e,projectPreview:u1e,resourceCollection:f1e,skillCenter:b1e,skillSourcePicker:h1e,studioBuildProgress:r1e,studioUpdate:c1e,systemInfo:Jwe,workspace:d1e},Symbol.toStringTag,{value:"Module"})),x1e="用户管理",w1e="{{count}} 位成员",O1e="用户",k1e="角色",S1e="账号状态",E1e="最近登录",C1e="操作",A1e="更改角色",T1e="关闭",_1e="保存角色",j1e="正在保存…",N1e="取消",R1e="返回",I1e="用户池",P1e="火山引擎 Identity",D1e="搜索姓名、邮箱或用户 ID",M1e="搜索",L1e="筛选角色",$1e="全部角色",F1e="刷新",B1e="正在读取用户…",U1e="更新于 {{time}}",Q1e="已将 {{name}} 设置为{{role}}",z1e="重试",V1e="你",H1e="初始超级管理员",q1e="初始超级管理员受保护,不能在此降级",W1e="保存后,对方刷新 Studio 即可使用新的权限",K1e="角色需要重新确认",G1e="没有匹配的用户",X1e="尝试其他关键词或角色",Y1e="用户登录或加入当前用户池后会显示在这里",Z1e="共 {{count}} 位用户",J1e="上一页",eOe="下一页",tOe="尚未登录",nOe="未提供",iOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},rOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},sOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},aOe={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 页面内修改角色"},YVe={title:x1e,memberCount:w1e,user:O1e,role:k1e,status:S1e,lastLogin:E1e,actions:C1e,changeRole:A1e,close:T1e,save:_1e,saving:j1e,cancel:N1e,back:R1e,pool:I1e,volcengineIdentity:P1e,searchPlaceholder:D1e,search:M1e,filterRole:L1e,allRoles:$1e,refresh:F1e,loading:B1e,updatedAt:U1e,saved:Q1e,retry:z1e,you:V1e,initialAdministrator:H1e,protectedExplanation:q1e,effectiveAfterRefresh:W1e,roleConflict:K1e,noUsers:G1e,tryAnotherSearch:X1e,poolEmpty:Y1e,resultCount:Z1e,previous:J1e,next:eOe,neverLoggedIn:tOe,unknown:nOe,roles:iOe,descriptions:rOe,states:sOe,errors:aOe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,actions:C1e,allRoles:$1e,back:R1e,cancel:N1e,changeRole:A1e,close:T1e,default:YVe,descriptions:rOe,effectiveAfterRefresh:W1e,errors:aOe,filterRole:L1e,initialAdministrator:H1e,lastLogin:E1e,loading:B1e,memberCount:w1e,neverLoggedIn:tOe,next:eOe,noUsers:G1e,pool:I1e,poolEmpty:Y1e,previous:J1e,protectedExplanation:q1e,refresh:F1e,resultCount:Z1e,retry:z1e,role:k1e,roleConflict:K1e,roles:iOe,save:_1e,saved:Q1e,saving:j1e,search:M1e,searchPlaceholder:D1e,states:sOe,status:S1e,title:x1e,tryAnotherSearch:X1e,unknown:nOe,updatedAt:U1e,user:O1e,volcengineIdentity:P1e,you:V1e},Symbol.toStringTag,{value:"Module"})),oOe="网站集成",lOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",cOe="返回自动化列表",uOe="添加网站",dOe="正在加载 Runtime",fOe="选择 Runtime",hOe="网站域名",pOe="例如 xxxx.com 或 localhost:5173",mOe="正在生成",gOe="生成 Token",bOe="已添加网站",yOe="{{count}} 个",vOe="{{count}} 个",xOe="正在加载网站集成",wOe="还没有网站集成",OOe="选择 Runtime 并输入网站域名即可生成 Token",kOe="引入方法",SOe="将下面代码放到网页的 body 结束标签前",EOe="已复制",COe="复制代码",AOe="添加网站后会在这里生成引入代码。",TOe="确定删除 {{domain}} 的网站集成吗?",_Oe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},jOe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},JVe={title:oOe,description:lOe,backToAutomations:cOe,addWebsite:uOe,loadingRuntime:dOe,selectRuntime:fOe,websiteDomain:hOe,domainPlaceholder:pOe,generating:mOe,generateToken:gOe,addedWebsites:bOe,websiteCount_one:yOe,websiteCount_other:vOe,loadingIntegrations:xOe,delete:"删除",emptyTitle:wOe,emptyDescription:OOe,embedMethod:kOe,embedInstructions:SOe,copied:EOe,copyCode:COe,embedHint:AOe,confirmDelete:TOe,errors:_Oe,widget:jOe},eHe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:uOe,addedWebsites:bOe,backToAutomations:cOe,confirmDelete:TOe,copied:EOe,copyCode:COe,default:JVe,description:lOe,domainPlaceholder:pOe,embedHint:AOe,embedInstructions:SOe,embedMethod:kOe,emptyDescription:OOe,emptyTitle:wOe,errors:_Oe,generateToken:gOe,generating:mOe,loadingIntegrations:xOe,loadingRuntime:dOe,selectRuntime:fOe,title:oOe,websiteCount_one:yOe,websiteCount_other:vOe,websiteDomain:hOe,widget:jOe},Symbol.toStringTag,{value:"Module"})),NOe={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:"下载产物失败"}},ROe={unknownSource:"未知来源",unknownCreator:"未知创建者"},IOe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},POe={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:"查看和编辑项目源码"},DOe={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}}"},MOe={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}}界面预览"}},LOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},$Oe={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}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},FOe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},BOe={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 环境。"},UOe={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 终端"},QOe={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:"添加"},zOe={artifactLibrary:NOe,resourceMetadata:ROe,artifactEdit:IOe,codeBrowser:POe,search:DOe,developerResources:MOe,library:LOe,manageAgents:$Oe,agentTopology:FOe,sessionEnvironment:BOe,agentKitCli:UOe,studioTools:QOe},tHe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:UOe,agentTopology:FOe,artifactEdit:IOe,artifactLibrary:NOe,codeBrowser:POe,default:zOe,developerResources:MOe,library:LOe,manageAgents:$Oe,resourceMetadata:ROe,search:DOe,sessionEnvironment:BOe,studioTools:QOe},Symbol.toStringTag,{value:"Module"})),NU=["zh-CN","en-US"],vA="en-US",VOe="agentkit.studio.locale",nHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function xA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=NU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function So(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 iHe(){if(typeof window>"u")return null;try{return xA(window.localStorage.getItem(VOe))}catch{return null}}function rHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function sHe(){const e=iHe();if(e)return e;for(const t of rHe()){const n=xA(t);if(n)return n}return vA}function aHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(VOe,e)}catch{}}function HOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=nHe[e].dir)}const Zn=e=>typeof e=="string",ZO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},k5=e=>e==null?"":String(e),oHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},lHe=/###/g,MG=e=>e&&e.includes("###")?e.replace(lHe,"."):e,LG=e=>!e||Zn(e),RS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=RS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=RS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=RS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},cHe=(e,t,n,i)=>{const{obj:r,k:s}=RS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},cR=(e,t)=>{const{obj:n,k:i}=RS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},uHe=(e,t,n)=>{const i=cR(e,n);return i!==void 0?i:cR(t,n)},qOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):qOe(e[i],t[i],n):e[i]=t[i]);return e},Wh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),dHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},fHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>dHe[t]):e;class hHe{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 pHe=[" ",",","?","!",";"],mHe=new hHe(20),gHe=(e,t,n)=>{t=t||"",n=n||"";const i=pHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=mHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},fF=(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,"-"),bHe={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 uR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||bHe,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=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new uR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new uR(this.logger,t)}}var rh=new uR;let YP=class{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 o=0;o{for(let o=0;o-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,o=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):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=cR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:fF((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 o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),$G(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)(Zn(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,o={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=cR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?qOe(c,i,s):c={...c,...i},$G(this.data,l,c),o.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 WOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const KOe=Symbol("i18next/PATH_KEY");function yHe(){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===KOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Qy(e,t){const{[KOe]:n}=e(yHe()),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 o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o: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 S5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class dR extends YP{constructor(t,n={}){super(),oHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=rh.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=S5(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 o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!gHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(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:Zn(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=Qy(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Qy(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=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&&!Zn(r.count),k=dR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",E=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",C=O&&!r.ordinal&&r.count===0,j=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${E}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=S5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){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,T,{...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(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;k&&!g?P[D]=this.translate(_,{...r,defaultValue:S5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){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 F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let H=0;H{var z;const Z=k&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,q,Z,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(H,u,q,Z,_,r),this.emit("missingKey",H,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(H=>{const q=this.pluralResolver.getSuffixes(H,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([H],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||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=Zn(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&&!Zn(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 o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=WOe.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,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Qy(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&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(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 S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let E;h&&(E=this.pluralResolver.getSuffix(x,n.count,n));const C=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&E.startsWith(j)&&O.push(d+E.replace(j,this.options.pluralSeparator)),O.push(d+E),m&&O.push(d+C)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&E.startsWith(j)&&O.push(T+E.replace(j,this.options.pluralSeparator)),O.push(T+E),m&&O.push(T+C))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,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&&!Zn(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 BG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=LE(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=LE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(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(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.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)),Zn(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||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;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 Zn(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))):Zn(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 UG={zero:0,one:1,two:2,few:3,many:4,other:5},QG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class vHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=rh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=LE(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 o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),QG;if(!t.match(/-|_/))return QG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}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)=>UG[r]-UG[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 zG=(e,t,n,i=".",r=!0)=>{let s=uHe(e,t,n);return!s&&r&&Zn(n)&&(s=fF(e,n,i),s===void 0&&(s=fF(t,n,i))),s},VG=e=>e.replace(/\$/g,"$$$$");class HG{constructor(t={}){var n;this.logger=rh.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:o,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:fHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Wh(s):o||"{{",this.suffix=l?Wh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Wh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Wh(d):"",this.nestingPrefix=h?Wh(h):m||Wh("$t("),this.nestingSuffix=g?Wh(g):b||Wh(")"),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,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=zG(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(zG(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(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=k5(o));const v=g.safeValue(o);if(t=t.replace(s[0],VG(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,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Wh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);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{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.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(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=k5(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],VG(k5(s))),this.regexp.lastIndex=0}return t}}const xHe=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(o=>{if(o){const[l,...c]=o.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}},qG=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 o=i+JSON.stringify(s);let l=t[o];return l||(l=e(LE(i),r),t[o]=l),l(n)}},wHe=e=>(t,n,i)=>e(LE(n),i)(t);class OHe{constructor(t={}){this.logger=rh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?qG:wHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=qG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=xHe(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 kHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class SHe extends YP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=rh.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=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},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?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[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(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,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=>{cHe(c.loaded,[s],o),kHe(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,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});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,o)},s);return}o(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();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},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={...o,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 E5=()=>({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]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(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}),WG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),T2=()=>{},EHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class IS extends YP{constructor(t={},n){if(super(),this.options=WG(t),this.services={},this.logger=rh,this.modules={external:[]},EHe(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&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=E5();this.options={...i,...this.options,...WG(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?rh.init(r(this.modules.logger),this.options):rh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=OHe;const d=new BG(this.options);this.store=new FG(this.options.resources,this.options);const f=this.services;f.logger=rh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new vHe(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 HG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new SHe(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 dR(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=T2),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=ZO(),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=T2){var s,o;let i=n;const r=Zn(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)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.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=ZO();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=T2),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"&&WOe.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))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(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?o(this.services.languageDetector.detect()):!t&&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(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Qy(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Qy(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Qy(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}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 o=(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,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=ZO();return this.options.ns?(Zn(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=ZO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),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 o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.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 BG(E5());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 IS(t,n);return i.createInstance=IS.createInstance,i}cloneInstance(t={},n=T2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new IS(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 FG(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...E5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new HG(u)}return s.translator=new dR(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 lc=IS.createInstance();lc.createInstance;lc.dir;lc.init;lc.loadResources;lc.reloadResources;lc.use;lc.changeLanguage;lc.getFixedT;lc.t;lc.exists;lc.setDefaultNamespace;lc.hasLoadedNamespace;lc.loadNamespaces;lc.loadLanguages;var GOe={exports:{}},Oi={};/** +安装命令:{{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:"接力失败"}},Mwe={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 快捷命令"}},Lwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},$we={common:Swe,tool:Ewe,threads:Cwe,permissions:Awe,workspace:Twe,approval:_we,composer:jwe,launch:Nwe,session:Rwe,agentDetails:Iwe,agentWorkspace:Pwe,handoff:Dwe,commands:Mwe,taskNotice:Lwe},VVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Iwe,agentWorkspace:Pwe,approval:_we,commands:Mwe,common:Swe,composer:jwe,default:$we,handoff:Dwe,launch:Nwe,permissions:Awe,session:Rwe,taskNotice:Lwe,threads:Cwe,tool:Ewe,workspace:Twe},Symbol.toStringTag,{value:"Module"})),Fwe={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。保留所有权利。"},Bwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Uwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Qwe={cancel:"取消",close:"关闭确认框"},HVe={login:Fwe,authExpired:Bwe,navbar:Uwe,confirm:Qwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Bwe,confirm:Qwe,default:HVe,login:Fwe,navbar:Uwe},Symbol.toStringTag,{value:"Module"})),zwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Vwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Hwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},WVe={account:zwe,navigation:Vwe,history:Hwe},KVe=Object.freeze(Object.defineProperty({__proto__:null,account:zwe,default:WVe,history:Hwe,navigation:Vwe},Symbol.toStringTag,{value:"Module"})),qwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Wwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Kwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Gwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Xwe={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}} 个文件"},Ywe={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:"所有方案均创建失败,可分别重试。"},Zwe={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 失败"},Jwe={configSelect:qwe,conversation:Wwe,errorDetails:Kwe,fileTree:Gwe,management:Xwe,generation:Ywe,api:Zwe},GVe=Object.freeze(Object.defineProperty({__proto__:null,api:Zwe,configSelect:qwe,conversation:Wwe,default:Jwe,errorDetails:Kwe,fileTree:Gwe,generation:Ywe,management:Xwe},Symbol.toStringTag,{value:"Module"})),e1e={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:"无"},t1e={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},n1e={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 未配置用户池"},i1e={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:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},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:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},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:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",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 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},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:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},r1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",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,不要重复填写镜像仓库路径。"}},s1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},a1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},o1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},l1e={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:"当前没有可选择的自定义环境。"},c1e={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:"日志"},u1e={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"},d1e={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 名称一致。"},f1e={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:"重新尝试"},h1e={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 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",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:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},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}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},p1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",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:"代码项目"},m1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},g1e={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"}},b1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},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:"查看日志"},y1e={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:"已删除"}},v1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},x1e={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}}"},w1e={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:"删除知识失败"}},k1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},XVe={common:e1e,agentKitPromo:t1e,systemInfo:n1e,agentWorkspace:i1e,environmentCenter:r1e,deploymentSelect:s1e,deploymentError:a1e,studioBuildProgress:o1e,cloudEnvironment:l1e,githubCicd:c1e,feishuDeployment:u1e,deploymentResources:d1e,studioUpdate:f1e,projectPreview:h1e,workspace:p1e,resourceCollection:m1e,skillSourcePicker:g1e,composer:b1e,agentSelector:y1e,myAgents:v1e,skillCenter:x1e,knowledge:w1e,channels:k1e},YVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:t1e,agentSelector:y1e,agentWorkspace:i1e,channels:k1e,cloudEnvironment:l1e,common:e1e,composer:b1e,default:XVe,deploymentError:a1e,deploymentResources:d1e,deploymentSelect:s1e,environmentCenter:r1e,feishuDeployment:u1e,githubCicd:c1e,knowledge:w1e,myAgents:v1e,projectPreview:h1e,resourceCollection:m1e,skillCenter:x1e,skillSourcePicker:g1e,studioBuildProgress:o1e,studioUpdate:f1e,systemInfo:n1e,workspace:p1e},Symbol.toStringTag,{value:"Module"})),O1e="用户管理",S1e="{{count}} 位成员",E1e="用户",C1e="角色",A1e="账号状态",T1e="最近登录",_1e="操作",j1e="更改角色",N1e="关闭",R1e="保存角色",I1e="正在保存…",P1e="取消",D1e="返回",M1e="用户池",L1e="火山引擎 Identity",$1e="搜索姓名、邮箱或用户 ID",F1e="搜索",B1e="筛选角色",U1e="全部角色",Q1e="刷新",z1e="正在读取用户…",V1e="更新于 {{time}}",H1e="已将 {{name}} 设置为{{role}}",q1e="重试",W1e="你",K1e="初始超级管理员",G1e="初始超级管理员受保护,不能在此降级",X1e="保存后,对方刷新 Studio 即可使用新的权限",Y1e="角色需要重新确认",Z1e="没有匹配的用户",J1e="尝试其他关键词或角色",eke="用户登录或加入当前用户池后会显示在这里",tke="共 {{count}} 位用户",nke="上一页",ike="下一页",rke="尚未登录",ske="未提供",ake={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},oke={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},lke={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},cke={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 页面内修改角色"},ZVe={title:O1e,memberCount:S1e,user:E1e,role:C1e,status:A1e,lastLogin:T1e,actions:_1e,changeRole:j1e,close:N1e,save:R1e,saving:I1e,cancel:P1e,back:D1e,pool:M1e,volcengineIdentity:L1e,searchPlaceholder:$1e,search:F1e,filterRole:B1e,allRoles:U1e,refresh:Q1e,loading:z1e,updatedAt:V1e,saved:H1e,retry:q1e,you:W1e,initialAdministrator:K1e,protectedExplanation:G1e,effectiveAfterRefresh:X1e,roleConflict:Y1e,noUsers:Z1e,tryAnotherSearch:J1e,poolEmpty:eke,resultCount:tke,previous:nke,next:ike,neverLoggedIn:rke,unknown:ske,roles:ake,descriptions:oke,states:lke,errors:cke},JVe=Object.freeze(Object.defineProperty({__proto__:null,actions:_1e,allRoles:U1e,back:D1e,cancel:P1e,changeRole:j1e,close:N1e,default:ZVe,descriptions:oke,effectiveAfterRefresh:X1e,errors:cke,filterRole:B1e,initialAdministrator:K1e,lastLogin:T1e,loading:z1e,memberCount:S1e,neverLoggedIn:rke,next:ike,noUsers:Z1e,pool:M1e,poolEmpty:eke,previous:nke,protectedExplanation:G1e,refresh:Q1e,resultCount:tke,retry:q1e,role:C1e,roleConflict:Y1e,roles:ake,save:R1e,saved:H1e,saving:I1e,search:F1e,searchPlaceholder:$1e,states:lke,status:A1e,title:O1e,tryAnotherSearch:J1e,unknown:ske,updatedAt:V1e,user:E1e,volcengineIdentity:L1e,you:W1e},Symbol.toStringTag,{value:"Module"})),uke="网站集成",dke="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",fke="返回自动化列表",hke="添加网站",pke="正在加载 Runtime",mke="选择 Runtime",gke="网站域名",bke="例如 xxxx.com 或 localhost:5173",yke="正在生成",vke="生成 Token",xke="已添加网站",wke="{{count}} 个",kke="{{count}} 个",Oke="正在加载网站集成",Ske="还没有网站集成",Eke="选择 Runtime 并输入网站域名即可生成 Token",Cke="引入方法",Ake="将下面代码放到网页的 body 结束标签前",Tke="已复制",_ke="复制代码",jke="添加网站后会在这里生成引入代码。",Nke="确定删除 {{domain}} 的网站集成吗?",Rke={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Ike={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},eHe={title:uke,description:dke,backToAutomations:fke,addWebsite:hke,loadingRuntime:pke,selectRuntime:mke,websiteDomain:gke,domainPlaceholder:bke,generating:yke,generateToken:vke,addedWebsites:xke,websiteCount_one:wke,websiteCount_other:kke,loadingIntegrations:Oke,delete:"删除",emptyTitle:Ske,emptyDescription:Eke,embedMethod:Cke,embedInstructions:Ake,copied:Tke,copyCode:_ke,embedHint:jke,confirmDelete:Nke,errors:Rke,widget:Ike},tHe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:hke,addedWebsites:xke,backToAutomations:fke,confirmDelete:Nke,copied:Tke,copyCode:_ke,default:eHe,description:dke,domainPlaceholder:bke,embedHint:jke,embedInstructions:Ake,embedMethod:Cke,emptyDescription:Eke,emptyTitle:Ske,errors:Rke,generateToken:vke,generating:yke,loadingIntegrations:Oke,loadingRuntime:pke,selectRuntime:mke,title:uke,websiteCount_one:wke,websiteCount_other:kke,websiteDomain:gke,widget:Ike},Symbol.toStringTag,{value:"Module"})),Pke={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:"下载产物失败"}},Dke={unknownSource:"未知来源",unknownCreator:"未知创建者"},Mke={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Lke={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:"查看和编辑项目源码"},$ke={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}}"},Fke={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}}界面预览"}},Bke={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},Uke={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}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},Qke={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},zke={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 环境。"},Vke={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 终端"},Hke={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:"添加"},qke={artifactLibrary:Pke,resourceMetadata:Dke,artifactEdit:Mke,codeBrowser:Lke,search:$ke,developerResources:Fke,library:Bke,manageAgents:Uke,agentTopology:Qke,sessionEnvironment:zke,agentKitCli:Vke,studioTools:Hke},nHe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Vke,agentTopology:Qke,artifactEdit:Mke,artifactLibrary:Pke,codeBrowser:Lke,default:qke,developerResources:Fke,library:Bke,manageAgents:Uke,resourceMetadata:Dke,search:$ke,sessionEnvironment:zke,studioTools:Hke},Symbol.toStringTag,{value:"Module"})),NU=["zh-CN","en-US"],kA="en-US",Wke="agentkit.studio.locale",iHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function OA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=NU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function _o(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 rHe(){if(typeof window>"u")return null;try{return OA(window.localStorage.getItem(Wke))}catch{return null}}function sHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function aHe(){const e=rHe();if(e)return e;for(const t of sHe()){const n=OA(t);if(n)return n}return kA}function oHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Wke,e)}catch{}}function Kke(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=iHe[e].dir)}const ei=e=>typeof e=="string",eO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},k5=e=>e==null?"":String(e),lHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},cHe=/###/g,FG=e=>e&&e.includes("###")?e.replace(cHe,"."):e,BG=e=>!e||ei(e),PS=(e,t,n)=>{const i=ei(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=PS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=PS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=PS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},uHe=(e,t,n,i)=>{const{obj:r,k:s}=PS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},lR=(e,t)=>{const{obj:n,k:i}=PS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},dHe=(e,t,n)=>{const i=lR(e,n);return i!==void 0?i:lR(t,n)},Gke=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?ei(e[i])||e[i]instanceof String||ei(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Gke(e[i],t[i],n):e[i]=t[i]);return e},Xh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),fHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},hHe=e=>ei(e)?e.replace(/[&<>"'\/]/g,t=>fHe[t]):e;class pHe{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 mHe=[" ",",","?","!",";"],gHe=new pHe(20),bHe=(e,t,n)=>{t=t||"",n=n||"";const i=mHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=gHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(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,"-"),yHe={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 cR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||yHe,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=>ei(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),ei(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cR(this.logger,t)}}var sh=new cR;let GP=class{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 o=0;o{for(let o=0;o-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,o=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):ei(i)&&s?l.push(...i.split(s)):l.push(i)));const c=lR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!ei(i)?c:dF((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 o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),UG(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)(ei(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,o={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=lR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Gke(c,i,s):c={...c,...i},UG(this.data,l,c),o.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 Xke={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const Yke=Symbol("i18next/PATH_KEY");function vHe(){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===Yke?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ly(e,t){const{[Yke]:n}=e(vHe()),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 o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o: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 O5=e=>!ei(e)&&typeof e!="boolean"&&typeof e!="number";class uR extends GP{constructor(t,n={}){super(),lHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sh.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=O5(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 o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:ei(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:ei(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=Ly(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Ly(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=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,k=r.count!==void 0&&!ei(r.count),S=uR.hasDefaultValue(r),O=k?this.pluralResolver.getSuffix(f,r.count,r):"",A=r.ordinal&&k?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=k&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${O}`]||r[`defaultValue${A}`]||r.defaultValue;let T=g;x&&!g&&S&&(T=j);const R=O5(T),C=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(C)&&!(ei(w)&&Array.isArray(T))){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,T,{...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(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;S&&!g?P[D]=this.translate(_,{...r,defaultValue:O5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&ei(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&S&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=S&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,k&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){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 F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let H=0;H{var z;const Z=S&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,q,Z,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(H,u,q,Z,_,r),this.emit("missingKey",H,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?L.forEach(H=>{const q=this.pluralResolver.getSuffixes(H,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([H],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||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=ei(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&&!ei(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 o=i.postProcess||this.options.postProcess,l=ei(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Xke.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,o,l;return ei(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Ly(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&&!ei(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(ei(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 O;if(this.isValidLookup(i))return;o=x;const k=[d];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(k,d,x,v,n);else{let A;h&&(A=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&A.startsWith(j)&&k.push(d+A.replace(j,this.options.pluralSeparator)),k.push(d+A),m&&k.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),h&&(n.ordinal&&A.startsWith(j)&&k.push(T+A.replace(j,this.options.pluralSeparator)),k.push(T+A),m&&k.push(T+E))}}let S;for(;S=k.pop();)this.isValidLookup(i)||(s=S,i=this.getResource(x,v,S,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,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&&!ei(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 zG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=FE(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=FE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ei(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(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.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)),ei(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||ei(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=ei(t)&&s&&!o;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 ei(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))):ei(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 VG={zero:0,one:1,two:2,few:3,many:4,other:5},HG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=sh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=FE(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 o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),HG;if(!t.match(/-|_/))return HG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}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)=>VG[r]-VG[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 qG=(e,t,n,i=".",r=!0)=>{let s=dHe(e,t,n);return!s&&r&&ei(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},WG=e=>e.replace(/\$/g,"$$$$");class KG{constructor(t={}){var n;this.logger=sh.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:o,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:hHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Xh(s):o||"{{",this.suffix=l?Xh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Xh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Xh(d):"",this.nestingPrefix=h?Xh(h):m||Xh("$t("),this.nestingSuffix=g?Xh(g):b||Xh(")"),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,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=qG(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(qG(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(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=ei(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!ei(o)&&!this.useRawValueToEscape&&(o=k5(o));const v=g.safeValue(o);if(t=t.replace(s[0],WG(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,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Xh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);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{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!ei(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.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(),o),o),s&&r[0]===t&&!ei(s))return s;ei(s)||(s=k5(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],WG(k5(s))),this.regexp.lastIndex=0}return t}}const wHe=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(o=>{if(o){const[l,...c]=o.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}},GG=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 o=i+JSON.stringify(s);let l=t[o];return l||(l=e(FE(i),r),t[o]=l),l(n)}},kHe=e=>(t,n,i)=>e(FE(n),i)(t);class OHe{constructor(t={}){this.logger=sh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?GG:kHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=GG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=wHe(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 SHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class EHe extends GP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=sh.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=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},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?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[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(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,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=>{uHe(c.loaded,[s],o),SHe(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,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});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,o)},s);return}o(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();ei(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ei(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},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={...o,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 S5=()=>({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]),ei(e[1])&&(t.defaultValue=e[1]),ei(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}),XG=e=>(ei(e.ns)&&(e.ns=[e.ns]),ei(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ei(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),A2=()=>{},CHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class DS extends GP{constructor(t={},n){if(super(),this.options=XG(t),this.services={},this.logger=sh,this.modules={external:[]},CHe(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&&(ei(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...XG(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?sh.init(r(this.modules.logger),this.options):sh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=OHe;const d=new zG(this.options);this.store=new QG(this.options.resources,this.options);const f=this.services;f.logger=sh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xHe(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 KG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new EHe(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 uR(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=A2),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=eO(),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=A2){var s,o;let i=n;const r=ei(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)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.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=eO();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=A2),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"&&Xke.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))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=ei(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(ei(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?o(this.services.languageDetector.detect()):!t&&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(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Ly(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Ly(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Ly(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return ei(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}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 o=(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,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=eO();return this.options.ns?(ei(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=eO();ei(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),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 o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.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 zG(S5());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 DS(t,n);return i.createInstance=DS.createInstance,i}cloneInstance(t={},n=A2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new DS(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 QG(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new KG(u)}return s.translator=new uR(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 sc=DS.createInstance();sc.createInstance;sc.dir;sc.init;sc.loadResources;sc.reloadResources;sc.use;sc.changeLanguage;sc.getFixedT;sc.t;sc.exists;sc.setDefaultNamespace;sc.hasLoadedNamespace;sc.loadNamespaces;sc.loadLanguages;var Zke={exports:{}},Si={};/** * @license React * react.production.js * @@ -61,7 +61,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 RU=Symbol.for("react.transitional.element"),CHe=Symbol.for("react.portal"),AHe=Symbol.for("react.fragment"),THe=Symbol.for("react.strict_mode"),_He=Symbol.for("react.profiler"),jHe=Symbol.for("react.consumer"),NHe=Symbol.for("react.context"),RHe=Symbol.for("react.forward_ref"),IHe=Symbol.for("react.suspense"),PHe=Symbol.for("react.memo"),XOe=Symbol.for("react.lazy"),DHe=Symbol.for("react.activity"),KG=Symbol.iterator;function MHe(e){return e===null||typeof e!="object"?null:(e=KG&&e[KG]||e["@@iterator"],typeof e=="function"?e:null)}var YOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZOe=Object.assign,JOe={};function j1(e,t,n){this.props=e,this.context=t,this.refs=JOe,this.updater=n||YOe}j1.prototype.isReactComponent={};j1.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")};j1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eke(){}eke.prototype=j1.prototype;function IU(e,t,n){this.props=e,this.context=t,this.refs=JOe,this.updater=n||YOe}var PU=IU.prototype=new eke;PU.constructor=IU;ZOe(PU,j1.prototype);PU.isPureReactComponent=!0;var GG=Array.isArray;function hF(){}var Rs={H:null,A:null,T:null,S:null},tke=Object.prototype.hasOwnProperty;function DU(e,t,n){var i=n.ref;return{$$typeof:RU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function LHe(e,t){return DU(e.type,t,e.props)}function MU(e){return typeof e=="object"&&e!==null&&e.$$typeof===RU}function $He(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var XG=/\/+/g;function C5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$He(""+e.key):t.toString(36)}function FHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(hF,hF):(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 tx(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case RU:case CHe:o=!0;break;case XOe:return o=e._init,tx(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+C5(e,0):i,GG(r)?(n="",o!=null&&(n=o.replace(XG,"$&/")+"/"),tx(r,t,n,"",function(u){return u})):r!=null&&(MU(r)&&(r=LHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(XG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(GG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function ZG(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(QHe[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(zHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const j2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,VHe=/<\/?([^\s]+?)[/\s>]/,HHe=/^\s*$/,qHe=/^(script|style)$/i,Jk="\0",WHe=Object.create(null);function nke(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Jk).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Jk).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(Jk)>-1&&(t.attrs[n]=i.split(Jk).join("<"))}t.children.length&&nke(t.children)})}function KHe(e,t){const n=t&&t.components||WHe,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;j2.lastIndex=0;let y;for(;y=j2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(VHe);w.startsWith("",e}}function XHe(e){return e.reduce(function(t,n){return t+ike("",n)},"")}var YHe={parse:KHe,stringify:XHe};const Uj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Bc(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)},JG={},Kx=(e,t,n,i)=>{Bc(n)&&JG[n]||(Bc(n)&&(JG[n]=new Date),Uj(e,t,n,i))},rke=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},pF=(e,t,n)=>{e.loadNamespaces(t,rke(e,n))},eX=(e,t,n,i)=>{if(Bc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return pF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,rke(e,i))},ZHe=(e,t,n={})=>!t.languages||!t.languages.length?(Kx(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}}),Bc=e=>typeof e=="string",Op=e=>typeof e=="object"&&e!==null,JHe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eqe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tqe=e=>eqe[e],ske=e=>e.replace(JHe,tqe);let mF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ske,transDefaultProps:void 0};const nqe=(e={})=>{mF={...mF,...e}},LU=()=>mF;let ake;const iqe=e=>{ake=e},$U=()=>ake,Qj=(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},eS=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?tg(t):t},rqe=e=>Array.isArray(e)&&e.every(p.isValidElement),tg=e=>Array.isArray(e)?e:[e],sqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},aqe=e=>{const t={};if(!e)return t;const n=i=>{tg(i).forEach(s=>{Bc(s)||(Qj(s)?n(eS(s)):Op(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},gF=(e,t,n,i)=>{if(!e)return"";let r="";const s=tg(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Bc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.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=Bc(m)?m:gF(m,t,n,i);r+=`<${d}>${b}`;return}const g=gF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Uj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Op(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}Uj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Uj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},oqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{tg(x).forEach(k=>{Bc(k)||(Qj(k)?d(eS(k)):Op(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=YHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,k)=>{var C;const S=eS(x),E=y(S,O.children,k);return rqe(S)&&E.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:E},v=(x,O,k,S,E)=>{x.dummy?(x.children=O,k.push(p.cloneElement(x,{key:S},E?void 0:O))):k.push(...p.Children.map([x],C=>{var T;if(C.type===p.Fragment||((T=C.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:S};return C&&C.props&&Object.keys(C.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(R[A]=C.props[A])}),p.createElement(C.type,R,E?null:O)}const j={key:S};return C&&C.props&&Object.keys(C.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=C.props[R])}),p.cloneElement(C,j,E?null:O)}))},y=(x,O,k)=>{const S=tg(x),E=tg(O),C={};return E.reduce((j,T,R)=>{var N,P;const A=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=S[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),k.length===1&&!I&&(I=k[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Bc(U)&&(D[q]=ske(U))});const _=Object.keys(D).length!==0?sqe({props:D},I):I,L=p.isValidElement(_),F=L&&Qj(T,!0)&&!T.voidElement,M=c&&Op(_)&&_.dummy&&!L,H=Op(t)&&Object.hasOwnProperty.call(t,T.name);if(Bc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Qj(_)||F){const q=b(_,T,k);v(_,q,j,R)}else if(M){const q=y(S,T.children,k);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(H){const q=b(_,T,k);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=C[T.name]||0;C[T.name]=q+1;let U,Z=0;for(let ne=0;ne`);else{const q=y(S,T.children,k);j.push(`<${T.name}>${q}`)}else if(Op(_)&&!L){const q=T.children[0]?A:null;q&&j.push(q)}else v(_,A,j,R,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:LU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,tg(e||[]));return eS(w[0])},oke=(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})},lqe=(e,t)=>e.map((n,i)=>oke(n,i,t)),cqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:oke(e[i],i,t)})}),n},uqe=(e,t,n,i)=>e?Array.isArray(e)?lqe(e,t):Op(e)?cqe(e,t):(Kx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,dqe=e=>!Op(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function fqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,H,q,U,Z,z;const g=d||$U();if(!g)return Kx(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)||(J=>J),v={...LU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=Bc(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),k=w!=null&&w.values?{...w.values,...o}:o,S=w!=null&&w.components?{...w.components,...c}:c,E=gF(e,v,g,i),C=l||(x==null?void 0:x.defaultValue)||E||v.transEmptyNodeValue||(typeof i=="function"?Qy(i):i),{hashTransKey:j}=v,T=i||(j?j(E||C):E||C);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=k;const R=aqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const A=o||t!==void 0&&!((z=(Z=g.options)==null?void 0:Z.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...A,defaultValue:C,ns:y};let P=T?b(T,N):C;P===T&&C&&(P=C);const I=uqe(S,P,g,i);let D=I||e,_=null;dqe(I)&&(_=I,D=e);const L=oqe(D,_,P,g,v,N,O),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const hqe={type:"3rdParty",init(e){nqe(e.options.react),iqe(e)}},lke=p.createContext();class pqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Rw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(lke)||{},v=d||g||$U(),y=f||(v==null?void 0:v.t.bind(v));return fqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,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 cke={exports:{}},uke={};/** + */var RU=Symbol.for("react.transitional.element"),AHe=Symbol.for("react.portal"),THe=Symbol.for("react.fragment"),_He=Symbol.for("react.strict_mode"),jHe=Symbol.for("react.profiler"),NHe=Symbol.for("react.consumer"),RHe=Symbol.for("react.context"),IHe=Symbol.for("react.forward_ref"),PHe=Symbol.for("react.suspense"),DHe=Symbol.for("react.memo"),Jke=Symbol.for("react.lazy"),MHe=Symbol.for("react.activity"),YG=Symbol.iterator;function LHe(e){return e===null||typeof e!="object"?null:(e=YG&&e[YG]||e["@@iterator"],typeof e=="function"?e:null)}var eOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tOe=Object.assign,nOe={};function R1(e,t,n){this.props=e,this.context=t,this.refs=nOe,this.updater=n||eOe}R1.prototype.isReactComponent={};R1.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")};R1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function iOe(){}iOe.prototype=R1.prototype;function IU(e,t,n){this.props=e,this.context=t,this.refs=nOe,this.updater=n||eOe}var PU=IU.prototype=new iOe;PU.constructor=IU;tOe(PU,R1.prototype);PU.isPureReactComponent=!0;var ZG=Array.isArray;function fF(){}var Is={H:null,A:null,T:null,S:null},rOe=Object.prototype.hasOwnProperty;function DU(e,t,n){var i=n.ref;return{$$typeof:RU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function $He(e,t){return DU(e.type,t,e.props)}function MU(e){return typeof e=="object"&&e!==null&&e.$$typeof===RU}function FHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var JG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FHe(""+e.key):t.toString(36)}function BHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(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 nx(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case RU:case AHe:o=!0;break;case Jke:return o=e._init,nx(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,ZG(r)?(n="",o!=null&&(n=o.replace(JG,"$&/")+"/"),nx(r,t,n,"",function(u){return u})):r!=null&&(MU(r)&&(r=$He(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(JG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(ZG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function tX(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(zHe[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(VHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,HHe=/<\/?([^\s]+?)[/\s>]/,qHe=/^\s*$/,WHe=/^(script|style)$/i,tS="\0",KHe=Object.create(null);function sOe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(tS).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(tS).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(tS)>-1&&(t.attrs[n]=i.split(tS).join("<"))}t.children.length&&sOe(t.children)})}function GHe(e,t){const n=t&&t.components||KHe,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;_2.lastIndex=0;let y;for(;y=_2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(HHe);w.startsWith("",e}}function YHe(e){return e.reduce(function(t,n){return t+aOe("",n)},"")}var ZHe={parse:GHe,stringify:YHe};const Bj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Mc(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)},nX={},Gx=(e,t,n,i)=>{Mc(n)&&nX[n]||(Mc(n)&&(nX[n]=new Date),Bj(e,t,n,i))},oOe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,oOe(e,n))},iX=(e,t,n,i)=>{if(Mc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,oOe(e,i))},JHe=(e,t,n={})=>!t.languages||!t.languages.length?(Gx(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}}),Mc=e=>typeof e=="string",Op=e=>typeof e=="object"&&e!==null,eqe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,tqe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},nqe=e=>tqe[e],lOe=e=>e.replace(eqe,nqe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:lOe,transDefaultProps:void 0};const iqe=(e={})=>{pF={...pF,...e}},LU=()=>pF;let cOe;const rqe=e=>{cOe=e},$U=()=>cOe,Uj=(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},nS=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?Jm(t):t},sqe=e=>Array.isArray(e)&&e.every(p.isValidElement),Jm=e=>Array.isArray(e)?e:[e],aqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},oqe=e=>{const t={};if(!e)return t;const n=i=>{Jm(i).forEach(s=>{Mc(s)||(Uj(s)?n(nS(s)):Op(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=Jm(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Mc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.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=Mc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Bj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Op(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}Bj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Bj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},lqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{Jm(x).forEach(S=>{Mc(S)||(Uj(S)?d(nS(S)):Op(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=ZHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,k,S)=>{var E;const O=nS(x),A=y(O,k.children,S);return sqe(O)&&A.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?O:A},v=(x,k,S,O,A)=>{x.dummy?(x.children=k,S.push(p.cloneElement(x,{key:O},A?void 0:k))):S.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:O};return E&&E.props&&Object.keys(E.props).forEach(C=>{C==="children"||C==="i18nIsDynamicList"||(R[C]=E.props[C])}),p.createElement(E.type,R,A?null:k)}const j={key:O};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,A?null:k)}))},y=(x,k,S)=>{const O=Jm(x),A=Jm(k),E={};return A.reduce((j,T,R)=>{var N,P;const C=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=O[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),S.length===1&&!I&&(I=S[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Mc(U)&&(D[q]=lOe(U))});const _=Object.keys(D).length!==0?aqe({props:D},I):I,L=p.isValidElement(_),F=L&&Uj(T,!0)&&!T.voidElement,M=c&&Op(_)&&_.dummy&&!L,H=Op(t)&&Object.hasOwnProperty.call(t,T.name);if(Mc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Uj(_)||F){const q=b(_,T,S);v(_,q,j,R)}else if(M){const q=y(O,T.children,S);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(H){const q=b(_,T,S);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,Z=0;for(let ne=0;ne`);else{const q=y(O,T.children,S);j.push(`<${T.name}>${q}`)}else if(Op(_)&&!L){const q=T.children[0]?C:null;q&&j.push(q)}else v(_,C,j,R,T.children.length!==1||!C)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:LU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,Jm(e||[]));return nS(w[0])},uOe=(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})},cqe=(e,t)=>e.map((n,i)=>uOe(n,i,t)),uqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:uOe(e[i],i,t)})}),n},dqe=(e,t,n,i)=>e?Array.isArray(e)?cqe(e,t):Op(e)?uqe(e,t):(Gx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,fqe=e=>!Op(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function hqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,H,q,U,Z,z;const g=d||$U();if(!g)return Gx(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)||(J=>J),v={...LU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=Mc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,k=h??(w==null?void 0:w.shouldUnescape),S=w!=null&&w.values?{...w.values,...o}:o,O=w!=null&&w.components?{...w.components,...c}:c,A=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||A||v.transEmptyNodeValue||(typeof i=="function"?Ly(i):i),{hashTransKey:j}=v,T=i||(j?j(A||E):A||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=S&&Object.keys(S).length>0?{...S,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=S;const R=oqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const C=o||t!==void 0&&!((z=(Z=g.options)==null?void 0:Z.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...C,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=dqe(O,P,g,i);let D=I||e,_=null;fqe(I)&&(_=I,D=e);const L=lqe(D,_,P,g,v,N,k),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const pqe={type:"3rdParty",init(e){iqe(e.options.react),rqe(e)}},dOe=p.createContext();class mqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Pw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(dOe)||{},v=d||g||$U(),y=f||(v==null?void 0:v.t.bind(v));return hqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,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 fOe={exports:{}},hOe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -69,7 +69,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 Iw=p;function mqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gqe=typeof Object.is=="function"?Object.is:mqe,bqe=Iw.useState,yqe=Iw.useEffect,vqe=Iw.useLayoutEffect,xqe=Iw.useDebugValue;function wqe(e,t){var n=t(),i=bqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return vqe(function(){r.value=n,r.getSnapshot=t,A5(r)&&s({inst:r})},[e,n,t]),yqe(function(){return A5(r)&&s({inst:r}),e(function(){A5(r)&&s({inst:r})})},[e]),xqe(n),n}function A5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gqe(e,n)}catch{return!0}}function Oqe(e,t){return t()}var kqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oqe:wqe;uke.useSyncExternalStore=Iw.useSyncExternalStore!==void 0?Iw.useSyncExternalStore:kqe;cke.exports=uke;var ZP=cke.exports;const Sqe=(e,t)=>{if(Bc(t))return t;if(Op(t)&&Bc(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},Eqe={t:Sqe,ready:!1},Cqe=()=>()=>{},Te=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(lke)||{},s=n||i||$U();s&&!s.reportNamespaces&&(s.reportNamespaces=new pqe),s||Kx(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 o=p.useMemo(()=>{var A;return{...LU(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Bc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return Cqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,A()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Eqe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>ZHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===A&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=ZP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const A=()=>y(N=>N+1);t.lng?eX(s,t.lng,f,A):pF(s,f,A)}},[s,t.lng,f,x,l,v]);const O=s||{},k=p.useRef(null),S=p.useRef(),E=A=>{const N=Object.getOwnPropertyDescriptors(A);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(A),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},C=p.useMemo(()=>{const A=O,N=A==null?void 0:A.language;let P=A;A&&(k.current&&k.current.__original===A?S.current!==N?(P=E(A),k.current=P,S.current=N):P=k.current:(P=E(A),k.current=P,S.current=N));const I=!x&&!l?(..._)=>(Kx(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(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let A=!1;try{A=!1}catch{}throw A&&Kx(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 P=()=>N();t.lng?eX(s,t.lng,f,P):pF(s,f,P)})}return C},dke=sHe(),bn=lc.createInstance();bn.use(hqe).init({resources:{"en-US":{adk:tde,app:rfe,conversation:Dfe},"zh-CN":{adk:jU,app:u0e,conversation:U0e}},lng:dke,fallbackLng:vA,supportedLngs:[...NU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});HOe(dke);bn.on("languageChanged",e=>{const t=xA(e)??vA;HOe(t)});const Aqe=Object.assign({"./resources/en-US/adk.json":Vze,"./resources/en-US/agentReviews.json":qze,"./resources/en-US/app.json":Wze,"./resources/en-US/automations.json":Kze,"./resources/en-US/common.json":Xze,"./resources/en-US/conversation.json":Yze,"./resources/en-US/create.json":Zze,"./resources/en-US/cronjobs.json":eVe,"./resources/en-US/deepseek.json":nVe,"./resources/en-US/feedback.json":rVe,"./resources/en-US/migrations.json":aVe,"./resources/en-US/newChat.json":oVe,"./resources/en-US/reviews.json":cVe,"./resources/en-US/sandbox.json":uVe,"./resources/en-US/shell.json":fVe,"./resources/en-US/sidebar.json":pVe,"./resources/en-US/skills.json":mVe,"./resources/en-US/ui.json":bVe,"./resources/en-US/users.json":vVe,"./resources/en-US/websiteIntegration.json":wVe,"./resources/en-US/workspaceTools.json":OVe,"./resources/zh-CN/adk.json":kVe,"./resources/zh-CN/agentReviews.json":EVe,"./resources/zh-CN/app.json":CVe,"./resources/zh-CN/automations.json":AVe,"./resources/zh-CN/common.json":_Ve,"./resources/zh-CN/conversation.json":jVe,"./resources/zh-CN/create.json":NVe,"./resources/zh-CN/cronjobs.json":IVe,"./resources/zh-CN/deepseek.json":DVe,"./resources/zh-CN/feedback.json":LVe,"./resources/zh-CN/migrations.json":FVe,"./resources/zh-CN/newChat.json":BVe,"./resources/zh-CN/reviews.json":QVe,"./resources/zh-CN/sandbox.json":zVe,"./resources/zh-CN/shell.json":HVe,"./resources/zh-CN/sidebar.json":WVe,"./resources/zh-CN/skills.json":KVe,"./resources/zh-CN/ui.json":XVe,"./resources/zh-CN/users.json":ZVe,"./resources/zh-CN/websiteIntegration.json":eHe,"./resources/zh-CN/workspaceTools.json":tHe});function Tqe(){const e={};for(const[t,n]of Object.entries(Aqe)){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(Tqe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function _qe(e){aHe(e),await bn.changeLanguage(e)}var fke={exports:{}},JP={},hke={exports:{}},pke={};/** + */var Dw=p;function gqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bqe=typeof Object.is=="function"?Object.is:gqe,yqe=Dw.useState,vqe=Dw.useEffect,xqe=Dw.useLayoutEffect,wqe=Dw.useDebugValue;function kqe(e,t){var n=t(),i=yqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return xqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),vqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),wqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bqe(e,n)}catch{return!0}}function Oqe(e,t){return t()}var Sqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oqe:kqe;hOe.useSyncExternalStore=Dw.useSyncExternalStore!==void 0?Dw.useSyncExternalStore:Sqe;fOe.exports=hOe;var XP=fOe.exports;const Eqe=(e,t)=>{if(Mc(t))return t;if(Op(t)&&Mc(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},Cqe={t:Eqe,ready:!1},Aqe=()=>()=>{},_e=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(dOe)||{},s=n||i||$U();s&&!s.reportNamespaces&&(s.reportNamespaces=new mqe),s||Gx(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 o=p.useMemo(()=>{var C;return{...LU(),...(C=s==null?void 0:s.options)==null?void 0:C.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Mc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(C=>{if(!s)return Aqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,C()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Cqe;const C=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>JHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===C&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:C,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=XP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const C=()=>y(N=>N+1);t.lng?iX(s,t.lng,f,C):hF(s,f,C)}},[s,t.lng,f,x,l,v]);const k=s||{},S=p.useRef(null),O=p.useRef(),A=C=>{const N=Object.getOwnPropertyDescriptors(C);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(C),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:C,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const C=k,N=C==null?void 0:C.language;let P=C;C&&(S.current&&S.current.__original===C?O.current!==N?(P=A(C),S.current=P,O.current=N):P=S.current:(P=A(C),S.current=P,O.current=N));const I=!x&&!l?(..._)=>(Gx(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(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,k,x,k.resolvedLanguage,k.language,k.languages]);if(s&&l&&!x){let C=!1;try{C=!1}catch{}throw C&&Gx(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 P=()=>N();t.lng?iX(s,t.lng,f,P):hF(s,f,P)})}return E},pOe=aHe(),bn=sc.createInstance();bn.use(pqe).init({resources:{"en-US":{adk:rde,app:ofe,conversation:$fe},"zh-CN":{adk:jU,app:hve,conversation:Vve}},lng:pOe,fallbackLng:kA,supportedLngs:[...NU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Kke(pOe);bn.on("languageChanged",e=>{const t=OA(e)??kA;Kke(t)});const Tqe=Object.assign({"./resources/en-US/adk.json":Hze,"./resources/en-US/agentReviews.json":Wze,"./resources/en-US/app.json":Kze,"./resources/en-US/automations.json":Gze,"./resources/en-US/common.json":Yze,"./resources/en-US/conversation.json":Zze,"./resources/en-US/create.json":Jze,"./resources/en-US/cronjobs.json":tVe,"./resources/en-US/deepseek.json":iVe,"./resources/en-US/feedback.json":sVe,"./resources/en-US/migrations.json":oVe,"./resources/en-US/newChat.json":lVe,"./resources/en-US/reviews.json":uVe,"./resources/en-US/sandbox.json":dVe,"./resources/en-US/shell.json":hVe,"./resources/en-US/sidebar.json":mVe,"./resources/en-US/skills.json":gVe,"./resources/en-US/ui.json":yVe,"./resources/en-US/users.json":xVe,"./resources/en-US/websiteIntegration.json":kVe,"./resources/en-US/workspaceTools.json":OVe,"./resources/zh-CN/adk.json":SVe,"./resources/zh-CN/agentReviews.json":CVe,"./resources/zh-CN/app.json":AVe,"./resources/zh-CN/automations.json":TVe,"./resources/zh-CN/common.json":jVe,"./resources/zh-CN/conversation.json":NVe,"./resources/zh-CN/create.json":RVe,"./resources/zh-CN/cronjobs.json":PVe,"./resources/zh-CN/deepseek.json":MVe,"./resources/zh-CN/feedback.json":$Ve,"./resources/zh-CN/migrations.json":BVe,"./resources/zh-CN/newChat.json":UVe,"./resources/zh-CN/reviews.json":zVe,"./resources/zh-CN/sandbox.json":VVe,"./resources/zh-CN/shell.json":qVe,"./resources/zh-CN/sidebar.json":KVe,"./resources/zh-CN/skills.json":GVe,"./resources/zh-CN/ui.json":YVe,"./resources/zh-CN/users.json":JVe,"./resources/zh-CN/websiteIntegration.json":tHe,"./resources/zh-CN/workspaceTools.json":nHe});function _qe(){const e={};for(const[t,n]of Object.entries(Tqe)){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(_qe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function jqe(e){oHe(e),await bn.changeLanguage(e)}var mOe={exports:{}},YP={},gOe={exports:{}},bOe={};/** * @license React * scheduler.production.js * @@ -77,7 +77,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(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Zr(z,U)?(D[F]=z,D[Z]=L,F=Z):(D[F]=U,D[q]=L,F=q);else if(Zr(z,L))D[F]=z,D[Z]=L,F=Z;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.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 o=Date,l=o.now();e.unstable_now=function(){return o.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 _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function k(D){if(b=!1,O(D),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var _=n(u);_!==null&&I(k,_.startTime-D)}}var S=!1,E=-1,C=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,O(D),_=!0;break t}f===n(c)&&i(c),O(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var H=n(u);H!==null&&I(k,H.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?A():S=!1}}}var A;if(typeof x=="function")A=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,A=function(){P.postMessage(null)}}else A=function(){y(R,0)};function I(D,_){E=y(function(){D(e.unstable_now())},_)}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||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(E),E=-1):b=!0,I(k,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,S||(S=!0,A()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(pke);hke.exports=pke;var jqe=hke.exports,mke={exports:{}},cc={};/** + */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Zr(z,U)?(D[F]=z,D[Z]=L,F=Z):(D[F]=U,D[q]=L,F=q);else if(Zr(z,L))D[F]=z,D[Z]=L,F=Z;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.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 o=Date,l=o.now();e.unstable_now=function(){return o.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 k(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function S(D){if(b=!1,k(D),!g)if(n(c)!==null)g=!0,O||(O=!0,C());else{var _=n(u);_!==null&&I(S,_.startTime-D)}}var O=!1,A=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,k(D),_=!0;break t}f===n(c)&&i(c),k(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var H=n(u);H!==null&&I(S,H.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?C():O=!1}}}var C;if(typeof x=="function")C=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,C=function(){P.postMessage(null)}}else C=function(){y(R,0)};function I(D,_){A=y(function(){D(e.unstable_now())},_)}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||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(A),A=-1):b=!0,I(S,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,O||(O=!0,C()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(bOe);gOe.exports=bOe;var Nqe=gOe.exports,yOe={exports:{}},ac={};/** * @license React * react-dom.production.js * @@ -85,7 +85,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 Nqe=p;function gke(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bke)}catch(e){console.error(e)}}bke(),mke.exports=cc;var yi=mke.exports;/** + */var Rqe=p;function vOe(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xOe)}catch(e){console.error(e)}}xOe(),yOe.exports=ac;var vi=yOe.exports;/** * @license React * react-dom-client.production.js * @@ -93,15 +93,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 fo=jqe,yke=p,Pqe=yi;function kt(e){var t="https://react.dev/errors/"+e;if(1xx||(e.current=OF[xx],OF[xx]=null,xx--)}function vs(e,t){xx++,OF[xx]=e.current,e.current=t}var ph=Th(null),$E=Th(null),Eg=Th(null),fR=Th(null);function hR(e,t){switch(vs(Eg,t),vs($E,e),vs(ph,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lY(t),e=VEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Io(ph),vs(ph,e)}function Pw(){Io(ph),Io($E),Io(Eg)}function kF(e){e.memoizedState!==null&&vs(fR,e);var t=ph.current,n=VEe(t,e.type);t!==n&&(vs($E,e),vs(ph,n))}function pR(e){$E.current===e&&(Io(ph),Io($E)),fR.current===e&&(Io(fR),GE._currentValue=zy)}var T5,iX;function ay(e){if(T5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);T5=t&&t[1]||"",iX=-1wx||(e.current=wF[wx],wF[wx]=null,wx--)}function Os(e,t){wx++,wF[wx]=e.current,e.current=t}var mh=jh(null),BE=jh(null),Og=jh(null),dR=jh(null);function fR(e,t){switch(Os(Og,t),Os(BE,e),Os(mh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dY(t),e=WEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$o(mh),Os(mh,e)}function Mw(){$o(mh),$o(BE),$o(Og)}function kF(e){e.memoizedState!==null&&Os(dR,e);var t=mh.current,n=WEe(t,e.type);t!==n&&(Os(BE,e),Os(mh,n))}function hR(e){BE.current===e&&($o(mh),$o(BE)),dR.current===e&&($o(dR),YE._currentValue=$y)}var A5,aX;function ty(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",aX=-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{_5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ay(n):""}function Fqe(e,t){switch(e.tag){case 26:case 27:case 5:return ay(e.type);case 16:return ay("Lazy");case 13:return e.child!==t&&t!==null?ay("Suspense Fallback"):ay("Suspense");case 19:return ay("SuspenseList");case 0:case 15:return j5(e.type,!1);case 11:return j5(e.type.render,!1);case 1:return j5(e.type,!0);case 31:return ay("Activity");default:return""}}function rX(e){try{var t="",n=null;do t+=Fqe(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{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ty(n):""}function Bqe(e,t){switch(e.tag){case 26:case 27:case 5:return ty(e.type);case 16:return ty("Lazy");case 13:return e.child!==t&&t!==null?ty("Suspense Fallback"):ty("Suspense");case 19:return ty("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return ty("Activity");default:return""}}function oX(e){try{var t="",n=null;do t+=Bqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var SF=Object.prototype.hasOwnProperty,UU=fo.unstable_scheduleCallback,N5=fo.unstable_cancelCallback,Bqe=fo.unstable_shouldYield,Uqe=fo.unstable_requestPaint,Eu=fo.unstable_now,Qqe=fo.unstable_getCurrentPriorityLevel,Eke=fo.unstable_ImmediatePriority,Cke=fo.unstable_UserBlockingPriority,mR=fo.unstable_NormalPriority,zqe=fo.unstable_LowPriority,Ake=fo.unstable_IdlePriority,Vqe=fo.log,Hqe=fo.unstable_setDisableYieldValue,OA=null,Cu=null;function dg(e){if(typeof Vqe=="function"&&Hqe(e),Cu&&typeof Cu.setStrictMode=="function")try{Cu.setStrictMode(OA,e)}catch{}}var Au=Math.clz32?Math.clz32:Kqe,qqe=Math.log,Wqe=Math.LN2;function Kqe(e){return e>>>=0,e===0?32:31-(qqe(e)/Wqe|0)|0}var R2=256,I2=262144,P2=4194304;function oy(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 tD(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=oy(i):(o&=l,o!==0?r=oy(o):n||(n=l&~e,n!==0&&(r=oy(n))))):(l=i&~s,l!==0?r=oy(l):o!==0?r=oy(o):n||(n=i&~e,n!==0&&(r=oy(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 kA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gqe(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 Tke(){var e=P2;return P2<<=1,!(P2&62914560)&&(P2=4194304),e}function R5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function SA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xqe(e,t,n,i,r,s){var o=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=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var nWe=/[\n"\\]/g;function sd(e){return e.replace(nWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function AF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ed(t)):e.value!==""+ed(t)&&(e.value=""+ed(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?TF(e,o,ed(t)):n!=null?TF(e,o,ed(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=""+ed(l):e.removeAttribute("name")}function Lke(e,t,n,i,r,s,o,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)){CF(e);return}n=n!=null?""+ed(n):"",t=t!=null?""+ed(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,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),CF(e)}function TF(e,t,n){t==="number"&&gR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Xx(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"),jF=!1;if(zp)try{var ek={};Object.defineProperty(ek,"passive",{get:function(){jF=!0}}),window.addEventListener("test",ek,ek),window.removeEventListener("test",ek,ek)}catch{jF=!1}var fg=null,WU=null,Hj=null;function Qke(){if(Hj)return Hj;var e,t=WU,n=t.length,i,r="value"in fg?fg.value:fg.textContent,s=r.length;for(e=0;e=DS),mX=" ",gX=!1;function Vke(e,t){switch(e){case"keyup":return jWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kx=!1;function RWe(e,t){switch(e){case"compositionend":return Hke(t);case"keypress":return t.which!==32?null:(gX=!0,mX);case"textInput":return e=t.data,e===mX&&gX?null:e;default:return null}}function IWe(e,t){if(kx)return e==="compositionend"||!GU&&Vke(e,t)?(e=Qke(),Hj=WU=fg=null,kx=!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=wX(n)}}function Gke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xke(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gR(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=gR(e.document)}return t}function XU(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 UWe=zp&&"documentMode"in document&&11>=document.documentMode,Sx=null,NF=null,LS=null,RF=!1;function kX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;RF||Sx==null||Sx!==gR(i)||(i=Sx,"selectionStart"in i&&XU(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}),LS&&UE(LS,i)||(LS=i,i=PR(NF,"onSelect"),0>=o,r-=o,sh=1<<32-Au(t)+r|n<C?(j=E,E=null):j=E.sibling;var T=h(y,E,x[C],O);if(T===null){E===null&&(E=j);break}e&&E&&T.alternate===null&&t(y,E),w=s(T,w,C),S===null?k=T:S.sibling=T,S=T,E=j}if(C===x.length)return n(y,E),or&&hp(y,C),k;if(E===null){for(;CC?(j=E,E=null):j=E.sibling;var R=h(y,E,T.value,O);if(R===null){E===null&&(E=j);break}e&&E&&R.alternate===null&&t(y,E),w=s(R,w,C),S===null?k=R:S.sibling=R,S=R,E=j}if(T.done)return n(y,E),or&&hp(y,C),k;if(E===null){for(;!T.done;C++,T=x.next())T=f(y,T.value,O),T!==null&&(w=s(T,w,C),S===null?k=T:S.sibling=T,S=T);return or&&hp(y,C),k}for(E=i(E);!T.done;C++,T=x.next())T=m(E,y,C,T.value,O),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?C:T.key),w=s(T,w,C),S===null?k=T:S.sibling=T,S=T);return e&&E.forEach(function(A){return t(y,A)}),or&&hp(y,C),k}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===vx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case N2:e:{for(var k=x.key;w!==null;){if(w.key===k){if(k=x.type,k===vx){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===k||typeof k=="object"&&k!==null&&k.$$typeof===Wm&&ly(k)===w.type){n(y,w.sibling),O=r(w,x.props),nk(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===vx?(O=Vy(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=Wj(x.type,x.key,x.props,null,y.mode,O),nk(O,x),O.return=y,y=O)}return o(y);case tS:e:{for(k=x.key;w!==null;){if(w.key===k)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=U5(x,y.mode,O),O.return=y,y=O}return o(y);case Wm:return x=ly(x),v(y,w,x,O)}if(nS(x))return g(y,w,x,O);if(JO(x)){if(k=JO(x),typeof k!="function")throw Error(kt(150));return x=k.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,$2(x),O);if(x.$$typeof===kp)return v(y,w,L2(y,x),O);F2(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=B5(x,y.mode,O),O.return=y,y=O),o(y)):n(y,w)}return function(y,w,x,O){try{VE=0;var k=v(y,w,x,O);return Jx=null,k}catch(E){if(E===P1||E===oD)throw E;var S=vu(29,E,null,y.mode);return S.lanes=O,S.return=y,S}finally{}}}var o0=dSe(!0),fSe=dSe(!1),Km=!1;function sQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function FF(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 Ag(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Ar&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=yR(e),iSe(e,null,n),t}return aD(e,i,t,n),yR(e)}function FS(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,jke(e,n)}}function z5(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 o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,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 BF=!1;function BS(){if(BF){var e=Zx;if(e!==null)throw e}}function US(e,t,n,i){BF=!1;var r=e.updateQueue;Km=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(nr&h)===h:(i&h)===h){h!==0&&h===Lw&&(BF=!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=Ps({},f,h);break e;case 2:Km=!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,o|=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),Wg|=o,e.lanes=o,e.memoizedState=f}}function hSe(e,t){if(typeof e!="function")throw Error(kt(191,e));e.call(t)}function pSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,yQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=XWe(c,i);QS(e,t,d,Tu(e))}else QS(e,t,i,Tu(e))}catch(f){QS(e,t,{then:function(){},status:"rejected",reason:f},Tu())}finally{Tr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function nKe(){}function HF(e,t,n,i){if(e.tag!==5)throw Error(kt(476));var r=FSe(e).queue;$Se(e,r,t,zy,n===null?nKe:function(){return BSe(e),n(i)})}function FSe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:zy,baseState:zy,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:zy},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function BSe(e){var t=FSe(e);t.next===null&&(t=e.alternate.memoizedState),QS(e,t.next.queue,{},Tu())}function bQ(){return rl(GE)}function USe(){return Aa().memoizedState}function QSe(){return Aa().memoizedState}function iKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Ag(n);var i=Tg(t,e,n);i!==null&&(Uc(i,t,n),FS(i,t,n)),t={cache:nQ()},e.payload=t;return}t=t.return}}function rKe(e,t,n){var i=Tu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dD(e)?VSe(t,n):(n=ZU(e,t,n,i),n!==null&&(Uc(n,e,i),HSe(n,t,i)))}function zSe(e,t,n){var i=Tu();QS(e,t,n,i)}function QS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dD(e))VSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Pu(l,o))return aD(e,t,r,0),ls===null&&sD(),!1}catch{}finally{}if(n=ZU(e,t,r,i),n!==null)return Uc(n,e,i),HSe(n,t,i),!0}return!1}function yQ(e,t,n,i){if(i={lane:2,revertLane:AQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},dD(e)){if(t)throw Error(kt(479))}else t=ZU(e,n,i,2),t!==null&&Uc(t,e,2)}function dD(e){var t=e.alternate;return e===Ai||t!==null&&t===Ai}function VSe(e,t){ew=SR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function HSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,jke(e,n)}}var qE={readContext:rl,use:cD,useCallback:la,useContext:la,useEffect:la,useImperativeHandle:la,useLayoutEffect:la,useInsertionEffect:la,useMemo:la,useReducer:la,useRef:la,useState:la,useDebugValue:la,useDeferredValue:la,useTransition:la,useSyncExternalStore:la,useId:la,useHostTransitionStatus:la,useFormState:la,useActionState:la,useOptimistic:la,useMemoCache:la,useCacheRefresh:la};qE.useEffectEvent=la;var qSe={readContext:rl,use:cD,useCallback:function(e,t){return Kl().memoizedState=[e,t===void 0?null:t],e},useContext:rl,useEffect:$X,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xj(4194308,4,ISe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xj(4194308,4,e,t)},useInsertionEffect:function(e,t){Xj(4,2,e,t)},useMemo:function(e,t){var n=Kl();t=t===void 0?null:t;var i=e();if(l0){dg(!0);try{e()}finally{dg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Kl();if(n!==void 0){var r=n(t);if(l0){dg(!0);try{n(t)}finally{dg(!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=rKe.bind(null,Ai,e),[i.memoizedState,e]},useRef:function(e){var t=Kl();return e={current:e},t.memoizedState=e},useState:function(e){e=zF(e);var t=e.queue,n=zSe.bind(null,Ai,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mQ,useDeferredValue:function(e,t){var n=Kl();return gQ(n,e,t)},useTransition:function(){var e=zF(!1);return e=$Se.bind(null,Ai,e.queue,!0,!1),Kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ai,r=Kl();if(or){if(n===void 0)throw Error(kt(407));n=n()}else{if(n=t(),ls===null)throw Error(kt(349));nr&127||vSe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,$X(wSe.bind(null,i,s,e),[e]),i.flags|=2048,Fw(9,{destroy:void 0},xSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Kl(),t=ls.identifierPrefix;if(or){var n=ah,i=sh;n=(i&~(1<<32-Au(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ER++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[tl]=t,s[zc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(sl(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&&Gh(t)}}return Es(t),Y5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Gh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(kt(166));if(e=Eg.current,Tv(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||zEe(e.nodeValue,n)),e||Hg(t,!0)}else e=DR(e).createTextNode(i),e[tl]=t,t.stateNode=e}return Es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Tv(t),n!==null){if(e===null){if(!i)throw Error(kt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(kt(557));e[tl]=t}else s0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),e=!1}else n=Q5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yu(t),t):(yu(t),null);if(t.flags&128)throw Error(kt(558))}return Es(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Tv(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(kt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(kt(317));r[tl]=t}else s0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),r=!1}else r=Q5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(yu(t),t):(yu(t),null)}return yu(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),B2(t,t.updateQueue),Es(t),null);case 4:return Pw(),e===null&&TQ(t.stateNode.containerInfo),Es(t),null;case 10:return jp(t.type),Es(t),null;case 19:if(Io(Sa),i=t.memoizedState,i===null)return Es(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ik(i,!1);else{if(da!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kR(e),s!==null){for(t.flags|=128,ik(i,!1),e=s.updateQueue,t.updateQueue=e,B2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)rSe(n,e),n=n.sibling;return vs(Sa,Sa.current&1|2),or&&hp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Eu()>_R&&(t.flags|=128,r=!0,ik(i,!1),t.lanes=4194304)}else{if(!r)if(e=kR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,B2(t,e),ik(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!or)return Es(t),null}else 2*Eu()-i.renderingStartTime>_R&&n!==536870912&&(t.flags|=128,r=!0,ik(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=Eu(),e.sibling=null,n=Sa.current,vs(Sa,r?n&1|2:n&1),or&&hp(t,i.treeForkCount),e):(Es(t),null);case 22:case 23:return yu(t),aQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Es(t),t.subtreeFlags&6&&(t.flags|=8192)):Es(t),n=t.updateQueue,n!==null&&B2(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&&Io(Hy),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),jp(Ka),Es(t),null;case 25:return null;case 30:return null}throw Error(kt(156,t.tag))}function cKe(e,t){switch(tQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jp(Ka),Pw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pR(t),null;case 31:if(t.memoizedState!==null){if(yu(t),t.alternate===null)throw Error(kt(340));s0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(kt(340));s0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(Sa),null;case 4:return Pw(),null;case 10:return jp(t.type),null;case 22:case 23:return yu(t),aQ(),e!==null&&Io(Hy),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return jp(Ka),null;case 25:return null;default:return null}}function rEe(e,t){switch(tQ(t),t.tag){case 3:jp(Ka),Pw();break;case 26:case 27:case 5:pR(t);break;case 4:Pw();break;case 31:t.memoizedState!==null&&yu(t);break;case 13:yu(t);break;case 19:Io(Sa);break;case 10:jp(t.type);break;case 22:case 23:yu(t),aQ(),e!==null&&Io(Hy);break;case 24:jp(Ka)}}function _A(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,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Qr(t,t.return,l)}}function qg(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 o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Qr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Qr(t,t.return,d)}}function sEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{pSe(t,n)}catch(i){Qr(e,e.return,i)}}}function aEe(e,t,n){n.props=c0(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Qr(e,t,i)}}function zS(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){Qr(e,t,r)}}function oh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Qr(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){Qr(e,t,r)}else n.current=null}function oEe(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){Qr(e,e.return,r)}}function Z5(e,t,n){try{var i=e.stateNode;NKe(i,e.type,n,t),i[zc]=t}catch(r){Qr(e,e.return,r)}}function lEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kb(e.type)||e.tag===4}function J5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lEe(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&&kb(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 XF(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=Sp));else if(i!==4&&(i===27&&kb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(XF(e,t,n),e=e.sibling;e!==null;)XF(e,t,n),e=e.sibling}function TR(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&&kb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(TR(e,t,n),e=e.sibling;e!==null;)TR(e,t,n),e=e.sibling}function cEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);sl(t,i,n),t[tl]=e,t[zc]=n}catch(s){Qr(e,e.return,s)}}var yp=!1,Wa=!1,e3=!1,YX=typeof WeakSet=="function"?WeakSet:Set,Eo=null;function uKe(e,t){if(e=e.containerInfo,i8=FR,e=Xke(e),XU(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 o=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=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(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(r8={focusedElem:e,selectionRange:n},FR=!1,Eo=t;Eo!==null;)if(t=Eo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Eo=e;else for(;Eo!==null;){switch(t=Eo,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"))),sl(s,i,n),s[tl]=e,Ao(s),i=s;break e;case"link":var o=bY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=OX(l,b),w=OX(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,si.T=null,n=JF,JF=null;var s=jg,o=Np;if(co=0,Uw=jg=null,Np=0,Ar&6)throw Error(kt(331));var l=Ar;if(Ar|=4,xEe(s.current),bEe(s,s.current,o,n),Ar=l,jA(0,!1),Cu&&typeof Cu.onPostCommitFiberRoot=="function")try{Cu.onPostCommitFiberRoot(OA,s)}catch{}return!0}finally{Tr.p=r,si.T=i,DEe(e,t)}}function tY(e,t,n){t=ad(n,t),t=WF(e.stateNode,t,2),e=Tg(e,t,2),e!==null&&(SA(e,2),_h(e))}function Qr(e,t,n){if(e.tag===3)tY(e,e,n);else for(;t!==null;){if(t.tag===3){tY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(_g===null||!_g.has(i))){e=ad(n,e),n=YSe(2),i=Tg(t,n,2),i!==null&&(ZSe(n,i,t,e),SA(i,2),_h(i));break}}t=t.return}}function n3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new hKe;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)||(SQ=!0,r.add(n),e=yKe.bind(null,e,t,n),t.then(e,e))}function yKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ls===e&&(nr&n)===n&&(da===4||da===3&&(nr&62914560)===nr&&300>Eu()-fD?!(Ar&2)&&Qw(e,0):EQ|=n,Bw===nr&&(Bw=0)),_h(e)}function LEe(e,t){t===0&&(t=Tke()),e=$0(e,t),e!==null&&(SA(e,t),_h(e))}function vKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),LEe(e,n)}function xKe(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(kt(314))}i!==null&&i.delete(t),LEe(e,n)}function wKe(e,t){return UU(e,t)}var RR=null,ix=null,t8=!1,IR=!1,i3=!1,mg=0;function _h(e){e!==ix&&e.next===null&&(ix===null?RR=ix=e:ix=ix.next=e),IR=!0,t8||(t8=!0,kKe())}function jA(e,t){if(!i3&&IR){i3=!0;do for(var n=!1,i=RR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Au(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,nY(i,s))}else s=nr,s=tD(i,i===ls?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||kA(i,s)||(n=!0,nY(i,s));i=i.next}while(n);i3=!1}}function OKe(){$Ee()}function $Ee(){IR=t8=!1;var e=0;mg!==0&&IKe()&&(e=mg);for(var t=Eu(),n=null,i=RR;i!==null;){var r=i.next,s=FEe(i,t);s===0?(i.next=null,n===null?RR=r:n.next=r,r===null&&(ix=n)):(n=i,(e!==0||s&3)&&(IR=!0)),i=r}co!==0&&co!==5||jA(e),mg!==0&&(mg=0)}function FEe(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&&oY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function KEe(e,t,n){var i=M1;if(i&&typeof t=="string"&&t){var r=sd(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),pY.has(r)||(pY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function QKe(e){um.D(e),KEe("dns-prefetch",e,null)}function zKe(e,t){um.C(e,t),KEe("preconnect",e,t)}function VKe(e,t,n){um.L(e,t,n);var i=M1;if(i&&e&&t){var r='link[rel="preload"][as="'+sd(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+sd(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+sd(n.imageSizes)+'"]')):r+='[href="'+sd(e)+'"]';var s=r;switch(t){case"style":s=zw(e);break;case"script":s=L1(e)}Cd.has(s)||(e=Ps({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Cd.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(NA(s))||t==="script"&&i.querySelector(RA(s))||(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function HKe(e,t){um.m(e,t);var n=M1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+sd(i)+'"][href="'+sd(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=L1(e)}if(!Cd.has(s)&&(e=Ps({rel:"modulepreload",href:e},t),Cd.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(RA(s)))return}i=n.createElement("link"),sl(i,"link",e),Ao(i),n.head.appendChild(i)}}}function qKe(e,t,n){um.S(e,t,n);var i=M1;if(i&&e){var r=Gx(i).hoistableStyles,s=zw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(NA(s)))l.loading=5;else{e=Ps({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Cd.get(s))&&_Q(e,n);var c=o=i.createElement("link");Ao(c),sl(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,eN(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function WKe(e,t){um.X(e,t);var n=M1;if(n&&e){var i=Gx(n).hoistableScripts,r=L1(e),s=i.get(r);s||(s=n.querySelector(RA(r)),s||(e=Ps({src:e,async:!0},t),(t=Cd.get(r))&&jQ(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function KKe(e,t){um.M(e,t);var n=M1;if(n&&e){var i=Gx(n).hoistableScripts,r=L1(e),s=i.get(r);s||(s=n.querySelector(RA(r)),s||(e=Ps({src:e,async:!0,type:"module"},t),(t=Cd.get(r))&&jQ(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function mY(e,t,n,i){var r=(r=Eg.current)?MR(r):null;if(!r)throw Error(kt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=zw(n.href),n=Gx(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=zw(n.href);var s=Gx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(NA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Cd.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},Cd.set(e,n),s||GKe(r,e,n,o.state))),t&&i===null)throw Error(kt(528,""));return o}if(t&&i!==null)throw Error(kt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=L1(n),n=Gx(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(kt(444,e))}}function zw(e){return'href="'+sd(e)+'"'}function NA(e){return'link[rel="stylesheet"]['+e+"]"}function GEe(e){return Ps({},e,{"data-precedence":e.precedence,precedence:null})}function GKe(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}),sl(t,"link",n),Ao(t),e.head.appendChild(t))}function L1(e){return'[src="'+sd(e)+'"]'}function RA(e){return"script[async]"+e}function gY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+sd(n.href)+'"]');if(i)return t.instance=i,Ao(i),i;var r=Ps({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ao(i),sl(i,"style",r),eN(i,n.precedence,e),t.instance=i;case"stylesheet":r=zw(n.href);var s=e.querySelector(NA(r));if(s)return t.state.loading|=4,t.instance=s,Ao(s),s;i=GEe(n),(r=Cd.get(r))&&_Q(i,r),s=(e.ownerDocument||e).createElement("link"),Ao(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),t.state.loading|=4,eN(s,n.precedence,e),t.instance=s;case"script":return s=L1(n.src),(r=e.querySelector(RA(s)))?(t.instance=r,Ao(r),r):(i=n,(r=Cd.get(s))&&(i=Ps({},n),jQ(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ao(r),sl(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(kt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,eN(i,n.precedence,e));return t.instance}function eN(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,o=0;o title"):null)}function XKe(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 XEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function YKe(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=zw(i.href),s=t.querySelector(NA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=LR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ao(s);return}s=t.ownerDocument||t,i=GEe(i),(r=Cd.get(r))&&_Q(i,r),s=s.createElement("link"),Ao(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(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=LR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var c3=0;function ZKe(e,t){return e.stylesheets&&e.count===0&&nN(e,e.stylesheets),0c3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function LR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $R=null;function nN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$R=new Map,t.forEach(JKe,e),$R=null,LR.call(e))}function JKe(e,t){if(!(t.state.loading&4)){var n=$R.get(e);if(n)var i=n.get(null);else{n=new Map,$R.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(rCe)}catch(e){console.error(e)}}rCe(),fke.exports=JP;var oGe=fke.exports;const lGe=_1(oGe),DQ=p.createContext({});function bD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const yD=p.createContext(null),ZE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class cGe 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 uGe({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(ZE);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!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 OF=Object.prototype.hasOwnProperty,UU=ho.unstable_scheduleCallback,j5=ho.unstable_cancelCallback,Uqe=ho.unstable_shouldYield,Qqe=ho.unstable_requestPaint,_u=ho.unstable_now,zqe=ho.unstable_getCurrentPriorityLevel,TOe=ho.unstable_ImmediatePriority,_Oe=ho.unstable_UserBlockingPriority,pR=ho.unstable_NormalPriority,Vqe=ho.unstable_LowPriority,jOe=ho.unstable_IdlePriority,Hqe=ho.log,qqe=ho.unstable_setDisableYieldValue,EA=null,ju=null;function cg(e){if(typeof Hqe=="function"&&qqe(e),ju&&typeof ju.setStrictMode=="function")try{ju.setStrictMode(EA,e)}catch{}}var Nu=Math.clz32?Math.clz32:Gqe,Wqe=Math.log,Kqe=Math.LN2;function Gqe(e){return e>>>=0,e===0?32:31-(Wqe(e)/Kqe|0)|0}var N2=256,R2=262144,I2=4194304;function ny(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 JP(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=ny(i):(o&=l,o!==0?r=ny(o):n||(n=l&~e,n!==0&&(r=ny(n))))):(l=i&~s,l!==0?r=ny(l):o!==0?r=ny(o):n||(n=i&~e,n!==0&&(r=ny(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 CA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xqe(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 NOe(){var e=I2;return I2<<=1,!(I2&62914560)&&(I2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function AA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Yqe(e,t,n,i,r,s){var o=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=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var iWe=/[\n"\\]/g;function od(e){return e.replace(iWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nd(t)):e.value!==""+nd(t)&&(e.value=""+nd(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,nd(t)):n!=null?AF(e,o,nd(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=""+nd(l):e.removeAttribute("name")}function BOe(e,t,n,i,r,s,o,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)){EF(e);return}n=n!=null?""+nd(n):"",t=t!=null?""+nd(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,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&mR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Yx(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"),_F=!1;if(Vp)try{var nO={};Object.defineProperty(nO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",nO,nO),window.removeEventListener("test",nO,nO)}catch{_F=!1}var ug=null,WU=null,Vj=null;function HOe(){if(Vj)return Vj;var e,t=WU,n=t.length,i,r="value"in ug?ug.value:ug.textContent,s=r.length;for(e=0;e=LS),yX=" ",vX=!1;function WOe(e,t){switch(e){case"keyup":return NWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function KOe(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sx=!1;function IWe(e,t){switch(e){case"compositionend":return KOe(t);case"keypress":return t.which!==32?null:(vX=!0,yX);case"textInput":return e=t.data,e===yX&&vX?null:e;default:return null}}function PWe(e,t){if(Sx)return e==="compositionend"||!GU&&WOe(e,t)?(e=HOe(),Vj=WU=ug=null,Sx=!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=SX(n)}}function ZOe(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ZOe(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function JOe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mR(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=mR(e.document)}return t}function XU(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 QWe=Vp&&"documentMode"in document&&11>=document.documentMode,Ex=null,jF=null,FS=null,NF=!1;function CX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||Ex==null||Ex!==mR(i)||(i=Ex,"selectionStart"in i&&XU(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}),FS&&zE(FS,i)||(FS=i,i=IR(jF,"onSelect"),0>=o,r-=o,ah=1<<32-Nu(t)+r|n<E?(j=A,A=null):j=A.sibling;var T=h(y,A,x[E],k);if(T===null){A===null&&(A=j);break}e&&A&&T.alternate===null&&t(y,A),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T,A=j}if(E===x.length)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;EE?(j=A,A=null):j=A.sibling;var R=h(y,A,T.value,k);if(R===null){A===null&&(A=j);break}e&&A&&R.alternate===null&&t(y,A),w=s(R,w,E),O===null?S=R:O.sibling=R,O=R,A=j}if(T.done)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,k),T!==null&&(w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return ur&&gp(y,E),S}for(A=i(A);!T.done;E++,T=x.next())T=m(A,y,E,T.value,k),T!==null&&(e&&T.alternate!==null&&A.delete(T.key===null?E:T.key),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return e&&A.forEach(function(C){return t(y,C)}),ur&&gp(y,E),S}function v(y,w,x,k){if(typeof x=="object"&&x!==null&&x.type===xx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case j2:e:{for(var S=x.key;w!==null;){if(w.key===S){if(S=x.type,S===xx){if(w.tag===7){n(y,w.sibling),k=r(w,x.props.children),k.return=y,y=k;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Hm&&iy(S)===w.type){n(y,w.sibling),k=r(w,x.props),rO(k,x),k.return=y,y=k;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===xx?(k=Fy(x.props.children,y.mode,k,x.key),k.return=y,y=k):(k=qj(x.type,x.key,x.props,null,y.mode,k),rO(k,x),k.return=y,y=k)}return o(y);case iS: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),k=r(w,x.children||[]),k.return=y,y=k;break e}else{n(y,w);break}else t(y,w);w=w.sibling}k=B5(x,y.mode,k),k.return=y,y=k}return o(y);case Hm:return x=iy(x),v(y,w,x,k)}if(rS(x))return g(y,w,x,k);if(tO(x)){if(S=tO(x),typeof S!="function")throw Error(wt(150));return x=S.call(x),b(y,w,x,k)}if(typeof x.then=="function")return v(y,w,L2(x),k);if(x.$$typeof===Sp)return v(y,w,M2(y,x),k);$2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),k=r(w,x),k.return=y,y=k):(n(y,w),k=F5(x,y.mode,k),k.return=y,y=k),o(y)):n(y,w)}return function(y,w,x,k){try{qE=0;var S=v(y,w,x,k);return ew=null,S}catch(A){if(A===M1||A===sD)throw A;var O=ku(29,A,null,y.mode);return O.lanes=k,O.return=y,O}finally{}}}var nv=pSe(!0),mSe=pSe(!1),qm=!1;function sQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(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 Eg(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,jr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=bR(e),aSe(e,null,n),t}return rD(e,i,t,n),bR(e)}function US(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,IOe(e,n)}}function Q5(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 o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,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 FF=!1;function QS(){if(FF){var e=Jx;if(e!==null)throw e}}function zS(e,t,n,i){FF=!1;var r=e.updateQueue;qm=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(ar&h)===h:(i&h)===h){h!==0&&h===Fw&&(FF=!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=Ds({},f,h);break e;case 2:qm=!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,o|=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),Vg|=o,e.lanes=o,e.memoizedState=f}}function gSe(e,t){if(typeof e!="function")throw Error(wt(191,e));e.call(t)}function bSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,yQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=YWe(c,i);VS(e,t,d,Ru(e))}else VS(e,t,i,Ru(e))}catch(f){VS(e,t,{then:function(){},status:"rejected",reason:f},Ru())}finally{Nr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function iKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(wt(476));var r=QSe(e).queue;USe(e,r,t,$y,n===null?iKe:function(){return zSe(e),n(i)})}function QSe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$y,baseState:$y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:$y},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zSe(e){var t=QSe(e);t.next===null&&(t=e.alternate.memoizedState),VS(e,t.next.queue,{},Ru())}function bQ(){return ol(YE)}function VSe(){return ja().memoizedState}function HSe(){return ja().memoizedState}function rKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ru();e=Eg(n);var i=Cg(t,e,n);i!==null&&(Lc(i,t,n),US(i,t,n)),t={cache:nQ()},e.payload=t;return}t=t.return}}function sKe(e,t,n){var i=Ru();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cD(e)?WSe(t,n):(n=ZU(e,t,n,i),n!==null&&(Lc(n,e,i),KSe(n,t,i)))}function qSe(e,t,n){var i=Ru();VS(e,t,n,i)}function VS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cD(e))WSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,$u(l,o))return rD(e,t,r,0),us===null&&iD(),!1}catch{}finally{}if(n=ZU(e,t,r,i),n!==null)return Lc(n,e,i),KSe(n,t,i),!0}return!1}function yQ(e,t,n,i){if(i={lane:2,revertLane:AQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cD(e)){if(t)throw Error(wt(479))}else t=ZU(e,n,i,2),t!==null&&Lc(t,e,2)}function cD(e){var t=e.alternate;return e===Ti||t!==null&&t===Ti}function WSe(e,t){tw=OR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function KSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,IOe(e,n)}}var KE={readContext:ol,use:oD,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useLayoutEffect:ua,useInsertionEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useSyncExternalStore:ua,useId:ua,useHostTransitionStatus:ua,useFormState:ua,useActionState:ua,useOptimistic:ua,useMemoCache:ua,useCacheRefresh:ua};KE.useEffectEvent=ua;var GSe={readContext:ol,use:oD,useCallback:function(e,t){return Hl().memoizedState=[e,t===void 0?null:t],e},useContext:ol,useEffect:UX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gj(4194308,4,MSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gj(4194308,4,e,t)},useInsertionEffect:function(e,t){Gj(4,2,e,t)},useMemo:function(e,t){var n=Hl();t=t===void 0?null:t;var i=e();if(iv){cg(!0);try{e()}finally{cg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Hl();if(n!==void 0){var r=n(t);if(iv){cg(!0);try{n(t)}finally{cg(!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=sKe.bind(null,Ti,e),[i.memoizedState,e]},useRef:function(e){var t=Hl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=qSe.bind(null,Ti,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mQ,useDeferredValue:function(e,t){var n=Hl();return gQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=USe.bind(null,Ti,e.queue,!0,!1),Hl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ti,r=Hl();if(ur){if(n===void 0)throw Error(wt(407));n=n()}else{if(n=t(),us===null)throw Error(wt(349));ar&127||kSe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,UX(SSe.bind(null,i,s,e),[e]),i.flags|=2048,Uw(9,{destroy:void 0},OSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Hl(),t=us.identifierPrefix;if(ur){var n=oh,i=ah;n=(i&~(1<<32-Nu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=SR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[rl]=t,s[Fc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(ll(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&&Zh(t)}}return Cs(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Zh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(wt(166));if(e=Og.current,j0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=sl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[rl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||qEe(e.nodeValue,n)),e||Qg(t,!0)}else e=PR(e).createTextNode(i),e[rl]=t,t.stateNode=e}return Cs(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=j0(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[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wu(t),t):(wu(t),null);if(t.flags&128)throw Error(wt(558))}return Cs(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=j0(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[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(wu(t),t):(wu(t),null)}return wu(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),F2(t,t.updateQueue),Cs(t),null);case 4:return Mw(),e===null&&TQ(t.stateNode.containerInfo),Cs(t),null;case 10:return Np(t.type),Cs(t),null;case 19:if($o(Aa),i=t.memoizedState,i===null)return Cs(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)sO(i,!1);else{if(ha!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kR(e),s!==null){for(t.flags|=128,sO(i,!1),e=s.updateQueue,t.updateQueue=e,F2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oSe(n,e),n=n.sibling;return Os(Aa,Aa.current&1|2),ur&&gp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_u()>TR&&(t.flags|=128,r=!0,sO(i,!1),t.lanes=4194304)}else{if(!r)if(e=kR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,F2(t,e),sO(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ur)return Cs(t),null}else 2*_u()-i.renderingStartTime>TR&&n!==536870912&&(t.flags|=128,r=!0,sO(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=_u(),e.sibling=null,n=Aa.current,Os(Aa,r?n&1|2:n&1),ur&&gp(t,i.treeForkCount),e):(Cs(t),null);case 22:case 23:return wu(t),aQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Cs(t),t.subtreeFlags&6&&(t.flags|=8192)):Cs(t),n=t.updateQueue,n!==null&&F2(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&&$o(By),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Np(Ga),Cs(t),null;case 25:return null;case 30:return null}throw Error(wt(156,t.tag))}function uKe(e,t){switch(tQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Np(Ga),Mw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hR(t),null;case 31:if(t.memoizedState!==null){if(wu(t),t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $o(Aa),null;case 4:return Mw(),null;case 10:return Np(t.type),null;case 22:case 23:return wu(t),aQ(),e!==null&&$o(By),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Np(Ga),null;case 25:return null;default:return null}}function oEe(e,t){switch(tQ(t),t.tag){case 3:Np(Ga),Mw();break;case 26:case 27:case 5:hR(t);break;case 4:Mw();break;case 31:t.memoizedState!==null&&wu(t);break;case 13:wu(t);break;case 19:$o(Aa);break;case 10:Np(t.type);break;case 22:case 23:wu(t),aQ(),e!==null&&$o(By);break;case 24:Np(Ga)}}function RA(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,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Wr(t,t.return,l)}}function zg(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 o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Wr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Wr(t,t.return,d)}}function lEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bSe(t,n)}catch(i){Wr(e,e.return,i)}}}function cEe(e,t,n){n.props=rv(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Wr(e,t,i)}}function HS(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){Wr(e,t,r)}}function lh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Wr(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){Wr(e,t,r)}else n.current=null}function uEe(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){Wr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;RKe(i,e.type,n,t),i[Fc]=t}catch(r){Wr(e,e.return,r)}}function dEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xb(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dEe(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&&xb(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 GF(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=Ep));else if(i!==4&&(i===27&&xb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function AR(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&&xb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(AR(e,t,n),e=e.sibling;e!==null;)AR(e,t,n),e=e.sibling}function fEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ll(t,i,n),t[rl]=e,t[Fc]=n}catch(s){Wr(e,e.return,s)}}var vp=!1,Ka=!1,J5=!1,eY=typeof WeakSet=="function"?WeakSet:Set,jo=null;function dKe(e,t){if(e=e.containerInfo,n8=$R,e=JOe(e),XU(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 o=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=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(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(i8={focusedElem:e,selectionRange:n},$R=!1,jo=t;jo!==null;)if(t=jo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jo=e;else for(;jo!==null;){switch(t=jo,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"))),ll(s,i,n),s[rl]=e,Ro(s),i=s;break e;case"link":var o=xY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=EX(l,b),w=EX(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,si.T=null,n=ZF,ZF=null;var s=Tg,o=Rp;if(uo=0,zw=Tg=null,Rp=0,jr&6)throw Error(wt(331));var l=jr;if(jr|=4,OEe(s.current),xEe(s,s.current,o,n),jr=l,IA(0,!1),ju&&typeof ju.onPostCommitFiberRoot=="function")try{ju.onPostCommitFiberRoot(EA,s)}catch{}return!0}finally{Nr.p=r,si.T=i,$Ee(e,t)}}function rY(e,t,n){t=ld(n,t),t=qF(e.stateNode,t,2),e=Cg(e,t,2),e!==null&&(AA(e,2),Nh(e))}function Wr(e,t,n){if(e.tag===3)rY(e,e,n);else for(;t!==null;){if(t.tag===3){rY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ag===null||!Ag.has(i))){e=ld(n,e),n=eEe(2),i=Cg(t,n,2),i!==null&&(tEe(n,i,t,e),AA(i,2),Nh(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new pKe;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)||(SQ=!0,r.add(n),e=vKe.bind(null,e,t,n),t.then(e,e))}function vKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,us===e&&(ar&n)===n&&(ha===4||ha===3&&(ar&62914560)===ar&&300>_u()-uD?!(jr&2)&&Vw(e,0):EQ|=n,Qw===ar&&(Qw=0)),Nh(e)}function BEe(e,t){t===0&&(t=NOe()),e=Iv(e,t),e!==null&&(AA(e,t),Nh(e))}function xKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BEe(e,n)}function wKe(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),BEe(e,n)}function kKe(e,t){return UU(e,t)}var NR=null,rx=null,e8=!1,RR=!1,n3=!1,hg=0;function Nh(e){e!==rx&&e.next===null&&(rx===null?NR=rx=e:rx=rx.next=e),RR=!0,e8||(e8=!0,SKe())}function IA(e,t){if(!n3&&RR){n3=!0;do for(var n=!1,i=NR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Nu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,sY(i,s))}else s=ar,s=JP(i,i===us?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||CA(i,s)||(n=!0,sY(i,s));i=i.next}while(n);n3=!1}}function OKe(){UEe()}function UEe(){RR=e8=!1;var e=0;hg!==0&&PKe()&&(e=hg);for(var t=_u(),n=null,i=NR;i!==null;){var r=i.next,s=QEe(i,t);s===0?(i.next=null,n===null?NR=r:n.next=r,r===null&&(rx=n)):(n=i,(e!==0||s&3)&&(RR=!0)),i=r}uo!==0&&uo!==5||IA(e),hg!==0&&(hg=0)}function QEe(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&&uY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function YEe(e,t,n){var i=$1;if(i&&typeof t=="string"&&t){var r=od(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),bY.has(r)||(bY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function zKe(e){dm.D(e),YEe("dns-prefetch",e,null)}function VKe(e,t){dm.C(e,t),YEe("preconnect",e,t)}function HKe(e,t,n){dm.L(e,t,n);var i=$1;if(i&&e&&t){var r='link[rel="preload"][as="'+od(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+od(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+od(n.imageSizes)+'"]')):r+='[href="'+od(e)+'"]';var s=r;switch(t){case"style":s=Hw(e);break;case"script":s=F1(e)}Ad.has(s)||(e=Ds({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ad.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(PA(s))||t==="script"&&i.querySelector(DA(s))||(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function qKe(e,t){dm.m(e,t);var n=$1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+od(i)+'"][href="'+od(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=F1(e)}if(!Ad.has(s)&&(e=Ds({rel:"modulepreload",href:e},t),Ad.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(DA(s)))return}i=n.createElement("link"),ll(i,"link",e),Ro(i),n.head.appendChild(i)}}}function WKe(e,t,n){dm.S(e,t,n);var i=$1;if(i&&e){var r=Xx(i).hoistableStyles,s=Hw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(PA(s)))l.loading=5;else{e=Ds({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ad.get(s))&&_Q(e,n);var c=o=i.createElement("link");Ro(c),ll(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,Jj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function KKe(e,t){dm.X(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function GKe(e,t){dm.M(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0,type:"module"},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function yY(e,t,n,i){var r=(r=Og.current)?DR(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=Hw(n.href),n=Xx(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=Hw(n.href);var s=Xx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(PA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Ad.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},Ad.set(e,n),s||XKe(r,e,n,o.state))),t&&i===null)throw Error(wt(528,""));return o}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=F1(n),n=Xx(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 Hw(e){return'href="'+od(e)+'"'}function PA(e){return'link[rel="stylesheet"]['+e+"]"}function ZEe(e){return Ds({},e,{"data-precedence":e.precedence,precedence:null})}function XKe(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}),ll(t,"link",n),Ro(t),e.head.appendChild(t))}function F1(e){return'[src="'+od(e)+'"]'}function DA(e){return"script[async]"+e}function vY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+od(n.href)+'"]');if(i)return t.instance=i,Ro(i),i;var r=Ds({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ro(i),ll(i,"style",r),Jj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Hw(n.href);var s=e.querySelector(PA(r));if(s)return t.state.loading|=4,t.instance=s,Ro(s),s;i=ZEe(n),(r=Ad.get(r))&&_Q(i,r),s=(e.ownerDocument||e).createElement("link"),Ro(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(s,"link",i),t.state.loading|=4,Jj(s,n.precedence,e),t.instance=s;case"script":return s=F1(n.src),(r=e.querySelector(DA(s)))?(t.instance=r,Ro(r),r):(i=n,(r=Ad.get(s))&&(i=Ds({},n),jQ(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ro(r),ll(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,Jj(i,n.precedence,e));return t.instance}function Jj(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,o=0;o title"):null)}function YKe(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 JEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function ZKe(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=Hw(i.href),s=t.querySelector(PA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=MR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ro(s);return}s=t.ownerDocument||t,i=ZEe(i),(r=Ad.get(r))&&_Q(i,r),s=s.createElement("link"),Ro(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(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=MR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function JKe(e,t){return e.stylesheets&&e.count===0&&tN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function MR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var LR=null;function tN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,LR=new Map,t.forEach(eGe,e),LR=null,MR.call(e))}function eGe(e,t){if(!(t.state.loading&4)){var n=LR.get(e);if(n)var i=n.get(null);else{n=new Map,LR.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(oCe)}catch(e){console.error(e)}}oCe(),mOe.exports=YP;var lGe=mOe.exports;const cGe=N1(lGe),DQ=p.createContext({});function mD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const gD=p.createContext(null),eC=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uGe 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 dGe({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(eC);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!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: ${o}px !important; @@ -109,27 +109,27 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),a.jsx(cGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const dGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=bD(fGe),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]),o==="popLayout"&&(e=a.jsx(uGe,{isPresent:n,children:e})),a.jsx(yD.Provider,{value:d,children:e})};function fGe(){return new Map}function sCe(e=!0){const t=p.useContext(yD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const q2=e=>e.key||"";function EY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const MQ=typeof window<"u",aCe=MQ?p.useLayoutEffect:p.useEffect,hf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=sCe(o),u=p.useMemo(()=>EY(e),[e]),d=o&&!l?[]:u.map(q2),f=p.useRef(!0),h=p.useRef(u),m=bD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);aCe(()=>{f.current=!1,h.current=u;for(let O=0;O{const k=q2(O),S=o&&!l?!1:u===v||d.includes(k),E=()=>{if(m.has(k))m.set(k,!0);else return;let C=!0;m.forEach(j=>{j||(C=!1)}),C&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(dGe,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:E,children:O},k)})})},_u=e=>e;let oCe=_u;const hGe={useManualTiming:!1};function pGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}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(o=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"],mGe=40;function lCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=W2.reduce((y,w)=>(y[w]=pGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,mGe),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=o[w];return y[w]=(O,k=!1,S=!1)=>(n||g(),x.schedule(O,k,S)),y},{}),cancel:y=>{for(let w=0;wCY[e].some(n=>!!t[n])};function gGe(e){for(const t in e)Hw[t]={...Hw[t],...e[t]}}const bGe=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 UR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bGe.has(e)}let uCe=e=>!UR(e);function dCe(e){e&&(uCe=t=>t.startsWith("on")?!UR(t):e(t))}try{dCe(require("@emotion/is-prop-valid").default)}catch{}function yGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(uCe(r)||n===!0&&UR(r)||!t&&!UR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function vGe({children:e,isValidProp:t,...n}){t&&dCe(t),n={...p.useContext(ZE),...n},n.isStatic=bD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(ZE.Provider,{value:i,children:e})}function xGe(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 vD=p.createContext({});function JE(e){return typeof e=="string"||Array.isArray(e)}function xD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const LQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$Q=["initial",...LQ];function wD(e){return xD(e.animate)||$Q.some(t=>JE(e[t]))}function fCe(e){return!!(wD(e)||e.variants)}function wGe(e,t){if(wD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||JE(n)?n:void 0,animate:JE(i)?i:void 0}}return e.inherit!==!1?t:{}}function OGe(e){const{initial:t,animate:n}=wGe(e,p.useContext(vD));return p.useMemo(()=>({initial:t,animate:n}),[AY(t),AY(n)])}function AY(e){return Array.isArray(e)?e.join(" "):e}const kGe=Symbol.for("motionComponentSymbol");function Nx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SGe(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):Nx(n)&&(n.current=i))},[t])}const FQ=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),EGe="framerAppearId",hCe="data-"+FQ(EGe),{schedule:BQ}=lCe(queueMicrotask,!1),pCe=p.createContext({});function CGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(vD),c=p.useContext(cCe),u=p.useContext(yD),d=p.useContext(ZE).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(pCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&AGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[hCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return aCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),BQ.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 AGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:mCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Nx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function mCe(e){if(e)return e.options.allowProjection!==!1?e.projection:mCe(e.parent)}function TGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&gGe(e);function l(u,d){let f;const h={...p.useContext(ZE),...u,layoutId:_Ge(u)},{isStatic:m}=h,g=OGe(u),b=i(u,m);if(!m&&MQ){jGe();const v=NGe(h);f=v.MeasureLayout,g.visualElement=CGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(vD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,SGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[kGe]=r,c}function _Ge({layoutId:e}){const t=p.useContext(DQ).id;return t&&e!==void 0?t+"-"+e:e}function jGe(e,t){p.useContext(cCe).strict}function NGe(e){const{drag:t,layout:n}=Hw;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 RGe=["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 UQ(e){return typeof e!="string"||e.includes("-")?!1:!!(RGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function TY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function QQ(e,t,n,i){if(typeof t=="function"){const[r,s]=TY(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]=TY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const f8=e=>Array.isArray(e),IGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),PGe=e=>f8(e)?e[e.length-1]||0:e,Al=e=>!!(e&&e.getVelocity);function rN(e){const t=Al(e)?e.get():e;return IGe(t)?t.toValue():t}function DGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:MGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const gCe=e=>(t,n)=>{const i=p.useContext(vD),r=p.useContext(yD),s=()=>DGe(e,t,i,r);return n?s():bD(s)};function MGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=rN(s[h]);let{initial:o,animate:l}=e;const c=wD(e),u=fCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!xD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),yCe=bCe("--"),LGe=bCe("var(--"),zQ=e=>LGe(e)?$Ge.test(e.split("/*")[0].trim()):!1,$Ge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Kp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},eC={...F1,transform:e=>Kp(0,1,e)},K2={...F1,default:1},IA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zm=IA("deg"),mh=IA("%"),Gn=IA("px"),FGe=IA("vh"),BGe=IA("vw"),_Y={...mh,parse:e=>mh.parse(e)/100,transform:e=>mh.transform(e*100)},UGe={borderWidth:Gn,borderTopWidth:Gn,borderRightWidth:Gn,borderBottomWidth:Gn,borderLeftWidth:Gn,borderRadius:Gn,radius:Gn,borderTopLeftRadius:Gn,borderTopRightRadius:Gn,borderBottomRightRadius:Gn,borderBottomLeftRadius:Gn,width:Gn,maxWidth:Gn,height:Gn,maxHeight:Gn,top:Gn,right:Gn,bottom:Gn,left:Gn,padding:Gn,paddingTop:Gn,paddingRight:Gn,paddingBottom:Gn,paddingLeft:Gn,margin:Gn,marginTop:Gn,marginRight:Gn,marginBottom:Gn,marginLeft:Gn,backgroundPositionX:Gn,backgroundPositionY:Gn},QGe={rotate:zm,rotateX:zm,rotateY:zm,rotateZ:zm,scale:K2,scaleX:K2,scaleY:K2,scaleZ:K2,skew:zm,skewX:zm,skewY:zm,distance:Gn,translateX:Gn,translateY:Gn,translateZ:Gn,x:Gn,y:Gn,z:Gn,perspective:Gn,transformPerspective:Gn,opacity:eC,originX:_Y,originY:_Y,originZ:Gn},jY={...F1,transform:Math.round},VQ={...UGe,...QGe,zIndex:jY,size:Gn,fillOpacity:eC,strokeOpacity:eC,numOctaves:jY},zGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VGe=$1.length;function HGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),xCe=()=>({...WQ(),attrs:{}}),KQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wCe(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 OCe=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 kCe(e,t,n,i){wCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(OCe.has(r)?r:FQ(r),t.attrs[r])}const QR={};function XGe(e){Object.assign(QR,e)}function SCe(e,{layout:t,layoutId:n}){return B0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!QR[e]||e==="opacity")}function GQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Al(r[o])||t.style&&Al(t.style[o])||SCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function ECe(e,t,n){const i=GQ(e,t,n);for(const r in e)if(Al(e[r])||Al(t[r])){const s=$1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function YGe(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 RY=["x","y","width","height","cx","cy","r"],ZGe={useVisualState:gCe({scrapeMotionValuesFromProps:ECe,createRenderState:xCe,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(B0.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{YGe(n,i),Is.render(()=>{qQ(i,r,KQ(n.tagName),e.transformTemplate),kCe(n,i)})})}})},JGe={useVisualState:gCe({scrapeMotionValuesFromProps:GQ,createRenderState:WQ})};function CCe(e,t,n){for(const i in t)!Al(t[i])&&!SCe(i,n)&&(e[i]=t[i])}function eXe({transformTemplate:e},t){return p.useMemo(()=>{const n=WQ();return HQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function tXe(e,t){const n=e.style||{},i={};return CCe(i,n,e),Object.assign(i,eXe(e,t)),i}function nXe(e,t){const n={},i=tXe(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 iXe(e,t,n,i){const r=p.useMemo(()=>{const s=xCe();return qQ(s,t,KQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};CCe(s,e.style,e),r.style={...s,...r.style}}return r}function rXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(UQ(n)?iXe:nXe)(i,s,o,n),u=yGe(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 sXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...UQ(i)?ZGe:JGe,preloadedFeatures:e,useRender:rXe(r),createVisualElement:t,Component:i};return TGe(o)}}function ACe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(sN===void 0&&gh.set(Go.isProcessing||hGe.useManualTiming?Go.timestamp:performance.now()),sN),set:e=>{sN=e,queueMicrotask(aXe)}};function YQ(e,t){e.indexOf(t)===-1&&e.push(t)}function ZQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class JQ{constructor(){this.subscriptions=[]}add(t){return YQ(this.subscriptions,t),()=>ZQ(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 lXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=gh.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=gh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oXe(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 JQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Is.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=gh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>IY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,IY);return _Ce(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 tC(e,t){return new lXe(e,t)}function cXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tC(n))}function uXe(e,t){const n=OD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=PGe(s[o]);cXe(e,o,l)}}function dXe(e){return!!(Al(e)&&e.add)}function h8(e,t){const n=e.getValue("willChange");if(dXe(n))return n.add(t)}function jCe(e){return e.props[hCe]}function ez(e){let t;return()=>(t===void 0&&(t=e()),t)}const fXe=ez(()=>window.ScrollTimeline!==void 0);class hXe{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(fXe()&&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 pXe extends hXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Rp=e=>e*1e3,Ip=e=>e/1e3;function tz(e){return typeof e=="function"}function PY(e,t){e.timeline=t,e.onfinish=null}const nz=e=>Array.isArray(e)&&typeof e[0]=="number",mXe={linearEasing:void 0};function gXe(e,t){const n=ez(e);return()=>{var i;return(i=mXe[t])!==null&&i!==void 0?i:n()}}const zR=gXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},NCe=(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})`,p8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:aS([0,.65,.55,1]),circOut:aS([.55,0,1,.45]),backIn:aS([.31,.01,.66,-.59]),backOut:aS([.33,1.53,.69,.99])};function ICe(e,t){if(e)return typeof e=="function"&&zR()?NCe(e,t):nz(e)?aS(e):Array.isArray(e)?e.map(n=>ICe(n,t)||p8.easeOut):p8[e]}const PCe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bXe=1e-7,yXe=12;function vXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=PCe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>bXe&&++lvXe(s,0,1,e,n);return s=>s===0||s===1?s:PCe(r(s),t,i)}const DCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,MCe=e=>t=>1-e(1-t),LCe=PA(.33,1.53,.69,.99),iz=MCe(LCe),$Ce=DCe(iz),FCe=e=>(e*=2)<1?.5*iz(e):.5*(2-Math.pow(2,-10*(e-1))),rz=e=>1-Math.sin(Math.acos(e)),BCe=MCe(rz),UCe=DCe(rz),QCe=e=>/^0[^.\s]+$/u.test(e);function xXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||QCe(e):!0}const KS=e=>Math.round(e*1e5)/1e5,sz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wXe(e){return e==null}const OXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,az=(e,t)=>n=>!!(typeof n=="string"&&OXe.test(n)&&n.startsWith(e)||t&&!wXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),zCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(sz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},kXe=e=>Kp(0,255,e),d3={...F1,transform:e=>Math.round(kXe(e))},Ty={test:az("rgb","red"),parse:zCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+d3.transform(e)+", "+d3.transform(t)+", "+d3.transform(n)+", "+KS(eC.transform(i))+")"};function SXe(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 m8={test:az("#"),parse:SXe,transform:Ty.transform},Rx={test:az("hsl","hue"),parse:zCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+mh.transform(KS(t))+", "+mh.transform(KS(n))+", "+KS(eC.transform(i))+")"},Sl={test:e=>Ty.test(e)||m8.test(e)||Rx.test(e),parse:e=>Ty.test(e)?Ty.parse(e):Rx.test(e)?Rx.parse(e):m8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ty.transform(e):Rx.transform(e)},EXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(EXe))===null||n===void 0?void 0:n.length)||0)>0}const VCe="number",HCe="color",AXe="var",TXe="var(",DY="${}",_Xe=/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 nC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(_Xe,c=>(Sl.test(c)?(i.color.push(s),r.push(HCe),n.push(Sl.parse(c))):c.startsWith(TXe)?(i.var.push(s),r.push(AXe),n.push(c)):(i.number.push(s),r.push(VCe),n.push(parseFloat(c))),++s,DY)).split(DY);return{values:n,split:l,indexes:i,types:r}}function qCe(e){return nC(e).values}function WCe(e){const{split:t,types:n}=nC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function NXe(e){const t=qCe(e);return WCe(e)(t.map(jXe))}const Gg={test:CXe,parse:qCe,createTransformer:WCe,getAnimatableNone:NXe},RXe=new Set(["brightness","contrast","saturate","opacity"]);function IXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(sz)||[];if(!i)return e;const r=n.replace(i,"");let s=RXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const PXe=/\b([a-z-]*)\(.*?\)/gu,g8={...Gg,getAnimatableNone:e=>{const t=e.match(PXe);return t?t.map(IXe).join(" "):e}},DXe={...VQ,color:Sl,backgroundColor:Sl,outlineColor:Sl,fill:Sl,stroke:Sl,borderColor:Sl,borderTopColor:Sl,borderRightColor:Sl,borderBottomColor:Sl,borderLeftColor:Sl,filter:g8,WebkitFilter:g8},oz=e=>DXe[e];function KCe(e,t){let n=oz(e);return n!==g8&&(n=Gg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const MXe=new Set(["auto","none","0"]);function LXe(e,t,n){let i=0,r;for(;ie===F1||e===Gn,LY=(e,t)=>parseFloat(e.split(", ")[t]),$Y=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return LY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?LY(s[1],e):0}},$Xe=new Set(["x","y","z"]),FXe=$1.filter(e=>!$Xe.has(e));function BXe(e){const t=[];return FXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Ww={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:$Y(4,13),y:$Y(5,14)};Ww.translateX=Ww.x;Ww.translateY=Ww.y;const Ky=new Set;let b8=!1,y8=!1;function GCe(){if(y8){const e=Array.from(Ky).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=BXe(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,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}y8=!1,b8=!1,Ky.forEach(e=>e.complete()),Ky.clear()}function XCe(){Ky.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(y8=!0)})}function UXe(){XCe(),GCe()}class lz{constructor(t,n,i,r,s,o=!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=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ky.add(this),b8||(b8=!0,Is.read(XCe),Is.resolveKeyframes(GCe))):(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),QXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zXe(e){const t=QXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function ZCe(e,t,n=1){const[i,r]=zXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return YCe(o)?parseFloat(o):o}return zQ(r)?ZCe(r,t,n+1):r}const JCe=e=>t=>t.test(e),VXe={test:e=>e==="auto",parse:e=>e},eAe=[F1,Gn,mh,zm,BGe,FGe,VXe],FY=e=>eAe.find(JCe(e));class tAe extends lz{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 BY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gg.test(e)||e==="0")&&!e.startsWith("url("));function HXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function kD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(WXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const KXe=40;class nAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=gh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>KXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&UXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=gh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!qXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(kD(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 v8=2e4;function iAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=v8?1/0:t}const ea=(e,t,n)=>e+(t-e)*n;function f3(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 GXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=f3(c,l,e+1/3),s=f3(c,l,e),o=f3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function VR(e,t){return n=>n>0?t:e}const h3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},XXe=[m8,Ty,Rx],YXe=e=>XXe.find(t=>t.test(e));function UY(e){const t=YXe(e);if(!t)return!1;let n=t.parse(e);return t===Rx&&(n=GXe(n)),n}const QY=(e,t)=>{const n=UY(e),i=UY(t);if(!n||!i)return VR(e,t);const r={...n};return s=>(r.red=h3(n.red,i.red,s),r.green=h3(n.green,i.green,s),r.blue=h3(n.blue,i.blue,s),r.alpha=ea(n.alpha,i.alpha,s),Ty.transform(r))},ZXe=(e,t)=>n=>t(e(n)),DA=(...e)=>e.reduce(ZXe),x8=new Set(["none","hidden"]);function JXe(e,t){return x8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function eYe(e,t){return n=>ea(e,t,n)}function cz(e){return typeof e=="number"?eYe:typeof e=="string"?zQ(e)?VR:Sl.test(e)?QY:iYe:Array.isArray(e)?rAe:typeof e=="object"?Sl.test(e)?QY:tYe:VR}function rAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>cz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function nYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Gg.createTransformer(t),i=nC(e),r=nC(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?x8.has(e)&&!r.values.length||x8.has(t)&&!i.values.length?JXe(e,t):DA(rAe(nYe(i,r),r.values),n):VR(e,t)};function sAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ea(e,t,n):cz(e)(e,t)}const rYe=5;function aAe(e,t,n){const i=Math.max(t-rYe,0);return _Ce(n-e(i),t-i)}const ca={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},p3=.001;function sYe({duration:e=ca.duration,bounce:t=ca.bounce,velocity:n=ca.velocity,mass:i=ca.mass}){let r,s,o=1-t;o=Kp(ca.minDamping,ca.maxDamping,o),e=Kp(ca.minDuration,ca.maxDuration,Ip(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=w8(u,o),g=Math.exp(-f);return p3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=w8(Math.pow(u,2),o);return(-r(u)+p3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-p3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=oYe(r,s,l);if(e=Rp(e),isNaN(c))return{stiffness:ca.stiffness,damping:ca.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const aYe=12;function oYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function uYe(e){let t={velocity:ca.velocity,stiffness:ca.stiffness,damping:ca.damping,mass:ca.mass,isResolvedFromDuration:!1,...e};if(!zY(e,cYe)&&zY(e,lYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Kp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ca.mass,stiffness:r,damping:s}}else{const n=sYe(e);t={...t,...n,mass:ca.mass},t.isResolvedFromDuration=!0}return t}function oAe(e=ca.visualDuration,t=ca.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],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=uYe({...n,velocity:-Ip(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Ip(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?ca.restSpeed.granular:ca.restSpeed.default),r||(r=w?ca.restDelta.granular:ca.restDelta.default);let x;if(b<1){const k=w8(y,b);x=S=>{const E=Math.exp(-b*y*S);return o-E*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)x=k=>o-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);x=S=>{const E=Math.exp(-b*y*S),C=Math.min(k*S,300);return o-E*((g+b*y*v)*Math.sinh(C)+k*v*Math.cosh(C))/k}}const O={calculatedDuration:m&&f||null,next:k=>{const S=x(k);if(m)l.done=k>=f;else{let E=0;b<1&&(E=k===0?Rp(g):aAe(x,k,S));const C=Math.abs(E)<=i,j=Math.abs(o-S)<=r;l.done=C&&j}return l.value=l.done?o:S,l},toString:()=>{const k=Math.min(iAe(O),v8),S=NCe(E=>O.next(k*E).value,k,30);return k+"ms "+S}};return O}function VY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=C=>l!==void 0&&Cc,g=C=>l===void 0?c:c===void 0||Math.abs(l-C)-b*Math.exp(-C/i),x=C=>y+w(C),O=C=>{const j=w(C),T=x(C);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let k,S;const E=C=>{m(h.value)&&(k=C,S=oAe({keyframes:[h.value,g(h.value)],velocity:aAe(x,C,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:C=>{let j=!1;return!S&&k===void 0&&(j=!0,O(C),E(C)),k!==void 0&&C>=k?S.next(C-k):(!j&&O(C),h)}}}const dYe=PA(.42,0,1,1),fYe=PA(0,0,.58,1),lAe=PA(.42,0,.58,1),hYe=e=>Array.isArray(e)&&typeof e[0]!="number",pYe={linear:_u,easeIn:dYe,easeInOut:lAe,easeOut:fYe,circIn:rz,circInOut:UCe,circOut:BCe,backIn:iz,backInOut:$Ce,backOut:LCe,anticipate:FCe},HY=e=>{if(nz(e)){oCe(e.length===4);const[t,n,i,r]=e;return PA(t,n,i,r)}else if(typeof e=="string")return pYe[e];return e};function mYe(e,t,n){const i=[],r=n||sAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=mYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Kp(e[0],e[s-1],d)):u}function bYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=qw(0,t,i);e.push(ea(n,1,r))}}function yYe(e){const t=[0];return bYe(t,e.length-1),t}function vYe(e,t){return e.map(n=>n*t)}function xYe(e,t){return e.map(()=>t||lAe).splice(0,e.length-1)}function HR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=hYe(i)?i.map(HY):HY(i),s={done:!1,value:t[0]},o=vYe(n&&n.length===t.length?n:yYe(t),e),l=gYe(o,t,{ease:Array.isArray(r)?r:xYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const wYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Is.update(t,!0),stop:()=>Kg(t),now:()=>Go.isProcessing?Go.timestamp:gh.now()}},OYe={decay:VY,inertia:VY,tween:HR,keyframes:HR,spring:oAe},kYe=e=>e/100;class uz extends nAe{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,o=(r==null?void 0:r.KeyframeResolver)||lz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(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:o=0}=this.options,l=tz(n)?n:OYe[n]||HR;let c,u;l!==HR&&typeof t[0]!="number"&&(c=DA(kYe,sAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=iAe(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:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,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 C=Math.min(this.currentTime,d)/f;let j=Math.floor(C),T=C%1;!T&&C>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(O=o)),x=Kp(0,1,T)*f}const k=w?{done:!1,value:c[0]}:O.next(x);l&&(k.value=l(k.value));let{done:S}=k;!w&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&r!==void 0&&(k.value=kD(c,this.options,r)),v&&v(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Ip(t.calculatedDuration):0}get time(){return Ip(this.currentTime)}set time(t){t=Rp(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=Ip(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wYe,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 SYe=new Set(["opacity","clipPath","filter","transform"]);function EYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=ICe(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:o==="reverse"?"alternate":"normal"})}const CYe=ez(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qR=10,AYe=2e4;function TYe(e){return tz(e.type)||e.type==="spring"||!RCe(e.ease)}function _Ye(e,t){const n=new uz({...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(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&zR()&&jYe(s)&&(s=cAe[s]),TYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=_Ye(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=EYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(PY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(kD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Ip(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ip(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Rp(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 _u;const{animation:i}=n;PY(i,t)}return _u}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:o,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 uz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Rp(this.time);u.setWithVelocity(g.sample(b-qR).value,g.sample(b).value,qR)}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:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return CYe()&&i&&SYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const NYe={type:"spring",stiffness:500,damping:25,restSpeed:10},RYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),IYe={type:"keyframes",duration:.8},PYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DYe=(e,{keyframes:t})=>t.length>2?IYe:B0.has(e)?e.startsWith("scale")?RYe(t[1]):NYe:PYe;function MYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(e,t,n,i={},r,s)=>o=>{const l=XQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Rp(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:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};MYe(l)||(d={...d,...DYe(e,d)}),d.duration&&(d.duration=Rp(d.duration)),d.repeatDelay&&(d.repeatDelay=Rp(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=kD(d.keyframes,l);if(h!==void 0)return Is.update(()=>{d.onUpdate(h),d.onComplete()}),new pXe([])}return!s&&qY.supports(d)?new qY(d):new uz(d)};function LYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function uAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=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&&LYe(d,f))continue;const g={delay:n,...XQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=jCe(e);if(y){const w=window.MotionHandoffAnimation(y,f,Is);w!==null&&(g.startTime=w,b=!0)}}h8(e,f),h.start(dz(f,h,m,e.shouldReduceMotion&&TCe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Is.update(()=>{l&&uXe(e,l)})}),u}function O8(e,t,n={}){var i;const r=OD(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 o=r?()=>Promise.all(uAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return $Ye(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function $Ye(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(FYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(O8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function FYe(e,t){return e.sortNodePosition(t)}function BYe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>O8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=O8(e,t,n);else{const r=typeof t=="function"?OD(e,t,n.custom):t;i=Promise.all(uAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const UYe=$Q.length;function dAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dAe(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})=>BYe(e,n,i)))}function HYe(e){let t=VYe(e),n=WY(),i=!0;const r=c=>(u,d)=>{var f;const h=OD(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 o(c){const{props:u}=e,d=dAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});k===!1&&(R={});const{prevResolvedValues:A={}}=w,N={...A,...R},P=_=>{C=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=A[_];if(m.hasOwnProperty(_))continue;let M=!1;f8(L)&&f8(F)?M=!ACe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&E)||j)&&f.push(...T.map(_=>({animation:_,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=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=WY(),i=!0}}}function qYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ACe(t,e):!1}function Wb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WY(){return{animate:Wb(!0),whileInView:Wb(),whileHover:Wb(),whileTap:Wb(),whileDrag:Wb(),whileFocus:Wb(),exit:Wb()}}class Sb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class WYe extends Sb{constructor(t){super(t),t.animationState||(t.animationState=HYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xD(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 KYe=0;class GYe extends Sb{constructor(){super(...arguments),this.id=KYe++}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 XYe={animation:{Feature:WYe},exit:{Feature:GYe}},Zd={x:!1,y:!1};function fAe(){return Zd.x||Zd.y}function YYe(e){return e==="x"||e==="y"?Zd[e]?null:(Zd[e]=!0,()=>{Zd[e]=!1}):Zd.x||Zd.y?null:(Zd.x=Zd.y=!0,()=>{Zd.x=Zd.y=!1})}const fz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function iC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function MA(e){return{point:{x:e.pageX,y:e.pageY}}}const ZYe=e=>t=>fz(t)&&e(t,MA(t));function GS(e,t,n,i){return iC(e,t,ZYe(n),i)}const KY=(e,t)=>Math.abs(e-t);function JYe(e,t){const n=KY(e.x,t.x),i=KY(e.y,t.y);return Math.sqrt(n**2+i**2)}class hAe{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=g3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=JYe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Go;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=m3(h,this.transformPagePoint),Is.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=g3(f.type==="pointercancel"?this.lastMoveEventInfo:m3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!fz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=MA(t),l=m3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Go;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,g3(l,this.history)),this.removeListeners=DA(GS(this.contextWindow,"pointermove",this.handlePointerMove),GS(this.contextWindow,"pointerup",this.handlePointerUp),GS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Kg(this.updatePoint)}}function m3(e,t){return t?{point:t(e.point)}:e}function GY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function g3({point:e},t){return{point:e,delta:GY(e,pAe(t)),offset:GY(e,eZe(t)),velocity:tZe(t,.1)}}function eZe(e){return e[0]}function pAe(e){return e[e.length-1]}function tZe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=pAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Rp(t)));)n--;if(!i)return{x:0,y:0};const s=Ip(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const mAe=1e-4,nZe=1-mAe,iZe=1+mAe,gAe=.01,rZe=0-gAe,sZe=0+gAe;function Mu(e){return e.max-e.min}function aZe(e,t,n){return Math.abs(e-t)<=n}function XY(e,t,n,i=.5){e.origin=i,e.originPoint=ea(t.min,t.max,e.origin),e.scale=Mu(n)/Mu(t),e.translate=ea(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nZe&&e.scale<=iZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=rZe&&e.translate<=sZe||isNaN(e.translate))&&(e.translate=0)}function XS(e,t,n,i){XY(e.x,t.x,n.x,i?i.originX:void 0),XY(e.y,t.y,n.y,i?i.originY:void 0)}function YY(e,t,n){e.min=n.min+t.min,e.max=e.min+Mu(t)}function oZe(e,t,n){YY(e.x,t.x,n.x),YY(e.y,t.y,n.y)}function ZY(e,t,n){e.min=t.min-n.min,e.max=e.min+Mu(t)}function YS(e,t,n){ZY(e.x,t.x,n.x),ZY(e.y,t.y,n.y)}function lZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ea(n,e,i.max):Math.min(e,n)),e}function JY(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 cZe(e,{top:t,left:n,bottom:i,right:r}){return{x:JY(e.x,n,r),y:JY(e.y,t,i)}}function eZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=qw(t.min,t.max-i,e.min):i>r&&(n=qw(e.min,e.max-r,t.min)),Kp(0,1,n)}function fZe(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 k8=.35;function hZe(e=k8){return e===!1?e=0:e===!0&&(e=k8),{x:tZ(e,"left","right"),y:tZ(e,"top","bottom")}}function tZ(e,t,n){return{min:nZ(e,t),max:nZ(e,n)}}function nZ(e,t){return typeof e=="number"?e:e[t]||0}const iZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ix=()=>({x:iZ(),y:iZ()}),rZ=()=>({min:0,max:0}),ya=()=>({x:rZ(),y:rZ()});function Zu(e){return[e("x"),e("y")]}function bAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function pZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mZe(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 b3(e){return e===void 0||e===1}function S8({scale:e,scaleX:t,scaleY:n}){return!b3(e)||!b3(t)||!b3(n)}function uy(e){return S8(e)||yAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yAe(e){return sZ(e.x)||sZ(e.y)}function sZ(e){return e&&e!=="0%"}function WR(e,t,n){const i=e-n,r=t*i;return n+r}function aZ(e,t,n,i,r){return r!==void 0&&(e=WR(e,r,i)),WR(e,n,i)+t}function E8(e,t=0,n=1,i,r){e.min=aZ(e.min,t,n,i,r),e.max=aZ(e.max,t,n,i,r)}function vAe(e,{x:t,y:n}){E8(e.x,t.translate,t.scale,t.originPoint),E8(e.y,n.translate,n.scale,n.originPoint)}const oZ=.999999999999,lZ=1.0000000000001;function gZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;loZ&&(t.x=1),t.yoZ&&(t.y=1)}function Px(e,t){e.min=e.min+t,e.max=e.max+t}function cZ(e,t,n,i,r=.5){const s=ea(e.min,e.max,r);E8(e,t,n,s,i)}function Dx(e,t){cZ(e.x,t.x,t.scaleX,t.scale,t.originX),cZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function xAe(e,t){return bAe(mZe(e.getBoundingClientRect(),t))}function bZe(e,t,n){const i=xAe(e,n),{scroll:r}=t;return r&&(Px(i.x,r.offset.x),Px(i.y,r.offset.y)),i}const wAe=({current:e})=>e?e.ownerDocument.defaultView:null,yZe=new WeakMap;class vZe{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=ya(),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(MA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=YYe(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),Zu(v=>{let y=this.getAxisMotionValue(v).get()||0;if(mh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Mu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Is.postRender(()=>g(d,f)),h8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(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=xZe(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=()=>Zu(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 hAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:wAe(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&&Is.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||!G2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=lZe(o,this.constraints[t],this.elastic[t])),s.set(o)}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&&Nx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=cZe(r.layoutBox,n):this.constraints=!1,this.elastic=hZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=fZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Nx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=bZe(i,r.root,this.visualElement.getTransformPagePoint());let o=uZe(r.layout.layoutBox,s);if(n){const l=n(pZe(o));this.hasMutatedConstraints=!!l,l&&(o=bAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Zu(d=>{if(!G2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(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 h8(this.visualElement,t),i.start(dz(t,i,0,n,this.visualElement,!1))}stopAnimation(){Zu(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zu(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){Zu(n=>{const{drag:i}=this.getProps();if(!G2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-ea(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Nx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Zu(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=dZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Zu(o=>{if(!G2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(ea(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;yZe.set(this.visualElement,this);const t=this.visualElement.current,n=GS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Nx(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()),Is.read(i);const o=iC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Zu(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function G2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wZe extends Sb{constructor(t){super(t),this.removeGroupControls=_u,this.removeListeners=_u,this.controls=new vZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_u}unmount(){this.removeGroupControls(),this.removeListeners()}}const uZ=e=>(t,n)=>{e&&Is.postRender(()=>e(t,n))};class OZe extends Sb{constructor(){super(...arguments),this.removePointerDownListener=_u}onPointerDown(t){this.session=new hAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:uZ(t),onStart:uZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Is.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=GS(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 aN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function dZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ak={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Gn.test(e))e=parseFloat(e);else return e;const n=dZ(e,t.target.x),i=dZ(e,t.target.y);return`${n}% ${i}%`}},kZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Gg.parse(e);if(r.length>5)return i;const s=Gg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=ea(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class SZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;XGe(EZe),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()})),aN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Is.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),BQ.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 OAe(e){const[t,n]=sCe(),i=p.useContext(DQ);return a.jsx(SZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(pCe),isPresent:t,safeToRemove:n})}const EZe={borderRadius:{...ak,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ak,borderTopRightRadius:ak,borderBottomLeftRadius:ak,borderBottomRightRadius:ak,boxShadow:kZe};function CZe(e,t,n){const i=Al(e)?e:tC(e);return i.start(dz("",i,t,n)),i.animation}function AZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const TZe=(e,t)=>e.depth-t.depth;class _Ze{constructor(){this.children=[],this.isDirty=!1}add(t){YQ(this.children,t),this.isDirty=!0}remove(t){ZQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TZe),this.isDirty=!1,this.children.forEach(t)}}function jZe(e,t){const n=gh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Kg(i),e(s-t))};return Is.read(i,!0),()=>Kg(i)}const kAe=["TopLeft","TopRight","BottomLeft","BottomRight"],NZe=kAe.length,fZ=e=>typeof e=="string"?parseFloat(e):e,hZ=e=>typeof e=="number"||Gn.test(e);function RZe(e,t,n,i,r,s){r?(e.opacity=ea(0,n.opacity!==void 0?n.opacity:1,IZe(i)),e.opacityExit=ea(t.opacity!==void 0?t.opacity:1,0,PZe(i))):s&&(e.opacity=ea(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(qw(e,t,i))}function mZ(e,t){e.min=t.min,e.max=t.max}function Yu(e,t){mZ(e.x,t.x),mZ(e.y,t.y)}function gZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bZ(e,t,n,i,r){return e-=t,e=WR(e,1/n,i),r!==void 0&&(e=WR(e,1/r,i)),e}function DZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(mh.test(t)&&(t=parseFloat(t),t=ea(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ea(s.min,s.max,i);e===s&&(l-=t),e.min=bZ(e.min,t,n,l,r),e.max=bZ(e.max,t,n,l,r)}function yZ(e,t,[n,i,r],s,o){DZe(e,t[n],t[i],t[r],t.scale,s,o)}const MZe=["x","scaleX","originX"],LZe=["y","scaleY","originY"];function vZ(e,t,n,i){yZ(e.x,t,MZe,n?n.x:void 0,i?i.x:void 0),yZ(e.y,t,LZe,n?n.y:void 0,i?i.y:void 0)}function xZ(e){return e.translate===0&&e.scale===1}function EAe(e){return xZ(e.x)&&xZ(e.y)}function wZ(e,t){return e.min===t.min&&e.max===t.max}function $Ze(e,t){return wZ(e.x,t.x)&&wZ(e.y,t.y)}function OZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function CAe(e,t){return OZ(e.x,t.x)&&OZ(e.y,t.y)}function kZ(e){return Mu(e.x)/Mu(e.y)}function SZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class FZe{constructor(){this.members=[]}add(t){YQ(this.members,t),t.scheduleRender()}remove(t){if(ZQ(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 BZe(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}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 dy={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},oS=typeof window<"u"&&window.MotionDebug!==void 0,y3=["","X","Y","Z"],UZe={visibility:"hidden"},EZ=1e3;let QZe=0;function v3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function AAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jCe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Is,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&AAe(i)}function TAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=QZe++,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,oS&&(dy.totalNodes=dy.resolvedTargetDeltas=dy.recalculatedProjection=0),this.nodes.forEach(HZe),this.nodes.forEach(XZe),this.nodes.forEach(YZe),this.nodes.forEach(qZe),oS&&window.MotionDebug.record(dy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=jZe(h,250),aN.hasAnimatedSinceResize&&(aN.hasAnimatedSinceResize=!1,this.nodes.forEach(AZ))})}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()||nJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!CAe(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={...XQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||AZ(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,Kg(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(ZZe),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&&AAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=O/1e3;TZ(f.x,o.x,k),TZ(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(YS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),eJe(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&$Ze(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ya()),Yu(x,this.relativeTarget)),b&&(this.animationValues=d,RZe(d,u,this.latestValues,k,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},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&&(Kg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Is.update(()=>{aN.hasAnimatedSinceResize=!0,this.currentAnimation=CZe(0,EZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},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(EZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&_Ae(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ya();const f=Mu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Mu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Yu(l,c),Dx(l,d),XS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new FZe),this.sharedNodes.get(o).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 o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&v3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(CZ),this.root.sharedNodes.clear()}}}function zZe(e){e.updateLayout()}function VZe(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,o=n.source!==e.layout.source;s==="size"?Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Mu(h);h.min=i[f].min,h.max=h.min+m}):_Ae(s,n.layoutBox,i)&&Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Mu(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=Ix();XS(l,i,n.layoutBox);const c=Ix();o?XS(c,e.applyTransform(r,!0),n.measuredBox):XS(c,i,n.layoutBox);const u=!EAe(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=ya();YS(g,n.layoutBox,h.layoutBox);const b=ya();YS(b,i,m.layoutBox),CAe(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 HZe(e){oS&&dy.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 qZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WZe(e){e.clearSnapshot()}function CZ(e){e.clearMeasurements()}function KZe(e){e.isLayoutDirty=!1}function GZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function AZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function XZe(e){e.resolveTargetDelta()}function YZe(e){e.calcProjection()}function ZZe(e){e.resetSkewAndRotation()}function JZe(e){e.removeLeadSnapshot()}function TZ(e,t,n){e.translate=ea(t.translate,0,n),e.scale=ea(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function _Z(e,t,n,i){e.min=ea(t.min,n.min,i),e.max=ea(t.max,n.max,i)}function eJe(e,t,n,i){_Z(e.x,t.x,n.x,i),_Z(e.y,t.y,n.y,i)}function tJe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nJe={duration:.45,ease:[.4,0,.1,1]},jZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),NZ=jZ("applewebkit/")&&!jZ("chrome/")?Math.round:_u;function RZ(e){e.min=NZ(e.min),e.max=NZ(e.max)}function iJe(e){RZ(e.x),RZ(e.y)}function _Ae(e,t,n){return e==="position"||e==="preserve-aspect"&&!aZe(kZ(t),kZ(n),.2)}function rJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const sJe=TAe({attachResizeListener:(e,t)=>iC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),x3={current:void 0},jAe=TAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!x3.current){const e=new sJe({});e.mount(window),e.setOptions({layoutScroll:!0}),x3.current=e}return x3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),aJe={pan:{Feature:OZe},drag:{Feature:wZe,ProjectionNode:jAe,MeasureLayout:OAe}};function oJe(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 NAe(e,t){const n=oJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function IZ(e){return t=>{t.pointerType==="touch"||fAe()||e(t)}}function lJe(e,t,n={}){const[i,r,s]=NAe(e,n),o=IZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=IZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function PZ(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&&Is.postRender(()=>s(t,MA(t)))}class cJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=lJe(t,n=>(PZ(this.node,n,"Start"),i=>PZ(this.node,i,"End"))))}unmount(){}}class uJe extends Sb{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=DA(iC(this.node.current,"focus",()=>this.onFocus()),iC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const RAe=(e,t)=>t?e===t?!0:RAe(e,t.parentElement):!1,dJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function fJe(e){return dJe.has(e.tagName)||e.tabIndex!==-1}const lS=new WeakSet;function DZ(e){return t=>{t.key==="Enter"&&e(t)}}function w3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=DZ(()=>{if(lS.has(n))return;w3(n,"down");const r=DZ(()=>{w3(n,"up")}),s=()=>w3(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 MZ(e){return fz(e)&&!fAe()}function pJe(e,t,n={}){const[i,r,s]=NAe(e,n),o=l=>{const c=l.currentTarget;if(!MZ(l)||lS.has(c))return;lS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!MZ(m)||!lS.has(c))&&(lS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||RAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!fJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>hJe(u,r),r)}),s}function LZ(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&&Is.postRender(()=>s(t,MA(t)))}class mJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=pJe(t,n=>(LZ(this.node,n,"Start"),(i,{success:r})=>LZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const C8=new WeakMap,O3=new WeakMap,gJe=e=>{const t=C8.get(e.target);t&&t(e)},bJe=e=>{e.forEach(gJe)};function yJe({root:e,...t}){const n=e||document;O3.has(n)||O3.set(n,{});const i=O3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(bJe,{root:e,...t})),i[r]}function vJe(e,t,n){const i=yJe(t);return C8.set(e,n),i.observe(e),()=>{C8.delete(e),i.unobserve(e)}}const xJe={some:0,all:1};class wJe extends Sb{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,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:xJe[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 vJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(OJe(t,n))&&this.startObserver()}unmount(){}}function OJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kJe={inView:{Feature:wJe},tap:{Feature:mJe},focus:{Feature:uJe},hover:{Feature:cJe}},SJe={layout:{ProjectionNode:jAe,MeasureLayout:OAe}},KR={current:null},hz={current:!1};function IAe(){if(hz.current=!0,!!MQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>KR.current=e.matches;e.addListener(t),t()}else KR.current=!1}const EJe=[...eAe,Sl,Gg],CJe=e=>EJe.find(JCe(e)),$Z=new WeakMap;function AJe(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,tC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,tC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const FZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class TJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lz,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=gh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),hz.current||IAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:KR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){$Z.delete(this.current),this.projection&&this.projection.unmount(),Kg(this.notifyUpdate),Kg(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=B0.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Is.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),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 Hw){const n=Hw[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):ya()}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=tC(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"&&(YCe(r)||QCe(r))?r=parseFloat(r):!CJe(r)&&Gg.test(n)&&(r=KCe(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 o=QQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[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 JQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class PAe extends TJe{constructor(){super(...arguments),this.KeyframeResolver=tAe}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 _Je(e){return window.getComputedStyle(e)}class jJe extends PAe{constructor(){super(...arguments),this.type="html",this.renderInstance=wCe}readValueFromInstance(t,n){if(B0.has(n)){const i=oz(n);return i&&i.default||0}else{const i=_Je(t),r=(yCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return xAe(t,n)}build(t,n,i){HQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return GQ(t,n,i)}}class NJe extends PAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ya}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(B0.has(n)){const i=oz(n);return i&&i.default||0}return n=OCe.has(n)?n:FQ(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return ECe(t,n,i)}build(t,n,i){qQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){kCe(t,n,i,r)}mount(t){this.isSVGTag=KQ(t.tagName),super.mount(t)}}const RJe=(e,t)=>UQ(e)?new NJe(t):new jJe(t,{allowProjection:e!==p.Fragment}),IJe=sXe({...XYe,...kJe,...aJe,...SJe},RJe),Cr=xGe(IJe);function SD(){!hz.current&&IAe();const[e]=p.useState(KR.current);return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function rx(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 PJe=["container"];function DJe(e){var t=e.container,n=t===void 0?document.body:t,i=ED(e,PJe);return yi.createPortal(Ni.createElement("div",oo({},i)),n)}function MJe(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.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 LJe(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.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 $Je(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function FJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function UZ(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,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Gm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function k3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Gm(e,s,n,innerWidth)[0],f=Gm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(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:o,lastCY:l}}function _8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function S3(e,t,n){var i=_8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=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]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function Y2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=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 UJe={T:0,L:0,W:0,H:0,FIT:void 0},MAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},QJe=["className"];function zJe(e){var t=e.className,n=t===void 0?"":t,i=ED(e,QJe);return Ni.createElement("div",oo({className:"PhotoView__Spinner "+n},i),Ni.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Ni.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"}),Ni.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var VJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function HJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=ED(e,VJe),u=MAe();return t&&!i?Ni.createElement(Ni.Fragment,null,Ni.createElement("img",oo({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&&(o?Ni.createElement("span",{className:"PhotoView__icon"},o):Ni.createElement(zJe,{className:"PhotoView__icon"}))):l?Ni.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var qJe={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 WJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,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,k=e.onPhotoResize,S=e.isActive,E=e.expose,C=GR(qJe),j=C[0],T=C[1],R=p.useRef(0),A=MAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,H=j.loaded,q=H===void 0?!n:H,U=j.broken,Z=j.x,z=j.y,J=j.touched,ne=j.stopRaf,W=j.maskTouched,X=j.rotate,V=j.scale,ae=j.CX,Y=j.CY,K=j.lastX,te=j.lastY,ue=j.lastCX,fe=j.lastCY,se=j.lastScale,me=j.touchTime,Ee=j.touchLength,xe=j.pause,Ne=j.reach,We=Gy({onScale:function(_e){return Xe(X2(_e))},onRotate:function(_e){X!==_e&&(E({rotate:_e}),T(oo({rotate:_e},S3(P,D,_e))))}});function Xe(_e,Ot,Nt){V!==_e&&(E({scale:_e}),T(oo({scale:_e},k3(Z,z,L,M,V,_e,Ot,Nt),_e<=1&&{x:0,y:0})))}var Re=Y2(function(_e,Ot,Nt){if(Nt===void 0&&(Nt=0),(J||W)&&S){var Yt=_8(X,L,M),xn=Yt[0],Ke=Yt[1];if(Nt===0&&R.current===0){var St=Math.abs(_e-ae)<=20,qe=Math.abs(Ot-Y)<=20;if(St&&qe)return void T({lastCX:_e,lastCY:Ot});R.current=St?Ot>Y?3:2:1}var nt,et=_e-ue,ft=Ot-fe;if(Nt===0){var Et=Gm(et+K,V,xn,innerWidth)[0],At=Gm(ft+te,V,Ke,innerHeight);nt=function(Gt,Ye,wt,vt){return Ye&&Gt===1||vt==="x"?"x":wt&&Gt>1||vt==="y"?"y":void 0}(R.current,Et,At[0],Ne),nt!==void 0&&x(nt,_e,Ot,V)}if(nt==="x"||W)return void T({reach:"x"});var It=X2(V+(Nt-Ee)/100/2*V,P/L,.2);E({scale:It}),T(oo({touchLength:Nt,reach:nt,scale:It},k3(Z,z,L,M,V,It,_e,Ot,et,ft)))}},{maxWait:8});function re(_e){return!ne&&!J&&(A.current&&T(oo({},_e,{pause:u})),A.current)}var ce,ve,Se,oe,$e,Ue,be,ke,Ae=($e=function(_e){return re({x:_e})},Ue=function(_e){return re({y:_e})},be=function(_e){return A.current&&(E({scale:_e}),T({scale:_e})),!J&&A.current},ke=Gy({X:function(_e){return $e(_e)},Y:function(_e){return Ue(_e)},S:function(_e){return be(_e)}}),function(_e,Ot,Nt,Yt,xn,Ke,St,qe,nt,et,ft){var Et=_8(et,xn,Ke),At=Et[0],It=Et[1],Gt=Gm(_e,qe,At,innerWidth),Ye=Gt[0],wt=Gt[1],vt=Gm(Ot,qe,It,innerHeight),tn=vt[0],Qt=vt[1],un=Date.now()-ft;if(un>=200||qe!==St||Math.abs(nt-St)>1){var De=k3(_e,Ot,xn,Ke,St,qe),on=De.x,On=De.y,Sn=Ye?wt:on!==_e?on:null,zi=tn?Qt:On!==Ot?On:null;return Sn!==null&&xy(_e,Sn,ke.X),zi!==null&&xy(Ot,zi,ke.Y),void(qe!==St&&xy(St,qe,ke.S))}var dn=(_e-Nt)/un,lr=(Ot-Yt)/un,Mn=Math.sqrt(Math.pow(dn,2)+Math.pow(lr,2)),ei=!1,Bn=!1;(function(ki,zn){var Rn,di=ki,rt=0,zt=0,ze=function(_n){Rn||(Rn=_n);var jr=_n-Rn,Hs=Math.sign(ki),qs=-.001*Hs,Dr=Math.sign(-di)*Math.pow(di,2)*2e-4,ti=di*jr+(qs+Dr)*Math.pow(jr,2)/2;rt+=ti,Rn=_n,Hs*(di+=(qs+Dr)*jr)<=0?Ht():zn(rt)?bt():Ht()};function bt(){zt=requestAnimationFrame(ze)}function Ht(){cancelAnimationFrame(zt)}bt()})(Mn,function(ki){var zn=_e+ki*(dn/Mn),Rn=Ot+ki*(lr/Mn),di=Gm(zn,St,At,innerWidth),rt=di[0],zt=di[1],ze=Gm(Rn,St,It,innerHeight),bt=ze[0],Ht=ze[1];if(rt&&!ei&&(ei=!0,Ye?xy(zn,zt,ke.X):QZ(zt,zn+(zn-zt),ke.X)),bt&&!Bn&&(Bn=!0,tn?xy(Rn,Ht,ke.Y):QZ(Ht,Rn+(Rn-Ht),ke.Y)),ei&&Bn)return!1;var _n=ei||ke.X(zt),jr=Bn||ke.Y(Ht);return _n&&jr})}),He=(ce=y,ve=function(_e,Ot){Ne||Xe(V!==1?1:Math.max(2,P/L),_e,Ot)},Se=p.useRef(0),oe=Y2(function(){Se.current=0,ce.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var _e=[].slice.call(arguments);Se.current+=1,oe.apply(void 0,_e),Se.current>=2&&(oe.cancel(),Se.current=0,ve.apply(void 0,_e))});function Qe(_e,Ot){if(R.current=0,(J||W)&&S){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Nt=X2(V,P/L);if(Ae(Z,z,K,te,L,M,V,Nt,se,X,me),O(_e,Ot),ae===_e&&Y===Ot){if(J)return void He(_e,Ot);W&&w(_e,Ot)}}}function jt(_e,Ot,Nt){Nt===void 0&&(Nt=0),T({touched:!0,CX:_e,CY:Ot,lastCX:_e,lastCY:Ot,lastX:Z,lastY:z,lastScale:V,touchLength:Nt,touchTime:Date.now()})}function Pt(_e){T({maskTouched:!0,CX:_e.clientX,CY:_e.clientY,lastX:Z,lastY:z})}rx(np?void 0:"mousemove",function(_e){_e.preventDefault(),Re(_e.clientX,_e.clientY)}),rx(np?void 0:"mouseup",function(_e){Qe(_e.clientX,_e.clientY)}),rx(np?"touchmove":void 0,function(_e){_e.preventDefault();var Ot=UZ(_e);Re.apply(void 0,Ot)},{passive:!1}),rx(np?"touchend":void 0,function(_e){var Ot=_e.changedTouches[0];Qe(Ot.clientX,Ot.clientY)},{passive:!1}),rx("resize",Y2(function(){q&&!J&&(T(S3(P,D,X)),k())},{maxWait:8})),T8(function(){S&&E(oo({scale:V,rotate:X},We))},[S]);var Kt=function(_e,Ot,Nt,Yt,xn,Ke,St,qe,nt,et){var ft=function(on,On,Sn,zi,dn){var lr=p.useRef(!1),Mn=GR({lead:!0,scale:Sn}),ei=Mn[0],Bn=ei.lead,ki=ei.scale,zn=Mn[1],Rn=Y2(function(di){try{return dn(!0),zn({lead:!1,scale:di}),Promise.resolve()}catch(rt){return Promise.reject(rt)}},{wait:zi});return T8(function(){lr.current?(dn(!1),zn({lead:!0}),Rn(Sn)):lr.current=!0},[Sn]),Bn?[on*ki,On*ki,Sn/ki]:[on*Sn,On*Sn,1]}(Ke,St,qe,nt,et),Et=ft[0],At=ft[1],It=ft[2],Gt=function(on,On,Sn,zi,dn){var lr=p.useState(UJe),Mn=lr[0],ei=lr[1],Bn=p.useState(0),ki=Bn[0],zn=Bn[1],Rn=p.useRef(),di=Gy({OK:function(){return on&&zn(4)}});function rt(zt){dn(!1),zn(zt)}return p.useEffect(function(){if(Rn.current||(Rn.current=Date.now()),Sn){if(function(zt,ze){var bt=zt&&zt.current;if(bt&&bt.nodeType===1){var Ht=bt.getBoundingClientRect();ze({T:Ht.top,L:Ht.left,W:Ht.width,H:Ht.height,FIT:bt.tagName==="IMG"?getComputedStyle(bt).objectFit:void 0})}}(On,ei),on)return Date.now()-Rn.current<250?(zn(1),requestAnimationFrame(function(){zn(2),requestAnimationFrame(function(){return rt(3)})}),void setTimeout(di.OK,zi)):void zn(4);rt(5)}},[on,Sn]),[ki,Mn]}(_e,Ot,Nt,nt,et),Ye=Gt[0],wt=Gt[1],vt=wt.W,tn=wt.FIT,Qt=innerWidth/2,un=innerHeight/2,De=Ye<3||Ye>4;return[De?vt?wt.L:Qt:Yt+(Qt-Ke*qe/2),De?vt?wt.T:un:xn+(un-St*qe/2),Et,De&&tn?Et*(wt.H/vt):At,Ye===0?It:De?vt/(Ke*qe)||.01:It,De?tn?1:0:1,Ye,tn]}(u,c,q,Z,z,L,M,V,d,function(_e){return T({pause:_e})}),Ct=Kt[4],xt=Kt[6],tt="transform "+d+"ms "+f,mt={className:m,onMouseDown:np?void 0:function(_e){_e.stopPropagation(),_e.button===0&&jt(_e.clientX,_e.clientY,0)},onTouchStart:np?function(_e){_e.stopPropagation(),jt.apply(void 0,UZ(_e))}:void 0,onWheel:function(_e){if(!Ne){var Ot=X2(V-_e.deltaY/100/2,P/L);T({stopRaf:!0}),Xe(Ot,_e.clientX,_e.clientY)}},style:{width:Kt[2]+"px",height:Kt[3]+"px",opacity:Kt[5],objectFit:xt===4?void 0:Kt[7],transform:X?"rotate("+X+"deg)":void 0,transition:xt>2?tt+", opacity "+d+"ms ease, height "+(xt<4?d/2:xt>4?d:0)+"ms "+f:void 0}};return Ni.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!np&&S?Pt:void 0,onTouchStart:np&&S?function(_e){return Pt(_e.touches[0])}:void 0},Ni.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ct+", 0, 0, "+Ct+", "+Kt[0]+", "+Kt[1]+")",transition:J||xe?void 0:tt,willChange:S?"transform":void 0}},n?Ni.createElement(HJe,oo({src:n,loaded:q,broken:U},mt,{onPhotoLoad:function(_e){T(oo({},_e,_e.loaded&&S3(_e.naturalWidth||0,_e.naturalHeight||0,X)))},loadingElement:b,brokenElement:v})):i&&i({attrs:mt,scale:Ct,rotate:X})))}var zZ={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 KJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,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,k=e.brokenElement,S=e.images,E=e.index,C=E===void 0?0:E,j=e.onIndexChange,T=e.visible,R=e.onClose,A=e.afterClose,N=e.portalContainer,P=GR(zZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,H=I.touched,q=I.pause,U=I.lastCX,Z=I.lastCY,z=I.bg,J=z===void 0?u:z,ne=I.lastBg,W=I.overlay,X=I.minimal,V=I.scale,ae=I.rotate,Y=I.onScale,K=I.onRotate,te=e.hasOwnProperty("index"),ue=te?C:L,fe=te?j:F,se=p.useRef(ue),me=S.length,Ee=S[ue],xe=typeof n=="boolean"?n:me>n,Ne=function(Ct,xt){var tt=p.useReducer(function(Nt){return!Nt},!1)[1],mt=p.useRef(0),_e=function(Nt){var Yt=p.useRef(Nt);function xn(Ke){Yt.current=Ke}return p.useMemo(function(){(function(Ke){Ct?(Ke(Ct),mt.current=1):mt.current=2})(xn)},[Nt]),[Yt.current,xn]}(Ct),Ot=_e[1];return[_e[0],mt.current,function(){tt(),mt.current===2&&(Ot(!1),xt&&xt()),mt.current=0}]}(T,A),We=Ne[0],Xe=Ne[1],Re=Ne[2];T8(function(){if(We)return D({pause:!0,x:ue*-(innerWidth+jv)}),void(se.current=ue);D(zZ)},[We]);var re=Gy({close:function(Ct){K&&K(0),D({overlay:!0,lastBg:J}),R(Ct)},changeIndex:function(Ct,xt){xt===void 0&&(xt=!1);var tt=xe?se.current+(Ct-ue):Ct,mt=me-1,_e=A8(tt,0,mt),Ot=xe?tt:_e,Nt=innerWidth+jv;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-Nt*Ot,pause:xt}),se.current=Ot,fe&&fe(xe?Ct<0?mt:Ct>mt?0:Ct:_e)}}),ce=re.close,ve=re.changeIndex;function Se(Ct){return Ct?ce():D({overlay:!W})}function oe(){D({x:-(innerWidth+jv)*ue,lastCX:void 0,lastCY:void 0,pause:!0}),se.current=ue}function $e(Ct,xt,tt,mt){Ct==="x"?function(_e){if(U!==void 0){var Ot=_e-U,Nt=Ot;!xe&&(ue===0&&Ot>0||ue===me-1&&Ot<0)&&(Nt=Ot/2),D({touched:!0,lastCX:U,x:-(innerWidth+jv)*se.current+Nt,pause:!1})}else D({touched:!0,lastCX:_e,x:M,pause:!1})}(xt):Ct==="y"&&function(_e,Ot){if(Z!==void 0){var Nt=u===null?null:A8(u,.01,u-Math.abs(_e-Z)/100/4);D({touched:!0,lastCY:Z,bg:Ot===1?Nt:u,minimal:Ot===1})}else D({touched:!0,lastCY:_e,bg:J,minimal:!0})}(tt,mt)}function Ue(Ct,xt){var tt=Ct-(U??Ct),mt=xt-(Z??xt),_e=!1;if(tt<-40)ve(ue+1);else if(tt>40)ve(ue-1);else{var Ot=-(innerWidth+jv)*se.current;Math.abs(mt)>100&&X&&f&&(_e=!0,ce()),D({touched:!1,x:Ot,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!_e||W})}}rx("keydown",function(Ct){if(T)switch(Ct.key){case"ArrowLeft":ve(ue-1,!0);break;case"ArrowRight":ve(ue+1,!0);break;case"Escape":ce()}});var be=function(Ct,xt,tt){return p.useMemo(function(){var mt=Ct.length;return tt?Ct.concat(Ct).concat(Ct).slice(mt+xt-1,mt+xt+2):Ct.slice(Math.max(xt-1,0),Math.min(xt+2,mt+1))},[Ct,xt,tt])}(S,ue,xe);if(!We)return null;var ke=W&&!Xe,Ae=T?J:ne,He=Y&&K&&{images:S,index:ue,visible:T,onClose:ce,onIndexChange:ve,overlayVisible:ke,overlay:Ee&&Ee.overlay,scale:V,rotate:ae,onScale:Y,onRotate:K},Qe=i?i(Xe):400,jt=r?r(Xe):BZ,Pt=i?i(3):600,Kt=r?r(3):BZ;return Ni.createElement(DJe,{className:"PhotoView-Portal"+(ke?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ct){return Ct.stopPropagation()},container:N},T&&Ni.createElement(FJe,null),Ni.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Xe===1?" PhotoView-Slider__fadeIn":Xe===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:jt,transitionDuration:(H?0:Qe)+"ms",animationDuration:Qe+"ms"},onAnimationEnd:Re}),m&&Ni.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Ni.createElement("div",{className:"PhotoView-Slider__Counter"},ue+1," / ",me),Ni.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&He&&b(He),Ni.createElement(MJe,{className:"PhotoView-Slider__toolbarIcon",onClick:ce}))),be.map(function(Ct,xt){var tt=xe||ue!==0?se.current-1+xt:ue+xt;return Ni.createElement(WJe,{key:xe?Ct.key+"/"+Ct.src+"/"+tt:Ct.key,item:Ct,speed:Qe,easing:jt,visible:T,onReachMove:$e,onReachUp:Ue,onPhotoTap:function(){return Se(s)},onMaskTap:function(){return Se(l)},wrapClassName:x,className:w,style:{left:(innerWidth+jv)*tt+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:H||q?void 0:"transform "+Pt+"ms "+Kt},loadingElement:O,brokenElement:k,onPhotoResize:oe,isActive:se.current===tt,expose:D})}),!np&&m&&Ni.createElement(Ni.Fragment,null,(xe||ue!==0)&&Ni.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(ue-1,!0)}},Ni.createElement(LJe,null)),(xe||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,o)}}),m=Gy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return oo({},o,h)},[o,h]);return Ni.createElement(DAe.Provider,{value:g},t,Ni.createElement(KJe,oo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var LAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(DAe),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=Gy({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:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,oo({},b,{ref:m}))):null};function u0(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function $Ae(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function pz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function oN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function ZJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function VZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function HZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function JJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function eet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function net(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.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 FAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function j8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function iet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Ic(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function ret(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function BAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function ul(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function N8(){return bn.resolvedLanguage||bn.language}function set(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function aet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&set(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function oet(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function cet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const qZ="veadk_auth_qs",uet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let ok=null;function det(){if(ok!==null)return ok;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,o)=>{(i&&uet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(qZ,r),ok=r):ok=sessionStorage.getItem(qZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return ok}function Ta(e){const t=det();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 ho=3e4,hr=12e4,mz=1e4;function po(e,t=ho){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const XR="veadk_local_user",YR="veadk_local_user_tab",fet="X-VeADK-OAuth-Refresh-Retry",het=[50,250],pet=/^[A-Za-z0-9]{1,16}$/;function UAe(){try{const e=sessionStorage.getItem(YR);if(e)return e;const t=localStorage.getItem(XR);return t&&sessionStorage.setItem(YR,t),t}catch{try{return localStorage.getItem(XR)}catch{return null}}}function WZ(e){try{sessionStorage.setItem(YR,e)}catch{}try{localStorage.setItem(XR,e)}catch{}}function met(){try{sessionStorage.removeItem(YR)}catch{}try{localStorage.removeItem(XR)}catch{}}function uc(e){const t=new Headers(e),n=UAe();return n&&t.set("X-VeADK-Local-User",n),t}async function QAe(){let e;try{e=await fetch("/web/auth-config",{headers:ul({Accept:"application/json"}),signal:po(void 0,mz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("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(Q("identity.invalidConfigResponse"))}}function get(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function bet(){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 yet(){const[e,t]=await Promise.all([R8(),QAe()]);return e.status==="unauthenticated"&&t.length>0}function vet(){window.location.assign("/oauth2/logout")}async function xet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:ul({Accept:"application/json"}),signal:po(void 0,mz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=het[e];if(t.status!==401||t.headers.get(fet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function R8(){const e=await xet();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(Q("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(Q("identity.serviceFailed",{status:e.status}));const t=UAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function wet(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 Oet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const I8="veadk:authentication-required";let ZS=null,cS=null;function ket(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 Eet(e){ZS||(ZS=new Promise(n=>{cS=n}),window.dispatchEvent(new Event(I8)));const t=ZS;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 Cet(){return ZS!==null}function Aet(){cS==null||cS(),cS=null,ZS=null}async function CD(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])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` -${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const Tet=/\brun_sse\s*failed\s*:\s*404\b/i,_et=/session not found/i,jet=/(?:^|[::\s])not found\s*$/i,Net=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,Ret=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Iet=/(?: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 Nv(e,t){return e.includes(t)?e:`${e} + `),()=>{document.head.removeChild(d)}},[t]),a.jsx(uGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const fGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=mD(hGe),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]),o==="popLayout"&&(e=a.jsx(dGe,{isPresent:n,children:e})),a.jsx(gD.Provider,{value:d,children:e})};function hGe(){return new Map}function lCe(e=!0){const t=p.useContext(gD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const H2=e=>e.key||"";function TY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const MQ=typeof window<"u",cCe=MQ?p.useLayoutEffect:p.useEffect,uf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=lCe(o),u=p.useMemo(()=>TY(e),[e]),d=o&&!l?[]:u.map(H2),f=p.useRef(!0),h=p.useRef(u),m=mD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);cCe(()=>{f.current=!1,h.current=u;for(let k=0;k{const S=H2(k),O=o&&!l?!1:u===v||d.includes(S),A=()=>{if(m.has(S))m.set(S,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(fGe,{isPresent:O,initial:!f.current||n?void 0:!1,custom:O?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:O?void 0:A,children:k},S)})})},Iu=e=>e;let uCe=Iu;const pGe={useManualTiming:!1};function mGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}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(o=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 q2=["read","resolveKeyframes","update","preRender","render","postRender"],gGe=40;function dCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=q2.reduce((y,w)=>(y[w]=mGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,gGe),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:q2.reduce((y,w)=>{const x=o[w];return y[w]=(k,S=!1,O=!1)=>(n||g(),x.schedule(k,S,O)),y},{}),cancel:y=>{for(let w=0;w_Y[e].some(n=>!!t[n])};function bGe(e){for(const t in e)Ww[t]={...Ww[t],...e[t]}}const yGe=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 BR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||yGe.has(e)}let hCe=e=>!BR(e);function pCe(e){e&&(hCe=t=>t.startsWith("on")?!BR(t):e(t))}try{pCe(require("@emotion/is-prop-valid").default)}catch{}function vGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(hCe(r)||n===!0&&BR(r)||!t&&!BR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function xGe({children:e,isValidProp:t,...n}){t&&pCe(t),n={...p.useContext(eC),...n},n.isStatic=mD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(eC.Provider,{value:i,children:e})}function wGe(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 bD=p.createContext({});function tC(e){return typeof e=="string"||Array.isArray(e)}function yD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const LQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$Q=["initial",...LQ];function vD(e){return yD(e.animate)||$Q.some(t=>tC(e[t]))}function mCe(e){return!!(vD(e)||e.variants)}function kGe(e,t){if(vD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||tC(n)?n:void 0,animate:tC(i)?i:void 0}}return e.inherit!==!1?t:{}}function OGe(e){const{initial:t,animate:n}=kGe(e,p.useContext(bD));return p.useMemo(()=>({initial:t,animate:n}),[jY(t),jY(n)])}function jY(e){return Array.isArray(e)?e.join(" "):e}const SGe=Symbol.for("motionComponentSymbol");function Rx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EGe(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):Rx(n)&&(n.current=i))},[t])}const FQ=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),CGe="framerAppearId",gCe="data-"+FQ(CGe),{schedule:BQ}=dCe(queueMicrotask,!1),bCe=p.createContext({});function AGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(bD),c=p.useContext(fCe),u=p.useContext(gD),d=p.useContext(eC).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(bCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&TGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[gCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return cCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),BQ.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 TGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Rx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function yCe(e){if(e)return e.options.allowProjection!==!1?e.projection:yCe(e.parent)}function _Ge({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&bGe(e);function l(u,d){let f;const h={...p.useContext(eC),...u,layoutId:jGe(u)},{isStatic:m}=h,g=OGe(u),b=i(u,m);if(!m&&MQ){NGe();const v=RGe(h);f=v.MeasureLayout,g.visualElement=AGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(bD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,EGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[SGe]=r,c}function jGe({layoutId:e}){const t=p.useContext(DQ).id;return t&&e!==void 0?t+"-"+e:e}function NGe(e,t){p.useContext(fCe).strict}function RGe(e){const{drag:t,layout:n}=Ww;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 IGe=["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 UQ(e){return typeof e!="string"||e.includes("-")?!1:!!(IGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function NY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function QQ(e,t,n,i){if(typeof t=="function"){const[r,s]=NY(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]=NY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),PGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),DGe=e=>d8(e)?e[e.length-1]||0:e,Cl=e=>!!(e&&e.getVelocity);function iN(e){const t=Cl(e)?e.get():e;return PGe(t)?t.toValue():t}function MGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:LGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const vCe=e=>(t,n)=>{const i=p.useContext(bD),r=p.useContext(gD),s=()=>MGe(e,t,i,r);return n?s():mD(s)};function LGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=iN(s[h]);let{initial:o,animate:l}=e;const c=vD(e),u=mCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!yD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),wCe=xCe("--"),$Ge=xCe("var(--"),zQ=e=>$Ge(e)?FGe.test(e.split("/*")[0].trim()):!1,FGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Gp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},nC={...U1,transform:e=>Gp(0,1,e)},W2={...U1,default:1},MA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Um=MA("deg"),gh=MA("%"),Yn=MA("px"),BGe=MA("vh"),UGe=MA("vw"),RY={...gh,parse:e=>gh.parse(e)/100,transform:e=>gh.transform(e*100)},QGe={borderWidth:Yn,borderTopWidth:Yn,borderRightWidth:Yn,borderBottomWidth:Yn,borderLeftWidth:Yn,borderRadius:Yn,radius:Yn,borderTopLeftRadius:Yn,borderTopRightRadius:Yn,borderBottomRightRadius:Yn,borderBottomLeftRadius:Yn,width:Yn,maxWidth:Yn,height:Yn,maxHeight:Yn,top:Yn,right:Yn,bottom:Yn,left:Yn,padding:Yn,paddingTop:Yn,paddingRight:Yn,paddingBottom:Yn,paddingLeft:Yn,margin:Yn,marginTop:Yn,marginRight:Yn,marginBottom:Yn,marginLeft:Yn,backgroundPositionX:Yn,backgroundPositionY:Yn},zGe={rotate:Um,rotateX:Um,rotateY:Um,rotateZ:Um,scale:W2,scaleX:W2,scaleY:W2,scaleZ:W2,skew:Um,skewX:Um,skewY:Um,distance:Yn,translateX:Yn,translateY:Yn,translateZ:Yn,x:Yn,y:Yn,z:Yn,perspective:Yn,transformPerspective:Yn,opacity:nC,originX:RY,originY:RY,originZ:Yn},IY={...U1,transform:Math.round},VQ={...QGe,...zGe,zIndex:IY,size:Yn,fillOpacity:nC,strokeOpacity:nC,numOctaves:IY},VGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HGe=B1.length;function qGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),OCe=()=>({...WQ(),attrs:{}}),KQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SCe(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 ECe=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 CCe(e,t,n,i){SCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(ECe.has(r)?r:FQ(r),t.attrs[r])}const UR={};function YGe(e){Object.assign(UR,e)}function ACe(e,{layout:t,layoutId:n}){return Dv.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!UR[e]||e==="opacity")}function GQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Cl(r[o])||t.style&&Cl(t.style[o])||ACe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function TCe(e,t,n){const i=GQ(e,t,n);for(const r in e)if(Cl(e[r])||Cl(t[r])){const s=B1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function ZGe(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 DY=["x","y","width","height","cx","cy","r"],JGe={useVisualState:vCe({scrapeMotionValuesFromProps:TCe,createRenderState:OCe,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(Dv.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{ZGe(n,i),Ps.render(()=>{qQ(i,r,KQ(n.tagName),e.transformTemplate),CCe(n,i)})})}})},eXe={useVisualState:vCe({scrapeMotionValuesFromProps:GQ,createRenderState:WQ})};function _Ce(e,t,n){for(const i in t)!Cl(t[i])&&!ACe(i,n)&&(e[i]=t[i])}function tXe({transformTemplate:e},t){return p.useMemo(()=>{const n=WQ();return HQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nXe(e,t){const n=e.style||{},i={};return _Ce(i,n,e),Object.assign(i,tXe(e,t)),i}function iXe(e,t){const n={},i=nXe(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 rXe(e,t,n,i){const r=p.useMemo(()=>{const s=OCe();return qQ(s,t,KQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};_Ce(s,e.style,e),r.style={...s,...r.style}}return r}function sXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(UQ(n)?rXe:iXe)(i,s,o,n),u=vGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Cl(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function aXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...UQ(i)?JGe:eXe,preloadedFeatures:e,useRender:sXe(r),createVisualElement:t,Component:i};return _Ge(o)}}function jCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(rN===void 0&&bh.set(Zo.isProcessing||pGe.useManualTiming?Zo.timestamp:performance.now()),rN),set:e=>{rN=e,queueMicrotask(oXe)}};function YQ(e,t){e.indexOf(t)===-1&&e.push(t)}function ZQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class JQ{constructor(){this.subscriptions=[]}add(t){return YQ(this.subscriptions,t),()=>ZQ(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 cXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=bh.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=bh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lXe(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 JQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Ps.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=bh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>MY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,MY);return RCe(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 iC(e,t){return new cXe(e,t)}function uXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,iC(n))}function dXe(e,t){const n=xD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=DGe(s[o]);uXe(e,o,l)}}function fXe(e){return!!(Cl(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(fXe(n))return n.add(t)}function ICe(e){return e.props[gCe]}function ez(e){let t;return()=>(t===void 0&&(t=e()),t)}const hXe=ez(()=>window.ScrollTimeline!==void 0);class pXe{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(hXe()&&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 mXe extends pXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ip=e=>e*1e3,Pp=e=>e/1e3;function tz(e){return typeof e=="function"}function LY(e,t){e.timeline=t,e.onfinish=null}const nz=e=>Array.isArray(e)&&typeof e[0]=="number",gXe={linearEasing:void 0};function bXe(e,t){const n=ez(e);return()=>{var i;return(i=gXe[t])!==null&&i!==void 0?i:n()}}const QR=bXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Kw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},PCe=(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})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lS([0,.65,.55,1]),circOut:lS([.55,0,1,.45]),backIn:lS([.31,.01,.66,-.59]),backOut:lS([.33,1.53,.69,.99])};function MCe(e,t){if(e)return typeof e=="function"&&QR()?PCe(e,t):nz(e)?lS(e):Array.isArray(e)?e.map(n=>MCe(n,t)||h8.easeOut):h8[e]}const LCe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yXe=1e-7,vXe=12;function xXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=LCe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>yXe&&++lxXe(s,0,1,e,n);return s=>s===0||s===1?s:LCe(r(s),t,i)}const $Ce=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,FCe=e=>t=>1-e(1-t),BCe=LA(.33,1.53,.69,.99),iz=FCe(BCe),UCe=$Ce(iz),QCe=e=>(e*=2)<1?.5*iz(e):.5*(2-Math.pow(2,-10*(e-1))),rz=e=>1-Math.sin(Math.acos(e)),zCe=FCe(rz),VCe=$Ce(rz),HCe=e=>/^0[^.\s]+$/u.test(e);function wXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||HCe(e):!0}const XS=e=>Math.round(e*1e5)/1e5,sz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kXe(e){return e==null}const OXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,az=(e,t)=>n=>!!(typeof n=="string"&&OXe.test(n)&&n.startsWith(e)||t&&!kXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),qCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(sz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},SXe=e=>Gp(0,255,e),u3={...U1,transform:e=>Math.round(SXe(e))},Oy={test:az("rgb","red"),parse:qCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+XS(nC.transform(i))+")"};function EXe(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 p8={test:az("#"),parse:EXe,transform:Oy.transform},Ix={test:az("hsl","hue"),parse:qCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+gh.transform(XS(t))+", "+gh.transform(XS(n))+", "+XS(nC.transform(i))+")"},Ol={test:e=>Oy.test(e)||p8.test(e)||Ix.test(e),parse:e=>Oy.test(e)?Oy.parse(e):Ix.test(e)?Ix.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Oy.transform(e):Ix.transform(e)},CXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function AXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(CXe))===null||n===void 0?void 0:n.length)||0)>0}const WCe="number",KCe="color",TXe="var",_Xe="var(",$Y="${}",jXe=/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 rC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(jXe,c=>(Ol.test(c)?(i.color.push(s),r.push(KCe),n.push(Ol.parse(c))):c.startsWith(_Xe)?(i.var.push(s),r.push(TXe),n.push(c)):(i.number.push(s),r.push(WCe),n.push(parseFloat(c))),++s,$Y)).split($Y);return{values:n,split:l,indexes:i,types:r}}function GCe(e){return rC(e).values}function XCe(e){const{split:t,types:n}=rC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function RXe(e){const t=GCe(e);return XCe(e)(t.map(NXe))}const qg={test:AXe,parse:GCe,createTransformer:XCe,getAnimatableNone:RXe},IXe=new Set(["brightness","contrast","saturate","opacity"]);function PXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(sz)||[];if(!i)return e;const r=n.replace(i,"");let s=IXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const DXe=/\b([a-z-]*)\(.*?\)/gu,m8={...qg,getAnimatableNone:e=>{const t=e.match(DXe);return t?t.map(PXe).join(" "):e}},MXe={...VQ,color:Ol,backgroundColor:Ol,outlineColor:Ol,fill:Ol,stroke:Ol,borderColor:Ol,borderTopColor:Ol,borderRightColor:Ol,borderBottomColor:Ol,borderLeftColor:Ol,filter:m8,WebkitFilter:m8},oz=e=>MXe[e];function YCe(e,t){let n=oz(e);return n!==m8&&(n=qg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const LXe=new Set(["auto","none","0"]);function $Xe(e,t,n){let i=0,r;for(;ie===U1||e===Yn,BY=(e,t)=>parseFloat(e.split(", ")[t]),UY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return BY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?BY(s[1],e):0}},FXe=new Set(["x","y","z"]),BXe=B1.filter(e=>!FXe.has(e));function UXe(e){const t=[];return BXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Gw={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:UY(4,13),y:UY(5,14)};Gw.translateX=Gw.x;Gw.translateY=Gw.y;const zy=new Set;let g8=!1,b8=!1;function ZCe(){if(b8){const e=Array.from(zy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=UXe(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,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,zy.forEach(e=>e.complete()),zy.clear()}function JCe(){zy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function QXe(){JCe(),ZCe()}class lz{constructor(t,n,i,r,s,o=!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=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zy.add(this),g8||(g8=!0,Ps.read(JCe),Ps.resolveKeyframes(ZCe))):(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),zXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function VXe(e){const t=zXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function tAe(e,t,n=1){const[i,r]=VXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return eAe(o)?parseFloat(o):o}return zQ(r)?tAe(r,t,n+1):r}const nAe=e=>t=>t.test(e),HXe={test:e=>e==="auto",parse:e=>e},iAe=[U1,Yn,gh,Um,UGe,BGe,HXe],QY=e=>iAe.find(nAe(e));class rAe extends lz{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 zY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qg.test(e)||e==="0")&&!e.startsWith("url("));function qXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function wD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(KXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const GXe=40;class sAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>GXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&QXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!WXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(wD(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 y8=2e4;function aAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const Js=(e,t,n)=>e+(t-e)*n;function d3(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 XXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function zR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},YXe=[p8,Oy,Ix],ZXe=e=>YXe.find(t=>t.test(e));function VY(e){const t=ZXe(e);if(!t)return!1;let n=t.parse(e);return t===Ix&&(n=XXe(n)),n}const HY=(e,t)=>{const n=VY(e),i=VY(t);if(!n||!i)return zR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=Js(n.alpha,i.alpha,s),Oy.transform(r))},JXe=(e,t)=>n=>t(e(n)),$A=(...e)=>e.reduce(JXe),v8=new Set(["none","hidden"]);function eYe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tYe(e,t){return n=>Js(e,t,n)}function cz(e){return typeof e=="number"?tYe:typeof e=="string"?zQ(e)?zR:Ol.test(e)?HY:rYe:Array.isArray(e)?oAe:typeof e=="object"?Ol.test(e)?HY:nYe:zR}function oAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>cz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function iYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=qg.createTransformer(t),i=rC(e),r=rC(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?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?eYe(e,t):$A(oAe(iYe(i,r),r.values),n):zR(e,t)};function lAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Js(e,t,n):cz(e)(e,t)}const sYe=5;function cAe(e,t,n){const i=Math.max(t-sYe,0);return RCe(n-e(i),t-i)}const da={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},h3=.001;function aYe({duration:e=da.duration,bounce:t=da.bounce,velocity:n=da.velocity,mass:i=da.mass}){let r,s,o=1-t;o=Gp(da.minDamping,da.maxDamping,o),e=Gp(da.minDuration,da.maxDuration,Pp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=lYe(r,s,l);if(e=Ip(e),isNaN(c))return{stiffness:da.stiffness,damping:da.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const oYe=12;function lYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function dYe(e){let t={velocity:da.velocity,stiffness:da.stiffness,damping:da.damping,mass:da.mass,isResolvedFromDuration:!1,...e};if(!qY(e,uYe)&&qY(e,cYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Gp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:da.mass,stiffness:r,damping:s}}else{const n=aYe(e);t={...t,...n,mass:da.mass},t.isResolvedFromDuration=!0}return t}function uAe(e=da.visualDuration,t=da.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],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=dYe({...n,velocity:-Pp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Pp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?da.restSpeed.granular:da.restSpeed.default),r||(r=w?da.restDelta.granular:da.restDelta.default);let x;if(b<1){const S=x8(y,b);x=O=>{const A=Math.exp(-b*y*O);return o-A*((g+b*y*v)/S*Math.sin(S*O)+v*Math.cos(S*O))}}else if(b===1)x=S=>o-Math.exp(-y*S)*(v+(g+y*v)*S);else{const S=y*Math.sqrt(b*b-1);x=O=>{const A=Math.exp(-b*y*O),E=Math.min(S*O,300);return o-A*((g+b*y*v)*Math.sinh(E)+S*v*Math.cosh(E))/S}}const k={calculatedDuration:m&&f||null,next:S=>{const O=x(S);if(m)l.done=S>=f;else{let A=0;b<1&&(A=S===0?Ip(g):cAe(x,S,O));const E=Math.abs(A)<=i,j=Math.abs(o-O)<=r;l.done=E&&j}return l.value=l.done?o:O,l},toString:()=>{const S=Math.min(aAe(k),y8),O=PCe(A=>k.next(S*A).value,S,30);return S+"ms "+O}};return k}function WY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,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),k=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let S,O;const A=E=>{m(h.value)&&(S=E,O=uAe({keyframes:[h.value,g(h.value)],velocity:cAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:E=>{let j=!1;return!O&&S===void 0&&(j=!0,k(E),A(E)),S!==void 0&&E>=S?O.next(E-S):(!j&&k(E),h)}}}const fYe=LA(.42,0,1,1),hYe=LA(0,0,.58,1),dAe=LA(.42,0,.58,1),pYe=e=>Array.isArray(e)&&typeof e[0]!="number",mYe={linear:Iu,easeIn:fYe,easeInOut:dAe,easeOut:hYe,circIn:rz,circInOut:VCe,circOut:zCe,backIn:iz,backInOut:UCe,backOut:BCe,anticipate:QCe},KY=e=>{if(nz(e)){uCe(e.length===4);const[t,n,i,r]=e;return LA(t,n,i,r)}else if(typeof e=="string")return mYe[e];return e};function gYe(e,t,n){const i=[],r=n||lAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Gp(e[0],e[s-1],d)):u}function yYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Kw(0,t,i);e.push(Js(n,1,r))}}function vYe(e){const t=[0];return yYe(t,e.length-1),t}function xYe(e,t){return e.map(n=>n*t)}function wYe(e,t){return e.map(()=>t||dAe).splice(0,e.length-1)}function VR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=pYe(i)?i.map(KY):KY(i),s={done:!1,value:t[0]},o=xYe(n&&n.length===t.length?n:vYe(t),e),l=bYe(o,t,{ease:Array.isArray(r)?r:wYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const kYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ps.update(t,!0),stop:()=>Hg(t),now:()=>Zo.isProcessing?Zo.timestamp:bh.now()}},OYe={decay:WY,inertia:WY,tween:VR,keyframes:VR,spring:uAe},SYe=e=>e/100;class uz extends sAe{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,o=(r==null?void 0:r.KeyframeResolver)||lz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(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:o=0}=this.options,l=tz(n)?n:OYe[n]||VR;let c,u;l!==VR&&typeof t[0]!="number"&&(c=$A(SYe,lAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=aAe(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:o,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,k=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(k=o)),x=Gp(0,1,T)*f}const S=w?{done:!1,value:c[0]}:k.next(x);l&&(S.value=l(S.value));let{done:O}=S;!w&&u!==null&&(O=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return A&&r!==void 0&&(S.value=wD(c,this.options,r)),v&&v(S.value),A&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Pp(t.calculatedDuration):0}get time(){return Pp(this.currentTime)}set time(t){t=Ip(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=Pp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=kYe,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 EYe=new Set(["opacity","clipPath","filter","transform"]);function CYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=MCe(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:o==="reverse"?"alternate":"normal"})}const AYe=ez(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),HR=10,TYe=2e4;function _Ye(e){return tz(e.type)||e.type==="spring"||!DCe(e.ease)}function jYe(e,t){const n=new uz({...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(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&QR()&&NYe(s)&&(s=fAe[s]),_Ye(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=jYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=CYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(LY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(wD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Pp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Pp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Ip(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 Iu;const{animation:i}=n;LY(i,t)}return Iu}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:o,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 uz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Ip(this.time);u.setWithVelocity(g.sample(b-HR).value,g.sample(b).value,HR)}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:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return AYe()&&i&&EYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const RYe={type:"spring",stiffness:500,damping:25,restSpeed:10},IYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),PYe={type:"keyframes",duration:.8},DYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},MYe=(e,{keyframes:t})=>t.length>2?PYe:Dv.has(e)?e.startsWith("scale")?IYe(t[1]):RYe:DYe;function LYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(e,t,n,i={},r,s)=>o=>{const l=XQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Ip(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:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};LYe(l)||(d={...d,...MYe(e,d)}),d.duration&&(d.duration=Ip(d.duration)),d.repeatDelay&&(d.repeatDelay=Ip(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=wD(d.keyframes,l);if(h!==void 0)return Ps.update(()=>{d.onUpdate(h),d.onComplete()}),new mXe([])}return!s&&GY.supports(d)?new GY(d):new uz(d)};function $Ye({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function hAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=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&&$Ye(d,f))continue;const g={delay:n,...XQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=ICe(e);if(y){const w=window.MotionHandoffAnimation(y,f,Ps);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(dz(f,h,m,e.shouldReduceMotion&&NCe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Ps.update(()=>{l&&dXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=xD(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 o=r?()=>Promise.all(hAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return FYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function FYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(BYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function BYe(e,t){return e.sortNodePosition(t)}function UYe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?xD(e,t,n.custom):t;i=Promise.all(hAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const QYe=$Q.length;function pAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?pAe(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})=>UYe(e,n,i)))}function qYe(e){let t=HYe(e),n=XY(),i=!0;const r=c=>(u,d)=>{var f;const h=xD(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 o(c){const{props:u}=e,d=pAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&k,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});S===!1&&(R={});const{prevResolvedValues:C={}}=w,N={...C,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=C[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!jCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(O&&A)||j)&&f.push(...T.map(_=>({animation:_,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=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=XY(),i=!0}}}function WYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jCe(t,e):!1}function Qb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function XY(){return{animate:Qb(!0),whileInView:Qb(),whileHover:Qb(),whileTap:Qb(),whileDrag:Qb(),whileFocus:Qb(),exit:Qb()}}class wb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class KYe extends wb{constructor(t){super(t),t.animationState||(t.animationState=qYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();yD(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 GYe=0;class XYe extends wb{constructor(){super(...arguments),this.id=GYe++}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 YYe={animation:{Feature:KYe},exit:{Feature:XYe}},Gd={x:!1,y:!1};function mAe(){return Gd.x||Gd.y}function ZYe(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 fz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function sC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function FA(e){return{point:{x:e.pageX,y:e.pageY}}}const JYe=e=>t=>fz(t)&&e(t,FA(t));function YS(e,t,n,i){return sC(e,t,JYe(n),i)}const YY=(e,t)=>Math.abs(e-t);function eZe(e,t){const n=YY(e.x,t.x),i=YY(e.y,t.y);return Math.sqrt(n**2+i**2)}class gAe{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=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=eZe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Zo;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=p3(h,this.transformPagePoint),Ps.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=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!fz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=FA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Zo;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=$A(YS(this.contextWindow,"pointermove",this.handlePointerMove),YS(this.contextWindow,"pointerup",this.handlePointerUp),YS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function ZY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:ZY(e,bAe(t)),offset:ZY(e,tZe(t)),velocity:nZe(t,.1)}}function tZe(e){return e[0]}function bAe(e){return e[e.length-1]}function nZe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=bAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Ip(t)));)n--;if(!i)return{x:0,y:0};const s=Pp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const yAe=1e-4,iZe=1-yAe,rZe=1+yAe,vAe=.01,sZe=0-vAe,aZe=0+vAe;function Bu(e){return e.max-e.min}function oZe(e,t,n){return Math.abs(e-t)<=n}function JY(e,t,n,i=.5){e.origin=i,e.originPoint=Js(t.min,t.max,e.origin),e.scale=Bu(n)/Bu(t),e.translate=Js(n.min,n.max,e.origin)-e.originPoint,(e.scale>=iZe&&e.scale<=rZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=sZe&&e.translate<=aZe||isNaN(e.translate))&&(e.translate=0)}function ZS(e,t,n,i){JY(e.x,t.x,n.x,i?i.originX:void 0),JY(e.y,t.y,n.y,i?i.originY:void 0)}function eZ(e,t,n){e.min=n.min+t.min,e.max=e.min+Bu(t)}function lZe(e,t,n){eZ(e.x,t.x,n.x),eZ(e.y,t.y,n.y)}function tZ(e,t,n){e.min=t.min-n.min,e.max=e.min+Bu(t)}function JS(e,t,n){tZ(e.x,t.x,n.x),tZ(e.y,t.y,n.y)}function cZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?Js(n,e,i.max):Math.min(e,n)),e}function nZ(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 uZe(e,{top:t,left:n,bottom:i,right:r}){return{x:nZ(e.x,n,r),y:nZ(e.y,t,i)}}function iZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Kw(t.min,t.max-i,e.min):i>r&&(n=Kw(e.min,e.max-r,t.min)),Gp(0,1,n)}function hZe(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 k8=.35;function pZe(e=k8){return e===!1?e=0:e===!0&&(e=k8),{x:rZ(e,"left","right"),y:rZ(e,"top","bottom")}}function rZ(e,t,n){return{min:sZ(e,t),max:sZ(e,n)}}function sZ(e,t){return typeof e=="number"?e:e[t]||0}const aZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Px=()=>({x:aZ(),y:aZ()}),oZ=()=>({min:0,max:0}),wa=()=>({x:oZ(),y:oZ()});function ed(e){return[e("x"),e("y")]}function xAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function mZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gZe(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 g3(e){return e===void 0||e===1}function O8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function sy(e){return O8(e)||wAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wAe(e){return lZ(e.x)||lZ(e.y)}function lZ(e){return e&&e!=="0%"}function qR(e,t,n){const i=e-n,r=t*i;return n+r}function cZ(e,t,n,i,r){return r!==void 0&&(e=qR(e,r,i)),qR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=cZ(e.min,t,n,i,r),e.max=cZ(e.max,t,n,i,r)}function kAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const uZ=.999999999999,dZ=1.0000000000001;function bZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;luZ&&(t.x=1),t.yuZ&&(t.y=1)}function Dx(e,t){e.min=e.min+t,e.max=e.max+t}function fZ(e,t,n,i,r=.5){const s=Js(e.min,e.max,r);S8(e,t,n,s,i)}function Mx(e,t){fZ(e.x,t.x,t.scaleX,t.scale,t.originX),fZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function OAe(e,t){return xAe(gZe(e.getBoundingClientRect(),t))}function yZe(e,t,n){const i=OAe(e,n),{scroll:r}=t;return r&&(Dx(i.x,r.offset.x),Dx(i.y,r.offset.y)),i}const SAe=({current:e})=>e?e.ownerDocument.defaultView:null,vZe=new WeakMap;class xZe{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=wa(),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(FA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZYe(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),ed(v=>{let y=this.getAxisMotionValue(v).get()||0;if(gh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Bu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ps.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(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=wZe(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=()=>ed(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 gAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:SAe(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&&Ps.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 o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=cZe(o,this.constraints[t],this.elastic[t])),s.set(o)}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&&Rx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=uZe(r.layoutBox,n):this.constraints=!1,this.elastic=pZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ed(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=yZe(i,r.root,this.visualElement.getTransformPagePoint());let o=dZe(r.layout.layoutBox,s);if(n){const l=n(mZe(o));this.hasMutatedConstraints=!!l,l&&(o=xAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=ed(d=>{if(!K2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(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 f8(this.visualElement,t),i.start(dz(t,i,0,n,this.visualElement,!1))}stopAnimation(){ed(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ed(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){ed(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:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-Js(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Rx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ed(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=fZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),ed(o=>{if(!K2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Js(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;vZe.set(this.visualElement,this);const t=this.visualElement.current,n=YS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Rx(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()),Ps.read(i);const o=sC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ed(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function K2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class kZe extends wb{constructor(t){super(t),this.removeGroupControls=Iu,this.removeListeners=Iu,this.controls=new xZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Iu}unmount(){this.removeGroupControls(),this.removeListeners()}}const hZ=e=>(t,n)=>{e&&Ps.postRender(()=>e(t,n))};class OZe extends wb{constructor(){super(...arguments),this.removePointerDownListener=Iu}onPointerDown(t){this.session=new gAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:hZ(t),onStart:hZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Ps.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=YS(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 sN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lO={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Yn.test(e))e=parseFloat(e);else return e;const n=pZ(e,t.target.x),i=pZ(e,t.target.y);return`${n}% ${i}%`}},SZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=qg.parse(e);if(r.length>5)return i;const s=qg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=Js(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class EZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;YGe(CZe),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()})),sN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Ps.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),BQ.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 EAe(e){const[t,n]=lCe(),i=p.useContext(DQ);return a.jsx(EZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(bCe),isPresent:t,safeToRemove:n})}const CZe={borderRadius:{...lO,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lO,borderTopRightRadius:lO,borderBottomLeftRadius:lO,borderBottomRightRadius:lO,boxShadow:SZe};function AZe(e,t,n){const i=Cl(e)?e:iC(e);return i.start(dz("",i,t,n)),i.animation}function TZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const _Ze=(e,t)=>e.depth-t.depth;class jZe{constructor(){this.children=[],this.isDirty=!1}add(t){YQ(this.children,t),this.isDirty=!0}remove(t){ZQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_Ze),this.isDirty=!1,this.children.forEach(t)}}function NZe(e,t){const n=bh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Hg(i),e(s-t))};return Ps.read(i,!0),()=>Hg(i)}const CAe=["TopLeft","TopRight","BottomLeft","BottomRight"],RZe=CAe.length,mZ=e=>typeof e=="string"?parseFloat(e):e,gZ=e=>typeof e=="number"||Yn.test(e);function IZe(e,t,n,i,r,s){r?(e.opacity=Js(0,n.opacity!==void 0?n.opacity:1,PZe(i)),e.opacityExit=Js(t.opacity!==void 0?t.opacity:1,0,DZe(i))):s&&(e.opacity=Js(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Kw(e,t,i))}function yZ(e,t){e.min=t.min,e.max=t.max}function Ju(e,t){yZ(e.x,t.x),yZ(e.y,t.y)}function vZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xZ(e,t,n,i,r){return e-=t,e=qR(e,1/n,i),r!==void 0&&(e=qR(e,1/r,i)),e}function MZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(gh.test(t)&&(t=parseFloat(t),t=Js(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Js(s.min,s.max,i);e===s&&(l-=t),e.min=xZ(e.min,t,n,l,r),e.max=xZ(e.max,t,n,l,r)}function wZ(e,t,[n,i,r],s,o){MZe(e,t[n],t[i],t[r],t.scale,s,o)}const LZe=["x","scaleX","originX"],$Ze=["y","scaleY","originY"];function kZ(e,t,n,i){wZ(e.x,t,LZe,n?n.x:void 0,i?i.x:void 0),wZ(e.y,t,$Ze,n?n.y:void 0,i?i.y:void 0)}function OZ(e){return e.translate===0&&e.scale===1}function TAe(e){return OZ(e.x)&&OZ(e.y)}function SZ(e,t){return e.min===t.min&&e.max===t.max}function FZe(e,t){return SZ(e.x,t.x)&&SZ(e.y,t.y)}function EZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function _Ae(e,t){return EZ(e.x,t.x)&&EZ(e.y,t.y)}function CZ(e){return Bu(e.x)/Bu(e.y)}function AZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class BZe{constructor(){this.members=[]}add(t){YQ(this.members,t),t.scheduleRender()}remove(t){if(ZQ(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 UZe(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}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 ay={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},cS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],QZe={visibility:"hidden"},TZ=1e3;let zZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function jAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ICe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ps,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&jAe(i)}function NAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zZe++,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,cS&&(ay.totalNodes=ay.resolvedTargetDeltas=ay.recalculatedProjection=0),this.nodes.forEach(qZe),this.nodes.forEach(YZe),this.nodes.forEach(ZZe),this.nodes.forEach(WZe),cS&&window.MotionDebug.record(ay)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=NZe(h,250),sN.hasAnimatedSinceResize&&(sN.hasAnimatedSinceResize=!1,this.nodes.forEach(jZ))})}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()||iJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!_Ae(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 k={...XQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||jZ(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,Hg(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(JZe),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&&jAe(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=k/1e3;NZ(f.x,o.x,S),NZ(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tJe(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&FZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=wa()),Ju(x,this.relativeTarget)),b&&(this.animationValues=d,IZe(d,u,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(Hg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ps.update(()=>{sN.hasAnimatedSinceResize=!0,this.currentAnimation=AZe(0,TZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},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(TZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&RAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||wa();const f=Bu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Bu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Ju(l,c),Mx(l,d),ZS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new BZe),this.sharedNodes.get(o).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 o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(_Z),this.root.sharedNodes.clear()}}}function VZe(e){e.updateLayout()}function HZe(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,o=n.source!==e.layout.source;s==="size"?ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(h);h.min=i[f].min,h.max=h.min+m}):RAe(s,n.layoutBox,i)&&ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(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=Px();ZS(l,i,n.layoutBox);const c=Px();o?ZS(c,e.applyTransform(r,!0),n.measuredBox):ZS(c,i,n.layoutBox);const u=!TAe(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=wa();JS(g,n.layoutBox,h.layoutBox);const b=wa();JS(b,i,m.layoutBox),_Ae(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 qZe(e){cS&&ay.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 WZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KZe(e){e.clearSnapshot()}function _Z(e){e.clearMeasurements()}function GZe(e){e.isLayoutDirty=!1}function XZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YZe(e){e.resolveTargetDelta()}function ZZe(e){e.calcProjection()}function JZe(e){e.resetSkewAndRotation()}function eJe(e){e.removeLeadSnapshot()}function NZ(e,t,n){e.translate=Js(t.translate,0,n),e.scale=Js(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function RZ(e,t,n,i){e.min=Js(t.min,n.min,i),e.max=Js(t.max,n.max,i)}function tJe(e,t,n,i){RZ(e.x,t.x,n.x,i),RZ(e.y,t.y,n.y,i)}function nJe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const iJe={duration:.45,ease:[.4,0,.1,1]},IZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),PZ=IZ("applewebkit/")&&!IZ("chrome/")?Math.round:Iu;function DZ(e){e.min=PZ(e.min),e.max=PZ(e.max)}function rJe(e){DZ(e.x),DZ(e.y)}function RAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!oZe(CZ(t),CZ(n),.2)}function sJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const aJe=NAe({attachResizeListener:(e,t)=>sC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},IAe=NAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new aJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),oJe={pan:{Feature:OZe},drag:{Feature:kZe,ProjectionNode:IAe,MeasureLayout:EAe}};function lJe(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 PAe(e,t){const n=lJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function MZ(e){return t=>{t.pointerType==="touch"||mAe()||e(t)}}function cJe(e,t,n={}){const[i,r,s]=PAe(e,n),o=MZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=MZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function LZ(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&&Ps.postRender(()=>s(t,FA(t)))}class uJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=cJe(t,n=>(LZ(this.node,n,"Start"),i=>LZ(this.node,i,"End"))))}unmount(){}}class dJe extends wb{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=$A(sC(this.node.current,"focus",()=>this.onFocus()),sC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const DAe=(e,t)=>t?e===t?!0:DAe(e,t.parentElement):!1,fJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hJe(e){return fJe.has(e.tagName)||e.tabIndex!==-1}const uS=new WeakSet;function $Z(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const pJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=$Z(()=>{if(uS.has(n))return;x3(n,"down");const r=$Z(()=>{x3(n,"up")}),s=()=>x3(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 FZ(e){return fz(e)&&!mAe()}function mJe(e,t,n={}){const[i,r,s]=PAe(e,n),o=l=>{const c=l.currentTarget;if(!FZ(l)||uS.has(c))return;uS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!FZ(m)||!uS.has(c))&&(uS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||DAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!hJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>pJe(u,r),r)}),s}function BZ(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&&Ps.postRender(()=>s(t,FA(t)))}class gJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=mJe(t,n=>(BZ(this.node,n,"Start"),(i,{success:r})=>BZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,bJe=e=>{const t=E8.get(e.target);t&&t(e)},yJe=e=>{e.forEach(bJe)};function vJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(yJe,{root:e,...t})),i[r]}function xJe(e,t,n){const i=vJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const wJe={some:0,all:1};class kJe extends wb{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,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:wJe[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 xJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(OJe(t,n))&&this.startObserver()}unmount(){}}function OJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const SJe={inView:{Feature:kJe},tap:{Feature:gJe},focus:{Feature:dJe},hover:{Feature:uJe}},EJe={layout:{ProjectionNode:IAe,MeasureLayout:EAe}},WR={current:null},hz={current:!1};function MAe(){if(hz.current=!0,!!MQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WR.current=e.matches;e.addListener(t),t()}else WR.current=!1}const CJe=[...iAe,Ol,qg],AJe=e=>CJe.find(nAe(e)),UZ=new WeakMap;function TJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Cl(r))e.addValue(i,r);else if(Cl(s))e.addValue(i,iC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,iC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const QZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _Je{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lz,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=bh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),hz.current||MAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){UZ.delete(this.current),this.projection&&this.projection.unmount(),Hg(this.notifyUpdate),Hg(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=Dv.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ps.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),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 Ww){const n=Ww[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):wa()}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=iC(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"&&(eAe(r)||HCe(r))?r=parseFloat(r):!AJe(r)&&qg.test(n)&&(r=YCe(t,n)),this.setBaseTarget(t,Cl(r)?r.get():r)),Cl(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 o=QQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Cl(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 JQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class LAe extends _Je{constructor(){super(...arguments),this.KeyframeResolver=rAe}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;Cl(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jJe(e){return window.getComputedStyle(e)}class NJe extends LAe{constructor(){super(...arguments),this.type="html",this.renderInstance=SCe}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}else{const i=jJe(t),r=(wCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return OAe(t,n)}build(t,n,i){HQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return GQ(t,n,i)}}class RJe extends LAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wa}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}return n=ECe.has(n)?n:FQ(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return TCe(t,n,i)}build(t,n,i){qQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){CCe(t,n,i,r)}mount(t){this.isSVGTag=KQ(t.tagName),super.mount(t)}}const IJe=(e,t)=>UQ(e)?new RJe(t):new NJe(t,{allowProjection:e!==p.Fragment}),PJe=aXe({...YYe,...SJe,...oJe,...EJe},IJe),_r=wGe(PJe);function kD(){!hz.current&&MAe();const[e]=p.useState(WR.current);return e}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function sx(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 DJe=["container"];function MJe(e){var t=e.container,n=t===void 0?document.body:t,i=OD(e,DJe);return vi.createPortal(Pi.createElement("div",lo({},i)),n)}function LJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.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 $Je(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.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 FJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function BJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function VZ(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,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Wm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function k3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Wm(e,s,n,innerWidth)[0],f=Wm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(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:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function O3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=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]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function X2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=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 QJe={T:0,L:0,W:0,H:0,FIT:void 0},FAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},zJe=["className"];function VJe(e){var t=e.className,n=t===void 0?"":t,i=OD(e,zJe);return Pi.createElement("div",lo({className:"PhotoView__Spinner "+n},i),Pi.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Pi.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"}),Pi.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var HJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function qJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=OD(e,HJe),u=FAe();return t&&!i?Pi.createElement(Pi.Fragment,null,Pi.createElement("img",lo({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&&(o?Pi.createElement("span",{className:"PhotoView__icon"},o):Pi.createElement(VJe,{className:"PhotoView__icon"}))):l?Pi.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var WJe={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 KJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,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,k=e.onReachUp,S=e.onPhotoResize,O=e.isActive,A=e.expose,E=KR(WJe),j=E[0],T=E[1],R=p.useRef(0),C=FAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,H=j.loaded,q=H===void 0?!n:H,U=j.broken,Z=j.x,z=j.y,J=j.touched,ne=j.stopRaf,W=j.maskTouched,X=j.rotate,le=j.scale,V=j.CX,Y=j.CY,K=j.lastX,ue=j.lastY,te=j.lastCX,Oe=j.lastCY,fe=j.lastScale,pe=j.touchTime,Se=j.touchLength,ve=j.pause,Le=j.reach,He=Vy({onScale:function(je){return Ge(G2(je))},onRotate:function(je){X!==je&&(A({rotate:je}),T(lo({rotate:je},O3(P,D,je))))}});function Ge(je,kt,Tt){le!==je&&(A({scale:je}),T(lo({scale:je},k3(Z,z,L,M,le,je,kt,Tt),je<=1&&{x:0,y:0})))}var De=X2(function(je,kt,Tt){if(Tt===void 0&&(Tt=0),(J||W)&&O){var fn=T8(X,L,M),tn=fn[0],We=fn[1];if(Tt===0&&R.current===0){var vt=Math.abs(je-V)<=20,Ke=Math.abs(kt-Y)<=20;if(vt&&Ke)return void T({lastCX:je,lastCY:kt});R.current=vt?kt>Y?3:2:1}var ot,it=je-te,tt=kt-Oe;if(Tt===0){var Ct=Wm(it+K,le,tn,innerWidth)[0],Ot=Wm(tt+ue,le,We,innerHeight);ot=function(Dt,Ze,bt,gt){return Ze&&Dt===1||gt==="x"?"x":bt&&Dt>1||gt==="y"?"y":void 0}(R.current,Ct,Ot[0],Le),ot!==void 0&&x(ot,je,kt,le)}if(ot==="x"||W)return void T({reach:"x"});var Bt=G2(le+(Tt-Se)/100/2*le,P/L,.2);A({scale:Bt}),T(lo({touchLength:Tt,reach:ot,scale:Bt},k3(Z,z,L,M,le,Bt,je,kt,it,tt)))}},{maxWait:8});function se(je){return!ne&&!J&&(C.current&&T(lo({},je,{pause:u})),C.current)}var ce,ye,Ae,Ee,Ce,Be,he,ie,we=(Ce=function(je){return se({x:je})},Be=function(je){return se({y:je})},he=function(je){return C.current&&(A({scale:je}),T({scale:je})),!J&&C.current},ie=Vy({X:function(je){return Ce(je)},Y:function(je){return Be(je)},S:function(je){return he(je)}}),function(je,kt,Tt,fn,tn,We,vt,Ke,ot,it,tt){var Ct=T8(it,tn,We),Ot=Ct[0],Bt=Ct[1],Dt=Wm(je,Ke,Ot,innerWidth),Ze=Dt[0],bt=Dt[1],gt=Wm(kt,Ke,Bt,innerHeight),an=gt[0],Ft=gt[1],cn=Date.now()-tt;if(cn>=200||Ke!==vt||Math.abs(ot-vt)>1){var Je=k3(je,kt,tn,We,vt,Ke),lt=Je.x,hn=Je.y,Sn=Ze?bt:lt!==je?lt:null,Ji=an?Ft:hn!==kt?hn:null;return Sn!==null&&my(je,Sn,ie.X),Ji!==null&&my(kt,Ji,ie.Y),void(Ke!==vt&&my(vt,Ke,ie.S))}var Qn=(je-Tt)/cn,_n=(kt-fn)/cn,pi=Math.sqrt(Math.pow(Qn,2)+Math.pow(_n,2)),Nn=!1,Dn=!1;(function(_i,Fn){var Kn,Rn=_i,nt=0,Ut=0,Qe=function(jn){Kn||(Kn=jn);var lr=jn-Kn,ta=Math.sign(_i),Ms=-.001*ta,ts=Math.sign(-Rn)*Math.pow(Rn,2)*2e-4,ci=Rn*lr+(Ms+ts)*Math.pow(lr,2)/2;nt+=ci,Kn=jn,ta*(Rn+=(Ms+ts)*lr)<=0?Qt():Fn(nt)?xt():Qt()};function xt(){Ut=requestAnimationFrame(Qe)}function Qt(){cancelAnimationFrame(Ut)}xt()})(pi,function(_i){var Fn=je+_i*(Qn/pi),Kn=kt+_i*(_n/pi),Rn=Wm(Fn,vt,Ot,innerWidth),nt=Rn[0],Ut=Rn[1],Qe=Wm(Kn,vt,Bt,innerHeight),xt=Qe[0],Qt=Qe[1];if(nt&&!Nn&&(Nn=!0,Ze?my(Fn,Ut,ie.X):HZ(Ut,Fn+(Fn-Ut),ie.X)),xt&&!Dn&&(Dn=!0,an?my(Kn,Qt,ie.Y):HZ(Qt,Kn+(Kn-Qt),ie.Y)),Nn&&Dn)return!1;var jn=Nn||ie.X(Ut),lr=Dn||ie.Y(Qt);return jn&&lr})}),Re=(ce=y,ye=function(je,kt){Le||Ge(le!==1?1:Math.max(2,P/L),je,kt)},Ae=p.useRef(0),Ee=X2(function(){Ae.current=0,ce.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var je=[].slice.call(arguments);Ae.current+=1,Ee.apply(void 0,je),Ae.current>=2&&(Ee.cancel(),Ae.current=0,ye.apply(void 0,je))});function Ue(je,kt){if(R.current=0,(J||W)&&O){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Tt=G2(le,P/L);if(we(Z,z,K,ue,L,M,le,Tt,fe,X,pe),k(je,kt),V===je&&Y===kt){if(J)return void Re(je,kt);W&&w(je,kt)}}}function _t(je,kt,Tt){Tt===void 0&&(Tt=0),T({touched:!0,CX:je,CY:kt,lastCX:je,lastCY:kt,lastX:Z,lastY:z,lastScale:le,touchLength:Tt,touchTime:Date.now()})}function Pt(je){T({maskTouched:!0,CX:je.clientX,CY:je.clientY,lastX:Z,lastY:z})}sx(sp?void 0:"mousemove",function(je){je.preventDefault(),De(je.clientX,je.clientY)}),sx(sp?void 0:"mouseup",function(je){Ue(je.clientX,je.clientY)}),sx(sp?"touchmove":void 0,function(je){je.preventDefault();var kt=VZ(je);De.apply(void 0,kt)},{passive:!1}),sx(sp?"touchend":void 0,function(je){var kt=je.changedTouches[0];Ue(kt.clientX,kt.clientY)},{passive:!1}),sx("resize",X2(function(){q&&!J&&(T(O3(P,D,X)),S())},{maxWait:8})),A8(function(){O&&A(lo({scale:le,rotate:X},He))},[O]);var Gt=function(je,kt,Tt,fn,tn,We,vt,Ke,ot,it){var tt=function(lt,hn,Sn,Ji,Qn){var _n=p.useRef(!1),pi=KR({lead:!0,scale:Sn}),Nn=pi[0],Dn=Nn.lead,_i=Nn.scale,Fn=pi[1],Kn=X2(function(Rn){try{return Qn(!0),Fn({lead:!1,scale:Rn}),Promise.resolve()}catch(nt){return Promise.reject(nt)}},{wait:Ji});return A8(function(){_n.current?(Qn(!1),Fn({lead:!0}),Kn(Sn)):_n.current=!0},[Sn]),Dn?[lt*_i,hn*_i,Sn/_i]:[lt*Sn,hn*Sn,1]}(We,vt,Ke,ot,it),Ct=tt[0],Ot=tt[1],Bt=tt[2],Dt=function(lt,hn,Sn,Ji,Qn){var _n=p.useState(QJe),pi=_n[0],Nn=_n[1],Dn=p.useState(0),_i=Dn[0],Fn=Dn[1],Kn=p.useRef(),Rn=Vy({OK:function(){return lt&&Fn(4)}});function nt(Ut){Qn(!1),Fn(Ut)}return p.useEffect(function(){if(Kn.current||(Kn.current=Date.now()),Sn){if(function(Ut,Qe){var xt=Ut&&Ut.current;if(xt&&xt.nodeType===1){var Qt=xt.getBoundingClientRect();Qe({T:Qt.top,L:Qt.left,W:Qt.width,H:Qt.height,FIT:xt.tagName==="IMG"?getComputedStyle(xt).objectFit:void 0})}}(hn,Nn),lt)return Date.now()-Kn.current<250?(Fn(1),requestAnimationFrame(function(){Fn(2),requestAnimationFrame(function(){return nt(3)})}),void setTimeout(Rn.OK,Ji)):void Fn(4);nt(5)}},[lt,Sn]),[_i,pi]}(je,kt,Tt,ot,it),Ze=Dt[0],bt=Dt[1],gt=bt.W,an=bt.FIT,Ft=innerWidth/2,cn=innerHeight/2,Je=Ze<3||Ze>4;return[Je?gt?bt.L:Ft:fn+(Ft-We*Ke/2),Je?gt?bt.T:cn:tn+(cn-vt*Ke/2),Ct,Je&&an?Ct*(bt.H/gt):Ot,Ze===0?Bt:Je?gt/(We*Ke)||.01:Bt,Je?an?1:0:1,Ze,an]}(u,c,q,Z,z,L,M,le,d,function(je){return T({pause:je})}),St=Gt[4],Lt=Gt[6],qe="transform "+d+"ms "+f,yt={className:m,onMouseDown:sp?void 0:function(je){je.stopPropagation(),je.button===0&&_t(je.clientX,je.clientY,0)},onTouchStart:sp?function(je){je.stopPropagation(),_t.apply(void 0,VZ(je))}:void 0,onWheel:function(je){if(!Le){var kt=G2(le-je.deltaY/100/2,P/L);T({stopRaf:!0}),Ge(kt,je.clientX,je.clientY)}},style:{width:Gt[2]+"px",height:Gt[3]+"px",opacity:Gt[5],objectFit:Lt===4?void 0:Gt[7],transform:X?"rotate("+X+"deg)":void 0,transition:Lt>2?qe+", opacity "+d+"ms ease, height "+(Lt<4?d/2:Lt>4?d:0)+"ms "+f:void 0}};return Pi.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!sp&&O?Pt:void 0,onTouchStart:sp&&O?function(je){return Pt(je.touches[0])}:void 0},Pi.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+St+", 0, 0, "+St+", "+Gt[0]+", "+Gt[1]+")",transition:J||ve?void 0:qe,willChange:O?"transform":void 0}},n?Pi.createElement(qJe,lo({src:n,loaded:q,broken:U},yt,{onPhotoLoad:function(je){T(lo({},je,je.loaded&&O3(je.naturalWidth||0,je.naturalHeight||0,X)))},loadingElement:b,brokenElement:v})):i&&i({attrs:yt,scale:St,rotate:X})))}var qZ={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 GJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,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,k=e.loadingElement,S=e.brokenElement,O=e.images,A=e.index,E=A===void 0?0:A,j=e.onIndexChange,T=e.visible,R=e.onClose,C=e.afterClose,N=e.portalContainer,P=KR(qZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,H=I.touched,q=I.pause,U=I.lastCX,Z=I.lastCY,z=I.bg,J=z===void 0?u:z,ne=I.lastBg,W=I.overlay,X=I.minimal,le=I.scale,V=I.rotate,Y=I.onScale,K=I.onRotate,ue=e.hasOwnProperty("index"),te=ue?E:L,Oe=ue?j:F,fe=p.useRef(te),pe=O.length,Se=O[te],ve=typeof n=="boolean"?n:pe>n,Le=function(St,Lt){var qe=p.useReducer(function(Tt){return!Tt},!1)[1],yt=p.useRef(0),je=function(Tt){var fn=p.useRef(Tt);function tn(We){fn.current=We}return p.useMemo(function(){(function(We){St?(We(St),yt.current=1):yt.current=2})(tn)},[Tt]),[fn.current,tn]}(St),kt=je[1];return[je[0],yt.current,function(){qe(),yt.current===2&&(kt(!1),Lt&&Lt()),yt.current=0}]}(T,C),He=Le[0],Ge=Le[1],De=Le[2];A8(function(){if(He)return D({pause:!0,x:te*-(innerWidth+R0)}),void(fe.current=te);D(qZ)},[He]);var se=Vy({close:function(St){K&&K(0),D({overlay:!0,lastBg:J}),R(St)},changeIndex:function(St,Lt){Lt===void 0&&(Lt=!1);var qe=ve?fe.current+(St-te):St,yt=pe-1,je=C8(qe,0,yt),kt=ve?qe:je,Tt=innerWidth+R0;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-Tt*kt,pause:Lt}),fe.current=kt,Oe&&Oe(ve?St<0?yt:St>yt?0:St:je)}}),ce=se.close,ye=se.changeIndex;function Ae(St){return St?ce():D({overlay:!W})}function Ee(){D({x:-(innerWidth+R0)*te,lastCX:void 0,lastCY:void 0,pause:!0}),fe.current=te}function Ce(St,Lt,qe,yt){St==="x"?function(je){if(U!==void 0){var kt=je-U,Tt=kt;!ve&&(te===0&&kt>0||te===pe-1&&kt<0)&&(Tt=kt/2),D({touched:!0,lastCX:U,x:-(innerWidth+R0)*fe.current+Tt,pause:!1})}else D({touched:!0,lastCX:je,x:M,pause:!1})}(Lt):St==="y"&&function(je,kt){if(Z!==void 0){var Tt=u===null?null:C8(u,.01,u-Math.abs(je-Z)/100/4);D({touched:!0,lastCY:Z,bg:kt===1?Tt:u,minimal:kt===1})}else D({touched:!0,lastCY:je,bg:J,minimal:!0})}(qe,yt)}function Be(St,Lt){var qe=St-(U??St),yt=Lt-(Z??Lt),je=!1;if(qe<-40)ye(te+1);else if(qe>40)ye(te-1);else{var kt=-(innerWidth+R0)*fe.current;Math.abs(yt)>100&&X&&f&&(je=!0,ce()),D({touched:!1,x:kt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!je||W})}}sx("keydown",function(St){if(T)switch(St.key){case"ArrowLeft":ye(te-1,!0);break;case"ArrowRight":ye(te+1,!0);break;case"Escape":ce()}});var he=function(St,Lt,qe){return p.useMemo(function(){var yt=St.length;return qe?St.concat(St).concat(St).slice(yt+Lt-1,yt+Lt+2):St.slice(Math.max(Lt-1,0),Math.min(Lt+2,yt+1))},[St,Lt,qe])}(O,te,ve);if(!He)return null;var ie=W&&!Ge,we=T?J:ne,Re=Y&&K&&{images:O,index:te,visible:T,onClose:ce,onIndexChange:ye,overlayVisible:ie,overlay:Se&&Se.overlay,scale:le,rotate:V,onScale:Y,onRotate:K},Ue=i?i(Ge):400,_t=r?r(Ge):zZ,Pt=i?i(3):600,Gt=r?r(3):zZ;return Pi.createElement(MJe,{className:"PhotoView-Portal"+(ie?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(St){return St.stopPropagation()},container:N},T&&Pi.createElement(BJe,null),Pi.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ge===1?" PhotoView-Slider__fadeIn":Ge===2?" PhotoView-Slider__fadeOut":""),style:{background:we?"rgba(0, 0, 0, "+we+")":void 0,transitionTimingFunction:_t,transitionDuration:(H?0:Ue)+"ms",animationDuration:Ue+"ms"},onAnimationEnd:De}),m&&Pi.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Pi.createElement("div",{className:"PhotoView-Slider__Counter"},te+1," / ",pe),Pi.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Re&&b(Re),Pi.createElement(LJe,{className:"PhotoView-Slider__toolbarIcon",onClick:ce}))),he.map(function(St,Lt){var qe=ve||te!==0?fe.current-1+Lt:te+Lt;return Pi.createElement(KJe,{key:ve?St.key+"/"+St.src+"/"+qe:St.key,item:St,speed:Ue,easing:_t,visible:T,onReachMove:Ce,onReachUp:Be,onPhotoTap:function(){return Ae(s)},onMaskTap:function(){return Ae(l)},wrapClassName:x,className:w,style:{left:(innerWidth+R0)*qe+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:H||q?void 0:"transform "+Pt+"ms "+Gt},loadingElement:k,brokenElement:S,onPhotoResize:Ee,isActive:fe.current===qe,expose:D})}),!sp&&m&&Pi.createElement(Pi.Fragment,null,(ve||te!==0)&&Pi.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ye(te-1,!0)}},Pi.createElement($Je,null)),(ve||te+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,o)}}),m=Vy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return lo({},o,h)},[o,h]);return Pi.createElement($Ae.Provider,{value:g},t,Pi.createElement(GJe,lo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var BAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext($Ae),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=Vy({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var k=d.props[w];k&&k(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:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,lo({},b,{ref:m}))):null};function sv(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function UAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function pz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function aN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function JJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function WZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function KZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function eet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function iet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.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 QAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function ret(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function _c(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function set(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function zAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function hl(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function j8(){return bn.resolvedLanguage||bn.language}function aet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function oet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&aet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function cet(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function uet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const GZ="veadk_auth_qs",det=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let cO=null;function fet(){if(cO!==null)return cO;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,o)=>{(i&&det.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(GZ,r),cO=r):cO=sessionStorage.getItem(GZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return cO}function Na(e){const t=fet();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 eo=3e4,yr=12e4,mz=1e4;function po(e,t=eo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const GR="veadk_local_user",XR="veadk_local_user_tab",het="X-VeADK-OAuth-Refresh-Retry",pet=[50,250],met=/^[A-Za-z0-9]{1,16}$/;function VAe(){try{const e=sessionStorage.getItem(XR);if(e)return e;const t=localStorage.getItem(GR);return t&&sessionStorage.setItem(XR,t),t}catch{try{return localStorage.getItem(GR)}catch{return null}}}function XZ(e){try{sessionStorage.setItem(XR,e)}catch{}try{localStorage.setItem(GR,e)}catch{}}function get(){try{sessionStorage.removeItem(XR)}catch{}try{localStorage.removeItem(GR)}catch{}}function oc(e){const t=new Headers(e),n=VAe();return n&&t.set("X-VeADK-Local-User",n),t}async function HAe(){let e;try{e=await fetch("/web/auth-config",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("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(Q("identity.invalidConfigResponse"))}}function bet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function yet(){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 vet(){const[e,t]=await Promise.all([N8(),HAe()]);return e.status==="unauthenticated"&&t.length>0}function xet(){window.location.assign("/oauth2/logout")}async function wet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=pet[e];if(t.status!==401||t.headers.get(het)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await wet();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(Q("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(Q("identity.serviceFailed",{status:e.status}));const t=VAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function ket(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 Oet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let eE=null,dS=null;function Eet(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 Cet(e){eE||(eE=new Promise(n=>{dS=n}),window.dispatchEvent(new Event(R8)));const t=eE;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 Aet(){return eE!==null}function Tet(){dS==null||dS(),dS=null,eE=null}async function SD(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])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` +${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const _et=/\brun_sse\s*failed\s*:\s*404\b/i,jet=/session not found/i,Net=/(?:^|[::\s])not found\s*$/i,Ret=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,Iet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Pet=/(?: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 I0(e,t){return e.includes(t)?e:`${e} -${t}`}function Jo(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(Net.test(t))i=Nv(i,Q("runSse.toolArgumentHint"));else{if(Ret.test(t))return Nv(i,Q("runSse.resourceCollectionExpiredHint"));if(Iet.test(t))return Nv(i,Q("runSse.modelQuotaHint"));Tet.test(t)&&(_et.test(t)?i=Nv(i,Q("runSse.persistentMemoryHint")):jet.test(t)&&(i=Nv(i,Q("runSse.unsupportedRouteHint"))))}return Nv(i,Q("runSse.networkConfigurationHint"))}const rC="__sseEvent";async function*LA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` -`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,rC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)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 o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Pet="X-Studio-FaaS-Instance",Det="X-Studio-FaaS-Request-Id";function ZR(e,t,n){var s,o;const i=((s=e.headers.get(Pet))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Det))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function KZ(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 Met(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 Let(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 zAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function nl(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(Ret.test(t))i=I0(i,Q("runSse.toolArgumentHint"));else{if(Iet.test(t))return I0(i,Q("runSse.resourceCollectionExpiredHint"));if(Pet.test(t))return I0(i,Q("runSse.modelQuotaHint"));_et.test(t)&&(jet.test(t)?i=I0(i,Q("runSse.persistentMemoryHint")):Net.test(t)&&(i=I0(i,Q("runSse.unsupportedRouteHint"))))}return I0(i,Q("runSse.networkConfigurationHint"))}const aC="__sseEvent";async function*BA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` +`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,aC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)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 o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Det="X-Studio-FaaS-Instance",Met="X-Studio-FaaS-Request-Id";function YR(e,t,n){var s,o;const i=((s=e.headers.get(Det))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Met))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function YZ(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 Let(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 $et(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 qAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("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(Q("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` -`)}async function $et(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 Fet(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 zAe({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 qAe({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*Fet({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Ta(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:ul(uc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await $et(l)}));for await(const c of LA(l)){if(!Let(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const Bet=255,Uet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Qet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Uet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>Bet)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const zet=/RunPipeline result could not be reconciled|Polling build status failed/i;class lN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function VAe(e){if(e instanceof lN)return!0;const t=e instanceof Error?e.message:String(e??"");return zet.test(t)}function HAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Vet({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 o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||HAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,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),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const P8="ap-southeast-1",gz="cn-beijing",Het="https://ark.ap-southeast.bytepluses.com/api/v3",qet="https://ark.cn-beijing.volces.com/api/v3/",Wet="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",Ket="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Get="dola-seed-2-1-turbo-260628",Xet="doubao-seed-2-1-pro-260628",Yet="skylark-embedding-vision-250615",Zet="doubao-embedding-vision-250615",Jet="seed-2-0-lite-260228",ett="doubao-seed-2-0-lite-260428",ttt="dola-seedream-5-0-pro-260628",ntt="doubao-seedream-5-0-260128",itt="seededit-3-0-i2i-250628",rtt="doubao-seededit-3-0-i2i-250628",stt="dreamina-seedance-2-0-260128",att="doubao-seedance-2-0-260128";function ju(e){return e==="byteplus"?[{value:P8,label:P8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function Zi(e){var t;return((t=ju(e)[0])==null?void 0:t.value)||gz}const ott=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function AD(e){return typeof e=="string"&&ott.has(e)}function Oh(e,t){var i;return((i=(t?ju(t):[...ju("volcengine"),...ju("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Gp(e){return e==="byteplus"?Get:Xet}function Po(e){return e==="byteplus"?Het:qet}function ltt(e){return e==="byteplus"?Wet:Ket}function ctt(e){return e==="byteplus"?Yet:Zet}function utt(e){return e==="byteplus"?Jet:ett}function dtt(e){return e==="byteplus"?ttt:ntt}function ftt(e){return e==="byteplus"?itt:rtt}function htt(e){return e==="byteplus"?stt:att}const bz="veadk.messageFeedback.v1";function yz(e,t,n,i){return[e,t,n,i].join(":")}function vz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(bz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function ptt(e,t,n){if(typeof window>"u")return;const i=vz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(bz,JSON.stringify(i))}function qAe(e){if(typeof window>"u")return;const t=yz(e.runtimeId,e.appName,e.userId,e.sessionId),n=vz(),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(bz,JSON.stringify(n))}}const cN="",xz=new Map;function WAe(e,t){xz.set(e,t)}function KAe(){xz.clear()}function Na(e){const t=xz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function B1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function gt(e,t={},n={},i=ho){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:ul(uc(t.headers))},l=()=>{const d={...o,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(`${cN}/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(`${cN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Ta(`${cN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(ket(d))return!0;if(d.status!==401)return!1;try{return await yet()}catch{return!1}};let u=await l();for(;await c(u);)await Eet(r),u=await l();return u}function yn(e,t={},n=ho){return gt(e,t,{},n)}function GAe(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 mtt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Ft(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=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=GAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} -${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function gtt(e){const t=await Ft(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function wz(e,t=!1){const n=await gt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function XAe(e,t){const n=await gt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function U1(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 gt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadModelsFailed")));return await i.json()}async function YAe(){const e=await gt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Q1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Oa extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const ZAe=()=>Q("client.privateRuntimeUnavailable"),JAe=()=>Q("client.runtimeTemporarilyUnavailable"),GZ=["cn-beijing","cn-shanghai"],btt=3e4,z1=5*60*1e3,eTe=60*1e3;let sC="volcengine";const nw=new Map,fy=new Map,hy=new Map,rf=new Map,ss=new Map;function Oz(e,t,n){return`${t}:${e}:${n??""}`}function tTe(e){e!==sC&&ss.clear(),sC=e}function $A(e){const t=(e||"").trim();if(sC==="byteplus")return[t&&!t.startsWith("cn-")?t:P8];const n=t&&!t.startsWith("ap-")?t:gz;return GZ.includes(n)?[n,...GZ.filter(i=>i!==n)]:[n]}function TD(e){const t=(e||"").trim();return t?[t]:$A()}function U0(...e){return e.map(t=>String(t??"")).join("")}function Eb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function kz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Z2(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 nTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function FA(e,t,n,i,r=ho){const s=await gt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await nTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new Q1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Oa(ZAe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Oa(JAe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Oa(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Oa(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ft(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Oa(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Oa(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&nw.set(Oz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+btt}),c}async function iTe(e,t){const{app:n,ep:i}=Na(e);if(B1(n,i)){const o=await ytt(i),l=await gt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await mtt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ft(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await gt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ft(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ft(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function ytt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await DD(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function Sz(e,t){const{app:n,ep:i}=Na(e);if(B1(n,i)){const s=await gt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await gtt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ft(r,Q("client.listSessionsFailed")));return r.json()}async function aC(e,t,n){const{app:i,ep:r}=Na(e);if(B1(i,r)){const l=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ft(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ft(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ft(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=yz(r.runtimeId,i,t,n);o.state={...vz()[l]??{},...o.state??{}}}return o}async function rTe(e){const{app:t,ep:n}=Na(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await gt("/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 Ft(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=yz(n.runtimeId,t,e.userId,e.sessionId);return ptt(s,e.eventId,r),r}async function _D(e,t={}){const n=U0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Eb(rf,n,eTe);if(!t.force&&i)return i;const r=rf.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of TD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await gt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return kz(rf,n,await u.json());s=new Error(await Ft(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();rf.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=rf.get(n);(l==null?void 0:l.promise)===o&&rf.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function D8(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await gt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function sTe(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await gt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function aTe(e){return Eb(rf,U0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),eTe)}function vtt(e){_D(e).catch(()=>{})}function oTe(e){_D(e,{force:!0}).catch(()=>{})}function lTe(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 uN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of rf.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=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:""},...o]:o;rf.set(i,{value:{...s,sets:lTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function cTe(e){let t=null;for(const n of TD(e.region)){const i=await gt("/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[o,l]of rf.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));rf.set(o,{value:{...c,sets:lTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ft(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function M8(e,t,n){const{app:i,ep:r}=Na(e);if(B1(i,r)){const o=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await gt(`/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 xtt(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 dTe(e,t,n,i,r){const{app:s,ep:o}=Na(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await gt(c,{},o,hr);if(!u.ok)throw new Error(await Ft(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=xtt(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 Cz(e,t,n,i,r){const{blob:s}=await dTe(e,t,n,i,r);return URL.createObjectURL(s)}async function wtt(e){const t=await gt("/web/media/capabilities");if(!t.ok)throw new Error(await Ft(t,"media capabilities failed"));return t.json()}async function fTe(e,t,n,i){const{app:r}=Na(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await gt("/web/media",{method:"POST",body:s},{},hr);if(!o.ok)throw new Error(await Ft(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function L8(e,t,n){const{app:i}=Na(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await gt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ft(s,"media cleanup failed"))}function hTe(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 dN(e,t){const n=hTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await gt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ft(i,"media cleanup failed"))}function pTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=hTe(t);if(!n)return t;const i=`${n}/content`;return Ta(`${cN}${i}`)}async function JR(e,t,n){const{app:i,ep:r}=Na(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 gt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await gt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ft(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function $8(e){const t=await gt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function XZ(e,t,n=!0,i){const r=await gt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await gt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function Ott(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function mTe(e,t,n=!0,i){try{return await XZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!Ott(r))throw r;return XZ("a2a-default",t,n,i)}}class jD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function gTe(e,t){const{ep:n}=Na(e),i=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ft(i,"turn control failed"));return i.json()}async function bTe(e,t,n,i){var o;const{ep:r}=Na(e),s=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new jD(l.detail)}if(!s.ok)throw new Error(await Ft(s,"turn control failed"));return s.json()}async function ktt(e,t,n,i,r){var c;const{ep:s}=Na(e),o=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new jD(u.detail)}if(!o.ok)throw new Error(await Ft(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*yTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Na(e),u=(s==null?void 0:s.trim())??"",d=_z(o);let f;try{const g=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=ZR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ft(g,"turn continue failed");throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(Jo("turn continue returned a different session"));f=await gt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}const h=ZR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ft(f,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of LA(f)){if(g&&typeof g=="object"&&g[rC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[rC],typeof b.error=="string"&&(b.error=Jo(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=Jo(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=Jo(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}finally{d.cleanup()}if(!m)throw new Error(Tz())}async function F8(e,t){const{app:n,ep:i}=Na(e);return mTe(n,i,!1,t)}async function Stt(e,t,n){let i=null;for(const r of $A(t)){const s={runtimeId:e,region:r};try{const o=Oz(e,r),l=nw.get(o);l&&l.expiresAt<=Date.now()&&nw.delete(o);const c=nw.get(o),u=n||(c==null?void 0:c.apps[0])||(await FA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return mTe(u,s)}catch(o){if(o instanceof Q1||o instanceof Oa&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Az(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=U0(e,t||"cn-beijing",r??""),l=Eb(fy,o,z1);if(!s.force&&l)return l;const c=fy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Stt(e,t,r).then(d=>kz(fy,o,d));fy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=fy.get(o);(d==null?void 0:d.promise)===u&&fy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function vTe(e,t,n=""){return Eb(fy,U0(e,t||"cn-beijing",n),z1)}function xTe(e,t,n=""){Az(e,t,n).catch(()=>{})}function eI(e){const{app:t,ep:n}=Na(e);return B1(t,n)}function ip(e){const{app:t,ep:n}=Na(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function wTe(e,t,n,i){const{app:r,ep:s}=Na(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await gt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ft(l,Q("client.agentSearchFailed")));return l.json()}async function OTe(e,t){const{app:n}=Na(e),i=await gt(`/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 Tz(){return Jo(Q("client.emptySseBody"))}function uS(){return Jo(Q("client.noDisplayableSseReply"))}const Ett=6e4;function Xg(){return Q("client.firstSseEventTimeout")}function _z(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(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Xg())))},Ett);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*B8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Na(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,O=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&O.length>0){const I=O[0],D=I.partMetadata;O[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const k=(s==null?void 0:s.trim())??"",S=(l==null?void 0:l.trim())??"",E=typeof o=="number",C=E||k?{veadkExecution:{...E?{executionConfigVersion:o}:{},...k?{idempotencyKey:k}:{}}}:void 0,j=x||C?{...x?{veadkInvocation:x}:{},...C??{}}:void 0,T=B1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const A=_z(g);try{if(T){const I=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({content:i,...E?{executionConfigVersion:o}:{}}),signal:A.signal},y,0),D=ZR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){A.cleanup();const L=await Ft(I,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...S?{lastEventId:S}:{}}),signal:A.signal},y,0)}else R=await gt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:O},streaming:!0,...S?{lastEventId:S}:{},...E?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:A.signal},y,0)}catch(I){throw A.cleanup(),A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}const N=ZR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){A.cleanup();const I=await Ft(R,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of LA(R)){if(I&&typeof I=="object"&&I[rC]==="done"){A.clearDeadline();break}P=!0,A.clearDeadline();const D={...I};delete D[rC],typeof D.error=="string"&&(D.error=Jo(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=Jo(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=Jo(D.error_message)),yield D}}catch(I){throw A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}finally{A.cleanup()}if(!P)throw new Error(Tz())}class iw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function jz(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new iw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=GAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new iw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new iw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function BA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(BA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function Nz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:BA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await gt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ft(i,Q("client.mpaOperationFailed")));return await i.json()}async function tI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return Nz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function kTe(){const e=await gt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ft(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function STe(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function ETe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function CTe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function ATe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function TTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await gt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ft(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function _Te(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await gt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ft(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Rz(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:BA(t.draft)})});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationFailed")));return await n.json()}async function Iz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await jz(n);return await n.json()}async function U8(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await jz(t);return await t.json()}async function jTe(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await jz(t);return await t.json()}async function ND(e,t){const n=new URLSearchParams({name:e,region:t}),i=await gt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function NTe(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 gt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ft(i,Q("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(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function RTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("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(Q("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(Q("client.environmentMountMismatch"));return i})}async function ITe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Na(t);let o;try{o=await gt("/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(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ft(o,Q("client.environmentMountFailed")));return RTe(await o.json(),r)}function Pz(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 PTe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const YZ={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 DTe(e){var r;const t=await gt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("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(Q("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(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(YZ[s.kind]??Number.MAX_SAFE_INTEGER)-(YZ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const MTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Dz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!MTe.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(Q("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(Q("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 LTe(e){if(!e||typeof e!="object")throw new Error(Q("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||!MTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function $Te(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidImageRepository"));return t}function Ctt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidCodeRepository"));return t}function Att(e){const t=$Te(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Mz(e){if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Ctt(t.gitSource),containerRepository:$Te(t.containerRepository),imageSource:Att(t.imageSource),latestVersion:Dz(t.latestVersion)}}function FTe(e){if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidWorkspace"));return t}async function Lz(e){const t=await gt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map(FTe)}async function BTe(e,t,n,i){const r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ft(r,Q("client.saveWorkspaceFailed")));return FTe(await r.json())}function UTe(e,t){return BTe("/web/workspaces","POST",e,t)}function QTe(e,t,n){return BTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function zTe(e,t){const n=await gt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteWorkspaceFailed")))}async function UA(e){const t=await gt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Mz)}async function VTe(e,t){const n=await gt("/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 Ft(n,Q("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(Q("client.invalidRepositoryProbe"));return i}async function HTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function qTe(e,t){const n=await gt("/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 Ft(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function WTe(e,t){const n=await gt("/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 Ft(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("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(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Mz(s.environment),error:s.error??""}})}async function KTe(e,t,n,i){let r;try{r=await gt(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(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ft(r,Q("client.saveEnvironmentFailed")));return Mz(await r.json())}function GTe(e,t){return KTe("/web/v3/environments","POST",e,t)}function XTe(e,t,n){return KTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function YTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteEnvironmentFailed")))}async function Q8(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.startEnvironmentBuildFailed")));const i=Dz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function ZTe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ft(r,Q("client.loadEnvironmentBuildFailed")));const s=Dz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function JTe(e,t,n){const i=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ft(i,Q("client.loadEnvironmentManifestFailed")));return LTe(await i.json())}function ZZ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function e2e(e){const t=await gt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:ZZ(n.codePipeline),containerRegistry:ZZ(n.containerRegistry)}}async function Ttt(e,t){const n=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("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(Q("client.invalidCodexSandboxUpdate"));return i}async function RD(e){const t=await gt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("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(Q("client.invalidUserPoolList"));return i})}class JZ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const JS=new Map;function _tt(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 eE extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function dm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=_tt(n.detail??n.error);if(i)return new eE(i)}catch{return new eE({message:t})}return new eE({message:Q("client.syncGithubFailed",{status:e.status})})}async function t2e(e){const t=await gt("/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 dm(t);return t.json()}async function n2e(e){const t=await gt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function i2e(e){const t=await gt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function jtt(e){const t=await gt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function r2e(e){const t=await gt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await dm(t);const n=await t.json();return n.pipelineId?n:null}async function fN(e){const t=await gt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await dm(t);return t.json()}async function s2e(e){const t=await gt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await dm(t);return t.json()}async function $z(e){const t=await gt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await dm(t);return t.json()}async function a2e(e){const t=await gt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function Q0(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&JS.set(r,s);const o=()=>{r&&JS.get(r)===s&&JS.delete(r)},l=async w=>{if(HAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new lN({taskId:r,cause:w});const x=await Vet({signal:s==null?void 0:s.signal,shouldRetry:O=>!(O instanceof JZ)||O.status===404||O.status===408||O.status===429||O.status>=500,load:async O=>{const k=await gt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:O,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(!k.ok)throw new JZ(k.status,await Ft(k,Q("client.deploymentFailed")));return k.json()}});if(!x)throw new lN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await gt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]: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,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,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:Qet((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:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ft(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of LA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw VAe(w)?new lN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("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,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function o2e(e){var n;const t=await gt("/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||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=JS.get(e))==null||n.abort(),JS.delete(e)}async function Ntt(e=gz){const t=await gt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const oC={title:"AgentKit Studio",logoUrl:""},z8={enabled:!1},E3={studio:!1,version:"",provider:"volcengine",branding:oC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:z8};function Rtt(e){if(!e||typeof e!="object")return z8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return z8;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 l2e(){var e,t;try{const n=await gt("/web/ui-config");if(!n.ok)return E3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:oC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return tTe(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:oC.title,logoUrl:r?Ta(r):""},features:{...E3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:Rtt(i.telemetry)}}catch{return E3}}const c2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function u2e(){var n,i,r,s,o,l;const e=await gt("/web/access");if(!e.ok)throw new Error(Q("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"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function d2e(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 gt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function f2e(){const e=await gt("/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||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function h2e(e){const t=await gt("/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||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function p2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await gt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ft(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function fm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function V8(e){const t=await gt(fm(),{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Itt(e,t){const n=await gt(fm(e),{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronJobFailed")));return await n.json()}async function m2e(e){const t=await gt(fm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.createCronJobFailed")));return await t.json()}async function g2e(e,t){const n=await gt(`${fm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCronJobFailed")));return await n.json()}async function b2e(e,t){const n=t?"enable":"disable",i=await gt(`${fm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ft(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function y2e(e){const t=await gt(`${fm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ft(t,Q("client.runCronJobFailed")));return await t.json()}async function H8(e,t){const n=await gt(`${fm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function v2e(e,t){const n=await gt(`${fm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ft(n,Q("client.stopCronRunFailed")));return await n.json()}async function x2e(e){const t=await gt(fm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ft(t,Q("client.deleteCronJobFailed")))}class ID extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function z0(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await gt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ft(n,Q("client.loadRuntimeFailed"));throw new ID(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Kw(e,t,n={}){if(n.preferCached){const i=Oz(e,t,n.currentVersion),r=nw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&nw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await FA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Q1||i instanceof Oa||i instanceof Error)throw i;return null}}async function w2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Oa(await Ft(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function O2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Oa(await Ft(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function k2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await gt("/.well-known/agent-card.json",{},i),s=await nTe(r);if(s==="runtime_access_denied")throw new Q1;if(s==="runtime_private_endpoint_unreachable")throw new Oa(ZAe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Oa(JAe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Oa(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ft(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function S2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await gt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function E2e(e,t,n={}){const i=await gt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})});if(!i.ok){const r=await i.text().catch(()=>"");throw new Error(r||Q("client.deleteFailed",{status:i.status}))}}async function C2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await gt("/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 Ft(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("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(Q("client.invalidMcpCredentials"));return u})}function hN({runtimeId:e,region:t,appName:n,currentVersion:i}){return U0(sC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Ptt({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 o=await gt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Dtt(o));return await o.json()}function PD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=hN(o);if(s&&ss.delete(l),!s){const f=Eb(ss,l,z1);if(f)return Z2(Promise.resolve(f),r);const h=(u=ss.get(l))==null?void 0:u.promise;if(h)return Z2(h,r);if(n){const m=hN({...o,appName:""}),g=(d=ss.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,k,S;if(v.recoveryStatus==="preparing")return((w=ss.get(l))==null?void 0:w.promise)===b&&ss.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((k=ss.get(l))==null?void 0:k.promise)===b&&ss.delete(l),PD(o)):(((S=ss.get(l))==null?void 0:S.promise)===b&&ss.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=ss.get(l))==null?void 0:y.promise)===b&&ss.delete(l),v}),ss.set(l,{promise:b,updatedAt:0}),Z2(b,r)}}}let c;return c=Ptt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f;if(((m=ss.get(l))==null?void 0:m.promise)===c){ss.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=hN({...o,appName:w});x!==l&&!((v=ss.get(x))!=null&&v.promise)&&ss.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f}),ss.set(l,{promise:c,updatedAt:0}),Z2(c,r)}function q8({runtimeId:e,region:t,appName:n,currentVersion:i}){return Eb(ss,hN({runtimeId:e,region:t,appName:n,currentVersion:i}),z1)}function W8(e){return PD(e).then(()=>{},()=>{})}function K8(e,t){if(!e){ss.clear();return}for(const n of ss.keys()){const[i,r,s]=n.split("");i===sC&&s===e&&(!t||r===t)&&ss.delete(n)}}async function Dtt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Mtt(e,t){let n=null;for(const i of $A(t)){const r=await gt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ft(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function DD(e,t="cn-beijing",n={}){const i=U0(e,t||"cn-beijing"),r=Eb(hy,i,z1);if(!n.force&&r)return r;const s=hy.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Mtt(e,t).then(l=>kz(hy,i,l));hy.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=hy.get(i);(l==null?void 0:l.promise)===o&&hy.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Ltt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await gt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ft(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function A2e(e,t="cn-beijing"){return Eb(hy,U0(e,t||"cn-beijing"),z1)}function T2e(e,t="cn-beijing"){DD(e,t).catch(()=>{})}async function tE(e){const t=await gt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ft(t,Q("client.generateProjectFailed")));return t.json()}const $tt=19e4,Ftt=12e4;async function _2e(e){const t=await gt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},$tt);if(!t.ok)throw new Error(await Ft(t,Q("client.generateAgentConfigFailed")));return CD(t,Q("client.generateAgentConfigFailed"))}async function j2e(e,t){const n=await gt("/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})},{},Ftt);if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugRunFailed")));return CD(n,Q("client.createDebugRunFailed"))}async function N2e(e,t){const n=await gt(`/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 Ft(n,Q("client.createDebugSessionFailed")));return(await CD(n,Q("client.createDebugSessionFailed"))).id}async function R2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ft(n,Q("client.loadDebugTraceFailed")));const i=await CD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*I2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=_z(r);let l;try{l=await gt(`/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:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Xg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ft(l,Q("client.debugRunFailed")));try{for await(const c of LA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Xg()):c}finally{o.cleanup()}}async function sx(e){const t=await gt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ft(t,Q("client.cleanupDebugRunFailed")))}function P2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("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(Q("client.invalidSandboxVersion"));return t}async function D2e(e){const t=await gt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(P2e)}async function M2e(e){const t=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ft(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:P2e(n.state)}}class fd extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function Ec(e,t,n={}){const i=await gt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new fd(i.status);return i.json()}function G8(e,t,n,i){return aet(gt,e,t,n,i)}function L2e(e,t,n,i,r){return oet(gt,e,t,n,i,r)}function $2e(e,t,n,i){return cet(gt,e,t,n,i)}const Btt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:fd,DEFAULT_SITE_BRANDING:oC,DEFAULT_STUDIO_ACCESS:c2e,GithubCicdPipelineError:eE,MpaExecutionConfigRequestError:iw,RuntimeAccessDeniedError:Q1,RuntimeListError:ID,RuntimeProbeError:Oa,TurnControlConflictError:jD,applyMpaProfileAfterDeployment:tI,attachGithubDeliveryCicdToSourceSync:jtt,bindGithubCicdRuntime:$z,buildEnvironment:Q8,cancelAgentkitDeployment:o2e,cancelCronJobRun:v2e,channelRequest:Ec,checkRuntimeNameAvailability:ND,clearMessageFeedbackCache:qAe,clearRemoteApps:KAe,componentSearch:wTe,continueTurn:ktt,continueTurnSSE:yTe,controlTurn:bTe,copyRuntimeEnvironmentSecret:Ltt,createCronJob:m2e,createEnvironment:GTe,createGeneratedAgentTestRun:j2e,createGeneratedAgentTestSession:N2e,createGithubCicdPipeline:t2e,createGithubDeliveryCicdPipeline:n2e,createGithubDeliveryRollbackPr:s2e,createSession:iTe,createWorkspace:UTe,deleteAgentFeedbackCases:cTe,deleteCronJob:x2e,deleteEnvironment:YTe,deleteGeneratedAgentTestRun:sx,deleteMedia:dN,deleteRuntime:E2e,deleteSession:M8,deleteSessionMedia:L8,deleteWorkspace:zTe,deployAgentkitProject:Q0,downloadArtifact:Ez,ensureRuntimeRouteChannel:O2e,exportEnvironmentShareCode:HTe,fetchRemoteApps:FA,fetchSessionFile:uTe,generateAgentDraftFromRequirement:_2e,generateAgentProject:tE,getAgentFeedbackCases:_D,getAgentInfo:F8,getAgentOptimizations:sTe,getAgentUsage:p2e,getAutomaticEvaluationStatuses:D8,getCachedAgentFeedbackCases:aTe,getCachedRuntimeAgentInfo:vTe,getCachedRuntimeDetail:A2e,getCachedRuntimeUpdateCapability:q8,getCronJob:Itt,getEnvironmentBuild:ZTe,getEnvironmentManifest:JTe,getEnvironmentResources:e2e,getGeneratedAgentTestTrace:R2e,getGithubCicdRuntimeBinding:r2e,getGithubDeliveryVersions:fN,getMediaCapabilities:wtt,getMpaAgentDeletePreview:ATe,getMpaAgentOperation:STe,getMpaAgentView:CTe,getMpaProfileStatus:ETe,getMpaRuntimeConsoleRuns:TTe,getMpaRuntimeConsoleTrace:_Te,getMpaSessionExecutionConfig:Iz,getMyRuntimes:Ntt,getRuntimeAgentInfo:Az,getRuntimeDetail:DD,getRuntimeMcpCredentials:C2e,getRuntimeStudioToolCapabilities:w2e,getRuntimeUpdateCapability:PD,getRuntimes:z0,getSandboxImageUpdates:D2e,getSession:aC,getSessionTrace:JR,getStudioAccess:u2e,getStudioUpdatePermissions:f2e,getStudioUpdateStatus:d2e,getSystemInfo:DTe,getTurnControl:gTe,getUiConfig:l2e,httpErrorMessage:Ft,importEnvironmentShareCodes:WTe,initializeGithubDeliveryMain:i2e,inspectEnvironmentRepository:VTe,inspectEnvironmentShareCodes:qTe,invalidateRuntimeUpdateCapabilityCache:K8,isMpaA2aRuntimeApp:ip,isMpaRuntimeApp:eI,listActiveMpaAgentOperations:kTe,listApps:YAe,listCronJobRuns:H8,listCronJobs:V8,listDeploymentResources:NTe,listEnvironments:UA,listIdentityUserPools:RD,listModelApiKeys:wz,listModelOptions:U1,listMpaCronTasks:G8,listMpaRuns:$2e,listSessions:Sz,listWorkspaces:Lz,mediaContentUrl:pTe,mpaProfileFromAgentDraft:BA,parseEnvironmentManifest:LTe,parseEnvironmentShareCodes:Pz,parsePreparedSessionEnvironmentMounts:RTe,patchMpaSessionExecutionConfig:U8,prefetchAgentFeedbackCases:vtt,prefetchRuntimeAgentInfo:xTe,prefetchRuntimeDetail:T2e,prefetchRuntimeUpdateCapability:W8,prepareSessionEnvironmentMounts:ITe,previewArtifact:Cz,probeRuntimeA2a:k2e,probeRuntimeApps:Kw,refreshAgentFeedbackCases:oTe,registerRemoteApp:WAe,requestMpaTask:L2e,retryMpaAgentOperation:Rz,revealModelApiKey:XAe,revealRuntimeApiKey:S2e,runCronJobNow:y2e,runGeneratedAgentTestSSE:I2e,runSSE:B8,runSseEmptyResponseError:Tz,runSseFirstEventTimeoutError:Xg,runSseIncompleteResponseError:uS,runtimeRegionCandidates:$A,setClientCloudProvider:tTe,setCronJobEnabled:b2e,startMpaAgentOperation:Nz,startStudioUpdate:h2e,studioFetch:yn,submitIssueFeedback:$8,submitMessageFeedback:rTe,syncGithubCicdRuntime:a2e,updateCodexSandboxToolModelEnv:Ttt,updateCronJob:g2e,updateEnvironment:XTe,updateSandboxTool:M2e,updateWorkspace:QTe,upgradeMpaSessionProfile:jTe,uploadMedia:fTe,upsertCachedAgentFeedbackCase:uN,webSearch:OTe,writeEnvironmentShareCode:PTe},Symbol.toStringTag,{value:"Module"})),Utt="/web/sandbox/sessions",eJ="/web/sandbox/codex-project-handoff",tJ=3e4,C3=33e4,Qtt=6e4,ztt=6e5,lk=15e3,up=6e4,Vtt=33e4,nJ=3e4,Htt=60*60,X8=40;function MD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function Fz(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ps(e){const t=ul(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Bz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(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 qtt(e){return e instanceof Bz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Bz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function iJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function Kb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("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:LD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:py(e.conversation)}}}function rJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("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 sJ(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 ck={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function LD(e){if(!e||typeof e!="object")return{...ck};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ck.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ck.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ck.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ck.networkAccess}}function aJ(e){if(!e||typeof e!="object")throw new Error(Q("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:LD(t.permissions)}}function xa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Wtt(e){const t=xa(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 Ktt(e){const t=xa(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 F2e(e){const t=xa(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 py(e){const t=xa(e),n=F2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=xa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=xa(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,...o.length?{skillNames:o}:{},...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:LD(t.permissions)}}function Y8(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 Gtt(e){const t=Y8(e.usage);if(!t||typeof e.turnId!="string")return;const n=Y8(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 Xtt(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 B2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;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(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Bz(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 k=xa(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...k,output:(g.snapshot?"":String(k.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:[],k=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(E=>{const C=xa(E);if(!C||typeof(C.text??C.step)!="string")return[];const j=C.status==="inProgress"?"in_progress":C.status;return[{text:String(C.text??C.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},S=i.get(g.id);S===void 0?(i.set(g.id,n.length),n.push(k)):n[S]=k,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=xa(g.payload),O=xa(x==null?void 0:x.delivery),k=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===k&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(S=>typeof S=="string")){const S={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}},E=n.findIndex(C=>C.kind==="delivery"&&C.value.sessionId===O.sessionId&&C.value.artifactSha256===O.artifactSha256&&C.value.validationReportSha256===O.validationReportSha256);E===-1?n.push(S):n[E]=S,l()}}if(h==="approval"){const x=Xtt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Gtt(g);x&&(o=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],k=((w=xa(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:k?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(S=>S.kind==="text").map(S=>S.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})),...o?{usage:o}:{}})}}async function Ytt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=B2e(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 o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function nu(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ps(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},up);if(!l.ok)throw await Bs(l,o);return l.json()}function U2e(e,t={}){return{async listSessions(n={}){const i=await yn(sJ(e,n),{method:"GET",headers:ps(),signal:n.signal},tJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>Kb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>rJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,X8).join(""):i,...(o=n.modelId)!=null&&o.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},C3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return Kb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(sJ(`/web/${n}/sessions`,i),{method:"GET",headers:ps(),signal:i.signal},tJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>Kb(o,n)),...(s.snapshots??[]).map(o=>rJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ps({"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},C3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return Kb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ps(),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:Kb(o,n),kind:n,webuiUrl:Ta(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ps(),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:Q2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},lk);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ps(),signal:r.signal},C3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return Kb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},lk);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ps({"Content-Type":"application/json"}),signal:i.signal},Qtt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=Kb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ps({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??ztt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Ytt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ps(),signal:i.signal},t.interruptTimeoutMs??lk);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await nu(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=aJ(r),o=xa(r),l=Y8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=xa(await nu(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("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 yn(`${eJ}/pairings`,{method:"POST",headers:ps({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:Htt}),signal:n.signal},nJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=xa(await iJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("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 yn(`${eJ}/pairings/${encodeURIComponent(n)}`,{headers:ps({Accept:"application/json"}),signal:i.signal},nJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=xa(await iJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("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=xa(await nu(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Wtt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=xa(await nu(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=xa(await nu(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=Ktt(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 o=s.size?`?${s}`:"",l=xa(await nu(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=F2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return py(await nu(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return py(await nu(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return py(await nu(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return py(await nu(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=xa(await nu(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:py(s)}:{}}},async deleteThread(n,i,r={}){const s=xa(await nu(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:py(s)}:{}}},async compactThread(n,i={}){await nu(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ps(),signal:i.signal},up);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return aJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return LD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ps(),signal:r.signal},up);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.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(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},up);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return oJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return oJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ps(),body:s,signal:r.signal},Vtt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.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(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ps(),signal:i.signal},lk);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ps(),signal:i.signal},lk);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Br=U2e(Utt),Rv=U2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function oJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ps(),signal:i.signal},up);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:Q2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function Q2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Ta(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const mu=e=>["succeeded","cancelled","failed"].includes(e.state),z2e="/web/intelligent-development";class Gw extends Error{constructor(t,n){super(t),this.status=n}}async function Gb(e,t="GET",n,i){const r=await yn(`${z2e}${e}`,{method:t,signal:i,headers:ps(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),o=s==null?void 0:s.detail;throw new Gw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function Iv(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(Q("developmentRuns.invalidResponse"));return t}const ef={async active(e){const t=await Gb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(Iv)},async get(e,t){return Iv(await Gb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Gb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(Iv)},async create(e,t,n){return Iv(await Gb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Gb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return Iv(await Gb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return Iv(await Gb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Ztt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(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 o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=B2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.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(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("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:Q(`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:Q(`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 o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=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},mu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(mu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done +${n}`}}async function*Bet({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Na(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:hl(oc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Fet(l)}));for await(const c of BA(l)){if(!$et(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const Uet=255,Qet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function zet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Qet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>Uet)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Vet=/RunPipeline result could not be reconciled|Polling build status failed/i;class oN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function WAe(e){if(e instanceof oN)return!0;const t=e instanceof Error?e.message:String(e??"");return Vet.test(t)}function KAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Het({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 o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||KAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,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),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",gz="cn-beijing",qet="https://ark.ap-southeast.bytepluses.com/api/v3",Wet="https://ark.cn-beijing.volces.com/api/v3/",Ket="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",Get="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Xet="dola-seed-2-1-turbo-260628",Yet="doubao-seed-2-1-pro-260628",Zet="skylark-embedding-vision-250615",Jet="doubao-embedding-vision-250615",ett="seed-2-0-lite-260228",ttt="doubao-seed-2-0-lite-260428",ntt="dola-seedream-5-0-pro-260628",itt="doubao-seedream-5-0-260128",rtt="seededit-3-0-i2i-250628",stt="doubao-seededit-3-0-i2i-250628",att="dreamina-seedance-2-0-260128",ott="doubao-seedance-2-0-260128";function Pu(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function nr(e){var t;return((t=Pu(e)[0])==null?void 0:t.value)||gz}const ltt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function ED(e){return typeof e=="string"&<t.has(e)}function Sh(e,t){var i;return((i=(t?Pu(t):[...Pu("volcengine"),...Pu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Xp(e){return e==="byteplus"?Xet:Yet}function Fo(e){return e==="byteplus"?qet:Wet}function ctt(e){return e==="byteplus"?Ket:Get}function utt(e){return e==="byteplus"?Zet:Jet}function dtt(e){return e==="byteplus"?ett:ttt}function ftt(e){return e==="byteplus"?ntt:itt}function htt(e){return e==="byteplus"?rtt:stt}function ptt(e){return e==="byteplus"?att:ott}const bz="veadk.messageFeedback.v1";function yz(e,t,n,i){return[e,t,n,i].join(":")}function vz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(bz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function mtt(e,t,n){if(typeof window>"u")return;const i=vz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(bz,JSON.stringify(i))}function GAe(e){if(typeof window>"u")return;const t=yz(e.runtimeId,e.appName,e.userId,e.sessionId),n=vz(),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(bz,JSON.stringify(n))}}const lN="",xz=new Map;function XAe(e,t){xz.set(e,t)}function YAe(){xz.clear()}function Pa(e){const t=xz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function Q1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function mt(e,t={},n={},i=eo){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:hl(oc(t.headers))},l=()=>{const d={...o,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(Na(`${lN}/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(Na(`${lN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Na(`${lN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(Eet(d))return!0;if(d.status!==401)return!1;try{return await vet()}catch{return!1}};let u=await l();for(;await c(u);)await Cet(r),u=await l();return u}function yn(e,t={},n=eo){return mt(e,t,{},n)}function ZAe(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 gtt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Vt(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=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=ZAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} +${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function btt(e){const t=await Vt(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function wz(e,t=!1){const n=await mt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Vt(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function JAe(e,t){const n=await mt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Vt(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function z1(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 mt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.loadModelsFailed")));return await i.json()}async function eTe(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class V1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ea extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const tTe=()=>Q("client.privateRuntimeUnavailable"),nTe=()=>Q("client.runtimeTemporarilyUnavailable"),ZZ=["cn-beijing","cn-shanghai"],ytt=3e4,H1=5*60*1e3,iTe=60*1e3;let oC="volcengine";const iw=new Map,oy=new Map,ly=new Map,ef=new Map,os=new Map;function kz(e,t,n){return`${t}:${e}:${n??""}`}function rTe(e){e!==oC&&os.clear(),oC=e}function UA(e){const t=(e||"").trim();if(oC==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:gz;return ZZ.includes(n)?[n,...ZZ.filter(i=>i!==n)]:[n]}function CD(e){const t=(e||"").trim();return t?[t]:UA()}function Mv(...e){return e.map(t=>String(t??"")).join("")}function kb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Y2(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 sTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function QA(e,t,n,i,r=eo){const s=await mt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await sTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new V1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Ea(tTe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Ea(nTe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ea(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ea(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Vt(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ea(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ea(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&iw.set(kz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+ytt}),c}async function aTe(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const o=await vtt(i),l=await mt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await gtt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Vt(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await mt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Vt(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Vt(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function vtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await ID(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function Sz(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const s=await mt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await btt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Vt(r,Q("client.listSessionsFailed")));return r.json()}async function lC(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const l=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Vt(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Vt(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await mt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Vt(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=yz(r.runtimeId,i,t,n);o.state={...vz()[l]??{},...o.state??{}}}return o}async function oTe(e){const{app:t,ep:n}=Pa(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},yr);if(!i.ok)throw new Error(await Vt(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=yz(n.runtimeId,t,e.userId,e.sessionId);return mtt(s,e.eventId,r),r}async function AD(e,t={}){const n=Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=kb(ef,n,iTe);if(!t.force&&i)return i;const r=ef.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of CD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await mt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(ef,n,await u.json());s=new Error(await Vt(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();ef.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=ef.get(n);(l==null?void 0:l.promise)===o&&ef.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await mt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Vt(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function lTe(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await mt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Vt(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function cTe(e){return kb(ef,Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),iTe)}function xtt(e){AD(e).catch(()=>{})}function uTe(e){AD(e,{force:!0}).catch(()=>{})}function dTe(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 cN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of ef.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=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:""},...o]:o;ef.set(i,{value:{...s,sets:dTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function fTe(e){let t=null;for(const n of CD(e.region)){const i=await mt("/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})},{},yr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of ef.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));ef.set(o,{value:{...c,sets:dTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Vt(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const o=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await mt(`/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 wtt(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 pTe(e,t,n,i,r){const{app:s,ep:o}=Pa(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await mt(c,{},o,yr);if(!u.ok)throw new Error(await Vt(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=wtt(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 Cz(e,t,n,i,r){const{blob:s}=await pTe(e,t,n,i,r);return URL.createObjectURL(s)}async function ktt(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await Vt(t,"media capabilities failed"));return t.json()}async function mTe(e,t,n,i){const{app:r}=Pa(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await mt("/web/media",{method:"POST",body:s},{},yr);if(!o.ok)throw new Error(await Vt(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Pa(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await mt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Vt(s,"media cleanup failed"))}function gTe(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 uN(e,t){const n=gTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await mt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Vt(i,"media cleanup failed"))}function bTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=gTe(t);if(!n)return t;const i=`${n}/content`;return Na(`${lN}${i}`)}async function ZR(e,t,n){const{app:i,ep:r}=Pa(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 mt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await mt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Vt(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await mt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vt(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function JZ(e,t,n=!0,i){const r=await mt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await mt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function Ott(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function yTe(e,t,n=!0,i){try{return await JZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!Ott(r))throw r;return JZ("a2a-default",t,n,i)}}class TD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function vTe(e,t){const{ep:n}=Pa(e),i=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Vt(i,"turn control failed"));return i.json()}async function xTe(e,t,n,i){var o;const{ep:r}=Pa(e),s=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new TD(l.detail)}if(!s.ok)throw new Error(await Vt(s,"turn control failed"));return s.json()}async function Stt(e,t,n,i,r){var c;const{ep:s}=Pa(e),o=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new TD(u.detail)}if(!o.ok)throw new Error(await Vt(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*wTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Pa(e),u=(s==null?void 0:s.trim())??"",d=_z(o);let f;try{const g=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=YR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Vt(g,"turn continue failed");throw new Error(nl(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(nl("turn continue returned a different session"));f=await mt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}const h=YR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Vt(f,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of BA(f)){if(g&&typeof g=="object"&&g[aC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[aC],typeof b.error=="string"&&(b.error=nl(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=nl(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=nl(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}finally{d.cleanup()}if(!m)throw new Error(Tz())}async function $8(e,t){const{app:n,ep:i}=Pa(e);return yTe(n,i,!1,t)}async function Ett(e,t,n){let i=null;for(const r of UA(t)){const s={runtimeId:e,region:r};try{const o=kz(e,r),l=iw.get(o);l&&l.expiresAt<=Date.now()&&iw.delete(o);const c=iw.get(o),u=n||(c==null?void 0:c.apps[0])||(await QA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return yTe(u,s)}catch(o){if(o instanceof V1||o instanceof Ea&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Az(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=Mv(e,t||"cn-beijing",r??""),l=kb(oy,o,H1);if(!s.force&&l)return l;const c=oy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ett(e,t,r).then(d=>Oz(oy,o,d));oy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=oy.get(o);(d==null?void 0:d.promise)===u&&oy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function kTe(e,t,n=""){return kb(oy,Mv(e,t||"cn-beijing",n),H1)}function OTe(e,t,n=""){Az(e,t,n).catch(()=>{})}function JR(e){const{app:t,ep:n}=Pa(e);return Q1(t,n)}function ap(e){const{app:t,ep:n}=Pa(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function STe(e,t,n,i){const{app:r,ep:s}=Pa(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await mt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Vt(l,Q("client.agentSearchFailed")));return l.json()}async function ETe(e,t){const{app:n}=Pa(e),i=await mt(`/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 Tz(){return nl(Q("client.emptySseBody"))}function fS(){return nl(Q("client.noDisplayableSseReply"))}const Ctt=6e4;function Wg(){return Q("client.firstSseEventTimeout")}function _z(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(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Wg())))},Ctt);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*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Pa(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,k=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&k.length>0){const I=k[0],D=I.partMetadata;k[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const S=(s==null?void 0:s.trim())??"",O=(l==null?void 0:l.trim())??"",A=typeof o=="number",E=A||S?{veadkExecution:{...A?{executionConfigVersion:o}:{},...S?{idempotencyKey:S}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=Q1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const C=_z(g);try{if(T){const I=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({content:i,...A?{executionConfigVersion:o}:{}}),signal:C.signal},y,0),D=YR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){C.cleanup();const L=await Vt(I,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...O?{lastEventId:O}:{}}),signal:C.signal},y,0)}else R=await mt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:k},streaming:!0,...O?{lastEventId:O}:{},...A?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:C.signal},y,0)}catch(I){throw C.cleanup(),C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}const N=YR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){C.cleanup();const I=await Vt(R,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of BA(R)){if(I&&typeof I=="object"&&I[aC]==="done"){C.clearDeadline();break}P=!0,C.clearDeadline();const D={...I};delete D[aC],typeof D.error=="string"&&(D.error=nl(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=nl(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=nl(D.error_message)),yield D}}catch(I){throw C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}finally{C.cleanup()}if(!P)throw new Error(Tz())}class rw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function jz(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new rw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=ZAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new rw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new rw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function zA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(zA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function Nz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:zA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await mt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Vt(i,Q("client.mpaOperationFailed")));return await i.json()}async function eI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return Nz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function CTe(){const e=await mt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Vt(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function ATe(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function TTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function _Te(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function jTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function NTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await mt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Vt(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function RTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await mt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Vt(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Rz(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:zA(t.draft)})});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationFailed")));return await n.json()}async function Iz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await jz(n);return await n.json()}async function B8(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await jz(t);return await t.json()}async function ITe(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await jz(t);return await t.json()}async function _D(e,t){const n=new URLSearchParams({name:e,region:t}),i=await mt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function PTe(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.namePrefix&&n.set("namePrefix",e.namePrefix),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await mt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Vt(i,Q("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(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function DTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("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(Q("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(Q("client.environmentMountMismatch"));return i})}async function MTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Pa(t);let o;try{o=await mt("/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(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Vt(o,Q("client.environmentMountFailed")));return DTe(await o.json(),r)}function Pz(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 LTe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const eJ={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 $Te(e){var r;const t=await mt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("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(Q("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(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(eJ[s.kind]??Number.MAX_SAFE_INTEGER)-(eJ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const FTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Dz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!FTe.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(Q("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(Q("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 BTe(e){if(!e||typeof e!="object")throw new Error(Q("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||!FTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function UTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidImageRepository"));return t}function Att(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidCodeRepository"));return t}function Ttt(e){const t=UTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Mz(e){if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Att(t.gitSource),containerRepository:UTe(t.containerRepository),imageSource:Ttt(t.imageSource),latestVersion:Dz(t.latestVersion)}}function QTe(e){if(!e||typeof e!="object")throw new Error(Q("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(Q("client.invalidWorkspace"));return t}async function Lz(e){const t=await mt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map(QTe)}async function zTe(e,t,n,i){const r=await mt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Vt(r,Q("client.saveWorkspaceFailed")));return QTe(await r.json())}function VTe(e,t){return zTe("/web/workspaces","POST",e,t)}function HTe(e,t,n){return zTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function qTe(e,t){const n=await mt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.deleteWorkspaceFailed")))}async function VA(e){const t=await mt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Mz)}async function WTe(e,t){const n=await mt("/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 Vt(n,Q("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(Q("client.invalidRepositoryProbe"));return i}async function KTe(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function GTe(e,t){const n=await mt("/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 Vt(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function XTe(e,t){const n=await mt("/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 Vt(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("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(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Mz(s.environment),error:s.error??""}})}async function YTe(e,t,n,i){let r;try{r=await mt(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(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Vt(r,Q("client.saveEnvironmentFailed")));return Mz(await r.json())}function ZTe(e,t){return YTe("/web/v3/environments","POST",e,t)}function JTe(e,t,n){return YTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function e2e(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.startEnvironmentBuildFailed")));const i=Dz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function t2e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Vt(r,Q("client.loadEnvironmentBuildFailed")));const s=Dz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function n2e(e,t,n){const i=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Vt(i,Q("client.loadEnvironmentManifestFailed")));return BTe(await i.json())}function tJ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function i2e(e){const t=await mt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:tJ(n.codePipeline),containerRegistry:tJ(n.containerRegistry)}}async function _tt(e,t){const n=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("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(Q("client.invalidCodexSandboxUpdate"));return i}async function jD(e){const t=await mt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("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(Q("client.invalidUserPoolList"));return i})}class nJ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const tE=new Map;function jtt(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 nE extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function fm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=jtt(n.detail??n.error);if(i)return new nE(i)}catch{return new nE({message:t})}return new nE({message:Q("client.syncGithubFailed",{status:e.status})})}async function r2e(e){const t=await mt("/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 fm(t);return t.json()}async function s2e(e){const t=await mt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function a2e(e){const t=await mt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Ntt(e){const t=await mt("/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,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function o2e(e){const t=await mt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);const n=await t.json();return n.pipelineId?n:null}async function dN(e){const t=await mt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);return t.json()}async function l2e(e){const t=await mt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function $z(e){const t=await mt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function c2e(e){const t=await mt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Lv(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&tE.set(r,s);const o=()=>{r&&tE.get(r)===s&&tE.delete(r)},l=async w=>{if(KAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new oN({taskId:r,cause:w});const x=await Het({signal:s==null?void 0:s.signal,shouldRetry:k=>!(k instanceof nJ)||k.status===404||k.status===408||k.status===429||k.status>=500,load:async k=>{const S=await mt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:k,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(!S.ok)throw new nJ(S.status,await Vt(S,Q("client.deploymentFailed")));return S.json()}});if(!x)throw new oN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await mt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]: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,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,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:zet((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:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Vt(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of BA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw WAe(w)?new oN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("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,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function u2e(e){var n;const t=await mt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=tE.get(e))==null||n.abort(),tE.delete(e)}async function Rtt(e=gz){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const cC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:cC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function Itt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;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 d2e(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:cC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return rTe(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:cC.title,logoUrl:r?Na(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:Itt(i.telemetry)}}catch{return S3}}const f2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function h2e(){var n,i,r,s,o,l;const e=await mt("/web/access");if(!e.ok)throw new Error(Q("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"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function p2e(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 mt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function m2e(){const e=await mt("/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||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function g2e(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},yr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function b2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await mt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Vt(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function hm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await mt(hm(),{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Ptt(e,t){const n=await mt(hm(e),{signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.loadCronJobFailed")));return await n.json()}async function y2e(e){const t=await mt(hm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vt(t,Q("client.createCronJobFailed")));return await t.json()}async function v2e(e,t){const n=await mt(`${hm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Vt(n,Q("client.updateCronJobFailed")));return await n.json()}async function x2e(e,t){const n=t?"enable":"disable",i=await mt(`${hm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Vt(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function w2e(e){const t=await mt(`${hm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Vt(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await mt(`${hm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function k2e(e,t){const n=await mt(`${hm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Vt(n,Q("client.stopCronRunFailed")));return await n.json()}async function O2e(e){const t=await mt(hm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Vt(t,Q("client.deleteCronJobFailed")))}class ND extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function $v(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await mt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Vt(n,Q("client.loadRuntimeFailed"));throw new ND(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Xw(e,t,n={}){if(n.preferCached){const i=kz(e,t,n.currentVersion),r=iw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&iw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await QA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof V1||i instanceof Ea||i instanceof Error)throw i;return null}}async function S2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ea(await Vt(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function E2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ea(await Vt(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function C2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await mt("/.well-known/agent-card.json",{},i),s=await sTe(r);if(s==="runtime_access_denied")throw new V1;if(s==="runtime_private_endpoint_unreachable")throw new Ea(tTe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ea(nTe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ea(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Vt(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function A2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await mt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function T2e(e,t,n={}){const i=n.agentCategory==="mpa";let r;try{r=await mt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})},{},i?18e4:eo)}catch(s){if(!i||!(s instanceof Error)||s.name!=="TimeoutError")throw s;try{const o=new URLSearchParams({runtimeId:e,region:t}),l=await mt(`/web/mpa-runtime-deletion-status?${o.toString()}`,{cache:"no-store"});if(l.ok){const c=await l.json();if((c==null?void 0:c.deleted)===!0)return}}catch{}throw new Error(Q("client.mpaDeleteUnconfirmed"))}if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(s||Q("client.deleteFailed",{status:r.status}))}}async function _2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await mt("/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 Vt(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("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(Q("client.invalidMcpCredentials"));return u})}function fN({runtimeId:e,region:t,appName:n,currentVersion:i}){return Mv(oC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Dtt({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 o=await mt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Mtt(o));return await o.json()}function RD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=fN(o);if(s&&os.delete(l),!s){const f=kb(os,l,H1);if(f)return Y2(Promise.resolve(f),r);const h=(u=os.get(l))==null?void 0:u.promise;if(h)return Y2(h,r);if(n){const m=fN({...o,appName:""}),g=(d=os.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,k,S,O;if(v.recoveryStatus==="preparing")return((w=os.get(l))==null?void 0:w.promise)===b&&os.delete(l),v;const y=((k=(x=v.agent)==null?void 0:x.appName)==null?void 0:k.trim())??"";return y&&y!==n.trim()?(((S=os.get(l))==null?void 0:S.promise)===b&&os.delete(l),RD(o)):(((O=os.get(l))==null?void 0:O.promise)===b&&os.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=os.get(l))==null?void 0:y.promise)===b&&os.delete(l),v}),os.set(l,{promise:b,updatedAt:0}),Y2(b,r)}}}let c;return c=Dtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f;if(((m=os.get(l))==null?void 0:m.promise)===c){os.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=fN({...o,appName:w});x!==l&&!((v=os.get(x))!=null&&v.promise)&&os.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f}),os.set(l,{promise:c,updatedAt:0}),Y2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return kb(os,fN({runtimeId:e,region:t,appName:n,currentVersion:i}),H1)}function q8(e){return RD(e).then(()=>{},()=>{})}function W8(e,t){if(!e){os.clear();return}for(const n of os.keys()){const[i,r,s]=n.split("");i===oC&&s===e&&(!t||r===t)&&os.delete(n)}}async function Mtt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Ltt(e,t){let n=null;for(const i of UA(t)){const r=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Vt(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function ID(e,t="cn-beijing",n={}){const i=Mv(e,t||"cn-beijing"),r=kb(ly,i,H1);if(!n.force&&r)return r;const s=ly.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Ltt(e,t).then(l=>Oz(ly,i,l));ly.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=ly.get(i);(l==null?void 0:l.promise)===o&&ly.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function $tt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await mt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Vt(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function j2e(e,t="cn-beijing"){return kb(ly,Mv(e,t||"cn-beijing"),H1)}function N2e(e,t="cn-beijing"){ID(e,t).catch(()=>{})}async function iE(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Vt(t,Q("client.generateProjectFailed")));return t.json()}const Ftt=19e4,Btt=12e4;async function R2e(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Ftt);if(!t.ok)throw new Error(await Vt(t,Q("client.generateAgentConfigFailed")));return SD(t,Q("client.generateAgentConfigFailed"))}async function I2e(e,t){const n=await mt("/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})},{},Btt);if(!n.ok)throw new Error(await Vt(n,Q("client.createDebugRunFailed")));return SD(n,Q("client.createDebugRunFailed"))}async function P2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Vt(n,Q("client.createDebugSessionFailed")));return(await SD(n,Q("client.createDebugSessionFailed"))).id}async function D2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Vt(n,Q("client.loadDebugTraceFailed")));const i=await SD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*M2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=_z(r);let l;try{l=await mt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Wg()):c}if(!l.ok)throw o.cleanup(),new Error(await Vt(l,Q("client.debugRunFailed")));try{for await(const c of BA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Wg()):c}finally{o.cleanup()}}async function ax(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Vt(t,Q("client.cleanupDebugRunFailed")))}function L2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("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(Q("client.invalidSandboxVersion"));return t}async function $2e(e){const t=await mt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(L2e)}async function F2e(e){const t=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Vt(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:L2e(n.state)}}class Ou extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function wc(e,t,n={}){const i=await mt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new Ou(i.status);return i.json()}function K8(e,t,n,i){return oet(mt,e,t,n,i)}function B2e(e,t,n,i,r){return cet(mt,e,t,n,i,r)}function U2e(e,t,n,i){return uet(mt,e,t,n,i)}const Utt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:Ou,DEFAULT_SITE_BRANDING:cC,DEFAULT_STUDIO_ACCESS:f2e,GithubCicdPipelineError:nE,MpaExecutionConfigRequestError:rw,RuntimeAccessDeniedError:V1,RuntimeListError:ND,RuntimeProbeError:Ea,TurnControlConflictError:TD,applyMpaProfileAfterDeployment:eI,attachGithubDeliveryCicdToSourceSync:Ntt,bindGithubCicdRuntime:$z,buildEnvironment:U8,cancelAgentkitDeployment:u2e,cancelCronJobRun:k2e,channelRequest:wc,checkRuntimeNameAvailability:_D,clearMessageFeedbackCache:GAe,clearRemoteApps:YAe,componentSearch:STe,continueTurn:Stt,continueTurnSSE:wTe,controlTurn:xTe,copyRuntimeEnvironmentSecret:$tt,createCronJob:y2e,createEnvironment:ZTe,createGeneratedAgentTestRun:I2e,createGeneratedAgentTestSession:P2e,createGithubCicdPipeline:r2e,createGithubDeliveryCicdPipeline:s2e,createGithubDeliveryRollbackPr:l2e,createSession:aTe,createWorkspace:VTe,deleteAgentFeedbackCases:fTe,deleteCronJob:O2e,deleteEnvironment:e2e,deleteGeneratedAgentTestRun:ax,deleteMedia:uN,deleteRuntime:T2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:qTe,deployAgentkitProject:Lv,downloadArtifact:Ez,ensureRuntimeRouteChannel:E2e,exportEnvironmentShareCode:KTe,fetchRemoteApps:QA,fetchSessionFile:hTe,generateAgentDraftFromRequirement:R2e,generateAgentProject:iE,getAgentFeedbackCases:AD,getAgentInfo:$8,getAgentOptimizations:lTe,getAgentUsage:b2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:cTe,getCachedRuntimeAgentInfo:kTe,getCachedRuntimeDetail:j2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Ptt,getEnvironmentBuild:t2e,getEnvironmentManifest:n2e,getEnvironmentResources:i2e,getGeneratedAgentTestTrace:D2e,getGithubCicdRuntimeBinding:o2e,getGithubDeliveryVersions:dN,getMediaCapabilities:ktt,getMpaAgentDeletePreview:jTe,getMpaAgentOperation:ATe,getMpaAgentView:_Te,getMpaProfileStatus:TTe,getMpaRuntimeConsoleRuns:NTe,getMpaRuntimeConsoleTrace:RTe,getMpaSessionExecutionConfig:Iz,getMyRuntimes:Rtt,getRuntimeAgentInfo:Az,getRuntimeDetail:ID,getRuntimeMcpCredentials:_2e,getRuntimeStudioToolCapabilities:S2e,getRuntimeUpdateCapability:RD,getRuntimes:$v,getSandboxImageUpdates:$2e,getSession:lC,getSessionTrace:ZR,getStudioAccess:h2e,getStudioUpdatePermissions:m2e,getStudioUpdateStatus:p2e,getSystemInfo:$Te,getTurnControl:vTe,getUiConfig:d2e,httpErrorMessage:Vt,importEnvironmentShareCodes:XTe,initializeGithubDeliveryMain:a2e,inspectEnvironmentRepository:WTe,inspectEnvironmentShareCodes:GTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:ap,isMpaRuntimeApp:JR,listActiveMpaAgentOperations:CTe,listApps:eTe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:PTe,listEnvironments:VA,listIdentityUserPools:jD,listModelApiKeys:wz,listModelOptions:z1,listMpaCronTasks:K8,listMpaRuns:U2e,listSessions:Sz,listWorkspaces:Lz,mediaContentUrl:bTe,mpaProfileFromAgentDraft:zA,parseEnvironmentManifest:BTe,parseEnvironmentShareCodes:Pz,parsePreparedSessionEnvironmentMounts:DTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:xtt,prefetchRuntimeAgentInfo:OTe,prefetchRuntimeDetail:N2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:MTe,previewArtifact:Cz,probeRuntimeA2a:C2e,probeRuntimeApps:Xw,refreshAgentFeedbackCases:uTe,registerRemoteApp:XAe,requestMpaTask:B2e,retryMpaAgentOperation:Rz,revealModelApiKey:JAe,revealRuntimeApiKey:A2e,runCronJobNow:w2e,runGeneratedAgentTestSSE:M2e,runSSE:F8,runSseEmptyResponseError:Tz,runSseFirstEventTimeoutError:Wg,runSseIncompleteResponseError:fS,runtimeRegionCandidates:UA,setClientCloudProvider:rTe,setCronJobEnabled:x2e,startMpaAgentOperation:Nz,startStudioUpdate:g2e,studioFetch:yn,submitIssueFeedback:L8,submitMessageFeedback:oTe,syncGithubCicdRuntime:c2e,updateCodexSandboxToolModelEnv:_tt,updateCronJob:v2e,updateEnvironment:JTe,updateSandboxTool:F2e,updateWorkspace:HTe,upgradeMpaSessionProfile:ITe,uploadMedia:mTe,upsertCachedAgentFeedbackCase:cN,webSearch:ETe,writeEnvironmentShareCode:LTe},Symbol.toStringTag,{value:"Module"})),Qtt="/web/sandbox/sessions",iJ="/web/sandbox/codex-project-handoff",rJ=3e4,E3=33e4,ztt=6e4,Vtt=6e5,uO=15e3,hp=6e4,Htt=33e4,sJ=3e4,qtt=60*60,G8=40;function PD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function Fz(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ys(e){const t=hl(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Bz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(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 Wtt(e){return e instanceof Bz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Bz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function aJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function zb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("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:DD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:cy(e.conversation)}}}function oJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("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 lJ(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 dO={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function DD(e){if(!e||typeof e!="object")return{...dO};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:dO.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:dO.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:dO.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:dO.networkAccess}}function cJ(e){if(!e||typeof e!="object")throw new Error(Q("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:DD(t.permissions)}}function Oa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ktt(e){const t=Oa(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 Gtt(e){const t=Oa(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 Q2e(e){const t=Oa(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 cy(e){const t=Oa(e),n=Q2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=Oa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=Oa(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,...o.length?{skillNames:o}:{},...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:DD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Xtt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ytt(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 z2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;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(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Bz(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),k=x===void 0?void 0:n[x];if((k==null?void 0:k.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const S=Oa(k.response)||{};n[x]=h==="tool_progress"?{...k,progressText:g.text}:{...k,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:"",k=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:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:k.flatMap(A=>{const E=Oa(A);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},O=i.get(g.id);O===void 0?(i.set(g.id,n.length),n.push(S)):n[O]=S,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=Oa(g.payload),k=Oa(x==null?void 0:x.delivery),S=h==="development.succeeded";if(k&&typeof k.sessionId=="string"&&typeof k.artifactSha256=="string"&&typeof k.validationReportSha256=="string"&&typeof k.agentName=="string"&&typeof k.entryPoint=="string"&&typeof k.fileCount=="number"&&typeof k.artifactSize=="number"&&typeof k.validatedAt=="string"&&k.deployable===!0&&k.verified===S&&typeof k.validationSummary=="string"&&Array.isArray(k.gateSummary)&&k.gateSummary.every(O=>typeof O=="string")){const O={kind:"delivery",value:{sessionId:k.sessionId,...typeof k.projectId=="string"&&typeof k.versionId=="string"?{projectId:k.projectId,versionId:k.versionId,...k.parentVersionId===null||typeof k.parentVersionId=="string"?{parentVersionId:k.parentVersionId}:{}}:{},artifactSha256:k.artifactSha256,validationReportSha256:k.validationReportSha256,agentName:k.agentName,entryPoint:k.entryPoint,fileCount:k.fileCount,artifactSize:k.artifactSize,validatedAt:k.validatedAt,gateSummary:k.gateSummary,deployable:k.deployable,verified:k.verified,validationSummary:k.validationSummary}},A=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===k.sessionId&&E.value.artifactSha256===k.artifactSha256&&E.value.validationReportSha256===k.validationReportSha256);A===-1?n.push(O):n[A]=O,l()}}if(h==="approval"){const x=Ytt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Xtt(g);x&&(o=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),k=x===void 0?void 0:n[x],S=((w=Oa(g))==null?void 0:w.snapshot)===!0;(k==null?void 0:k.kind)==="text"?n[x]={...k,phase:typeof g.phase=="string"&&g.phase?g.phase:k.phase,text:S?k.text.startsWith(g.text)?k.text:g.text:k.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(O=>O.kind==="text").map(O=>O.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})),...o?{usage:o}:{}})}}async function Ztt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=z2e(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 o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function su(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ys(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},hp);if(!l.ok)throw await Bs(l,o);return l.json()}function V2e(e,t={}){return{async listSessions(n={}){const i=await yn(lJ(e,n),{method:"GET",headers:ys(),signal:n.signal},rJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>zb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>oJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.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},E3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return zb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(lJ(`/web/${n}/sessions`,i),{method:"GET",headers:ys(),signal:i.signal},rJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>zb(o,n)),...(s.snapshots??[]).map(o=>oJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ys({"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},E3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return zb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:zb(o,n),kind:n,webuiUrl:Na(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:H2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ys(),signal:r.signal},E3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return zb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ys({"Content-Type":"application/json"}),signal:i.signal},ztt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=zb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ys({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??Vtt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Ztt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ys(),signal:i.signal},t.interruptTimeoutMs??uO);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await su(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=cJ(r),o=Oa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=Oa(await su(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("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 yn(`${iJ}/pairings`,{method:"POST",headers:ys({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:qtt}),signal:n.signal},sJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=Oa(await aJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("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 yn(`${iJ}/pairings/${encodeURIComponent(n)}`,{headers:ys({Accept:"application/json"}),signal:i.signal},sJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=Oa(await aJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("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=Oa(await su(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Ktt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=Oa(await su(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=Oa(await su(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=Gtt(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 o=s.size?`?${s}`:"",l=Oa(await su(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=Q2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return cy(await su(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return cy(await su(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return cy(await su(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return cy(await su(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=Oa(await su(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:cy(s)}:{}}},async deleteThread(n,i,r={}){const s=Oa(await su(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:cy(s)}:{}}},async compactThread(n,i={}){await su(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return cJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return DD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ys(),signal:r.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.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(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return uJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return uJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ys(),body:s,signal:r.signal},Htt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.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(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Hr=V2e(Qtt),P0=V2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function uJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:H2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function H2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Na(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const yu=e=>["succeeded","cancelled","failed"].includes(e.state),q2e="/web/intelligent-development";class Yw extends Error{constructor(t,n){super(t),this.status=n}}async function Vb(e,t="GET",n,i){const r=await yn(`${q2e}${e}`,{method:t,signal:i,headers:ys(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),o=s==null?void 0:s.detail;throw new Yw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function D0(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(Q("developmentRuns.invalidResponse"));return t}const Yd={async active(e){const t=await Vb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(D0)},async get(e,t){return D0(await Vb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(D0)},async create(e,t,n){return D0(await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Vb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Jtt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(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 o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=z2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.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(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("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:Q(`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:Q(`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 o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=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},yu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(yu(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 o=t.type==="activity"&&n.kind==="commentary";this.projection(s).consumeFrame(`event: ${o?"delta":t.type} -data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{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=!mu(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),o={...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:o})}}}}function Jtt(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 ent(e,t,n){var c;const i=await yn(`${z2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ps({Accept:"text/event-stream"})},0);if(!i.ok)throw new Gw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=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(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function tnt(e,t,n,i,r){const s=new Map;let o=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 ef.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 Ztt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Gw&&v.status===404&&mu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Gw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await Jtt(Math.min(1e3*2**o++,15e3),t)}}function nnt({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,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 A=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!A.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(null),E=p.useRef({sessionId:e,ownerId:t});E.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const A=S.current;if(((A==null?void 0:A.session)!==e||A.owner!==t)&&(y.current=[],m(!1),k.current=!1,S.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&E.current.sessionId===e&&E.current.ownerId===t;return tnt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(O.current||!!(D&&!mu(D))),D&&mu(D)&&(m(!1),k.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function C(A,N=e){const P=E.current.ownerId;let I=S.current;return(!I||I.session!==N||I.owner!==P||I.text!==A)&&(I={session:N,owner:P,text:A,id:crypto.randomUUID()},S.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:A}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!mu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(A,N=e){var L;if(!A.trim()||O.current||k.current)return!1;O.current=!0,f(!0),u("");const P=E.current.ownerId,I=()=>E.current.ownerId===P&&E.current.sessionId===N;C(A,N),x(),g.current.onBusy(!0);const D=S.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===A?D:{session:N,owner:P,text:A,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};S.current=_;try{const F=await ef.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!mu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let H;return _.runId?(await ef.steer(_.runId,A,_.id),H=await ef.get(_.runId)):H=await ef.create(N,A,_.id),(_.stopRequested||I()&&k.current)&&(H=await ef.stop(H.runId)),I()&&(s(H),(L=w.current)==null||L.call(w,H),g.current.onBusy(!mu(H)),S.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!mu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(k.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function T(){k.current=!0,m(!0),u(""),S.current&&(S.current.stopRequested=!0);const A=b.current;try{const P=(await ef.list(e)).find(I=>!mu(I));if(P){const I=await ef.stop(P.runId);A===b.current&&s(I)}else!O.current&&A===b.current&&(k.current=!1,m(!1))}catch(N){A===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),k.current=!1)}}async function R(){if(!r)return;const A=b.current;try{const N=await ef.resume(r.runId);A===b.current&&(s(N),u(""))}catch(N){A===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:C,submit:j,stop:T,resume:R}}function lJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function V2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(N8())});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])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(N8(),{maximumFractionDigits:1})})).join(" ")}const A3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},cJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function H2e(e){var n;const t=A3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(A3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("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?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>cJ(A3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:cJ(t.query)}):e.name}const int=e=>["tool","thinking","plan","diff"].includes(e.kind);function rnt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=int(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 uJ="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 d0({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=SD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.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"?a.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:[a.jsx("path",{className:"studio-loading__track",d:uJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(Cr.path,{className:"studio-loading__path",d:uJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(Cr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function Ci({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(d0,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function snt({variant:e,...t}){return a.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"?a.jsxs(a.Fragment,{children:[a.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"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function ant(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function ont({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(snt,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(Ci,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(ant,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Uz(){}const lnt=Object.freeze([]),nc=Object.freeze({});function $D(e){p.useEffect(e,lnt)}const dJ={};function Ad(e,t){const n=p.useRef(dJ);return n.current===dJ&&(n.current=e(t)),n}const cnt=()=>{},Jn=typeof document<"u"?p.useLayoutEffect:cnt;function unt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Hc=unt("https://base-ui.com/production-error","Base UI"),q2e=p.createContext(void 0);function Qz(){const e=p.useContext(q2e);if(!e)throw new Error(Hc(73));return e}var W2e={exports:{}},K2e={};/** +data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{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=!yu(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),o={...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:o})}}}}function ent(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 tnt(e,t,n){var c;const i=await yn(`${q2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ys({Accept:"text/event-stream"})},0);if(!i.ok)throw new Yw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=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(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function nnt(e,t,n,i,r){const s=new Map;let o=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 Jtt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Yw&&v.status===404&&yu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Yw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await ent(Math.min(1e3*2**o++,15e3),t)}}function int({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,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 C=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!C.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(null),A=p.useRef({sessionId:e,ownerId:t});A.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const C=O.current;if(((C==null?void 0:C.session)!==e||C.owner!==t)&&(y.current=[],m(!1),S.current=!1,O.current=null,k.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&A.current.sessionId===e&&A.current.ownerId===t;return nnt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(k.current||!!(D&&!yu(D))),D&&yu(D)&&(m(!1),S.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(C,N=e){const P=A.current.ownerId;let I=O.current;return(!I||I.session!==N||I.owner!==P||I.text!==C)&&(I={session:N,owner:P,text:C,id:crypto.randomUUID()},O.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:C}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!yu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(C,N=e){var L;if(!C.trim()||k.current||S.current)return!1;k.current=!0,f(!0),u("");const P=A.current.ownerId,I=()=>A.current.ownerId===P&&A.current.sessionId===N;E(C,N),x(),g.current.onBusy(!0);const D=O.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===C?D:{session:N,owner:P,text:C,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};O.current=_;try{const F=await Yd.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!yu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let H;return _.runId?(await Yd.steer(_.runId,C,_.id),H=await Yd.get(_.runId)):H=await Yd.create(N,C,_.id),(_.stopRequested||I()&&S.current)&&(H=await Yd.stop(H.runId)),I()&&(s(H),(L=w.current)==null||L.call(w,H),g.current.onBusy(!yu(H)),O.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!yu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(S.current=!1,m(!1))),!1}finally{I()&&(k.current=!1,f(!1))}}async function T(){S.current=!0,m(!0),u(""),O.current&&(O.current.stopRequested=!0);const C=b.current;try{const P=(await Yd.list(e)).find(I=>!yu(I));if(P){const I=await Yd.stop(P.runId);C===b.current&&s(I)}else!k.current&&C===b.current&&(S.current=!1,m(!1))}catch(N){C===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),S.current=!1)}}async function R(){if(!r)return;const C=b.current;try{const N=await Yd.resume(r.runId);C===b.current&&(s(N),u(""))}catch(N){C===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function dJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function W2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});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])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},fJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function K2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("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?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>fJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:fJ(t.query)}):e.name}const rnt=e=>["tool","thinking","plan","diff"].includes(e.kind);function snt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=rnt(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 hJ="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 av({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=kD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.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"?a.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:[a.jsx("path",{className:"studio-loading__track",d:hJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(_r.path,{className:"studio-loading__path",d:hJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(_r.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function ki({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(av,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function ant({variant:e,...t}){return a.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"?a.jsxs(a.Fragment,{children:[a.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"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function ont(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function lnt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(ant,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(ont,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Uz(){}const cnt=Object.freeze([]),Jl=Object.freeze({});function MD(e){p.useEffect(e,cnt)}const pJ={};function Td(e,t){const n=p.useRef(pJ);return n.current===pJ&&(n.current=e(t)),n}const unt=()=>{},ti=typeof document<"u"?p.useLayoutEffect:unt;function dnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Uc=dnt("https://base-ui.com/production-error","Base UI"),G2e=p.createContext(void 0);function Qz(){const e=p.useContext(G2e);if(!e)throw new Error(Uc(73));return e}var X2e={exports:{}},Y2e={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -137,353 +137,353 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{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 FD=p,dnt=ZP;function fnt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hnt=typeof Object.is=="function"?Object.is:fnt,pnt=dnt.useSyncExternalStore,mnt=FD.useRef,gnt=FD.useEffect,bnt=FD.useMemo,ynt=FD.useDebugValue;K2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=mnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=bnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,hnt(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=pnt(e,s[0],s[1]);return gnt(function(){o.hasValue=!0,o.value=l},[l]),ynt(l),l};W2e.exports=K2e;var G2e=W2e.exports;const vnt=_1(G2e),xnt=parseInt(p.version,10);function zz(e){return xnt>=e}const wnt=zz(19),Ont=wnt?Snt:Ent;function X2e(e,t,n,i,r){return Ont(e,t,n,i,r)}function knt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return ZP.useSyncExternalStore(e.subscribe,s,s)}function Snt(e,t,n,i,r){return knt(e,t,n,i,r)}function Ent(e,t,n,i,r){return G2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Cnt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(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 X2e(this,t,n,i,r)}}const Vz={...P0},T3=Vz.useInsertionEffect,Ant=T3&&T3!==Vz.useLayoutEffect?T3:e=>e();function ci(e){const t=Ad(Tnt).current;return t.next=e,Ant(t.effect),t.trampoline}function Tnt(){const e={next:void 0,callback:_nt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function _nt(){}class BD extends Cnt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Jn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Jn(()=>(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);Jn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Jn(()=>{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),X2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=ci(n??Uz);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 o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function UD(){return typeof window<"u"}function ll(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hm(e){var t;return(t=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hz(e){return UD()?e instanceof Node||e instanceof ta(e).Node:!1}function Er(e){return UD()?e instanceof Element||e instanceof ta(e).Element:!1}function Js(e){return UD()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function Xw(e){return!UD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}function QA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Lu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function jnt(e){return/^(table|td|th)$/.test(ll(e))}function QD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Nnt=/transform|translate|scale|rotate|perspective|filter/,Rnt=/paint|layout|strict|content/,Xb=e=>!!e&&e!=="none";let _3;function qz(e){const t=Er(e)?Lu(e):e;return Xb(t.transform)||Xb(t.translate)||Xb(t.scale)||Xb(t.rotate)||Xb(t.perspective)||!Wz()&&(Xb(t.backdropFilter)||Xb(t.filter))||Nnt.test(t.willChange||"")||Rnt.test(t.contain||"")}function Int(e){let t=Yg(e);for(;Js(t)&&!Pg(t);){if(qz(t))return t;if(QD(t))return null;t=Yg(t)}return null}function Wz(){return _3==null&&(_3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_3}function Pg(e){return/^(html|body|#document)$/.test(ll(e))}function Lu(e){return ta(e).getComputedStyle(e)}function zD(e){return Er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yg(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xw(e)&&e.host||hm(e);return Xw(t)?t.host:t}function Y2e(e){const t=Yg(e);return Pg(t)?(e.ownerDocument||e).body:Js(t)&&QA(t)?t:Y2e(t)}function lC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Y2e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ta(r);if(s){const l=Z8(o);return t.concat(o,o.visualViewport||[],QA(r)?r:[],l&&n?lC(l):[])}else return t.concat(r,lC(r,[],n))}function Z8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const J2=null;let Pnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(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)}},e_=new Pnt;class jc{constructor(){Zt(this,"currentId",J2);Zt(this,"cancel",()=>{this.currentId!==J2&&(e_.cancel(this.currentId),this.currentId=J2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new jc}static request(t){return e_.request(t)}static cancel(t){return e_.cancel(t)}request(t){this.cancel(),this.currentId=e_.request(()=>{this.currentId=J2,t()})}}function Kz(){const e=Ad(jc.create).current;return $D(e.disposeEffect),e}const uk=0;class $u{constructor(){Zt(this,"currentId",uk);Zt(this,"clear",()=>{this.currentId!==uk&&(clearTimeout(this.currentId),this.currentId=uk)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new $u}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=uk,n()},t)}isStarted(){return this.currentId!==uk}}function f0(){const e=Ad($u.create).current;return $D(e.disposeEffect),e}let fJ=0;function Dnt(e){return fJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${fJ}`}function j3(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 Mnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Lnt,platform:$nt,maxTouchPoints:Fnt}=Mnt(),VD=Lnt.toLowerCase(),cC=$nt.toLowerCase(),HD=/^i(os$|p)/.test(cC)||cC==="macintel"&&Fnt>1,hJ="android",J8=cC===hJ||VD.includes(hJ),Bnt=!HD&&cC.startsWith("mac");cC.startsWith("win");const Unt=Bnt||HD;var Aue;const V1=typeof CSS<"u"&&!!((Aue=CSS.supports)!=null&&Aue.call(CSS,"-webkit-backdrop-filter:none"));!V1&&VD.includes("firefox");!V1&&VD.includes("chrom");const Qnt=Unt,Z2e=/jsdom|happydom/.test(VD),eB="data-base-ui-focusable",J2e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Tc(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 ii(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&&Xw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function uo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function e_e(e,t){if(!Er(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function N3(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 znt(e){return e.matches("html,body")}function Gz(e){return Js(e)&&e.matches(J2e)}function Vnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${J2e}`))!=null}function pJ(e){return e?e.getAttribute("role")==="combobox"&&Gz(e):!1}function tB(e){if(!e||Z2e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function mJ(e){return e?e.hasAttribute(eB)?e:e.querySelector(`[${eB}]`)||e:null}function Zg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Zg(e,r.id,n)]})}function gJ(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(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function Hnt(e){e.preventDefault(),e.stopPropagation()}function qnt(e){return"nativeEvent"in e}function Wnt(e){return e.pointerType===""&&e.isTrusted?!0:J8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function t_e(e){return Z2e?!1:!J8&&e.width===0&&e.height===0||J8&&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 rw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Knt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Gnt=["top","right","bottom","left"],Jg=Math.min,Pp=Math.max,nI=Math.round,t_=Math.floor,Dp=e=>({x:e,y:e}),Xnt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xz(e,t,n){return Pp(e,Jg(t,n))}function kh(e,t){return typeof e=="function"?e(t):e}function wd(e){return e.split("-")[0]}function pm(e){return e.split("-")[1]}function Yz(e){return e==="x"?"y":"x"}function qD(e){return e==="y"?"height":"width"}function hd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function WD(e){return Yz(hd(e))}function Ynt(e,t,n){n===void 0&&(n=!1);const i=pm(e),r=WD(e),s=qD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=iI(o)),[o,iI(o)]}function Znt(e){const t=iI(e);return[nB(e),t,nB(t)]}function nB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const bJ=["left","right"],yJ=["right","left"],Jnt=["top","bottom"],eit=["bottom","top"];function tit(e,t,n){switch(e){case"top":case"bottom":return n?t?yJ:bJ:t?bJ:yJ;case"left":case"right":return t?Jnt:eit;default:return[]}}function nit(e,t,n,i){const r=pm(e);let s=tit(wd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(nB)))),s}function iI(e){const t=wd(e);return Xnt[t]+e.slice(t.length)}function iit(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 Zz(e){return typeof e!="number"?iit(e):{top:e,right:e,bottom:e,left:e}}function rI(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 rit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function n_e(e,t=e?Lu(e):null){return!e||!e.isConnected||!t||rit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const sit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ait(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Xw(n)?n.host:null}function iB(e){for(const t of Array.from(e.children))if(ll(t)==="summary")return t;return null}function oit(e,t){const n=iB(t);return!!n&&(e===n||ii(n,e))}function i_e(e){const t=e?ll(e):"";return e!=null&&e.matches(sit)&&(t!=="summary"||e.parentElement!=null&&ll(e.parentElement)==="details"&&iB(e.parentElement)===e)&&(t!=="details"||iB(e)==null)&&(t!=="input"||e.type!=="hidden")}function r_e(e){if(!i_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=ait(t)){const n=t!==e,i=ll(t)==="slot";if(t.hasAttribute("inert")||n&&ll(t)==="details"&&!t.open&&!oit(e,t)||t.hasAttribute("hidden")||!i&&!lit(t,n))return!1}return!0}function lit(e,t){const n=Lu(e);return t?n.display!=="none":n_e(e,n)}function s_e(e){const t=e.tabIndex;if(t<0){const n=ll(e);if(n==="details"||n==="audio"||n==="video"||Js(e)&&e.isContentEditable)return 0}return t}function R3(e){if(ll(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function cit(e,t){const n=R3(e);if(!n)return!0;const i=t.find(r=>{const s=R3(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=R3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function a_e(e){if(Js(e)&&ll(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Js(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function o_e(e,t){a_e(e).forEach(n=>{i_e(n)&&t.push(n),o_e(n,t)})}function l_e(e,t,n){a_e(e).forEach(i=>{Js(i)&&i.matches(t)&&n.push(i),l_e(i,t,n)})}function Jz(e){return r_e(e)&&s_e(e)>=0}function c_e(e){const t=[];return o_e(e,t),t.filter(r_e)}function zA(e){const t=c_e(e);return t.filter(n=>s_e(n)>=0&&cit(n,t))}function u_e(e,t){const n=zA(e),i=n.length;if(i===0)return;const r=Tc(kr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function eV(e){return u_e(kr(e).body,1)||e}function d_e(e){return u_e(kr(e).body,-1)||e}function f_e(e,t){if(!e)return null;const n=zA(kr(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 uit(e){return f_e(e,1)}function dit(e){return f_e(e,-1)}function sw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function fit(e){zA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vJ(e){const t=[];l_e(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 I3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function P3(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 Uf={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 hit extends BD{constructor(n){super({...n,toastMetadata:I3(n.toasts)},{},Uf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Dnt("toast");if(n.id){const u=Uf.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 o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(P3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Uf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Uf.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??o,f=c.timeout??o,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)),Uf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Uf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=P3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=j3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=j3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=j3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=uo(n);ii(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 o=P3(this.state.toasts,i);s.toasts=o,s.toastMetadata=I3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Uf.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 o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}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=$u.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=!Uf.expandedOrOutOfFocus(this.state)?$u.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:I3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Tc(kr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!tB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Uf.toasts(this.state),s=Uf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew hit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return $D(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(q2e.Provider,{value:o,children:[a.jsx(mit,{store:o,timeout:i,limit:r}),n]})};function mit(e){const{store:t,timeout:n,limit:i}=e;return Jn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const git={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},h_e={...git,position:"fixed",top:0,left:0},h0=p.forwardRef(function(t,n){const[i,r]=p.useState();Jn(()=>{Qnt&&V1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:h_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Yw(e,t,n,i){const r=Ad(p_e).current;return yit(r,e,t,n,i)&&m_e(r,[e,t,n,i]),r.callback}function bit(e){const t=Ad(p_e).current;return vit(t,e)&&m_e(t,e),t.callback}function p_e(){return{callback:null,cleanup:null,refs:[]}}function yit(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function vit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function m_e(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 iV(e){return typeof e=="function"}function y_e(e,t){return iV(e)?e(t):e??tV}function Eit(e,t){return t?e?(...n)=>{const i=n[0];if(w_e(i)){const s=i;aI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:v_e(t):e}function v_e(e){return e&&((...t)=>{const n=t[0];return w_e(n)&&aI(n),e(...t)})}function aI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function x_e(e,t){return t?e?t+" "+e:t:e}function w_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ra(e,t,n={}){const i=t.render,r=Cit(t,n);if(n.enabled===!1)return null;const s=n.state??nc;return _it(e,i,r,s)}function Cit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=nc,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?wit(n,s):void 0,f=u?g_e(i,s):void 0,h=u?xit(s,c):nc,m=u&&l?Ait(l):void 0,g=u?rB(h,m)??{}:nc;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=bit([g.ref,xJ(r),...o]):g.ref=Yw(g.ref,xJ(r),o):Yw(null,null)),u?(d!==void 0&&(g.className=x_e(g.className,d)),f!==void 0&&(g.style=rB(g.style,f)),g):nc}function Ait(e){return Array.isArray(e)?Oit(e):nV(void 0,e)}const Tit=Symbol.for("react.lazy");function _it(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Tit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return jit(e,n);throw new Error(Hc(8))}function jit(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 Nit=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Qz(),u=f0(),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=(F=g[0])==null?void 0:F.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=ta(M),q=kr(M);function U(J){J.key==="F6"&&uo(J)!==M&&(J.preventDefault(),c.set("prevFocusElement",Tc(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function Z(J){uo(J)===H&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(J){if(J.relatedTarget)return;const ne=uo(J),W=Tc(kr(M));(ne===H||!ii(M,ne)||!tB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return bh(Ri(H,"keydown",U),Ri(H,"blur",Z,!0),Ri(H,"focus",z,!0),Ri(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function k(M){var q,U;d.current=!0;const H=M.relatedTarget===c.state.viewport?g.find(Z=>Z.transitionStatus!=="ending"&&!Z.limited):void 0;H?(U=(q=H.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function S(M){M.key==="Tab"&&M.shiftKey&&uo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function E(){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(E,[x,c]);function C(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,E()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function A(M){M.pointerType==="touch"&&(h.current=!1,E())}function N(){if(d.current){d.current=!1;return}b||tB(Tc(kr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:S,onClick:N,onPointerDown:R,onPointerUp:A,onPointerCancel:A,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(h0,{onFocus:k}),L=Ra("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&O.length>0&&a.jsx("div",{style:h_e,children:O.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function rV(e){return zz(19)?e:e?"true":void 0}const O_e=p.createContext(void 0);function Rit(){const e=p.useContext(O_e);if(!e)throw new Error(Hc(66));return e}let oI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Iit={"data-starting-style":""},Pit={"data-ending-style":""},KD={transitionStatus(e){return e==="starting"?Iit:e==="ending"?Pit:null}};function rp(e){return e==null?e:"current"in e?e.current:e}function sV(e,t=!1){const n=Kz();return ci((i,r=null)=>{n.cancel();const s=rp(e);if(s==null)return;const o=s,l=()=>{yi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function VA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=ci(r),o=sV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Dit=500,Mit={style:{transition:"none"}},aV="data-base-ui-click-trigger",Lit="data-base-ui-swipe-ignore",$it="data-swipe-ignore",Fit=`[${Lit}]`,Bit=`[${$it}]`,Uit={fallbackAxisSide:"end"},Qit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function D3(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 zit(e){const n=ta(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[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 Vit={...KD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},wJ=40,Hit=10,OJ=.5,qit=1,Wit=`${Fit},${Bit}`,Kit=p.forwardRef(function(t,n){var Xe;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Xe=i.positionerProps)==null?void 0:Xe.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Qz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[k,S]=p.useState({x:0,y:0,scale:1}),[E,C]=p.useState(),[j,T]=p.useState(),[R,A]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),H=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),Z=p.useRef(null),z=h.useState("toastIndex",i.id),J=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),X=h.useState("expanded");VA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const V=ci((Re=!1)=>{const re=N.current;if(!re)return;const ce=re.style.height;re.style.height="auto";const ve=re.offsetHeight;re.style.height=ce;function Se(){h.updateToastInternal(i.id,{ref:N,height:ve,transitionStatus:void 0})}Re?yi.flushSync(Se):Se()});Jn(()=>{const Re=P.current;i.transitionStatus!=="starting"&&Re===i.id||(Re!==void 0&&(g(void 0),S({x:0,y:0,scale:1}),ae({x:0,y:0})),P.current=i.id,V())},[V,i.id,i.transitionStatus]);function ae(Re){q.current=Re,O(Re)}Jn(()=>()=>{var Re;(Re=Z.current)==null||Re.abort()},[]);function Y(Re,re){const ce=oe=>oe>0?oe**OJ:-(Math.abs(oe)**OJ),ve=Re>0&&!d.includes("right")||Re<0&&!d.includes("left"),Se=re>0&&!d.includes("down")||re<0&&!d.includes("up");return{x:ve?ce(Re):Re,y:Se?ce(re):re}}const K=ci(Re=>{var $e;if(Re.pointerId!==U.current)return;U.current=null,($e=Z.current)==null||$e.abort(),Z.current=null,v(!1),w(!1),A(null);const re=D.current;if(Re.type==="pointercancel"||F.current){ae({x:re.x,y:re.y}),g(void 0);return}const ce=q.current,ve=ce.x-re.x,Se=ce.y-re.y;let oe;for(const Ue of d)if(D3(Ue,ve,Se)>wJ){oe=Ue;break}oe?(g(oe),h.closeToast(i.id)):(ae({x:re.x,y:re.y}),g(void 0))});function te(Re){var Ue,be;if(Re.button!==0)return;Re.pointerType==="touch"&&h.pauseTimers();const re=uo(Re.nativeEvent);if(re==null?void 0:re.closest(`button,a,input,textarea,[role="button"],${Wit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=Re.pointerId,I.current={x:Re.clientX,y:Re.clientY},M.current=I.current;const ve=Re.currentTarget,Se=zit(ve);D.current=Se,S(Se),ae({x:Se.x,y:Se.y}),h.set("hovering",!0),v(!0),w(!1),A(null),H.current=!0,(Ue=Z.current)==null||Ue.abort();const oe=new AbortController;Z.current=oe;const $e=kr(ve);$e.addEventListener("pointerup",K,{signal:oe.signal}),$e.addEventListener("pointercancel",K,{signal:oe.signal}),(be=ve.setPointerCapture)==null||be.call(ve,Re.pointerId)}function ue(Re){if(Re.pointerId!==U.current)return;Re.preventDefault(),H.current&&(I.current={x:Re.clientX,y:Re.clientY},H.current=!1);const{clientY:re,clientX:ce,movementX:ve,movementY:Se}=Re;(Se<0&&re>M.current.y||Se>0&&reM.current.x||ve>0&&ce=qit){w(!0);const xt=d.includes("left")||d.includes("right"),tt=d.includes("up")||d.includes("down");if(xt&&tt){const mt=Math.abs(oe),_e=Math.abs($e);ke=mt>_e?"horizontal":"vertical",A(ke)}}let Ae;if(!_.current)ke==="vertical"?$e>0?Ae="down":$e<0&&(Ae="up"):ke==="horizontal"?oe>0?Ae="right":oe<0&&(Ae="left"):Math.abs(oe)>=Math.abs($e)?Ae=oe>0?"right":"left":Ae=$e>0?"down":"up",Ae&&d.includes(Ae)&&(_.current=Ae,L.current=D3(Ae,oe,$e),g(Ae));else{const Ct=_.current,xt=D3(Ct,be,Ue);xt>wJ?(F.current=!1,g(Ct)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-xt>=Hit&&(F.current=!0)}const He=Y(oe,$e);let Qe=D.current.x,jt=D.current.y;const Pt=d.includes("left")||d.includes("right"),Kt=d.includes("up")||d.includes("down");ke!=="vertical"&&Pt&&(Qe+=He.x),ke!=="horizontal"&&Kt&&(jt+=He.y),ae({x:Qe,y:jt})}function fe(Re){if(Re.key==="Escape"){if(!N.current||!ii(N.current,Tc(kr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const Re=N.current;if(!f||!Re)return;function re(ce){U.current===null||!ii(Re,uo(ce))||ce.preventDefault()}return Ri(Re,"touchmove",re,{passive:!1})},[f]);function se(){const Re=x.x-k.x,re=x.y-k.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${Re}px`,"--toast-swipe-movement-y":`${re}px`}}const me=i.priority==="high",Ee={role:me?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":E,"aria-describedby":j,"aria-hidden":me&&!W?!0:void 0,onPointerDown:f?te:void 0,onPointerMove:f?ue:void 0,onPointerUp:f?K:void 0,onPointerCancel:f?K:void 0,onKeyDown:fe,inert:rV(i.limited),style:{...se(),"--toast-index":i.transitionStatus==="ending"?z:J,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},xe=p.useMemo(()=>({toast:i,setTitleId:C,setDescriptionId:T,recalculateHeight:V,visibleIndex:J,expanded:X}),[i,C,T,V,J,X]),Ne={transitionStatus:i.transitionStatus,expanded:X,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},We=Ra("div",t,{ref:[n,N],state:Ne,stateAttributesMapping:Vit,props:[Ee,c]});return a.jsx(O_e.Provider,{value:xe,children:We})});let kJ=0;function Git(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(kJ+=1,i(`${t}-${kJ}`))},[n,t]),r}const SJ=Vz.useId;function HA(e,t){if(SJ!==void 0){const n=SJ();return e??(t?`${t}-${n}`:n)}return Git(e,t)}function k_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(k_e):!0}function Xit(e){return p.isValidElement(e)&&k_e(e.props.children)}function S_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Rit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:HA(e),children:l,type:i.type,setId:o}}function E_e(e,t,n){const i=Xit(e);return Jn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Yit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=S_e(o,l,"description"),g=Ra("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return E_e(g,u,h)}),Zit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=S_e(o,l,"title"),g=Ra("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return E_e(g,u,h)}),Jit=p.createContext(void 0);function ert(e=!1){const t=p.useContext(Jit);if(t===void 0&&!e)throw new Error(Hc(16));return t}function trt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=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||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function M3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ta(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=ert(!0),c=s??l!==void 0,{props:u}=trt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;L3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Jn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nV({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(aI(O),y==null||y(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,S=O.currentTarget,E=L3(S),C=!r&&nrt(S),j=k&&(r?E:!C),T=O.key==="Enter",R=O.key===" ",A=S.getAttribute("role"),N=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&R){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||E)&&(O.preventBaseUIHandler(),M3(S,O));return}if(!j||r||!R&&!T){k&&C&&R&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),T&&(O.preventBaseUIHandler(),M3(S,O)))},onKeyUp(O){if(!t){if(aI(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&L3(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),M3(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=ci(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function L3(e){return Js(e)&&e.tagName==="BUTTON"}function nrt(e){return Js(e)&&e.tagName==="A"&&!!e.href}const C_e="none",Zw="trigger-press",gu="trigger-hover",A_e="outside-press",T_e="close-press",uC="focus-out",__e="escape-key",j_e="imperative-action";function fa(e,t,n,i){let r=!1,s=!1;const o=nc;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,...o}}function lI(e){return`data-base-ui-${e}`}const N_e=p.createContext(null),R_e=()=>p.useContext(N_e),irt=lI("portal");function I_e(e={}){const{ref:t,container:n,componentProps:i=nc,elementProps:r}=e,s=HA(),o=R_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=ci(v=>{v!==null&&f(v)}),m=p.useRef(null);Jn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Hz(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=Ra("div",i,{ref:[t,h],props:[{id:s,[irt]:""},r]}),b=c&&g?yi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const P_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=I_e({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,k=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function E(C){u&&C.relatedTarget&&sw(C)&&(C.type==="focusin"?w.current&&(vJ(u),w.current=!1):(fit(u),w.current=!0))}return bh(Ri(u,"focusin",E,!0),Ri(u,"focusout",E,!0))},[u,x]),Jn(()=>{!u||O!==!0||!w.current||(vJ(u),w.current=!1)},[O,u]);const S=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(N_e.Provider,{value:S,children:[k&&u&&a.jsx(h0,{"data-type":"outside",ref:h,onFocus:E=>{var C;if(sw(E,u))(C=g.current)==null||C.focus();else{const j=v?v.domReference:null,T=d_e(j);T==null||T.focus()}}}),k&&u&&a.jsx("span",{"aria-owns":d,style:Qit}),u&&yi.createPortal(o,u),k&&u&&a.jsx(h0,{"data-type":"outside",ref:m,onFocus:E=>{var C;if(sw(E,u))(C=b.current)==null||C.focus();else{const j=v?v.domReference:null,T=eV(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,fa(uC,E.nativeEvent)))}}})]})]})}),rrt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=I_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&yi.createPortal(i,u)]})}),srt=p.forwardRef(function(t,n){return a.jsx(rrt,{ref:n,...t})});function Zl(e){const t=Ad(art,e).current;return t.next=e,Jn(t.effect),t}function art(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ort(e,t){return t!=null&&!rw(t)?0:typeof e=="function"?e():e}function sB(e,t,n){const i=ort(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function EJ(e){return typeof e=="function"?e():e}function D_e(e,t){return t||e==="click"||e==="mousedown"}function lrt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let n_=0;function $3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(n_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Uz;const o=requestAnimationFrame(s);return n_=o,()=>{n_===o&&(cancelAnimationFrame(o),n_=0)}}const F3={inert:new WeakMap,"aria-hidden":new WeakMap},CJ="data-base-ui-inert",aB={inert:new WeakSet,"aria-hidden":new WeakSet};let dk=new WeakMap,B3=0;function crt(e){return aB[e]}function M_e(e){return e?Xw(e)?e.host:M_e(e.parentNode):null}const AJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=M_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),TJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},_J=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{ll(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function urt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=AJ(t,e),u=r?_J(t,TJ(c),new Set(c)):[],d=[],f=[];if(s){const h=F3[s],m=crt(s);l=m,o=h;const g=AJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);_J(t,TJ(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=(dk.get(h)||0)+1;dk.set(h,m),f.push(h),m===1&&h.setAttribute(CJ,"")}),B3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(dk.get(h)||0)-1;dk.set(h,m),m||h.removeAttribute(CJ)}),B3-=1,B3||(F3.inert=new WeakMap,F3["aria-hidden"]=new WeakMap,aB.inert=new WeakSet,aB["aria-hidden"]=new WeakSet,dk=new WeakMap)}}function jJ(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=kr(e[0]).body;return urt(e,s,n,i,{mark:r})}function L_e(){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 drt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",L_e())}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 $_e=p.createContext(null),F_e=p.createContext(null),XD=()=>{var e;return((e=p.useContext($_e))==null?void 0:e.id)||null},H1=e=>{const t=p.useContext(F_e);return e??t};function frt(e){const t=HA(),n=H1(e),i=XD();return Jn(()=>{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 hrt(e){const{children:t,id:n}=e,i=XD();return a.jsx($_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function prt(e){const{children:t,externalTree:n}=e,i=Ad(()=>n??new drt).current;return a.jsx(F_e.Provider,{value:i,children:t})}function mrt(e,t){const n=ta(uo(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 NJ=20;let gg=[];function oV(){gg=gg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function RJ(e){oV(),e&&ll(e)!=="body"&&(gg.push(new WeakRef(e)),gg.length>NJ&&(gg=gg.slice(-NJ)))}function IJ(){var e;return oV(),(e=gg[gg.length-1])==null?void 0:e.deref()}function grt(e){return e?Jz(e)?e:zA(e)[0]||e:null}function PJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=c_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Jz(s)||s.hasAttribute("data-tabindex")&&!o.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 B_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!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,k=ci(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),S=r===!1,E=pJ(y)&&S,C=Zl(r),j=Zl(s),T=Zl(u),R=Zl(v),A=H1(m),N=R_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),H=p.useRef(null),q=Yw(M,h,N==null?void 0:N.beforeInsideRef),U=Yw(H,N==null?void 0:N.afterInsideRef),Z=f0(),z=f0(),J=Kz(),ne=N!=null,W=mJ(w),X=ci((Y=W)=>Y?zA(Y):[]),V=ci(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(te){te.key==="Tab"&&ii(W,Tc(kr(W)))&&X().length===0&&!E&&Hnt(te)}const K=kr(W);return Ri(K,"keydown",Y)},[i,W,l,E,X]),p.useEffect(()=>{if(i||!v)return;const Y=kr(W);function K(){D.current=!1}function te(fe){const se=uo(fe),me=V(),Ee=ii(w,se)||ii(y,se)||ii(N==null?void 0:N.portalNode,se)||me.some(xe=>xe===se||ii(xe,se));D.current=!Ee,F.current=fe.pointerType||"keyboard",se!=null&&se.closest(`[${aV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function ue(){F.current="keyboard"}return bh(Ri(Y,"pointerdown",te,!0),Ri(Y,"pointerup",K,!0),Ri(Y,"pointercancel",K,!0),Ri(Y,"keydown",ue,!0),K)},[i,w,y,W,v,N,z,V]),p.useEffect(()=>{if(i||!c)return;const Y=kr(W);function K(){I.current=!0,z.start(0,()=>{I.current=!1})}function te(me){const Ee=uo(me);Jz(Ee)&&(_.current=Ee)}function ue(me){const Ee=me.relatedTarget,xe=me.currentTarget,Ne=uo(me);l&&Ee==null&&Ne!=null&&ii(w,Ne)&&RJ(Ne),queueMicrotask(()=>{const We=k(),Xe=b.context.triggerElements,Re=V(),re=(Ee==null?void 0:Ee.hasAttribute(lI("focus-guard")))&&[M.current,H.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,rp(f),rp(d)].includes(Ee),ce=!(ii(y,Ee)||ii(w,Ee)||ii(Ee,w)||ii(N==null?void 0:N.portalNode,Ee)||Re.some(ve=>ve===Ee||ii(ve,Ee))||Xe.hasMatchingElement(ve=>ii(ve,Ee))||re||A&&(Zg(A.nodesRef.current,We).find(ve=>{var Se,oe;return ii((Se=ve.context)==null?void 0:Se.elements.floating,Ee)||ii((oe=ve.context)==null?void 0:oe.elements.domReference,Ee)})||gJ(A.nodesRef.current,We).find(ve=>{var Se,oe,$e;return[(Se=ve.context)==null?void 0:Se.elements.floating,mJ((oe=ve.context)==null?void 0:oe.elements.floating)].includes(Ee)||(($e=ve.context)==null?void 0:$e.elements.domReference)===Ee})));if(xe===y&&W&&PJ(W),o&&xe!==y&&!n_e(Ne)&&Tc(Y)===Y.body){if(Js(W)&&(W.focus(),o==="popup")){J.request(()=>{W.focus()});return}const ve=X(),Se=_.current,oe=(Se&&ve.includes(Se)?Se:null)||ve[ve.length-1]||W;Js(oe)&&oe.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(E||!l)&&Ee&&ce&&!I.current&&(E||Ee!==IJ())&&(P.current=!0,b.setOpen(!1,fa(uC,me)))})}function fe(){D.current||(O.current.insideReactTree=!0,Z.start(0,()=>{O.current.insideReactTree=!1}))}const se=Js(y)?y:null;if(!(!w&&!se))return bh(se&&Ri(se,"focusout",ue),se&&Ri(se,"pointerdown",K),w&&Ri(w,"focusin",te),w&&Ri(w,"focusout",ue),w&&N&&Ri(w,"focusout",fe,!0))},[i,y,w,W,l,A,N,b,c,o,X,E,k,O,Z,z,J,d,f,V]),p.useEffect(()=>{var xe,Ne,We;if(i||!w||!v)return;const Y=Array.from(((xe=N==null?void 0:N.portalNode)==null?void 0:xe.querySelectorAll(`[${lI("portal")}]`))||[]),te=(We=(Ne=(A?gJ(A.nodesRef.current,k()):[]).find(Xe=>{var Re;return pJ(((Re=Xe.context)==null?void 0:Re.elements.domReference)||null)}))==null?void 0:Ne.context)==null?void 0:We.elements.domReference,fe=[...[w,...Y,M.current,H.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...V()],te,rp(f),rp(d),E?y:null].filter(Xe=>Xe!=null),se=jJ(fe,{ariaHidden:l||E,mark:!1}),me=[w,...Y].filter(Xe=>Xe!=null),Ee=jJ(me);return()=>{Ee(),se()}},[v,i,y,w,l,N,E,A,k,d,f,V]),Jn(()=>{if(!v||i||!Js(W))return;L.current="",F.current="";const Y=kr(W),K=Tc(Y);queueMicrotask(()=>{const te=C.current,ue=typeof te=="function"?te(T.current||""):te;if(ue===void 0||ue===!1||ii(W,K))return;let se=null;const me=()=>(se==null&&(se=X(W)),se[0]||W);let Ee;ue===!0||ue===null?Ee=me():Ee=rp(ue),Ee=Ee||me();const xe=ii(W,Tc(Y));$3(Ee,{preventScroll:Ee===W,shouldFocus(){if(!R.current)return!1;if(xe)return!0;const Ne=Tc(Y);return!(Ne!==Ee&&ii(W,Ne))}})})},[i,v,W,X,C,T,R]),Jn(()=>{if(i||!W)return;const Y=kr(W),K=Tc(Y),te=T.current==null;RJ(K);function ue(se){if(se.open||(L.current=mrt(se.nativeEvent,F.current)),se.reason===gu&&se.nativeEvent.type==="mouseleave"&&(P.current=!0),se.reason===A_e)if(se.nested)P.current=!1;else if(Wnt(se.nativeEvent)||t_e(se.nativeEvent))P.current=!1;else{let me=!1;kr(W).createElement("div").focus({get preventScroll(){return me=!0,!1}}),me?P.current=!1:P.current=!0}}x.on("openchange",ue);function fe(se){const me=j.current;let Ee=typeof me=="function"?me(se):me;if(Ee===void 0||Ee===!1)return null;Ee===null&&(Ee=!0);const xe=y!=null&&y.isConnected?y:null,Ne=K!=null&&K.isConnected&&ll(K)!=="body"?K:null;let We=te?Ne||xe:xe||Ne;return We||(We=IJ()||null),typeof Ee=="boolean"?We:rp(Ee)||We||null}return()=>{x.off("openchange",ue);const se=Tc(Y),me=V(),Ee=ii(w,se)||me.some(Xe=>Xe===se||ii(Xe,se))||A&&Zg(A.nodesRef.current,k(),!1).some(Xe=>{var Re;return ii((Re=Xe.context)==null?void 0:Re.elements.floating,se)}),xe=j.current,Ne=L.current,We=fe(Ne);queueMicrotask(()=>{const Xe=grt(We),Re=typeof xe!="boolean";if(xe&&!P.current&&Js(Xe)&&(!(!Re&&Xe!==se&&se!==Y.body)||Ee)){const re={preventScroll:!0};Ne==="keyboard"&&(re.focusVisible=!0),Xe.focus(re)}P.current=!1})}},[i,w,W,j,T,x,A,y,k,V]),Jn(()=>{if(!V1||v||!w)return;const Y=Tc(kr(w));!Js(Y)||!Gz(Y)||ii(w,Y)&&Y.blur()},[v,w]),Jn(()=>{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]),Jn(()=>{if(!(i||!W))return PJ(W),()=>{queueMicrotask(oV)}},[i,W]);const ae=!i&&(l?!E:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[ae&&a.jsx(h0,{"data-type":"inside",ref:q,onFocus:Y=>{var K;if(l){const te=X();$3(te[te.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,sw(Y,N.portalNode)){const te=eV(y);te==null||te.focus()}else(K=rp(f??N.beforeOutsideRef))==null||K.focus()}}),n,ae&&a.jsx(h0,{"data-type":"inside",ref:U,onFocus:Y=>{var K;if(l)$3(X()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),sw(Y,N.portalNode)){const te=d_e(y);te==null||te.focus()}else(K=rp(d??N.afterOutsideRef))==null||K.focus()}})]})}function U_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=Zw}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Kz(),m=f0(),g=p.useMemo(()=>{function b(y,w,x,O){const k=fa(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,k)}):u.setOpen(y,k)}function v(y,w,x){const O=d.current.openEvent,k=u.select("domReferenceElement")!==w;return y&&k||!y||!r?!0:O&&o?!x(O.type):!1}return{onPointerDown(y){f.current=rw(y.pointerType,!0)&&t_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||rw(w,!0)&&s)return;const k=v(O,y.currentTarget,C=>C==="click"||C==="mousedown"),S=uo(x);if(Gz(S)){b(k,x,S,w);return}const E=y.currentTarget;h.request(()=>{b(k,x,E,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(rw(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:nc,[n,g])}function brt(){return!1}function yrt(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 Q_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=brt,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=H1(c),g=ci(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=ci(()=>s),{escapeKey:w,outsidePress:x}=yrt(l),O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(!1),E=p.useRef(!1),C=p.useRef(""),j=p.useRef(null),T=f0(),R=f0(),A=ci(()=>{R.clear(),h.current.insideReactTree=!1}),N=ci(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Zg(m.nodesRef.current,U):[]).some(J=>{var ne;return((ne=J.context)==null?void 0:ne.open)&&!J.context.dataRef.current[q]})}),P=ci(q=>N3(q,u.select("floatingElement"))||N3(q,u.select("domReferenceElement"))),I=ci(q=>{o()&&u.setOpen(!1,fa(Zw,q.nativeEvent))}),D=ci(q=>{if(!d||!n||!i||q.key!=="Escape"||E.current||!w&&N("__escapeKeyBubbles"))return;const U=qnt(q)?q.nativeEvent:q,Z=fa(__e,U);u.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!w&&!Z.isPropagationAllowed&&q.stopPropagation()}),_=ci(()=>{h.current.insideReactTree=!0,R.start(0,A)}),L=ci(q=>{if(!d||!n||q.button!==0)return;const U=uo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(O.current||(O.current=!0,k.current=!1))}),F=ci(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&O.current&&(k.current=!0)});p.useEffect(()=>{if(!d||!n)return A;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new $u,U=new $u;function Z(){q.clear(),E.current=!0}function z(){q.start(V1?5:0,()=>{E.current=!1})}function J(){S.current=!0,U.start(0,()=>{S.current=!1})}function ne(){O.current=!1,k.current=!1}function W(){const Re=C.current,re=Re==="pen"||!Re?"mouse":Re,ce=y(),ve=typeof ce=="function"?ce():ce;return typeof ve=="string"?ve:ve[re]}function X(Re){const re=W();return re==="intentional"&&Re.type!=="click"||re==="sloppy"&&Re.type==="click"}function V(Re){var ve;const re=(ve=h.current.floatingContext)==null?void 0:ve.nodeId,ce=m&&Zg(m.nodesRef.current,re).some(Se=>{var oe;return N3(Re,(oe=Se.context)==null?void 0:oe.elements.floating)});return P(Re)||ce}function ae(Re){if(X(Re)){Re.type!=="click"&&!P(Re)&&(U.clear(),S.current=!1),A();return}if(h.current.insideReactTree){A();return}const re=uo(Re),ce=`[${lI("inert")}]`,ve=Er(re)?re.getRootNode():null,Se=Array.from((Xw(ve)?ve:kr(u.select("floatingElement"))).querySelectorAll(ce)),oe=u.context.triggerElements;if(re&&(oe.hasElement(re)||oe.hasMatchingElement(Ue=>ii(Ue,re))))return;let $e=Er(re)?re:null;for(;$e&&!Pg($e);){const Ue=Yg($e);if(Pg(Ue)||!Er(Ue))break;$e=Ue}if(!(Se.length&&Er(re)&&!znt(re)&&!ii(re,u.select("floatingElement"))&&Se.every(Ue=>!ii($e,Ue)))){if(Js(re)&&!("touches"in Re)){const Ue=Pg(re),be=Lu(re),ke=/auto|scroll/,Ae=Ue||ke.test(be.overflowX),He=Ue||ke.test(be.overflowY),Qe=Ae&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,jt=He&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,Pt=be.direction==="rtl",Kt=jt&&(Pt?Re.offsetX<=re.offsetWidth-re.clientWidth:Re.offsetX>re.clientWidth),Ct=Qe&&Re.offsetY>re.clientHeight;if(Kt||Ct)return}if(!V(Re)){if(W()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof b=="function"&&!b(Re)||N("__outsidePressBubbles")||(u.setOpen(!1,fa(A_e,Re)),A())}}}function Y(Re){W()!=="sloppy"||Re.pointerType==="touch"||!u.select("open")||!n||P(Re)||ae(Re)}function K(Re){if(W()!=="sloppy"||!u.select("open")||!n||P(Re))return;const re=Re.touches[0];re&&(j.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function te(Re,re){const ce=uo(Re);if(!ce)return;const ve=Ri(ce,Re.type,()=>{re(Re),ve()})}function ue(Re){C.current="touch",te(Re,K)}function fe(Re){T.clear(),Re.type==="pointerdown"&&(C.current=Re.pointerType),!(Re.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&te(Re,re=>{re.type==="pointerdown"?Y(re):ae(re)})}function se(Re){if(!O.current)return;const re=k.current;if(ne(),W()==="intentional"){if(Re.type==="pointercancel"){re&&J();return}if(!V(Re)){if(re){J();return}typeof b=="function"&&!b(Re)||(U.clear(),S.current=!0,A())}}}function me(Re){if(W()!=="sloppy"||!j.current||P(Re))return;const re=Re.touches[0];if(!re)return;const ce=Math.abs(re.clientX-j.current.startX),ve=Math.abs(re.clientY-j.current.startY),Se=Math.sqrt(ce*ce+ve*ve);Se>5&&(j.current.dismissOnTouchEnd=!0),Se>10&&(ae(Re),T.clear(),j.current=null)}function Ee(Re){te(Re,me)}function xe(Re){W()!=="sloppy"||!j.current||P(Re)||(j.current.dismissOnTouchEnd&&ae(Re),T.clear(),j.current=null)}function Ne(Re){te(Re,xe)}const We=kr(f),Xe=bh(i&&bh(Ri(We,"keydown",D),Ri(We,"compositionstart",Z),Ri(We,"compositionend",z)),v&&bh(Ri(We,"click",fe,!0),Ri(We,"pointerdown",fe,!0),Ri(We,"pointerup",se,!0),Ri(We,"pointercancel",se,!0),Ri(We,"mousedown",fe,!0),Ri(We,"mouseup",se,!0),Ri(We,"touchstart",ue,!0),Ri(We,"touchmove",Ee,!0),Ri(We,"touchend",Ne,!0)));return()=>{Xe(),q.clear(),U.clear(),ne(),S.current=!1,A()}},[h,f,i,v,b,d,n,w,x,D,A,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),H=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:H,trigger:M}:{},[n,M,H])}function DJ(e,t,n){let{reference:i,floating:r}=e;const s=hd(t),o=WD(t),l=qD(o),c=wd(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=pm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function vrt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=kh(t,e),g=Zz(m),v=l[h?f==="floating"?"reference":"floating":f],y=rI(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:o.floating.width,height:o.floating.height}:o.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},k=rI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+g.top)/O.y,bottom:(k.bottom-y.bottom+g.bottom)/O.y,left:(y.left-k.left+g.left)/O.x,right:(k.right-y.right+g.right)/O.x}}const xrt=50,wrt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:vrt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=DJ(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:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=kh(e,t)||{};if(u==null)return{};const f=Zz(d),h={x:n,y:i},m=WD(r),g=qD(m),b=await o.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],k=h[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let E=S?S[x]:0;(!E||!await(o.isElement==null?void 0:o.isElement(S)))&&(E=l.floating[x]||s.floating[g]);const C=O/2-k/2,j=E/2-b[g]/2-1,T=Jg(f[y],j),R=Jg(f[w],j),A=E-b[g]-R,N=E/2-b[g]/2+C,P=Xz(T,N,A),I=!c.arrow&&pm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,A;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=E[P];if(I&&(!(f==="alignment"?w!==hd(I):!1)||T.every(L=>hd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(A=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(S){const F=hd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function MJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LJ(e){return Gnt.some(t=>e[t]>=0)}const Srt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=kh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=MJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:LJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=MJ(o,n.floating);return{data:{escapedOffsets:l,escaped:LJ(l)}}}default:return{}}}}},z_e=new Set(["left","top"]);async function Ert(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=wd(n),l=pm(n),c=hd(n)==="y",u=z_e.has(o)?-1:1,d=s&&c?-1:1,f=kh(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 Crt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await Ert(t,e);return o===((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:o}}}}},Art=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:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=kh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=hd(r),m=Yz(h);let g=d[m],b=d[h];const v=(w,x)=>Xz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(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]:o,[h]:l}}}}}},Trt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=kh(e,t),h={x:r,y:s},m=hd(o),g=Yz(m);let b=h[g],v=h[m];const y=kh(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 k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+w.mainAxis,E=l.reference[g]+l.reference[k]-w.mainAxis;bE&&(b=E)}if(f){var x,O;const k=g==="y"?"width":"height",S=z_e.has(wd(o)),E=l.reference[m]-l.floating[k]+(S&&((x=c.offset)==null?void 0:x[m])||0)+(S?0:w.crossAxis),C=l.reference[m]+l.reference[k]+(S?0:((O=c.offset)==null?void 0:O[m])||0)-(S?w.crossAxis:0);vC&&(v=C)}return{[g]:b,[m]:v}}}},_rt=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:o=()=>{},...l}=kh(e,t),c=await r.detectOverflow(t,l),u=wd(n),d=pm(n),f=hd(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=Jg(m-c[g],v),x=Jg(h-c[b],y),O=t.middlewareData.shift,k=!O;let S=w,E=x;O!=null&&O.enabled.x&&(E=y),O!=null&&O.enabled.y&&(S=v),k&&!d&&(f?E=h-2*Pp(c.left,c.right):S=m-2*Pp(c.top,c.bottom)),await o({...t,availableWidth:E,availableHeight:S});const C=await r.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function V_e(e){const t=Lu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Js(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=nI(n)!==s||nI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function lV(e){return Er(e)?e:e.contextElement}function aw(e){const t=lV(e);if(!Js(t))return Dp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=V_e(t);let o=(s?nI(n.width):n.width)/i,l=(s?nI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const jrt=Dp(0);function H_e(e){const t=ta(e);return!Wz()||!t.visualViewport?jrt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nrt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ta(e)}function p0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lV(e);let o=Dp(1);t&&(i?Er(i)&&(o=aw(i)):o=aw(e));const l=Nrt(s,n,i)?H_e(s):Dp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ta(s),m=Er(i)?ta(i):i;let g=h,b=Z8(g);for(;b&&m!==g;){const v=aw(b),y=b.getBoundingClientRect(),w=Lu(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=ta(b),b=Z8(g)}}return rI({width:d,height:f,x:c,y:u})}function YD(e,t){const n=zD(e).scrollLeft;return t?t.left+n:p0(hm(e)).left+n}function q_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-YD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Rrt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=hm(i),l=t?QD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Dp(1);const d=Dp(0),f=Js(i);if((f||!s)&&((ll(i)!=="body"||QA(o))&&(c=zD(i)),f)){const m=p0(i);u=aw(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?q_e(o,c):Dp(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 Irt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Prt(e){const t=zD(e),n=e.ownerDocument.body,i=Pp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Pp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+YD(e);const o=-t.scrollTop;return Lu(n).direction==="rtl"&&(s+=Pp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Drt=25;function Mrt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ta(e),s=hm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!Wz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(YD(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<=Drt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Lrt(e,t){const n=p0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=aw(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function $J(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Mrt(e,n,t);else if(t==="document")i=Prt(hm(e));else if(Er(t))i=Lrt(t,n);else{const r=H_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return rI(i)}function $rt(e,t){const n=t.get(e);if(n)return n;let i=lC(e,[],!1).filter(l=>Er(l)&&ll(l)!=="body"),r=null;const s=Lu(e).position==="fixed";let o=s?Yg(e):e;for(;Er(o)&&!Pg(o);){const l=Lu(o),c=qz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Yg(o)}return t.set(e,i),i}function Frt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?QD(t)?[]:$rt(t,this._c):[].concat(n),i],l=$J(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}E=!1}try{i=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(C,S)}i.observe(e)}const c=ta(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function oB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=lV(e),d=r||s?[...u?lC(u):[],...t?lC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?Hrt(u,n,s):null;let h=-1,m=null;o&&(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?p0(e):null;c&&v();function v(){const y=p0(e);b&&!K_e(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 qrt=Crt,Wrt=Art,Krt=krt,Grt=_rt,Xrt=Srt,BJ=Ort,Yrt=Trt,Zrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Vrt,...r.platform,_c:i};return wrt(e,t,{...r,platform:s})};var Jrt=typeof document<"u",est=function(){},mN=Jrt?p.useLayoutEffect:est;function cI(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(!cI(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)&&!cI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function G_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UJ(e,t){const n=G_e(e);return Math.round(t*n)/n}function Q3(e){const t=p.useRef(e);return mN(()=>{t.current=e}),t}function X_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},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);cI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==S.current&&(S.current=L,b(L))},[]),x=p.useCallback(L=>{L!==E.current&&(E.current=L,y(L))},[]),O=s||g,k=o||v,S=p.useRef(null),E=p.useRef(null),C=p.useRef(d),j=c!=null,T=Q3(c),R=Q3(r),A=Q3(u),N=p.useCallback(()=>{if(!S.current||!E.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Zrt(S.current,E.current,L).then(F=>{const M={...F,isPositioned:A.current!==!1};P.current&&!cI(C.current,M)&&(C.current=M,yi.flushSync(()=>{f(M)}))})},[h,t,n,R,A]);mN(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);mN(()=>(P.current=!0,()=>{P.current=!1}),[]),mN(()=>{if(O&&(S.current=O),k&&(E.current=k),O&&k){if(T.current)return T.current(O,k,N);N()}},[O,k,N,T,j]);const I=p.useMemo(()=>({reference:S,floating:E,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:O,floating:k}),[O,k]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=UJ(D.floating,d.x),M=UJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...G_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const tst=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?BJ({element:i.current,padding:r}).fn(n):{}:i?BJ({element:i,padding:r}).fn(n):{}}}},Y_e=(e,t)=>{const n=qrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z_e=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},J_e=(e,t)=>({fn:Yrt(e).fn,options:[e,t]}),eje=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tje=(e,t)=>{const n=Grt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nst=(e,t)=>{const n=Xrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ist=(e,t)=>{const n=tst(e);return{name:n.name,fn:n.fn,options:[e,t]}},rst={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 cV extends BD{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:L_e(),nested:r,triggerElements:o},rst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&Knt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(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)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function sst(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cV({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),Jn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Er(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 nje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Jn(()=>{if(!e&&s&&i!=="ending"&&n){const l=jc.request(()=>{r("ending")});return()=>{jc.cancel(l)}}},[e,s,i,n]),Jn(()=>{if(!e||t)return;const l=jc.request(()=>{r(void 0)});return()=>{jc.cancel(l)}},[t,e]),Jn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=jc.request(()=>{r("idle")});return()=>{jc.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const ije={tabIndex:-1,[eB]:""};function rje(e){return t=>t==="touch"?e.current:!0}function sje(e,t=!1){const n=HA(),i=XD()!=null,r=Ad(()=>e(n,i)).current;return sst({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function aje({handle:e,store:t}){return Jn(()=>e.attachStore(t),[e,t]),null}function ast(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 o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),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 o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function oje(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 ost(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=ast(e,n),o=ci(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&&o(c)},[s,o]);return Jn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function cje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Jn(()=>{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=fa(C_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function uje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=nje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=ci(()=>{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 VA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function dje(e,t){e.useSyncedValues(t),Jn(()=>()=>{e.update({activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc})},[e])}function fje(e,t){Jn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Jn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uV{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 lst(){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function hje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:lst(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc}}function pje(e,t,n=!1){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const nE=e=>e.triggerIdProp??e.activeTriggerId,dV=e=>e.openProp??e.open,QJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function mje(e,t){return t!==void 0&&dV(e)&&nE(e)===t}function cst(e,t){return mje(e,t)?!0:t!==void 0&&dV(e)&&nE(e)==null&&e.triggerCount===1}const gje={open:dV,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:nE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:QJ,isTriggerActive:(e,t)=>t!==void 0&&nE(e)===t,isOpenedByTrigger:(e,t)=>mje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>cst(e,t)?QJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function bje(e){const t=p.useCallback(i=>e===void 0?Uz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return ZP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function ust(e){return dst(e,e.rootContext)}function dst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=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=H1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=X_e({...e,elements:{...y,...u&&{reference:u}}}),x=Er(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",O);const k=p.useCallback(R=>{const A=Er(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(A),w.refs.setReference(A)},[w.refs]),S=p.useCallback(R=>{(Er(R)||R===null)&&(b.current=R,h(R)),(Er(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Er(R))&&w.refs.setReference(R)},[w.refs,h]),E=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),C=p.useMemo(()=>({...w.refs,setReference:S,setFloating:E,setPositionReference:k,domReference:b}),[w.refs,S,E,k]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:C,elements:j,nodeId:n,rootStore:t}),[w,C,j,n,t,l,c]);return Jn(()=>{o&&(b.current=o)},[o]),Jn(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(A=>A.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:C,elements:j,rootStore:t}),[w,C,j,T,t])}class fV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(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 $u,this.restTimeout=new $u,this.handleCloseOptions=void 0}static create(){return new fV}}const uI=new WeakMap;function dI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&uI.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"),uI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function yje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=uI.get(n);s&&s!==e&&dI(s),dI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,uI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function vje(e){const t=e.context.dataRef.current,n=Ad(()=>t.hoverInteractionState??fV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),$D(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function fst(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=H1(),f=XD(),h=vje(s),m=f0(),g=ci(()=>{var y;return D_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=ci(()=>{var y;return lrt((y=u.current.openEvent)==null?void 0:y.type)}),v=ci(()=>{dI(h)});Jn(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),Jn(()=>{var y,w,x,O,k;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Er(c)&&l){const S=c,E=l,C=kr(l),j=(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;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==E?h.pointerEventsScopeElement:null,R=j!==E?j:null,A=((k=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??T??R??S.closest("[data-rootownerid]")??C.body;return yje(h,{scopeElement:A,referenceElement:S,floatingElement:E}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Zg(d.nodesRef.current,f).length>0)}function w(C){const j=sB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,fa(gu,C)),d==null||d.events.emit("floating.closed",C)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(C){const j=uo(C);if(!Vnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",S),v()}function k(C){var A;if(y()&&d){d.events.on("floating.closed",S);return}if(e_e(C.relatedTarget,s.context.triggerElements))return;const j=((A=u.current.floatingContext)==null?void 0:A.nodeId)??r,T=C.relatedTarget;if(!(d&&j&&Er(T)&&Zg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(C);return}v(),b()&&!g()&&w(C)}}function S(C){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",S),s.setOpen(!1,fa(gu,C)),d.events.emit("floating.closed",C)})}const E=l;return bh(E&&Ri(E,"mouseenter",O),E&&Ri(E,"mouseleave",k),E&&Ri(E,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",S)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const hst={current:null};function pst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=hst,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=H1(u),x=vje(b),O=p.useRef(!1),k=Zl(r),S=Zl(i),E=Zl(o),C=Zl(n),j=Zl(m),T=Zl(h),R=ci(()=>{var _;return D_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),A=ci(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=ci((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Er(F))return!1;const H=F;return M.hasMatchingElement(q=>ii(q,H))&&(!_||!ii(_,H))}),P=ci(()=>{if(!x.handler)return;kr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=ci(()=>{dI(x)});return d&&(x.handleCloseOptions=(D=k.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?O.current=!1:(O.current=L.reason===gu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,Z=!0){const z=sB(S.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,fa(gu,U)),w==null||w.events.emit("floating.closed",U)}):Z&&(x.openChangeTimeout.clear(),b.setOpen(!1,fa(gu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Er(L))return;function F(U){var me;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!rw(x.pointerType))return;const Z=EJ(E.current),z=sB(S.current,"open",x.pointerType),J=uo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let X=ne;if(Er(J)&&!b.context.triggerElements.hasElement(J)){for(const Ee of b.context.triggerElements.elements())if(ii(Ee,J)){X=Ee;break}}Er(ne)&&Er(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(X=W);const V=X==null?!1:N(W,X,J),ae=b.select("open"),Y=((me=T.current)==null?void 0:me.call(T))??b.select("transitionStatus")==="ending",K=!ae&&Y&&O.current,te=!V&&Er(X)&&Er(W)&&ii(W,X)&&K,ue=Z>0&&!z,fe=V&&(ae||K)||te,se=!ae||V;if(fe){A()&&b.setOpen(!0,fa(gu,U,X));return}ue||(z?x.openChangeTimeout.start(z,()=>{se&&A()&&b.setOpen(!0,fa(gu,U,X))}):se&&A()&&b.setOpen(!0,fa(gu,U,X)))}function M(U){if(R()){I();return}P();const Z=b.select("domReferenceElement"),z=kr(Z);x.restTimeout.clear(),x.restTimeoutPending=!1;const J=v.current.floatingContext??(f==null?void 0:f());if(e_e(U.relatedTarget,b.context.triggerElements))return;if(k.current&&J){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=k.current({...J,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),C.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function H(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Ri(L,"mouseout",H):void 0;return l?bh(Ri(L,"mousemove",F,{once:!0}),Ri(L,"mouseenter",F),Ri(L,"mouseleave",M),q):bh(Ri(L,"mouseenter",F),Ri(L,"mouseleave",M),q)},[P,I,v,S,b,n,k,x,d,N,R,s,l,E,c,w,C,f,T,A,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var J,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,H=b.select("domReferenceElement"),q=b.select("open"),U=N(H,M,L.target);if(s&&!rw(x.pointerType))return;if(q&&U&&((J=x.handleCloseOptions)!=null&&J.blockPointerEvents)){const X=b.select("floatingElement");if(X){const V=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;yje(x,{scopeElement:V,referenceElement:M,floatingElement:X})}}const Z=EJ(E.current);if(q&&!U||Z===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const X=b.select("open");!x.blockMouseMove&&(!X||U)&&A()&&b.setOpen(!0,fa(gu,F,M))}x.pointerType==="touch"?yi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(Z,z))}}},[n,x,R,N,s,b,E,A])}const zJ=.1,mst=zJ*zJ,Hr=.5;function i_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function r_(e,t,n,i,r,s,o,l,c,u){let d=!1;return i_(e,t,n,i,r,s)&&(d=!d),i_(e,t,r,s,o,l)&&(d=!d),i_(e,t,o,l,c,u)&&(d=!d),i_(e,t,c,u,n,i)&&(d=!d),d}function gst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function s_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function bst(e={}){const{blockPointerEvents:t=!1}=e,n=new $u,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),k=O-b;if(m===null||g===null||k===0)return m=w,g=x,b=O,!1;const S=w-m,E=x-g,C=S*S+E*E,j=k*k*mst;return m=w,g=x,b=O,C0)}function N(){A()||y()}if(A())return;const P=O.getBoundingClientRect(),I=k.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,H=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let Z=!1;switch(f){case"top":Z=s_(S,E,M,P.top+1,H,I.bottom-1);break;case"bottom":Z=s_(S,E,M,I.top+1,H,P.bottom-1);break;case"left":Z=s_(S,E,I.right-1,U,P.left+1,q);break;case"right":Z=s_(S,E,P.right-1,U,I.left+1,q);break}if(Z)return;if(h&&!gst(S,E,P)){N();return}if(!j&&v(S,E)){N();return}let z=!1;switch(f){case"top":{const J=L?Hr/2:Hr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s+Hr+1,V=D||L?I.bottom-Hr:I.top,ae=D?L?I.bottom-Hr:I.top:I.bottom-Hr;z=r_(S,E,ne,X,W,X,I.left,V,I.right,ae);break}case"bottom":{const J=L?Hr/2:Hr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s-Hr,V=D||L?I.top+Hr:I.bottom,ae=D?L?I.top+Hr:I.bottom:I.top+Hr;z=r_(S,E,ne,X,W,X,I.left,V,I.right,ae);break}case"left":{const J=F?Hr/2:Hr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r+Hr+1,V=_||F?I.right-Hr:I.left,ae=_?F?I.right-Hr:I.left:I.right-Hr;z=r_(S,E,V,I.top,ae,I.bottom,X,ne,X,W);break}case"right":{const J=F?Hr/2:Hr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r-Hr,V=_||F?I.left+Hr:I.right,ae=_?F?I.left+Hr:I.right:I.left+Hr;z=r_(S,E,X,ne,X,W,V,I.top,ae,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const yst=p.createContext(void 0);function vst(){const e=p.useContext(yst);return(e==null?void 0:e.direction)??"ltr"}const xst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=kh(e,t)||{};if(u==null)return{};const h=Zz(d),m={x:n,y:i},g=WD(r),b=qD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[g]-m[g]-s.floating[b],S=m[g]-s.reference[g],E=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let C=l.floating[O]||s.floating[b];(!C||!await((M=o.isElement)==null?void 0:M.call(o,E)))&&(C=l.floating[O]||s.floating[b]);const j=k/2-S/2,T=C/2-v[b]/2-1,R=Math.min(h[w],T),A=Math.min(h[x],T),N=R,P=C-v[b]-A,I=C/2-v[b]/2+j,D=Xz(N,I,P),_=!c.arrow&&pm(r)!=null&&I!==D&&s.reference[b]/2-(I({...xst(e),options:[e,t]}),Ost={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,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},kst={sideX:"left",sideY:"top"},VJ="--available-width",HJ="--available-height";function xje(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 qJ(e,t,n){const{rects:i,placement:r}=e;return{side:xje(t,wd(r),n),align:pm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Sst(e){return Est(e,ust)}function Est(e,t){var tt,mt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="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:k=!1,externalTree:S}=e,[E,C]=p.useState(null);!v&&E!==null&&C(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",A=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=ci(P),D=P?I:n,_=Zl(n),L=Zl(v),M=vst()==="rtl",H=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?H:`${H}-${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 Z=1,z=r==="bottom"?Z:0,J=r==="top"?Z:0,ne=r==="right"?Z:0,W=r==="left"?Z:0,X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},V=p.useRef(null),ae=Zl(s),Y=Zl(l),K=typeof s!="function"?s:0,te=typeof l!="function"?l:0,ue=[];m&&ue.push(m),ue.push(Y_e(_e=>{const Ot=qJ(_e,r,M),Nt=typeof ae.current=="function"?ae.current(Ot):ae.current,Yt=typeof Y.current=="function"?Y.current(Ot):Y.current;return{mainAxis:Nt,crossAxis:Yt,alignmentAxis:Yt}},[K,te,M,r]));const fe=T==="none"&&j!=="shift",se=!fe&&(d||A||j==="shift"),me=j==="none"?null:eje({...X,padding:{top:U.top+Z+z,right:U.right+Z+W,bottom:U.bottom+Z+J,left:U.left+Z+ne},mainAxis:!A&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),Ee=fe?null:Z_e({...X,rootBoundary:N,mainAxis:T!=="none",crossAxis:se,limiter:d||A?void 0:J_e(_e=>{if(!V.current)return{};const{width:Ot,height:Nt}=V.current.getBoundingClientRect(),Yt=hd(wd(_e.placement)),xn=Yt==="y"?Ot:Nt,Ke=Yt==="y"?U.left+U.right:U.top+U.bottom;return{offset:xn/2+Ke/2}})},[X,d,A,N,U,T]);j==="shift"||T==="shift"||o==="center"?ue.push(Ee,me):ue.push(me,Ee),ue.push(tje({...X,apply({elements:{floating:_e},availableWidth:Ot,availableHeight:Nt,rects:Yt}){if(!L.current)return;const xn=_e.style;xn.setProperty(VJ,`${Ot}px`),xn.setProperty(HJ,`${Nt}px`);const Ke=ta(_e).devicePixelRatio||1,{x:St,y:qe,width:nt,height:et}=Yt.reference,ft=(Math.round((St+nt)*Ke)-Math.round(St*Ke))/Ke,Et=(Math.round((qe+et)*Ke)-Math.round(qe*Ke))/Ke;xn.setProperty("--anchor-width",`${ft}px`),xn.setProperty("--anchor-height",`${Et}px`)}}),wst(_e=>({element:V.current||kr(_e.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(_e){var De,on,On;const{elements:Ot,middlewareData:Nt,placement:Yt,rects:xn,y:Ke}=_e,St=wd(Yt),qe=hd(St),nt=V.current,et=((De=Nt.arrow)==null?void 0:De.x)||0,ft=((on=Nt.arrow)==null?void 0:on.y)||0,Et=(nt==null?void 0:nt.clientWidth)||0,At=(nt==null?void 0:nt.clientHeight)||0,It=et+Et/2,Gt=ft+At/2,Ye=Math.abs(((On=Nt.shift)==null?void 0:On.y)||0),wt=xn.reference.height/2,vt=typeof s=="function"?s(qJ(_e,r,M)):s,tn=Ye>vt,Qt={top:`${It}px calc(100% + ${vt}px)`,bottom:`${It}px ${-vt}px`,left:`calc(100% + ${vt}px) ${Gt}px`,right:`${-vt}px ${Gt}px`}[St],un=`${It}px ${xn.reference.y+wt-Ke}px`;return Ot.floating.style.setProperty("--transform-origin",se&&qe==="y"&&tn?un:Qt),{}}},Ost,O),Jn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const xe=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Ne,elements:We,x:Xe,y:Re,middlewareData:re,update:ce,placement:ve,context:Se,isPositioned:oe,floatingStyles:$e}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:ue,strategy:i,whileElementsMounted:g?void 0:(..._e)=>oB(..._e,xe),nodeId:x,externalTree:S}),{sideX:Ue,sideY:be}=re.adaptiveOrigin||kst,ke=oe?i:"fixed",Ae=p.useMemo(()=>{let _e;return oe?O?_e={position:ke,[Ue]:Xe,[be]:Re}:_e={...$e,position:ke}:_e={position:ke,top:0,left:0},_e[VJ]="100vw",_e[HJ]="100vh",oe||(_e.opacity=0),_e},[O,ke,Ue,Xe,be,Re,$e,oe]),He=p.useRef(null);Jn(()=>{if(!v)return;const _e=_.current,Ot=typeof _e=="function"?_e():_e,Yt=(WJ(Ot)?Ot.current:Ot)||null||null;Yt!==He.current&&(Ne.setPositionReference(Yt),He.current=Yt)},[v,Ne,D,_]),p.useEffect(()=>{if(!v)return;const _e=_.current;typeof _e!="function"&&WJ(_e)&&_e.current!==He.current&&(Ne.setPositionReference(_e.current),He.current=_e.current)},[v,Ne,D,_]),p.useEffect(()=>{if(g&&v&&We.reference&&We.floating)return oB(We.reference,We.floating,ce,xe)},[g,v,We,ce,xe]);const Qe=wd(ve),jt=xje(r,Qe,M),Pt=pm(ve)||"center",Kt=!!((tt=re.hide)!=null&&tt.referenceHidden);Jn(()=>{k&&v&&oe&&Qe!==H&&C(Qe)},[k,v,oe,Qe,H]);const Ct=p.useMemo(()=>{var _e,Ot;return{position:"absolute",top:(_e=re.arrow)==null?void 0:_e.y,left:(Ot=re.arrow)==null?void 0:Ot.x}},[re.arrow]),xt=((mt=re.arrow)==null?void 0:mt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:V,arrowUncentered:xt,side:jt,align:Pt,physicalSide:Qe,anchorHidden:Kt,refs:Ne,context:Se,isPositioned:oe,update:ce}),[Ae,Ct,V,xt,jt,Pt,Qe,Kt,Ne,Se,oe,ce])}function WJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Cst={"data-popup-open":""},Ast={"data-popup-open":"","data-pressed":""},Tst={"data-open":""},_st={"data-closed":""},jst={"data-anchor-hidden":""},wje={open(e){return e?Cst:null}},Nst={open(e){return e?Ast:null}},hV={open(e){return e?Tst:_st},anchorHidden(e){return e?jst:null}},Oje={...hV,...KD};function kje(e){return e==="starting"?Mit:nc}function Rst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Ra("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},kje(i),r],stateAttributesMapping:hV})}function Sje(){const e=Qz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function vf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,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),k=p.useRef(null),S=i&&e!=="horizontal",E=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var T;(T=k.current)==null||T.abort()},[]);const C=p.useCallback(()=>{const T=O.current;if(!S||!T)return;const R=T.scrollHeight-T.clientHeight,A=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===A&&P.bottom===N?P:{top:A,bottom:N})},[S]);p.useEffect(()=>{const T=O.current;if(!S||!T)return;const R=new ResizeObserver(C);R.observe(T);for(const A of T.children)R.observe(A);return C(),()=>R.disconnect()},[S,E,C]);async function j(){if(!u||!c||k.current)return;const T=new AbortController;k.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),k.current===T&&(k.current=null)}}return a.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":S&&(w.top||w.bottom)||void 0,"data-fade-top":S&&w.top||void 0,"data-fade-bottom":S&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),C();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(d0,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Ist(){const{add:e,close:t}=Sje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Pst({position:e,label:t}){const{toasts:n,close:i}=Sje();return a.jsx(srt,{children:a.jsx(Nit,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(vf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(Kit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(ont,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Zit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Yit,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Dst({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(pit,{timeout:t,limit:3,children:[e,a.jsx(Pst,{position:n,label:i})]})}function Mst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=Te("sandbox"),l=Ist(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,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=(E,C=x)=>{var j,T;x=C,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:E,error:C})},k=E=>{const{toast:C,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||E.sessionId===T){C.dismiss(E.runId),g.delete(E.runId);return}b.has(E.runId)||g.get(E.runId)===E.state||(g.set(E.runId,E.state),C.add({id:E.runId,duration:0,title:j(`taskNotice.${E.state}`),description:E.message.slice(0,80),variant:E.state==="succeeded"?"success":E.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(E.runId),action:a.jsx(Ci,{variant:"secondary",onClick:()=>{R(E.sessionId,h.signal).catch(A=>{h.signal.aborted||C.add({id:"task-open-error",variant:"error",description:A instanceof Error?A.message:String(A)})})},children:j("taskNotice.open")})}))}},S=async(E=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,E&&O(!0);try{const C=await ef.active(h.signal);if(h.signal.aborted)return;w=C,O(!1,"");const j=new Set(C.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!mu(T)){let R;try{R=await ef.get(T.runId,h.signal)}catch(A){if(A instanceof Gw&&A.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw A}if(h.signal.aborted)return;m.set(R.runId,R),k(R)}for(const T of C)m.set(T.runId,T),k(T);f.current.toast.dismiss("task-connection")}catch(C){if(h.signal.aborted)return;C instanceof Gw&&[401,403].includes(C.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,C instanceof Error?C.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(S,3e3))}}};return d.current=()=>{S(!0)},O(!0),S(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Lst(e){const{t}=Te("sandbox");return a.jsx(Dst,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Mst,{...e},e.ownerId)})}const dC=["super_admin","admin","developer","user"];class fC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Eje(e){let t;try{t=await e.json()}catch{throw new fC("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 fC(n,e.status)}return t}function Cje(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&&dC.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 $st(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Eje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Cje)||!("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 fC("invalid_response",502);return n}async function Fst(e,t,n){const i=await Eje(await yn(`/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)||!Cje(i.user))throw new fC("invalid_response",502);return i.user}function Bst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Ust(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function xf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("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),k=p.useRef(null),S=p.useRef([]),[E,C]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),A=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{C(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!E)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[E,f,o,N]),p.useEffect(()=>{var L,F;if(E){if(N){(L=O.current)==null||L.focus();return}(F=S.current[j])==null||F.focus()}},[E,N]),p.useEffect(()=>{var L;!E||N&&document.activeElement===O.current||(L=S.current[j])==null||L.focus()},[j,E,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!E||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=k.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,E,r.length]);const I=(L=1)=>{const F=r.findIndex(H=>H.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),C(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,H;const F=L.target===O.current;if(L.key==="Escape"&&E){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(H=S.current[0])==null||H.focus());return}L.key==="ArrowDown"?(L.preventDefault(),E?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),E?D(j-1):I(-1)):E&&L.key==="Home"?(L.preventDefault(),T(0)):E&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":E,"aria-controls":E?y:void 0,disabled:s,onClick:()=>{E?P():I()},children:[a.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),a.jsx(Bst,{className:`pp-deployment-select-chevron${E?" is-open":""}`})]}),E&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:O,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:H=>{S.current[F]=H},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` -`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Ust,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function ZD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function cn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.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`},...o,children:r})}function Qst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Aje(e){return e instanceof fC?e.code:"request_failed"}function zst({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=Te("users"),s=p.useRef(null),o=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=o.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;o.current=v,h(!0),g("");try{const y=await Fst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Aje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(xf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:dC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=dC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.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 Vst({onBack:e}){const{t,i18n:n}=Te("users"),[i,r]=p.useState(null),[s,o]=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),[k,S]=p.useState(null),[E,C]=p.useState(null);p.useEffect(()=>{const A=new AbortController;return o(!0),c(""),$st({page:b,query:f,role:m,signal:A.signal}).then(N=>{if(!A.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),C(new Date)}}).catch(N=>{A.signal.aborted||c(Aje(N))}).finally(()=>{A.signal.aborted||o(!1)}),()=>A.abort()},[b,f,m,y]);const j=A=>{A.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=A=>{if(!A)return t("neverLoggedIn");const N=Number(A),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:A);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(ZD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:A=>d(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.nativeEvent.isComposing||A.keyCode===229)&&A.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(xf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...dC.map(A=>({value:A,label:t(`roles.${A}`)}))],onChange:A=>{const N=dC.find(P=>P===A);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{S(null),w(A=>A+1)},children:[a.jsx(Qst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(cn,{children:t("loading")}):k?a.jsx("span",{children:t("saved",{name:k.name,role:t(`roles.${k.role}`)})}):E?a.jsx("span",{children:t("updatedAt",{time:E.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(A=>A+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(A=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(A.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[A.name,A.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:A.email||A.id,children:A.email||A.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${A.role==="super_admin"?" is-super":""}`,children:t(`roles.${A.role}`)}),A.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${A.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(A.lastLogin)}),a.jsx("td",{className:"users-actions",children:A.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||A.currentUser,onClick:()=>{S(null),O(A)},children:t("changeRole")})})]},A.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(cn,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(A=>A-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(A=>A+1),children:t("next")})]})]}):null]}),x?a.jsx(zst,{user:x,onClose:()=>O(null),onSaved:A=>{O(null),S(A),w(N=>N+1)}}):null]})}const Tje=p.createContext(null);function Hst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function qst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=Te("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await uTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Wst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Kst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),JD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),a_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Xst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),hC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),_je=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.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"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),jje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.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"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),aat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Nje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),lat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),uat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"}),a.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"})]}),KJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Ije=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),gN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),bat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),yat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Pje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),mV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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 LD=p,fnt=XP;function hnt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pnt=typeof Object.is=="function"?Object.is:hnt,mnt=fnt.useSyncExternalStore,gnt=LD.useRef,bnt=LD.useEffect,ynt=LD.useMemo,vnt=LD.useDebugValue;Y2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=gnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=ynt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,pnt(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=mnt(e,s[0],s[1]);return bnt(function(){o.hasValue=!0,o.value=l},[l]),vnt(l),l};X2e.exports=Y2e;var Z2e=X2e.exports;const xnt=N1(Z2e),wnt=parseInt(p.version,10);function zz(e){return wnt>=e}const knt=zz(19),Ont=knt?Ent:Cnt;function J2e(e,t,n,i,r){return Ont(e,t,n,i,r)}function Snt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return XP.useSyncExternalStore(e.subscribe,s,s)}function Ent(e,t,n,i,r){return Snt(e,t,n,i,r)}function Cnt(e,t,n,i,r){return Z2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Ant{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(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 J2e(this,t,n,i,r)}}const Vz={..._v},A3=Vz.useInsertionEffect,Tnt=A3&&A3!==Vz.useLayoutEffect?A3:e=>e();function oi(e){const t=Td(_nt).current;return t.next=e,Tnt(t.effect),t.trampoline}function _nt(){const e={next:void 0,callback:jnt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function jnt(){}class $D extends Ant{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;ti(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;ti(()=>(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);ti(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;ti(()=>{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),J2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=oi(n??Uz);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 o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function FD(){return typeof window<"u"}function dl(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ea(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pm(e){var t;return(t=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hz(e){return FD()?e instanceof Node||e instanceof ea(e).Node:!1}function Tr(e){return FD()?e instanceof Element||e instanceof ea(e).Element:!1}function Zs(e){return FD()?e instanceof HTMLElement||e instanceof ea(e).HTMLElement:!1}function Zw(e){return!FD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ea(e).ShadowRoot}function HA(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 Nnt(e){return/^(table|td|th)$/.test(dl(e))}function BD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Rnt=/transform|translate|scale|rotate|perspective|filter/,Int=/paint|layout|strict|content/,Hb=e=>!!e&&e!=="none";let T3;function qz(e){const t=Tr(e)?Uu(e):e;return Hb(t.transform)||Hb(t.translate)||Hb(t.scale)||Hb(t.rotate)||Hb(t.perspective)||!Wz()&&(Hb(t.backdropFilter)||Hb(t.filter))||Rnt.test(t.willChange||"")||Int.test(t.contain||"")}function Pnt(e){let t=Kg(e);for(;Zs(t)&&!Rg(t);){if(qz(t))return t;if(BD(t))return null;t=Kg(t)}return null}function Wz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Rg(e){return/^(html|body|#document)$/.test(dl(e))}function Uu(e){return ea(e).getComputedStyle(e)}function UD(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kg(e){if(dl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zw(e)&&e.host||pm(e);return Zw(t)?t.host:t}function e_e(e){const t=Kg(e);return Rg(t)?(e.ownerDocument||e).body:Zs(t)&&HA(t)?t:e_e(t)}function uC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=e_e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ea(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],HA(r)?r:[],l&&n?uC(l):[])}else return t.concat(r,uC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Z2=null;let Dnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(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)}},J2=new Dnt;class Cc{constructor(){Zt(this,"currentId",Z2);Zt(this,"cancel",()=>{this.currentId!==Z2&&(J2.cancel(this.currentId),this.currentId=Z2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new Cc}static request(t){return J2.request(t)}static cancel(t){return J2.cancel(t)}request(t){this.cancel(),this.currentId=J2.request(()=>{this.currentId=Z2,t()})}}function Kz(){const e=Td(Cc.create).current;return MD(e.disposeEffect),e}const fO=0;class Qu{constructor(){Zt(this,"currentId",fO);Zt(this,"clear",()=>{this.currentId!==fO&&(clearTimeout(this.currentId),this.currentId=fO)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Qu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fO,n()},t)}isStarted(){return this.currentId!==fO}}function ov(){const e=Td(Qu.create).current;return MD(e.disposeEffect),e}let mJ=0;function Mnt(e){return mJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${mJ}`}function _3(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 Lnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:$nt,platform:Fnt,maxTouchPoints:Bnt}=Lnt(),QD=$nt.toLowerCase(),dC=Fnt.toLowerCase(),zD=/^i(os$|p)/.test(dC)||dC==="macintel"&&Bnt>1,gJ="android",Z8=dC===gJ||QD.includes(gJ),Unt=!zD&&dC.startsWith("mac");dC.startsWith("win");const Qnt=Unt||zD;var jue;const q1=typeof CSS<"u"&&!!((jue=CSS.supports)!=null&&jue.call(CSS,"-webkit-backdrop-filter:none"));!q1&&QD.includes("firefox");!q1&&QD.includes("chrom");const znt=Qnt,t_e=/jsdom|happydom/.test(QD),J8="data-base-ui-focusable",n_e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Sc(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 ii(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&&Zw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function fo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function i_e(e,t){if(!Tr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(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 Vnt(e){return e.matches("html,body")}function Gz(e){return Zs(e)&&e.matches(n_e)}function Hnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${n_e}`))!=null}function bJ(e){return e?e.getAttribute("role")==="combobox"&&Gz(e):!1}function eB(e){if(!e||t_e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function yJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Gg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Gg(e,r.id,n)]})}function vJ(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(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function qnt(e){e.preventDefault(),e.stopPropagation()}function Wnt(e){return"nativeEvent"in e}function Knt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function r_e(e){return t_e?!1:!Z8&&e.width===0&&e.height===0||Z8&&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 sw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Gnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xnt=["top","right","bottom","left"],Xg=Math.min,Dp=Math.max,tI=Math.round,e_=Math.floor,Mp=e=>({x:e,y:e}),Ynt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xz(e,t,n){return Dp(e,Xg(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function kd(e){return e.split("-")[0]}function mm(e){return e.split("-")[1]}function Yz(e){return e==="x"?"y":"x"}function VD(e){return e==="y"?"height":"width"}function pd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function HD(e){return Yz(pd(e))}function Znt(e,t,n){n===void 0&&(n=!1);const i=mm(e),r=HD(e),s=VD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=nI(o)),[o,nI(o)]}function Jnt(e){const t=nI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xJ=["left","right"],wJ=["right","left"],eit=["top","bottom"],tit=["bottom","top"];function nit(e,t,n){switch(e){case"top":case"bottom":return n?t?wJ:xJ:t?xJ:wJ;case"left":case"right":return t?eit:tit;default:return[]}}function iit(e,t,n,i){const r=mm(e);let s=nit(kd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function nI(e){const t=kd(e);return Ynt[t]+e.slice(t.length)}function rit(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 Zz(e){return typeof e!="number"?rit(e):{top:e,right:e,bottom:e,left:e}}function iI(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 sit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function s_e(e,t=e?Uu(e):null){return!e||!e.isConnected||!t||sit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const ait='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function oit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Zw(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(dl(t)==="summary")return t;return null}function lit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function a_e(e){const t=e?dl(e):"";return e!=null&&e.matches(ait)&&(t!=="summary"||e.parentElement!=null&&dl(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function o_e(e){if(!a_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=oit(t)){const n=t!==e,i=dl(t)==="slot";if(t.hasAttribute("inert")||n&&dl(t)==="details"&&!t.open&&!lit(e,t)||t.hasAttribute("hidden")||!i&&!cit(t,n))return!1}return!0}function cit(e,t){const n=Uu(e);return t?n.display!=="none":s_e(e,n)}function l_e(e){const t=e.tabIndex;if(t<0){const n=dl(e);if(n==="details"||n==="audio"||n==="video"||Zs(e)&&e.isContentEditable)return 0}return t}function N3(e){if(dl(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function uit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(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=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function c_e(e){if(Zs(e)&&dl(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function u_e(e,t){c_e(e).forEach(n=>{a_e(n)&&t.push(n),u_e(n,t)})}function d_e(e,t,n){c_e(e).forEach(i=>{Zs(i)&&i.matches(t)&&n.push(i),d_e(i,t,n)})}function Jz(e){return o_e(e)&&l_e(e)>=0}function f_e(e){const t=[];return u_e(e,t),t.filter(o_e)}function qA(e){const t=f_e(e);return t.filter(n=>l_e(n)>=0&&uit(n,t))}function h_e(e,t){const n=qA(e),i=n.length;if(i===0)return;const r=Sc(Cr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function eV(e){return h_e(Cr(e).body,1)||e}function p_e(e){return h_e(Cr(e).body,-1)||e}function m_e(e,t){if(!e)return null;const n=qA(Cr(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 dit(e){return m_e(e,1)}function fit(e){return m_e(e,-1)}function aw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function hit(e){qA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kJ(e){const t=[];d_e(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 R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(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 Bf={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 pit extends $D{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Bf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Mnt("toast");if(n.id){const u=Bf.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 o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Bf.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??o,f=c.timeout??o,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)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Bf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=fo(n);ii(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 o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Bf.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 o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}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=Qu.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=!Bf.expandedOrOutOfFocus(this.state)?Qu.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:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Sc(Cr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Bf.toasts(this.state),s=Bf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew pit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return MD(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(G2e.Provider,{value:o,children:[a.jsx(git,{store:o,timeout:i,limit:r}),n]})};function git(e){const{store:t,timeout:n,limit:i}=e;return ti(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const bit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},g_e={...bit,position:"fixed",top:0,left:0},lv=p.forwardRef(function(t,n){const[i,r]=p.useState();ti(()=>{znt&&q1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:g_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Jw(e,t,n,i){const r=Td(b_e).current;return vit(r,e,t,n,i)&&y_e(r,[e,t,n,i]),r.callback}function yit(e){const t=Td(b_e).current;return xit(t,e)&&y_e(t,e),t.callback}function b_e(){return{callback:null,cleanup:null,refs:[]}}function vit(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function xit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function y_e(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 iV(e){return typeof e=="function"}function w_e(e,t){return iV(e)?e(t):e??tV}function Cit(e,t){return t?e?(...n)=>{const i=n[0];if(S_e(i)){const s=i;sI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:k_e(t):e}function k_e(e){return e&&((...t)=>{const n=t[0];return S_e(n)&&sI(n),e(...t)})}function sI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function O_e(e,t){return t?e?t+" "+e:t:e}function S_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Da(e,t,n={}){const i=t.render,r=Ait(t,n);if(n.enabled===!1)return null;const s=n.state??Jl;return jit(e,i,r,s)}function Ait(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Jl,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?kit(n,s):void 0,f=u?v_e(i,s):void 0,h=u?wit(s,c):Jl,m=u&&l?Tit(l):void 0,g=u?iB(h,m)??{}:Jl;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=yit([g.ref,OJ(r),...o]):g.ref=Jw(g.ref,OJ(r),o):Jw(null,null)),u?(d!==void 0&&(g.className=O_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):Jl}function Tit(e){return Array.isArray(e)?Oit(e):nV(void 0,e)}const _it=Symbol.for("react.lazy");function jit(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===_it&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Nit(e,n);throw new Error(Uc(8))}function Nit(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 Rit=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Qz(),u=ov(),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=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),k=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const H=ea(M),q=Cr(M);function U(J){J.key==="F6"&&fo(J)!==M&&(J.preventDefault(),c.set("prevFocusElement",Sc(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function Z(J){fo(J)===H&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(J){if(J.relatedTarget)return;const ne=fo(J),W=Sc(Cr(M));(ne===H||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return yh(Di(H,"keydown",U),Di(H,"blur",Z,!0),Di(H,"focus",z,!0),Di(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function S(M){var q,U;d.current=!0;const H=M.relatedTarget===c.state.viewport?g.find(Z=>Z.transitionStatus!=="ending"&&!Z.limited):void 0;H?(U=(q=H.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function O(M){M.key==="Tab"&&M.shiftKey&&fo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function A(){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(A,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,A()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function C(M){M.pointerType==="touch"&&(h.current=!1,A())}function N(){if(d.current){d.current=!1;return}b||eB(Sc(Cr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:O,onClick:N,onPointerDown:R,onPointerUp:C,onPointerCancel:C,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(lv,{onFocus:S}),L=Da("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&k.length>0&&a.jsx("div",{style:g_e,children:k.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function rV(e){return zz(19)?e:e?"true":void 0}const E_e=p.createContext(void 0);function Iit(){const e=p.useContext(E_e);if(!e)throw new Error(Uc(66));return e}let aI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Pit={"data-starting-style":""},Dit={"data-ending-style":""},qD={transitionStatus(e){return e==="starting"?Pit:e==="ending"?Dit:null}};function op(e){return e==null?e:"current"in e?e.current:e}function sV(e,t=!1){const n=Kz();return oi((i,r=null)=>{n.cancel();const s=op(e);if(s==null)return;const o=s,l=()=>{vi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function WA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=oi(r),o=sV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Mit=500,Lit={style:{transition:"none"}},aV="data-base-ui-click-trigger",$it="data-base-ui-swipe-ignore",Fit="data-swipe-ignore",Bit=`[${$it}]`,Uit=`[${Fit}]`,Qit={fallbackAxisSide:"end"},zit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(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 Vit(e){const n=ea(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[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 Hit={...qD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},SJ=40,qit=10,EJ=.5,Wit=1,Kit=`${Bit},${Uit}`,Git=p.forwardRef(function(t,n){var Ge;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Ge=i.positionerProps)==null?void 0:Ge.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Qz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,k]=p.useState({x:0,y:0}),[S,O]=p.useState({x:0,y:0,scale:1}),[A,E]=p.useState(),[j,T]=p.useState(),[R,C]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),H=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),Z=p.useRef(null),z=h.useState("toastIndex",i.id),J=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),X=h.useState("expanded");WA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const le=oi((De=!1)=>{const se=N.current;if(!se)return;const ce=se.style.height;se.style.height="auto";const ye=se.offsetHeight;se.style.height=ce;function Ae(){h.updateToastInternal(i.id,{ref:N,height:ye,transitionStatus:void 0})}De?vi.flushSync(Ae):Ae()});ti(()=>{const De=P.current;i.transitionStatus!=="starting"&&De===i.id||(De!==void 0&&(g(void 0),O({x:0,y:0,scale:1}),V({x:0,y:0})),P.current=i.id,le())},[le,i.id,i.transitionStatus]);function V(De){q.current=De,k(De)}ti(()=>()=>{var De;(De=Z.current)==null||De.abort()},[]);function Y(De,se){const ce=Ee=>Ee>0?Ee**EJ:-(Math.abs(Ee)**EJ),ye=De>0&&!d.includes("right")||De<0&&!d.includes("left"),Ae=se>0&&!d.includes("down")||se<0&&!d.includes("up");return{x:ye?ce(De):De,y:Ae?ce(se):se}}const K=oi(De=>{var Ce;if(De.pointerId!==U.current)return;U.current=null,(Ce=Z.current)==null||Ce.abort(),Z.current=null,v(!1),w(!1),C(null);const se=D.current;if(De.type==="pointercancel"||F.current){V({x:se.x,y:se.y}),g(void 0);return}const ce=q.current,ye=ce.x-se.x,Ae=ce.y-se.y;let Ee;for(const Be of d)if(P3(Be,ye,Ae)>SJ){Ee=Be;break}Ee?(g(Ee),h.closeToast(i.id)):(V({x:se.x,y:se.y}),g(void 0))});function ue(De){var Be,he;if(De.button!==0)return;De.pointerType==="touch"&&h.pauseTimers();const se=fo(De.nativeEvent);if(se==null?void 0:se.closest(`button,a,input,textarea,[role="button"],${Kit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=De.pointerId,I.current={x:De.clientX,y:De.clientY},M.current=I.current;const ye=De.currentTarget,Ae=Vit(ye);D.current=Ae,O(Ae),V({x:Ae.x,y:Ae.y}),h.set("hovering",!0),v(!0),w(!1),C(null),H.current=!0,(Be=Z.current)==null||Be.abort();const Ee=new AbortController;Z.current=Ee;const Ce=Cr(ye);Ce.addEventListener("pointerup",K,{signal:Ee.signal}),Ce.addEventListener("pointercancel",K,{signal:Ee.signal}),(he=ye.setPointerCapture)==null||he.call(ye,De.pointerId)}function te(De){if(De.pointerId!==U.current)return;De.preventDefault(),H.current&&(I.current={x:De.clientX,y:De.clientY},H.current=!1);const{clientY:se,clientX:ce,movementX:ye,movementY:Ae}=De;(Ae<0&&se>M.current.y||Ae>0&&seM.current.x||ye>0&&ce=Wit){w(!0);const Lt=d.includes("left")||d.includes("right"),qe=d.includes("up")||d.includes("down");if(Lt&&qe){const yt=Math.abs(Ee),je=Math.abs(Ce);ie=yt>je?"horizontal":"vertical",C(ie)}}let we;if(!_.current)ie==="vertical"?Ce>0?we="down":Ce<0&&(we="up"):ie==="horizontal"?Ee>0?we="right":Ee<0&&(we="left"):Math.abs(Ee)>=Math.abs(Ce)?we=Ee>0?"right":"left":we=Ce>0?"down":"up",we&&d.includes(we)&&(_.current=we,L.current=P3(we,Ee,Ce),g(we));else{const St=_.current,Lt=P3(St,he,Be);Lt>SJ?(F.current=!1,g(St)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-Lt>=qit&&(F.current=!0)}const Re=Y(Ee,Ce);let Ue=D.current.x,_t=D.current.y;const Pt=d.includes("left")||d.includes("right"),Gt=d.includes("up")||d.includes("down");ie!=="vertical"&&Pt&&(Ue+=Re.x),ie!=="horizontal"&&Gt&&(_t+=Re.y),V({x:Ue,y:_t})}function Oe(De){if(De.key==="Escape"){if(!N.current||!ii(N.current,Sc(Cr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const De=N.current;if(!f||!De)return;function se(ce){U.current===null||!ii(De,fo(ce))||ce.preventDefault()}return Di(De,"touchmove",se,{passive:!1})},[f]);function fe(){const De=x.x-S.x,se=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":`${De}px`,"--toast-swipe-movement-y":`${se}px`}}const pe=i.priority==="high",Se={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":j,"aria-hidden":pe&&!W?!0:void 0,onPointerDown:f?ue:void 0,onPointerMove:f?te:void 0,onPointerUp:f?K:void 0,onPointerCancel:f?K:void 0,onKeyDown:Oe,inert:rV(i.limited),style:{...fe(),"--toast-index":i.transitionStatus==="ending"?z:J,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},ve=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:le,visibleIndex:J,expanded:X}),[i,E,T,le,J,X]),Le={transitionStatus:i.transitionStatus,expanded:X,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},He=Da("div",t,{ref:[n,N],state:Le,stateAttributesMapping:Hit,props:[Se,c]});return a.jsx(E_e.Provider,{value:ve,children:He})});let CJ=0;function Xit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(CJ+=1,i(`${t}-${CJ}`))},[n,t]),r}const AJ=Vz.useId;function KA(e,t){if(AJ!==void 0){const n=AJ();return e??(t?`${t}-${n}`:n)}return Xit(e,t)}function C_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(C_e):!0}function Yit(e){return p.isValidElement(e)&&C_e(e.props.children)}function A_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Iit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:KA(e),children:l,type:i.type,setId:o}}function T_e(e,t,n){const i=Yit(e);return ti(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Zit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=A_e(o,l,"description"),g=Da("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return T_e(g,u,h)}),Jit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=A_e(o,l,"title"),g=Da("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return T_e(g,u,h)}),ert=p.createContext(void 0);function trt(e=!1){const t=p.useContext(ert);if(t===void 0&&!e)throw new Error(Uc(16));return t}function nrt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=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||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ea(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function WD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=trt(!0),c=s??l!==void 0,{props:u}=nrt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);ti(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nV({onClick(k){if(t){k.preventDefault();return}g==null||g(k)},onMouseDown(k){t||b==null||b(k)},onKeyDown(k){if(t||(sI(k),y==null||y(k),k.baseUIHandlerPrevented))return;const S=k.target===k.currentTarget,O=k.currentTarget,A=M3(O),E=!r&&irt(O),j=S&&(r?A:!E),T=k.key==="Enter",R=k.key===" ",C=O.getAttribute("role"),N=(C==null?void 0:C.startsWith("menuitem"))||C==="option"||C==="gridcell";if(S&&c&&R){if(k.defaultPrevented&&N)return;k.preventDefault(),(!r||A)&&(k.preventBaseUIHandler(),D3(O,k));return}if(!j||r||!R&&!T){S&&E&&R&&k.preventDefault();return}k.defaultPrevented||(k.preventDefault(),T&&(k.preventBaseUIHandler(),D3(O,k)))},onKeyUp(k){if(!t){if(sI(k),v==null||v(k),k.target===k.currentTarget&&r&&c&&M3(k.currentTarget)&&k.key===" "){k.preventDefault();return}k.baseUIHandlerPrevented||k.target===k.currentTarget&&!r&&!c&&!k.defaultPrevented&&k.key===" "&&(k.preventBaseUIHandler(),D3(k.currentTarget,k))}},onPointerDown(k){if(t){k.preventDefault();return}w==null||w(k)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=oi(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return Zs(e)&&e.tagName==="BUTTON"}function irt(e){return Zs(e)&&e.tagName==="A"&&!!e.href}const __e="none",e1="trigger-press",vu="trigger-hover",j_e="outside-press",N_e="close-press",fC="focus-out",R_e="escape-key",I_e="imperative-action";function pa(e,t,n,i){let r=!1,s=!1;const o=Jl;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,...o}}function oI(e){return`data-base-ui-${e}`}const P_e=p.createContext(null),D_e=()=>p.useContext(P_e),rrt=oI("portal");function M_e(e={}){const{ref:t,container:n,componentProps:i=Jl,elementProps:r}=e,s=KA(),o=D_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=oi(v=>{v!==null&&f(v)}),m=p.useRef(null);ti(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Hz(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=Da("div",i,{ref:[t,h],props:[{id:s,[rrt]:""},r]}),b=c&&g?vi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const L_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=M_e({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,k=v==null?void 0:v.open,S=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function A(E){u&&E.relatedTarget&&aw(E)&&(E.type==="focusin"?w.current&&(kJ(u),w.current=!1):(hit(u),w.current=!0))}return yh(Di(u,"focusin",A,!0),Di(u,"focusout",A,!0))},[u,x]),ti(()=>{!u||k!==!0||!w.current||(kJ(u),w.current=!1)},[k,u]);const O=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(P_e.Provider,{value:O,children:[S&&u&&a.jsx(lv,{"data-type":"outside",ref:h,onFocus:A=>{var E;if(aw(A,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=p_e(j);T==null||T.focus()}}}),S&&u&&a.jsx("span",{"aria-owns":d,style:zit}),u&&vi.createPortal(o,u),S&&u&&a.jsx(lv,{"data-type":"outside",ref:m,onFocus:A=>{var E;if(aw(A,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=eV(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,pa(fC,A.nativeEvent)))}}})]})]})}),srt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=M_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&vi.createPortal(i,u)]})}),art=p.forwardRef(function(t,n){return a.jsx(srt,{ref:n,...t})});function Gl(e){const t=Td(ort,e).current;return t.next=e,ti(t.effect),t}function ort(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function lrt(e,t){return t!=null&&!sw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=lrt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function TJ(e){return typeof e=="function"?e():e}function $_e(e,t){return t||e==="click"||e==="mousedown"}function crt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let t_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(t_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Uz;const o=requestAnimationFrame(s);return t_=o,()=>{t_===o&&(cancelAnimationFrame(o),t_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},_J="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let hO=new WeakMap,F3=0;function urt(e){return sB[e]}function F_e(e){return e?Zw(e)?e.host:F_e(e.parentNode):null}const jJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=F_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),NJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},RJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{dl(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function drt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=jJ(t,e),u=r?RJ(t,NJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=urt(s);l=m,o=h;const g=jJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);RJ(t,NJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",k=(h.get(y)||0)+1;h.set(y,k),d.push(y),k===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(hO.get(h)||0)+1;hO.set(h,m),f.push(h),m===1&&h.setAttribute(_J,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(hO.get(h)||0)-1;hO.set(h,m),m||h.removeAttribute(_J)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,hO=new WeakMap)}}function IJ(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=Cr(e[0]).body;return drt(e,s,n,i,{mark:r})}function B_e(){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 frt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",B_e())}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 U_e=p.createContext(null),Q_e=p.createContext(null),KD=()=>{var e;return((e=p.useContext(U_e))==null?void 0:e.id)||null},W1=e=>{const t=p.useContext(Q_e);return e??t};function hrt(e){const t=KA(),n=W1(e),i=KD();return ti(()=>{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 prt(e){const{children:t,id:n}=e,i=KD();return a.jsx(U_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function mrt(e){const{children:t,externalTree:n}=e,i=Td(()=>n??new frt).current;return a.jsx(Q_e.Provider,{value:i,children:t})}function grt(e,t){const n=ea(fo(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 PJ=20;let pg=[];function oV(){pg=pg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function DJ(e){oV(),e&&dl(e)!=="body"&&(pg.push(new WeakRef(e)),pg.length>PJ&&(pg=pg.slice(-PJ)))}function MJ(){var e;return oV(),(e=pg[pg.length-1])==null?void 0:e.deref()}function brt(e){return e?Jz(e)?e:qA(e)[0]||e:null}function LJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=f_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Jz(s)||s.hasAttribute("data-tabindex")&&!o.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 z_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!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:k}=b.context,S=oi(()=>{var Y;return(Y=k.current.floatingContext)==null?void 0:Y.nodeId}),O=r===!1,A=bJ(y)&&O,E=Gl(r),j=Gl(s),T=Gl(u),R=Gl(v),C=W1(m),N=D_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),H=p.useRef(null),q=Jw(M,h,N==null?void 0:N.beforeInsideRef),U=Jw(H,N==null?void 0:N.afterInsideRef),Z=ov(),z=ov(),J=Kz(),ne=N!=null,W=yJ(w),X=oi((Y=W)=>Y?qA(Y):[]),le=oi(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ue){ue.key==="Tab"&&ii(W,Sc(Cr(W)))&&X().length===0&&!A&&qnt(ue)}const K=Cr(W);return Di(K,"keydown",Y)},[i,W,l,A,X]),p.useEffect(()=>{if(i||!v)return;const Y=Cr(W);function K(){D.current=!1}function ue(Oe){const fe=fo(Oe),pe=le(),Se=ii(w,fe)||ii(y,fe)||ii(N==null?void 0:N.portalNode,fe)||pe.some(ve=>ve===fe||ii(ve,fe));D.current=!Se,F.current=Oe.pointerType||"keyboard",fe!=null&&fe.closest(`[${aV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function te(){F.current="keyboard"}return yh(Di(Y,"pointerdown",ue,!0),Di(Y,"pointerup",K,!0),Di(Y,"pointercancel",K,!0),Di(Y,"keydown",te,!0),K)},[i,w,y,W,v,N,z,le]),p.useEffect(()=>{if(i||!c)return;const Y=Cr(W);function K(){I.current=!0,z.start(0,()=>{I.current=!1})}function ue(pe){const Se=fo(pe);Jz(Se)&&(_.current=Se)}function te(pe){const Se=pe.relatedTarget,ve=pe.currentTarget,Le=fo(pe);l&&Se==null&&Le!=null&&ii(w,Le)&&DJ(Le),queueMicrotask(()=>{const He=S(),Ge=b.context.triggerElements,De=le(),se=(Se==null?void 0:Se.hasAttribute(oI("focus-guard")))&&[M.current,H.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,op(f),op(d)].includes(Se),ce=!(ii(y,Se)||ii(w,Se)||ii(Se,w)||ii(N==null?void 0:N.portalNode,Se)||De.some(ye=>ye===Se||ii(ye,Se))||Ge.hasMatchingElement(ye=>ii(ye,Se))||se||C&&(Gg(C.nodesRef.current,He).find(ye=>{var Ae,Ee;return ii((Ae=ye.context)==null?void 0:Ae.elements.floating,Se)||ii((Ee=ye.context)==null?void 0:Ee.elements.domReference,Se)})||vJ(C.nodesRef.current,He).find(ye=>{var Ae,Ee,Ce;return[(Ae=ye.context)==null?void 0:Ae.elements.floating,yJ((Ee=ye.context)==null?void 0:Ee.elements.floating)].includes(Se)||((Ce=ye.context)==null?void 0:Ce.elements.domReference)===Se})));if(ve===y&&W&&LJ(W),o&&ve!==y&&!s_e(Le)&&Sc(Y)===Y.body){if(Zs(W)&&(W.focus(),o==="popup")){J.request(()=>{W.focus()});return}const ye=X(),Ae=_.current,Ee=(Ae&&ye.includes(Ae)?Ae:null)||ye[ye.length-1]||W;Zs(Ee)&&Ee.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(A||!l)&&Se&&ce&&!I.current&&(A||Se!==MJ())&&(P.current=!0,b.setOpen(!1,pa(fC,pe)))})}function Oe(){D.current||(k.current.insideReactTree=!0,Z.start(0,()=>{k.current.insideReactTree=!1}))}const fe=Zs(y)?y:null;if(!(!w&&!fe))return yh(fe&&Di(fe,"focusout",te),fe&&Di(fe,"pointerdown",K),w&&Di(w,"focusin",ue),w&&Di(w,"focusout",te),w&&N&&Di(w,"focusout",Oe,!0))},[i,y,w,W,l,C,N,b,c,o,X,A,S,k,Z,z,J,d,f,le]),p.useEffect(()=>{var ve,Le,He;if(i||!w||!v)return;const Y=Array.from(((ve=N==null?void 0:N.portalNode)==null?void 0:ve.querySelectorAll(`[${oI("portal")}]`))||[]),ue=(He=(Le=(C?vJ(C.nodesRef.current,S()):[]).find(Ge=>{var De;return bJ(((De=Ge.context)==null?void 0:De.elements.domReference)||null)}))==null?void 0:Le.context)==null?void 0:He.elements.domReference,Oe=[...[w,...Y,M.current,H.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...le()],ue,op(f),op(d),A?y:null].filter(Ge=>Ge!=null),fe=IJ(Oe,{ariaHidden:l||A,mark:!1}),pe=[w,...Y].filter(Ge=>Ge!=null),Se=IJ(pe);return()=>{Se(),fe()}},[v,i,y,w,l,N,A,C,S,d,f,le]),ti(()=>{if(!v||i||!Zs(W))return;L.current="",F.current="";const Y=Cr(W),K=Sc(Y);queueMicrotask(()=>{const ue=E.current,te=typeof ue=="function"?ue(T.current||""):ue;if(te===void 0||te===!1||ii(W,K))return;let fe=null;const pe=()=>(fe==null&&(fe=X(W)),fe[0]||W);let Se;te===!0||te===null?Se=pe():Se=op(te),Se=Se||pe();const ve=ii(W,Sc(Y));L3(Se,{preventScroll:Se===W,shouldFocus(){if(!R.current)return!1;if(ve)return!0;const Le=Sc(Y);return!(Le!==Se&&ii(W,Le))}})})},[i,v,W,X,E,T,R]),ti(()=>{if(i||!W)return;const Y=Cr(W),K=Sc(Y),ue=T.current==null;DJ(K);function te(fe){if(fe.open||(L.current=grt(fe.nativeEvent,F.current)),fe.reason===vu&&fe.nativeEvent.type==="mouseleave"&&(P.current=!0),fe.reason===j_e)if(fe.nested)P.current=!1;else if(Knt(fe.nativeEvent)||r_e(fe.nativeEvent))P.current=!1;else{let pe=!1;Cr(W).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?P.current=!1:P.current=!0}}x.on("openchange",te);function Oe(fe){const pe=j.current;let Se=typeof pe=="function"?pe(fe):pe;if(Se===void 0||Se===!1)return null;Se===null&&(Se=!0);const ve=y!=null&&y.isConnected?y:null,Le=K!=null&&K.isConnected&&dl(K)!=="body"?K:null;let He=ue?Le||ve:ve||Le;return He||(He=MJ()||null),typeof Se=="boolean"?He:op(Se)||He||null}return()=>{x.off("openchange",te);const fe=Sc(Y),pe=le(),Se=ii(w,fe)||pe.some(Ge=>Ge===fe||ii(Ge,fe))||C&&Gg(C.nodesRef.current,S(),!1).some(Ge=>{var De;return ii((De=Ge.context)==null?void 0:De.elements.floating,fe)}),ve=j.current,Le=L.current,He=Oe(Le);queueMicrotask(()=>{const Ge=brt(He),De=typeof ve!="boolean";if(ve&&!P.current&&Zs(Ge)&&(!(!De&&Ge!==fe&&fe!==Y.body)||Se)){const se={preventScroll:!0};Le==="keyboard"&&(se.focusVisible=!0),Ge.focus(se)}P.current=!1})}},[i,w,W,j,T,x,C,y,S,le]),ti(()=>{if(!q1||v||!w)return;const Y=Sc(Cr(w));!Zs(Y)||!Gz(Y)||ii(w,Y)&&Y.blur()},[v,w]),ti(()=>{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]),ti(()=>{if(!(i||!W))return LJ(W),()=>{queueMicrotask(oV)}},[i,W]);const V=!i&&(l?!A:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[V&&a.jsx(lv,{"data-type":"inside",ref:q,onFocus:Y=>{var K;if(l){const ue=X();L3(ue[ue.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,aw(Y,N.portalNode)){const ue=eV(y);ue==null||ue.focus()}else(K=op(f??N.beforeOutsideRef))==null||K.focus()}}),n,V&&a.jsx(lv,{"data-type":"inside",ref:U,onFocus:Y=>{var K;if(l)L3(X()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),aw(Y,N.portalNode)){const ue=p_e(y);ue==null||ue.focus()}else(K=op(d??N.afterOutsideRef))==null||K.focus()}})]})}function V_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=e1}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Kz(),m=ov(),g=p.useMemo(()=>{function b(y,w,x,k){const S=pa(c,w,x);y&&k==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,S)}):u.setOpen(y,S)}function v(y,w,x){const k=d.current.openEvent,S=u.select("domReferenceElement")!==w;return y&&S||!y||!r?!0:k&&o?!x(k.type):!1}return{onPointerDown(y){f.current=sw(y.pointerType,!0)&&r_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,k=u.select("open");if(y.button!==0||i==="click"||sw(w,!0)&&s)return;const S=v(k,y.currentTarget,E=>E==="click"||E==="mousedown"),O=fo(x);if(Gz(O)){b(S,x,O,w);return}const A=y.currentTarget;h.request(()=>{b(S,x,A,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(sw(w,!0)&&s)return;const x=u.select("open"),k=v(x,y.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");b(k,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:Jl,[n,g])}function yrt(){return!1}function vrt(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 H_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=yrt,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=W1(c),g=oi(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=oi(()=>s),{escapeKey:w,outsidePress:x}=vrt(l),k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(!1),A=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=ov(),R=ov(),C=oi(()=>{R.clear(),h.current.insideReactTree=!1}),N=oi(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Gg(m.nodesRef.current,U):[]).some(J=>{var ne;return((ne=J.context)==null?void 0:ne.open)&&!J.context.dataRef.current[q]})}),P=oi(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=oi(q=>{o()&&u.setOpen(!1,pa(e1,q.nativeEvent))}),D=oi(q=>{if(!d||!n||!i||q.key!=="Escape"||A.current||!w&&N("__escapeKeyBubbles"))return;const U=Wnt(q)?q.nativeEvent:q,Z=pa(R_e,U);u.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!w&&!Z.isPropagationAllowed&&q.stopPropagation()}),_=oi(()=>{h.current.insideReactTree=!0,R.start(0,C)}),L=oi(q=>{if(!d||!n||q.button!==0)return;const U=fo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(k.current||(k.current=!0,S.current=!1))}),F=oi(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&k.current&&(S.current=!0)});p.useEffect(()=>{if(!d||!n)return C;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Qu,U=new Qu;function Z(){q.clear(),A.current=!0}function z(){q.start(q1?5:0,()=>{A.current=!1})}function J(){O.current=!0,U.start(0,()=>{O.current=!1})}function ne(){k.current=!1,S.current=!1}function W(){const De=E.current,se=De==="pen"||!De?"mouse":De,ce=y(),ye=typeof ce=="function"?ce():ce;return typeof ye=="string"?ye:ye[se]}function X(De){const se=W();return se==="intentional"&&De.type!=="click"||se==="sloppy"&&De.type==="click"}function le(De){var ye;const se=(ye=h.current.floatingContext)==null?void 0:ye.nodeId,ce=m&&Gg(m.nodesRef.current,se).some(Ae=>{var Ee;return j3(De,(Ee=Ae.context)==null?void 0:Ee.elements.floating)});return P(De)||ce}function V(De){if(X(De)){De.type!=="click"&&!P(De)&&(U.clear(),O.current=!1),C();return}if(h.current.insideReactTree){C();return}const se=fo(De),ce=`[${oI("inert")}]`,ye=Tr(se)?se.getRootNode():null,Ae=Array.from((Zw(ye)?ye:Cr(u.select("floatingElement"))).querySelectorAll(ce)),Ee=u.context.triggerElements;if(se&&(Ee.hasElement(se)||Ee.hasMatchingElement(Be=>ii(Be,se))))return;let Ce=Tr(se)?se:null;for(;Ce&&!Rg(Ce);){const Be=Kg(Ce);if(Rg(Be)||!Tr(Be))break;Ce=Be}if(!(Ae.length&&Tr(se)&&!Vnt(se)&&!ii(se,u.select("floatingElement"))&&Ae.every(Be=>!ii(Ce,Be)))){if(Zs(se)&&!("touches"in De)){const Be=Rg(se),he=Uu(se),ie=/auto|scroll/,we=Be||ie.test(he.overflowX),Re=Be||ie.test(he.overflowY),Ue=we&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,_t=Re&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,Pt=he.direction==="rtl",Gt=_t&&(Pt?De.offsetX<=se.offsetWidth-se.clientWidth:De.offsetX>se.clientWidth),St=Ue&&De.offsetY>se.clientHeight;if(Gt||St)return}if(!le(De)){if(W()==="intentional"&&O.current){U.clear(),O.current=!1;return}typeof b=="function"&&!b(De)||N("__outsidePressBubbles")||(u.setOpen(!1,pa(j_e,De)),C())}}}function Y(De){W()!=="sloppy"||De.pointerType==="touch"||!u.select("open")||!n||P(De)||V(De)}function K(De){if(W()!=="sloppy"||!u.select("open")||!n||P(De))return;const se=De.touches[0];se&&(j.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ue(De,se){const ce=fo(De);if(!ce)return;const ye=Di(ce,De.type,()=>{se(De),ye()})}function te(De){E.current="touch",ue(De,K)}function Oe(De){T.clear(),De.type==="pointerdown"&&(E.current=De.pointerType),!(De.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ue(De,se=>{se.type==="pointerdown"?Y(se):V(se)})}function fe(De){if(!k.current)return;const se=S.current;if(ne(),W()==="intentional"){if(De.type==="pointercancel"){se&&J();return}if(!le(De)){if(se){J();return}typeof b=="function"&&!b(De)||(U.clear(),O.current=!0,C())}}}function pe(De){if(W()!=="sloppy"||!j.current||P(De))return;const se=De.touches[0];if(!se)return;const ce=Math.abs(se.clientX-j.current.startX),ye=Math.abs(se.clientY-j.current.startY),Ae=Math.sqrt(ce*ce+ye*ye);Ae>5&&(j.current.dismissOnTouchEnd=!0),Ae>10&&(V(De),T.clear(),j.current=null)}function Se(De){ue(De,pe)}function ve(De){W()!=="sloppy"||!j.current||P(De)||(j.current.dismissOnTouchEnd&&V(De),T.clear(),j.current=null)}function Le(De){ue(De,ve)}const He=Cr(f),Ge=yh(i&&yh(Di(He,"keydown",D),Di(He,"compositionstart",Z),Di(He,"compositionend",z)),v&&yh(Di(He,"click",Oe,!0),Di(He,"pointerdown",Oe,!0),Di(He,"pointerup",fe,!0),Di(He,"pointercancel",fe,!0),Di(He,"mousedown",Oe,!0),Di(He,"mouseup",fe,!0),Di(He,"touchstart",te,!0),Di(He,"touchmove",Se,!0),Di(He,"touchend",Le,!0)));return()=>{Ge(),q.clear(),U.clear(),ne(),O.current=!1,C()}},[h,f,i,v,b,d,n,w,x,D,C,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),H=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:H,trigger:M}:{},[n,M,H])}function $J(e,t,n){let{reference:i,floating:r}=e;const s=pd(t),o=HD(t),l=VD(o),c=kd(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=mm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function xrt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Eh(t,e),g=Zz(m),v=l[h?f==="floating"?"reference":"floating":f],y=iI(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:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=iI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-S.top+g.top)/k.y,bottom:(S.bottom-y.bottom+g.bottom)/k.y,left:(y.left-S.left+g.left)/k.x,right:(S.right-y.right+g.right)/k.x}}const wrt=50,krt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:xrt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=$J(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:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=Zz(d),h={x:n,y:i},m=HD(r),g=VD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=s.reference[g]+s.reference[m]-h[m]-s.floating[g],S=h[m]-s.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let A=O?O[x]:0;(!A||!await(o.isElement==null?void 0:o.isElement(O)))&&(A=l.floating[x]||s.floating[g]);const E=k/2-S/2,j=A/2-b[g]/2-1,T=Xg(f[y],j),R=Xg(f[w],j),C=A-b[g]-R,N=A/2-b[g]/2+E,P=Xz(T,N,C),I=!c.arrow&&mm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,C;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=A[P];if(I&&(!(f==="alignment"?w!==pd(I):!1)||T.every(L=>pd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(C=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:C.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(O){const F=pd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function FJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BJ(e){return Xnt.some(t=>e[t]>=0)}const Ert=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=FJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=FJ(o,n.floating);return{data:{escapedOffsets:l,escaped:BJ(l)}}}default:return{}}}}},q_e=new Set(["left","top"]);async function Crt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=kd(n),l=mm(n),c=pd(n)==="y",u=q_e.has(o)?-1:1,d=s&&c?-1:1,f=Eh(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 Art=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await Crt(t,e);return o===((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:o}}}}},Trt=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:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:k}=w;return{x,y:k}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=pd(r),m=Yz(h);let g=d[m],b=d[h];const v=(w,x)=>Xz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(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]:o,[h]:l}}}}}},_rt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},m=pd(o),g=Yz(m);let b=h[g],v=h[m];const y=Eh(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",O=l.reference[g]-l.floating[S]+w.mainAxis,A=l.reference[g]+l.reference[S]-w.mainAxis;bA&&(b=A)}if(f){var x,k;const S=g==="y"?"width":"height",O=q_e.has(kd(o)),A=l.reference[m]-l.floating[S]+(O&&((x=c.offset)==null?void 0:x[m])||0)+(O?0:w.crossAxis),E=l.reference[m]+l.reference[S]+(O?0:((k=c.offset)==null?void 0:k[m])||0)-(O?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},jrt=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:o=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=kd(n),d=mm(n),f=pd(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=Xg(m-c[g],v),x=Xg(h-c[b],y),k=t.middlewareData.shift,S=!k;let O=w,A=x;k!=null&&k.enabled.x&&(A=y),k!=null&&k.enabled.y&&(O=v),S&&!d&&(f?A=h-2*Dp(c.left,c.right):O=m-2*Dp(c.top,c.bottom)),await o({...t,availableWidth:A,availableHeight:O});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function W_e(e){const t=Uu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Zs(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=tI(n)!==s||tI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function lV(e){return Tr(e)?e:e.contextElement}function ow(e){const t=lV(e);if(!Zs(t))return Mp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=W_e(t);let o=(s?tI(n.width):n.width)/i,l=(s?tI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Nrt=Mp(0);function K_e(e){const t=ea(e);return!Wz()||!t.visualViewport?Nrt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rrt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ea(e)}function cv(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lV(e);let o=Mp(1);t&&(i?Tr(i)&&(o=ow(i)):o=ow(e));const l=Rrt(s,n,i)?K_e(s):Mp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ea(s),m=Tr(i)?ea(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=ow(b),y=b.getBoundingClientRect(),w=Uu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,k=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=k,g=ea(b),b=Y8(g)}}return iI({width:d,height:f,x:c,y:u})}function GD(e,t){const n=UD(e).scrollLeft;return t?t.left+n:cv(pm(e)).left+n}function G_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-GD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Irt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=pm(i),l=t?BD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mp(1);const d=Mp(0),f=Zs(i);if((f||!s)&&((dl(i)!=="body"||HA(o))&&(c=UD(i)),f)){const m=cv(i);u=ow(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?G_e(o,c):Mp(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 Prt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Drt(e){const t=UD(e),n=e.ownerDocument.body,i=Dp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Dp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+GD(e);const o=-t.scrollTop;return Uu(n).direction==="rtl"&&(s+=Dp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Mrt=25;function Lrt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ea(e),s=pm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!Wz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(GD(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<=Mrt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function $rt(e,t){const n=cv(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=ow(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function UJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Lrt(e,n,t);else if(t==="document")i=Drt(pm(e));else if(Tr(t))i=$rt(t,n);else{const r=K_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return iI(i)}function Frt(e,t){const n=t.get(e);if(n)return n;let i=uC(e,[],!1).filter(l=>Tr(l)&&dl(l)!=="body"),r=null;const s=Uu(e).position==="fixed";let o=s?Kg(e):e;for(;Tr(o)&&!Rg(o);){const l=Uu(o),c=qz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Kg(o)}return t.set(e,i),i}function Brt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?BD(t)?[]:Frt(t,this._c):[].concat(n),i],l=UJ(t,o[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)}A=!1}try{i=new IntersectionObserver(E,{...O,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,O)}i.observe(e)}const c=ea(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=lV(e),d=r||s?[...u?uC(u):[],...t?uC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?qrt(u,n,s):null;let h=-1,m=null;o&&(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?cv(e):null;c&&v();function v(){const y=cv(e);b&&!Y_e(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 Wrt=Art,Krt=Trt,Grt=Srt,Xrt=jrt,Yrt=Ert,zJ=Ort,Zrt=_rt,Jrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Hrt,...r.platform,_c:i};return krt(e,t,{...r,platform:s})};var est=typeof document<"u",tst=function(){},pN=est?p.useLayoutEffect:tst;function lI(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(!lI(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)&&!lI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Z_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VJ(e,t){const n=Z_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return pN(()=>{t.current=e}),t}function J_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},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);lI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==O.current&&(O.current=L,b(L))},[]),x=p.useCallback(L=>{L!==A.current&&(A.current=L,y(L))},[]),k=s||g,S=o||v,O=p.useRef(null),A=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),C=U3(u),N=p.useCallback(()=>{if(!O.current||!A.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Jrt(O.current,A.current,L).then(F=>{const M={...F,isPositioned:C.current!==!1};P.current&&!lI(E.current,M)&&(E.current=M,vi.flushSync(()=>{f(M)}))})},[h,t,n,R,C]);pN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);pN(()=>(P.current=!0,()=>{P.current=!1}),[]),pN(()=>{if(k&&(O.current=k),S&&(A.current=S),k&&S){if(T.current)return T.current(k,S,N);N()}},[k,S,N,T,j]);const I=p.useMemo(()=>({reference:O,floating:A,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:k,floating:S}),[k,S]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=VJ(D.floating,d.x),M=VJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...Z_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const nst=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?zJ({element:i.current,padding:r}).fn(n):{}:i?zJ({element:i,padding:r}).fn(n):{}}}},eje=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tje=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nje=(e,t)=>({fn:Zrt(e).fn,options:[e,t]}),ije=(e,t)=>{const n=Grt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rje=(e,t)=>{const n=Xrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ist=(e,t)=>{const n=Yrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rst=(e,t)=>{const n=nst(e);return{name:n.name,fn:n.fn,options:[e,t]}},sst={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 cV extends $D{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:B_e(),nested:r,triggerElements:o},sst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&Gnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(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)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ast(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cV({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),ti(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Tr(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 sje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),ti(()=>{if(!e&&s&&i!=="ending"&&n){const l=Cc.request(()=>{r("ending")});return()=>{Cc.cancel(l)}}},[e,s,i,n]),ti(()=>{if(!e||t)return;const l=Cc.request(()=>{r(void 0)});return()=>{Cc.cancel(l)}},[t,e]),ti(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Cc.request(()=>{r("idle")});return()=>{Cc.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const aje={tabIndex:-1,[J8]:""};function oje(e){return t=>t==="touch"?e.current:!0}function lje(e,t=!1){const n=KA(),i=KD()!=null,r=Td(()=>e(n,i)).current;return ast({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function cje({handle:e,store:t}){return ti(()=>e.attachStore(t),[e,t]),null}function ost(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 o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),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 o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function uje(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 lst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function dje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=ost(e,n),o=oi(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&&o(c)},[s,o]);return ti(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function fje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");ti(()=>{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=pa(__e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function hje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=sje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=oi(()=>{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 WA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function pje(e,t){e.useSyncedValues(t),ti(()=>()=>{e.update({activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl})},[e])}function mje(e,t){ti(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ti(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uV{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 cst(){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function gje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:cst(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl}}function bje(e,t,n=!1){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const rE=e=>e.triggerIdProp??e.activeTriggerId,dV=e=>e.openProp??e.open,HJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function yje(e,t){return t!==void 0&&dV(e)&&rE(e)===t}function ust(e,t){return yje(e,t)?!0:t!==void 0&&dV(e)&&rE(e)==null&&e.triggerCount===1}const vje={open:dV,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:rE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:HJ,isTriggerActive:(e,t)=>t!==void 0&&rE(e)===t,isOpenedByTrigger:(e,t)=>yje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&rE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ust(e,t)?HJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function xje(e){const t=p.useCallback(i=>e===void 0?Uz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return XP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function dst(e){return fst(e,e.rootContext)}function fst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=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=W1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=J_e({...e,elements:{...y,...u&&{reference:u}}}),x=Tr(f)?f:null,k=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",k);const S=p.useCallback(R=>{const C=Tr(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(C),w.refs.setReference(C)},[w.refs]),O=p.useCallback(R=>{(Tr(R)||R===null)&&(b.current=R,h(R)),(Tr(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Tr(R))&&w.refs.setReference(R)},[w.refs,h]),A=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:O,setFloating:A,setPositionReference:S,domReference:b}),[w.refs,O,A,S]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return ti(()=>{o&&(b.current=o)},[o]),ti(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(C=>C.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class fV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(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 Qu,this.restTimeout=new Qu,this.handleCloseOptions=void 0}static create(){return new fV}}const cI=new WeakMap;function uI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&cI.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"),cI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function wje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=cI.get(n);s&&s!==e&&uI(s),uI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,cI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function kje(e){const t=e.context.dataRef.current,n=Td(()=>t.hoverInteractionState??fV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),MD(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function hst(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=W1(),f=KD(),h=kje(s),m=ov(),g=oi(()=>{var y;return $_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=oi(()=>{var y;return crt((y=u.current.openEvent)==null?void 0:y.type)}),v=oi(()=>{uI(h)});ti(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),ti(()=>{var y,w,x,k,S;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Tr(c)&&l){const O=c,A=l,E=Cr(l),j=(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;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==A?h.pointerEventsScopeElement:null,R=j!==A?j:null,C=((S=(k=h.handleCloseOptions)==null?void 0:k.getScope)==null?void 0:S.call(k))??T??R??O.closest("[data-rootownerid]")??E.body;return wje(h,{scopeElement:C,referenceElement:O,floatingElement:A}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Gg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,pa(vu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=fo(E);if(!Hnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function k(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",O),v()}function S(E){var C;if(y()&&d){d.events.on("floating.closed",O);return}if(i_e(E.relatedTarget,s.context.triggerElements))return;const j=((C=u.current.floatingContext)==null?void 0:C.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Tr(T)&&Gg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function O(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",O),s.setOpen(!1,pa(vu,E)),d.events.emit("floating.closed",E)})}const A=l;return yh(A&&Di(A,"mouseenter",k),A&&Di(A,"mouseleave",S),A&&Di(A,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",O)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const pst={current:null};function mst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=pst,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=W1(u),x=kje(b),k=p.useRef(!1),S=Gl(r),O=Gl(i),A=Gl(o),E=Gl(n),j=Gl(m),T=Gl(h),R=oi(()=>{var _;return $_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),C=oi(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=oi((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Tr(F))return!1;const H=F;return M.hasMatchingElement(q=>ii(q,H))&&(!_||!ii(_,H))}),P=oi(()=>{if(!x.handler)return;Cr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=oi(()=>{uI(x)});return d&&(x.handleCloseOptions=(D=S.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?k.current=!1:(k.current=L.reason===vu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,Z=!0){const z=rB(O.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U)}):Z&&(x.openChangeTimeout.clear(),b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Tr(L))return;function F(U){var pe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!sw(x.pointerType))return;const Z=TJ(A.current),z=rB(O.current,"open",x.pointerType),J=fo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let X=ne;if(Tr(J)&&!b.context.triggerElements.hasElement(J)){for(const Se of b.context.triggerElements.elements())if(ii(Se,J)){X=Se;break}}Tr(ne)&&Tr(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(X=W);const le=X==null?!1:N(W,X,J),V=b.select("open"),Y=((pe=T.current)==null?void 0:pe.call(T))??b.select("transitionStatus")==="ending",K=!V&&Y&&k.current,ue=!le&&Tr(X)&&Tr(W)&&ii(W,X)&&K,te=Z>0&&!z,Oe=le&&(V||K)||ue,fe=!V||le;if(Oe){C()&&b.setOpen(!0,pa(vu,U,X));return}te||(z?x.openChangeTimeout.start(z,()=>{fe&&C()&&b.setOpen(!0,pa(vu,U,X))}):fe&&C()&&b.setOpen(!0,pa(vu,U,X)))}function M(U){if(R()){I();return}P();const Z=b.select("domReferenceElement"),z=Cr(Z);x.restTimeout.clear(),x.restTimeoutPending=!1;const J=v.current.floatingContext??(f==null?void 0:f());if(i_e(U.relatedTarget,b.context.triggerElements))return;if(S.current&&J){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=S.current({...J,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function H(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Di(L,"mouseout",H):void 0;return l?yh(Di(L,"mousemove",F,{once:!0}),Di(L,"mouseenter",F),Di(L,"mouseleave",M),q):yh(Di(L,"mouseenter",F),Di(L,"mouseleave",M),q)},[P,I,v,O,b,n,S,x,d,N,R,s,l,A,c,w,E,f,T,C,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var J,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,H=b.select("domReferenceElement"),q=b.select("open"),U=N(H,M,L.target);if(s&&!sw(x.pointerType))return;if(q&&U&&((J=x.handleCloseOptions)!=null&&J.blockPointerEvents)){const X=b.select("floatingElement");if(X){const le=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;wje(x,{scopeElement:le,referenceElement:M,floatingElement:X})}}const Z=TJ(A.current);if(q&&!U||Z===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const X=b.select("open");!x.blockMouseMove&&(!X||U)&&C()&&b.setOpen(!0,pa(vu,F,M))}x.pointerType==="touch"?vi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(Z,z))}}},[n,x,R,N,s,b,A,C])}const qJ=.1,gst=qJ*qJ,Kr=.5;function n_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function i_(e,t,n,i,r,s,o,l,c,u){let d=!1;return n_(e,t,n,i,r,s)&&(d=!d),n_(e,t,r,s,o,l)&&(d=!d),n_(e,t,o,l,c,u)&&(d=!d),n_(e,t,c,u,n,i)&&(d=!d),d}function bst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function r_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function yst(e={}){const{blockPointerEvents:t=!1}=e,n=new Qu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const k=performance.now(),S=k-b;if(m===null||g===null||S===0)return m=w,g=x,b=k,!1;const O=w-m,A=x-g,E=O*O+A*A,j=S*S*gst;return m=w,g=x,b=k,E0)}function N(){C()||y()}if(C())return;const P=k.getBoundingClientRect(),I=S.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,H=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let Z=!1;switch(f){case"top":Z=r_(O,A,M,P.top+1,H,I.bottom-1);break;case"bottom":Z=r_(O,A,M,I.top+1,H,P.bottom-1);break;case"left":Z=r_(O,A,I.right-1,U,P.left+1,q);break;case"right":Z=r_(O,A,P.right-1,U,I.left+1,q);break}if(Z)return;if(h&&!bst(O,A,P)){N();return}if(!j&&v(O,A)){N();return}let z=!1;switch(f){case"top":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s+Kr+1,le=D||L?I.bottom-Kr:I.top,V=D?L?I.bottom-Kr:I.top:I.bottom-Kr;z=i_(O,A,ne,X,W,X,I.left,le,I.right,V);break}case"bottom":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s-Kr,le=D||L?I.top+Kr:I.bottom,V=D?L?I.top+Kr:I.bottom:I.top+Kr;z=i_(O,A,ne,X,W,X,I.left,le,I.right,V);break}case"left":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r+Kr+1,le=_||F?I.right-Kr:I.left,V=_?F?I.right-Kr:I.left:I.right-Kr;z=i_(O,A,le,I.top,V,I.bottom,X,ne,X,W);break}case"right":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r-Kr,le=_||F?I.left+Kr:I.right,V=_?F?I.left+Kr:I.right:I.left+Kr;z=i_(O,A,X,ne,X,W,le,I.top,V,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const vst=p.createContext(void 0);function xst(){const e=p.useContext(vst);return(e==null?void 0:e.direction)??"ltr"}const wst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Eh(e,t)||{};if(u==null)return{};const h=Zz(d),m={x:n,y:i},g=HD(r),b=VD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-m[g]-s.floating[b],O=m[g]-s.reference[g],A=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[k]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,A)))&&(E=l.floating[k]||s.floating[b]);const j=S/2-O/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),C=Math.min(h[x],T),N=R,P=E-v[b]-C,I=E/2-v[b]/2+j,D=Xz(N,I,P),_=!c.arrow&&mm(r)!=null&&I!==D&&s.reference[b]/2-(I({...wst(e),options:[e,t]}),Ost={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,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},Sst={sideX:"left",sideY:"top"},WJ="--available-width",KJ="--available-height";function Oje(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 GJ(e,t,n){const{rects:i,placement:r}=e;return{side:Oje(t,kd(r),n),align:mm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Est(e){return Cst(e,dst)}function Cst(e,t){var qe,yt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="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:k,lazyFlip:S=!1,externalTree:O}=e,[A,E]=p.useState(null);!v&&A!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",C=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=oi(P),D=P?I:n,_=Gl(n),L=Gl(v),M=xst()==="rtl",H=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?H:`${H}-${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 Z=1,z=r==="bottom"?Z:0,J=r==="top"?Z:0,ne=r==="right"?Z:0,W=r==="left"?Z:0,X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},le=p.useRef(null),V=Gl(s),Y=Gl(l),K=typeof s!="function"?s:0,ue=typeof l!="function"?l:0,te=[];m&&te.push(m),te.push(eje(je=>{const kt=GJ(je,r,M),Tt=typeof V.current=="function"?V.current(kt):V.current,fn=typeof Y.current=="function"?Y.current(kt):Y.current;return{mainAxis:Tt,crossAxis:fn,alignmentAxis:fn}},[K,ue,M,r]));const Oe=T==="none"&&j!=="shift",fe=!Oe&&(d||C||j==="shift"),pe=j==="none"?null:ije({...X,padding:{top:U.top+Z+z,right:U.right+Z+W,bottom:U.bottom+Z+J,left:U.left+Z+ne},mainAxis:!C&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),Se=Oe?null:tje({...X,rootBoundary:N,mainAxis:T!=="none",crossAxis:fe,limiter:d||C?void 0:nje(je=>{if(!le.current)return{};const{width:kt,height:Tt}=le.current.getBoundingClientRect(),fn=pd(kd(je.placement)),tn=fn==="y"?kt:Tt,We=fn==="y"?U.left+U.right:U.top+U.bottom;return{offset:tn/2+We/2}})},[X,d,C,N,U,T]);j==="shift"||T==="shift"||o==="center"?te.push(Se,pe):te.push(pe,Se),te.push(rje({...X,apply({elements:{floating:je},availableWidth:kt,availableHeight:Tt,rects:fn}){if(!L.current)return;const tn=je.style;tn.setProperty(WJ,`${kt}px`),tn.setProperty(KJ,`${Tt}px`);const We=ea(je).devicePixelRatio||1,{x:vt,y:Ke,width:ot,height:it}=fn.reference,tt=(Math.round((vt+ot)*We)-Math.round(vt*We))/We,Ct=(Math.round((Ke+it)*We)-Math.round(Ke*We))/We;tn.setProperty("--anchor-width",`${tt}px`),tn.setProperty("--anchor-height",`${Ct}px`)}}),kst(je=>({element:le.current||Cr(je.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(je){var Je,lt,hn;const{elements:kt,middlewareData:Tt,placement:fn,rects:tn,y:We}=je,vt=kd(fn),Ke=pd(vt),ot=le.current,it=((Je=Tt.arrow)==null?void 0:Je.x)||0,tt=((lt=Tt.arrow)==null?void 0:lt.y)||0,Ct=(ot==null?void 0:ot.clientWidth)||0,Ot=(ot==null?void 0:ot.clientHeight)||0,Bt=it+Ct/2,Dt=tt+Ot/2,Ze=Math.abs(((hn=Tt.shift)==null?void 0:hn.y)||0),bt=tn.reference.height/2,gt=typeof s=="function"?s(GJ(je,r,M)):s,an=Ze>gt,Ft={top:`${Bt}px calc(100% + ${gt}px)`,bottom:`${Bt}px ${-gt}px`,left:`calc(100% + ${gt}px) ${Dt}px`,right:`${-gt}px ${Dt}px`}[vt],cn=`${Bt}px ${tn.reference.y+bt-We}px`;return kt.floating.style.setProperty("--transform-origin",fe&&Ke==="y"&&an?cn:Ft),{}}},Ost,k),ti(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const ve=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Le,elements:He,x:Ge,y:De,middlewareData:se,update:ce,placement:ye,context:Ae,isPositioned:Ee,floatingStyles:Ce}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:te,strategy:i,whileElementsMounted:g?void 0:(...je)=>aB(...je,ve),nodeId:x,externalTree:O}),{sideX:Be,sideY:he}=se.adaptiveOrigin||Sst,ie=Ee?i:"fixed",we=p.useMemo(()=>{let je;return Ee?k?je={position:ie,[Be]:Ge,[he]:De}:je={...Ce,position:ie}:je={position:ie,top:0,left:0},je[WJ]="100vw",je[KJ]="100vh",Ee||(je.opacity=0),je},[k,ie,Be,Ge,he,De,Ce,Ee]),Re=p.useRef(null);ti(()=>{if(!v)return;const je=_.current,kt=typeof je=="function"?je():je,fn=(XJ(kt)?kt.current:kt)||null||null;fn!==Re.current&&(Le.setPositionReference(fn),Re.current=fn)},[v,Le,D,_]),p.useEffect(()=>{if(!v)return;const je=_.current;typeof je!="function"&&XJ(je)&&je.current!==Re.current&&(Le.setPositionReference(je.current),Re.current=je.current)},[v,Le,D,_]),p.useEffect(()=>{if(g&&v&&He.reference&&He.floating)return aB(He.reference,He.floating,ce,ve)},[g,v,He,ce,ve]);const Ue=kd(ye),_t=Oje(r,Ue,M),Pt=mm(ye)||"center",Gt=!!((qe=se.hide)!=null&&qe.referenceHidden);ti(()=>{S&&v&&Ee&&Ue!==H&&E(Ue)},[S,v,Ee,Ue,H]);const St=p.useMemo(()=>{var je,kt;return{position:"absolute",top:(je=se.arrow)==null?void 0:je.y,left:(kt=se.arrow)==null?void 0:kt.x}},[se.arrow]),Lt=((yt=se.arrow)==null?void 0:yt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:we,arrowStyles:St,arrowRef:le,arrowUncentered:Lt,side:_t,align:Pt,physicalSide:Ue,anchorHidden:Gt,refs:Le,context:Ae,isPositioned:Ee,update:ce}),[we,St,le,Lt,_t,Pt,Ue,Gt,Le,Ae,Ee,ce])}function XJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Ast={"data-popup-open":""},Tst={"data-popup-open":"","data-pressed":""},_st={"data-open":""},jst={"data-closed":""},Nst={"data-anchor-hidden":""},Sje={open(e){return e?Ast:null}},Rst={open(e){return e?Tst:null}},hV={open(e){return e?_st:jst},anchorHidden(e){return e?Nst:null}},Eje={...hV,...qD};function Cje(e){return e==="starting"?Lit:Jl}function Ist(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Da("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Cje(i),r],stateAttributesMapping:hV})}function Aje(){const e=Qz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function gf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,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}),k=p.useRef(null),S=p.useRef(null),O=i&&e!=="horizontal",A=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>k.current,[]),p.useEffect(()=>()=>{var T;(T=S.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=k.current;if(!O||!T)return;const R=T.scrollHeight-T.clientHeight,C=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===C&&P.bottom===N?P:{top:C,bottom:N})},[O]);p.useEffect(()=>{const T=k.current;if(!O||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const C of T.children)R.observe(C);return E(),()=>R.disconnect()},[O,A,E]);async function j(){if(!u||!c||S.current)return;const T=new AbortController;S.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),S.current===T&&(S.current=null)}}return a.jsxs("div",{...m,ref:k,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":O&&(w.top||w.bottom)||void 0,"data-fade-top":O&&w.top||void 0,"data-fade-bottom":O&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(av,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Pst(){const{add:e,close:t}=Aje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Dst({position:e,label:t}){const{toasts:n,close:i}=Aje();return a.jsx(art,{children:a.jsx(Rit,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(gf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(Git,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(lnt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Jit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Zit,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Mst({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(mit,{timeout:t,limit:3,children:[e,a.jsx(Dst,{position:n,label:i})]})}function Lst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=_e("sandbox"),l=Pst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,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 k=(A,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:A,error:E})},S=A=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||A.sessionId===T){E.dismiss(A.runId),g.delete(A.runId);return}b.has(A.runId)||g.get(A.runId)===A.state||(g.set(A.runId,A.state),E.add({id:A.runId,duration:0,title:j(`taskNotice.${A.state}`),description:A.message.slice(0,80),variant:A.state==="succeeded"?"success":A.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(A.runId),action:a.jsx(ki,{variant:"secondary",onClick:()=>{R(A.sessionId,h.signal).catch(C=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:C instanceof Error?C.message:String(C)})})},children:j("taskNotice.open")})}))}},O=async(A=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,A&&k(!0);try{const E=await Yd.active(h.signal);if(h.signal.aborted)return;w=E,k(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!yu(T)){let R;try{R=await Yd.get(T.runId,h.signal)}catch(C){if(C instanceof Yw&&C.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw C}if(h.signal.aborted)return;m.set(R.runId,R),S(R)}for(const T of E)m.set(T.runId,T),S(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Yw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),k(!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(O,3e3))}}};return d.current=()=>{O(!0)},k(!0),O(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function $st(e){const{t}=_e("sandbox");return a.jsx(Mst,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Lst,{...e},e.ownerId)})}const hC=["super_admin","admin","developer","user"];class pC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Tje(e){let t;try{t=await e.json()}catch{throw new pC("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 pC(n,e.status)}return t}function _je(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&&hC.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 Fst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Tje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(_je)||!("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 pC("invalid_response",502);return n}async function Bst(e,t,n){const i=await Tje(await yn(`/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)||!_je(i.user))throw new pC("invalid_response",502);return i.user}function Ust(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Qst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function bf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,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),k=p.useRef(null),S=p.useRef(null),O=p.useRef([]),[A,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),C=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!A)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[A,f,o,N]),p.useEffect(()=>{var L,F;if(A){if(N){(L=k.current)==null||L.focus();return}(F=O.current[j])==null||F.focus()}},[A,N]),p.useEffect(()=>{var L;!A||N&&document.activeElement===k.current||(L=O.current[j])==null||L.focus()},[j,A,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!A||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=S.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,A,r.length]);const I=(L=1)=>{const F=r.findIndex(H=>H.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,H;const F=L.target===k.current;if(L.key==="Escape"&&A){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(H=O.current[0])==null||H.focus());return}L.key==="ArrowDown"?(L.preventDefault(),A?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),A?D(j-1):I(-1)):A&&L.key==="Home"?(L.preventDefault(),T(0)):A&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":A,"aria-controls":A?y:void 0,disabled:s,onClick:()=>{A?P():I()},children:[a.jsx("span",{className:C?void 0:"is-placeholder",children:C??i}),a.jsx(Ust,{className:`pp-deployment-select-chevron${A?" is-open":""}`})]}),A&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:k,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.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 F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:H=>{O.current[F]=H},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` +`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Qst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function XD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function on({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.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`},...o,children:r})}function zst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function jje(e){return e instanceof pC?e.code:"request_failed"}function Vst({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=_e("users"),s=p.useRef(null),o=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=o.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;o.current=v,h(!0),g("");try{const y=await Bst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${jje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(bf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:hC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=hC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.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 Hst({onBack:e}){const{t,i18n:n}=_e("users"),[i,r]=p.useState(null),[s,o]=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,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(null);p.useEffect(()=>{const C=new AbortController;return o(!0),c(""),Fst({page:b,query:f,role:m,signal:C.signal}).then(N=>{if(!C.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{C.signal.aborted||c(jje(N))}).finally(()=>{C.signal.aborted||o(!1)}),()=>C.abort()},[b,f,m,y]);const j=C=>{C.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=C=>{if(!C)return t("neverLoggedIn");const N=Number(C),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:C);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(XD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.nativeEvent.isComposing||C.keyCode===229)&&C.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(bf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...hC.map(C=>({value:C,label:t(`roles.${C}`)}))],onChange:C=>{const N=hC.find(P=>P===C);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{O(null),w(C=>C+1)},children:[a.jsx(zst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(on,{children:t("loading")}):S?a.jsx("span",{children:t("saved",{name:S.name,role:t(`roles.${S.role}`)})}):A?a.jsx("span",{children:t("updatedAt",{time:A.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(C=>C+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(C=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(C.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[C.name,C.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:C.email||C.id,children:C.email||C.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${C.role==="super_admin"?" is-super":""}`,children:t(`roles.${C.role}`)}),C.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${C.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(C.lastLogin)}),a.jsx("td",{className:"users-actions",children:C.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||C.currentUser,onClick:()=>{O(null),k(C)},children:t("changeRole")})})]},C.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(on,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(C=>C-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(C=>C+1),children:t("next")})]})]}):null]}),x?a.jsx(Vst,{user:x,onClose:()=>k(null),onSaved:C=>{k(null),O(C),w(N=>N+1)}}):null]})}const Nje=p.createContext(null);function qst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Wst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=_e("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await hTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Kst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),YD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),s_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Yst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),mC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.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"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Ije=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.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"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),aat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),lat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Pje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),cat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),uat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),dat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"}),a.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"})]}),YJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Dje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Mje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),bat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),mN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),yat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),vat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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"})}),Lje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.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"}),a.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"})]}),mV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.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 vat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dje=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + */const xat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$je=(...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 xat={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 wat={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 wat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...xat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Dje("lucide",r),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + */const kat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...wat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:$je("lucide",r),...l},[...o.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 An=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(wat,{ref:s,iconNode:t,className:Dje(`lucide-${vat(e)}`,i),...r}));return n.displayName=`${e}`,n};/** + */const Cn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(kat,{ref:s,iconNode:t,className:$je(`lucide-${xat(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 Mje=An("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const Fje=Cn("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 Oat=An("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 Oat=Cn("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 iE=An("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const sE=Cn("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 kat=An("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Sat=Cn("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 Lje=An("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 Bje=Cn("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 $je=An("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 Uje=Cn("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 Sat=An("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 Eat=Cn("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 Eat=An("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 Cat=Cn("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 Cf=An("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Of=Cn("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 Cat=An("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Aat=Cn("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 Aat=An("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const Tat=Cn("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 qA=An("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const GA=Cn("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 bN=An("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 gN=Cn("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 Tat=An("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const _at=Cn("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 lB=An("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 oB=Cn("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 _at=An("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const jat=Cn("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 jat=An("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 Nat=Cn("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 eM=An("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 ZD=Cn("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 Nat=An("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const Rat=Cn("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 Rat=An("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 Iat=Cn("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 yN=An("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 bN=Cn("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 tM=An("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 JD=Cn("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 GJ=An("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 ZJ=Cn("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 m0=An("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 uv=Cn("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 Iat=An("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 Pat=Cn("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 Pat=An("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 Dat=Cn("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 Dat=An("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 Mat=Cn("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 gV=An("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 gV=Cn("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 Mat=An("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 Lat=Cn("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 Fje=An("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 Qje=Cn("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 Lat=An("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 $at=Cn("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 $at=An("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 Fat=Cn("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 bV=An("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 bV=Cn("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 Fat=An("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 Bat=Cn("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 Bat=An("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 Uat=Cn("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 Uat=An("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 Qat=Cn("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 nM=An("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 eM=Cn("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 yV=An("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 yV=Cn("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 mm=An("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 gm=Cn("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 Bje=An("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 zje=Cn("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 Qat=An("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 zat=Cn("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 Bi=An("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Vi=Cn("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 zat=An("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 Vat=Cn("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 Vat=An("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 Hat=Cn("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 rE=An("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 aE=Cn("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 Hat=An("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const qat=Cn("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 Uje=An("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 Vje=Cn("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 qat=An("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 Wat=Cn("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 Wat=An("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + */const Kat=Cn("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kat=An("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 Gat=Cn("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 Qje=An("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const Hje=Cn("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 ic=An("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const ec=Cn("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 Gat=An("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 Xat=Cn("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 zje=An("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 qje=Cn("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 Xat=An("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 Yat=Cn("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 fI=An("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const dI=Cn("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 Yat=An("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 Zat=Cn("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 XJ=An("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 JJ=Cn("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 pC=An("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 gC=Cn("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 Zat=An("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 Jat=Cn("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 eb=An("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 Yg=Cn("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 Jat=An("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 eot=Cn("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 eot=An("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 tot=Cn("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 Do=An("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),YJ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),sE=Object.freeze({modelName:"",current:YJ,cumulative:YJ}),tot={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},not=24,iot=64,rot=16;function o_(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),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function sot(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=o_(t),s=n.reduce((d,f)=>d+iot+o_(f),0),o=i.reduce((d,f)=>d+rot+o_(f.name)+o_(f.description??""),0);return not+r+s+o}function aot({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),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function oot(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 o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*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:o,slices:u}})}function fk(e,t){const n=e,i=n[t]??n[tot[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function lot(e){const t=fk(e,"promptTokenCount"),n=fk(e,"candidatesTokenCount"),i=fk(e,"thoughtsTokenCount");return{totalTokenCount:fk(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:fk(e,"cachedContentTokenCount")}}function cot(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 vV(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 o=lot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:cot(e.cumulative,o)}}function ZJ(e){return e.reduce((t,n)=>vV(t,n),sE)}function JJ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function uot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function dot(e,t){if(!t)return e;const n=new Set(e.filter(r=>uot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function g0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function bg(e){return typeof e=="string"?e:""}function Vje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function fot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=g0(t)??{};return g0(n.result)??n}function hot(e){var n;const t=(n=g0(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return bg((r=g0(i))==null?void 0:r.label)}):[]}function Hje(e,t,n){const i=hot(e),r=fot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=g0(s[c])??{};return{label:bg(u.label)||i[c]||`方向 ${c+1}`,content:bg(u.content),status:Vje(u.status,o),error:bg(u.error)}})}}function pot(e){const t=g0(e),n=g0(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:bg(n.requestId),branchIndex:n.branchIndex,label:bg(n.label),delta:bg(n.delta),status:Vje(n.status,"running"),error:bg(n.error)||void 0}}function mot(e,t,n){return{branches:Hje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ko(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const qje=28e4;function eee(e){try{return JSON.stringify(e).length}catch{return qje}}function got(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+eee(r),0);for(;t.length>1&&n>qje;)n-=eee(t.shift());return t}function Ou(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ji(e){return typeof e=="string"?e:""}function xV(e,t=""){const n=Ji(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function Wje(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 Kje(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=Ji(e.command),n=Ji(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 my(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 Gje(e){const t=Ji(e.id||e.itemId||e.item_id),n=Ji(e.kind);if(!t||!n)return null;const i=xV(e.status),r=Ji(e.text||e.detail||e.delta),s=!Ji(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",thoughtKind:n==="reasoning"?"reasoning":"thought"},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 o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ji(e.title)||Ko("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=Ou(l),u=Ji(c==null?void 0:c.text);if(!u)return[];const d=Ji(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 o=Ko(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Kje(e),c=Wje(e)??(n==="status"&&r||void 0);return{id:t,block:my(Ji(e.name||e.title)||o,t,i,l,c)}}return null}function Xje(e){const t=Ji(e.type),n=Ou(e.item),i=Ji(n==null?void 0:n.type),r=Ji((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=xV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=Ji(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...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=Ou(c),d=Ji(u==null?void 0:u.text);if(!d)return[];const f=Ji(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:Ko("planTitle"),summary:Ko("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Ko(`command.${s}`);return{id:r,block:my(o,r,s,Kje(n??{}),Wje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Ko("projectFiles",{count:o.length}):Ko("projectFile"),c=Ko(`fileChange.${s}`,{subject:l});return{id:r,block:my(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[Ji(n==null?void 0:n.server),Ji(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ko("externalTool"),l=Ko(`mcp.${s}`,{tool:o}),c=Ou(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ji(c==null?void 0:c.message)||void 0;return{id:r,block:my(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=Ji(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Ko(`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:my(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Ko(`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:my(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=Ou(e.error),l=Ji((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Ko("errorDetail");return{id:r,block:my(Ko("errorTitle"),r,"failed",void 0,l)}}return null}function bot(e){const t=Ou(e),n=Ou(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ji(n.toolName),r=Ji(n.requestId);if(!i||!r)return null;const s=Ou(n.event??n.activity);if(!s)return null;const o=Ou(s.item)||Ji(s.type)?Xje(s):Gje(s);if(!o)return null;const l=Ji(n.title||n.label),c=Ji(s.agentSessionId??s.agent_session_id),u=Ji(s.sandboxSessionId??s.sandbox_session_id),d=Ji(s.threadId??s.thread_id),f=xV(s.status,Ji(s.type)),m=Ji(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:o}}function yot(e,t){const n=Ou(t),i=Ou((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ji(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ji(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=Ji(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ji(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...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=Ou(d);if(!f)continue;const h=Ou(f.item)||Ji(f.type)?Xje(f):Gje(f);h&&(h.finalAnswer||(c=cB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function cB(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:got(n)}}const uB="send_a2ui_json_to_client",dB="validated_a2ui_json",vN="adk_request_credential",z3="transfer_to_agent";function vot(e){var i,r,s,o;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)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function fB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const xot=2048;function tee(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=cB(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=cB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function wot(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 nee(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 mC=e=>e.functionCall??e.function_call,tb=e=>e.functionResponse??e.function_response;function q1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Oot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function ag(e,t){const n=e[t];return typeof n=="string"?n:""}function Yje(e){return Oot(q1(e),"mpa")}function wV(e){const t=q1(e),n=Yje(e);return ag(t,"eventType")||ag(t,"event_type")||ag(n,"eventType")||ag(n,"event_type")||ag(n,"kind")}function ow(e){const t=q1(e),n=Yje(e);return ag(t,"source")==="sandbox"||ag(n,"source")==="sandbox"}function Zje(e){const t=wV(e);return t==="usage.updated"||t==="usage"}function hI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=tb(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function iee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function kot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function ree(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Sot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function Eot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Cot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function WA(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 o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.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 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:Cot(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 Xy(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 Aot=new Set(["llm","sequential","parallel","loop","a2a"]);function Tot(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 o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Aot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function _ot(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 jot(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 V3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function H3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function hk(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Jje(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(Zje(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(hI(t))return iee(i),hk(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=pot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=bot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const O=i[x];if(!(O.kind!=="tool"||O.done||O.name!==w.toolName||w.requestId&&O.callId&&O.callId!==w.requestId)){O.response=mot(O.args,O.response,w),O.status="running";break}}for(const w of c)tee(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>mC(w)||tb(w));if(t.partial&&!u){for(const w of o){const x=Xy(w),O=n.mpaA2a&&w.thought?ag(q1(t),"reasoningSegmentId"):"";if(O&&typeof x=="string"&&x){const k=i.find(S=>S.kind==="thinking"&&S.reasoningSegmentId===O);(k==null?void 0:k.kind)==="thinking"?k.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:H3(t),reasoningSegmentId:O});continue}typeof x=="string"&&x&&V3(i,w.thought?"thinking":"text",x,w.thought?H3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Xy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=mC(w),O=tb(w),k=WA([w]),S=Xy(w);if(typeof S=="string"&&S)V3(i,w.thought?"thinking":"text",S,w.thought?H3(t):void 0);else if(k.length)hk(i),_ot(i,k);else if(x)if(hk(i),x.name===z3){const E=Eot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:E,done:!1})}else{if(x.name==="sandbox_task"&&ow(t))continue;if(x.name===vN){const E=x.args??{},C=E.authConfig??E.auth_config??E,T=String(E.functionCallId??E.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:vot(C),authConfig:C,done:!1})}else{const E=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((E==null?void 0:E.kind)==="tool"){E.name=x.name??E.name,E.args=x.args??E.args,E.response===void 0&&(E.done=!1,E.status="running");continue}const C={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(C),C.callId){const j=[];for(const T of s)T.toolName===C.name&&T.requestId===C.callId?tee(i,T):j.push(T);s=j}}}else if(O){if(hk(i),O.name===z3)for(let C=i.length-1;C>=0;C--){const j=i[C];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(O.name===vN)for(let C=i.length-1;C>=0;C--){const j=i[C];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let E=!1;for(let C=i.length-1;C>=0;C--){const j=i[C],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||O.id&&j.callId===O.id)&&(O.id&&j.callId&&j.callId===O.id||(!O.id||!j.callId)&&kot(j.name,O.name??""))){const R=T?nee(j.response):"",A=ree(O.response,t.partial===!0);if(j.done=A.done,j.response=O.response,j.status=A.status,T){j.codexActivity=yot(j.codexActivity,O.response),j.status=A.status==="running"?"running":wot(O.response);const N=nee(O.response);N&&N!==R&&V3(i,"text",N)}E=!0;break}}if(!E&&O.name!==z3&&O.name!==vN&&O.name!==uB){const C=ree(O.response,t.partial===!0);i.push({kind:"tool",name:O.name??"",callId:O.id,response:O.response,done:C.done,status:C.status})}if(O.name===uB){const C=((b=O.response)==null?void 0:b[dB])??[];if(C.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...C):i.push({kind:"a2ui",messages:C})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&jot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),ow(t)&&wV(t)==="invocation.completed"&&iee(i),hk(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function Not(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(hI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Xy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||WA([b]).length>0}),r=n.some(b=>{var y;const v=tb(b);return(v==null?void 0:v.name)===uB&&Array.isArray((y=v.response)==null?void 0:y[dB])&&v.response[dB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(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||o||l&&c}function eNe(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function see(e){var n,i,r;if(eNe(e))return!0;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=>!!(Xy(s)||WA([s]).length>0||mC(s)||tb(s)))}function Rot(e,t){var o;const n=q1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||ow(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!mC(l)&&!tb(l)&&WA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Iot(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Pot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>mC(i)||tb(i))}function xN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=vV(sE,v).current.totalTokenCount;if(!y)return!1;const w=q1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=fB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,A,N;if(Pot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!see(v)&&!((A=(R=v.content)==null?void 0:R.parts)!=null&&A.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(Zje(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>xot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let O=ow(v)?"":w,k=f(O,x),S=r.get(k);if(!S&&ow(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(k=P[0],S=P[1],O=S.meta.author??"")}if(!S&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===O)&&(r.delete(l),l=void 0,S=P)}if(!S&&hI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S&&!see(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S){const P=`${e}-${i++}`;S={acc:fB(),localId:P,meta:{author:O||void 0,invocationId:x||void 0}}}S.acc=Jje(n.mpaA2a?Rot(S.acc,v):S.acc,v,n);const E=v.usageMetadata??v.usage_metadata,C=Not(v,S.acc.blocks);S.meta={...S.meta,author:O||S.meta.author,localId:S.localId,streaming:!C,a2aStatus:eNe(v),tokens:(E==null?void 0:E.totalTokenCount)||S.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:ow(v)&&wV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Xy(P)??"").join("").trim()||void 0:S.meta.mpaFinalAnswer}:{},ts:v.timestamp||S.meta.ts,invocationId:x||S.meta.invocationId,eventId:C&&v.id?v.id:S.meta.eventId};const j={role:"assistant",blocks:S.acc.blocks,meta:S.meta},T=C&&hI(v);return C&&!T?(r.delete(k),l=void 0):r.set(k,S),n.mpaA2a&&(c=j),{turn:j,completed:C}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function _y(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function aee(e,t={},n={}){var l;let i=[],r=0;const s=()=>xN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=tb(b))==null?void 0:v.name)===vN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Xy).filter(b=>!!b).join(""),h=WA(d),m=Tot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=_y(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=_y(i,d.turn))}for(const c of o.finish())i=_y(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function iM(e,t=bn.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(o=>o.text).find(Boolean);if(s)return s}return t}function Dot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Mot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Dot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function tNe(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=tNe(i,t,e);if(r)return r}}function Lot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=tNe(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 $ot(e,t){const n=[];return e.forEach((i,r)=>{const s=Lot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.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 Fot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var k;return(k=O.meta)!=null&&k.mpaFinalAnswer?[O.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(O=>{var S;const k=O.blocks.filter(E=>E.kind==="text").map(E=>E.text).join("").trim();return!((S=O.meta)!=null&&S.mpaFinalAnswer)&&k&&h.has(k)?{...O,blocks:O.blocks.filter(E=>E.kind!=="text")}:O}),g=[...m].reverse().find(O=>O.blocks.some(k=>k.kind==="text"&&k.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(O=>{var k;return(k=O.meta)==null?void 0:k.mpaUsage});for(const O of f){for(const[S,E]of Object.entries(((r=O.meta)==null?void 0:r.mpaUsage)??{}))b[S]=Math.max(b[S]??0,E);const k=(s=O.meta)==null?void 0:s.tokens;if(typeof k=="number"&&Number.isFinite(k)&&k>=0){const S=((o=O.meta)==null?void 0:o.invocationId)||"unidentified";v.set(S,Math.max(v.get(S)??0,k))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(O=>{var k;return(k=O.meta)!=null&&k.ts?[O.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(O=>O.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(O=>{var k;return((k=O.meta)==null?void 0:k.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((O,k)=>O+k,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function Bot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.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 nNe(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},OV=e=>{const t=Uot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,OV(s)):r}return i})},Qot="_Badge_1viyg_1",zot={Badge:Qot},Ya=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:Qi(zot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:OV(e)});var Vot=typeof ug=="object"&&ug&&ug.Object===Object&&ug,Hot=typeof self=="object"&&self&&self.Object===Object&&self;Vot||Hot||Function("return this")();var qot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Wot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var oee={width:void 0,height:void 0};function iNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(oee),o=Wot(),l=p.useRef({...oee}),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=lee(d,f,"inlineSize"),m=lee(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):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function lee(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 kV(e,t){const n=p.useRef(e);qot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const Kot={DEV:!1,MODE:"production"},lw=typeof import.meta<"u"?Kot:void 0,Got=!!(lw!=null&&lw.DEV),Xot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",rNe=(lw==null?void 0:lw.MODE)==="test"||Xot,Yot=typeof window<"u",sNe=typeof document<"u",Zot=Yot&&sNe,SV=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())},pI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Zot||typeof window.requestAnimationFrame!="function"||sNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},V0=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),q3=e=>typeof e=="number"?`${e}deg`:e,W3=e=>String(e),l_=e=>`${e}ms`,K3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${q3(i)})`,r==null?null:`skewX(${q3(r)})`,s==null?null:`skewY(${q3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},G3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Mp=e=>{e.preventDefault()},aNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Jot="_LoadingIndicator_7yl6f_1",elt={LoadingIndicator:Jot},KA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:Qi(elt.LoadingIndicator,e),style:i||V0({"indicator-size":t,"indicator-stroke":n})});var tlt=Object.defineProperty,EV=(e,t)=>tlt(e,"name",{value:t,configurable:!0});function hB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}EV(hB,"setRef");function oNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=hB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rnlt(e,"name",{value:t,configurable:!0});function Xp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];pB(r)&&typeof c_=="function"&&(r=c_(r._payload)),p.Children.forEach(r,h=>{var m;if(hNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;pB(b)&&typeof c_=="function"&&(b=c_(b._payload)),o=ilt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?fNe(o):void 0,d=_r(i,u);if(!o){if(r||r===0)throw new Error(l?alt(e):slt(e));return r}const f=dNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Af(Xp,"createSlot");var lNe=Xp("Slot"),cNe=Symbol.for("radix.slottable");function uNe(e){const t=Af(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=cNe,t}Af(uNe,"createSlottable");var ilt=Af((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 dNe(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}}Af(dNe,"mergeProps");function fNe(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)}Af(fNe,"getElementRef");function hNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cNe}Af(hNe,"isSlottable");var rlt=Symbol.for("react.lazy");function pB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rlt&&"_payload"in e&&pNe(e._payload)}Af(pB,"isLazyComponent");function pNe(e){return typeof e=="object"&&e!==null&&"then"in e}Af(pNe,"isPromiseLike");var slt=Af(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),alt=Af(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),c_=P0[" use ".trim().toString()],olt=Object.defineProperty,llt=(e,t)=>olt(e,"name",{value:t,configurable:!0}),clt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xr=clt.reduce((e,t)=>{const n=Xp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function CV(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}llt(CV,"dispatchDiscreteCustomEvent");var ult=Object.defineProperty,dlt=(e,t)=>ult(e,"name",{value:t,configurable:!0}),flt=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"}),hlt=p.forwardRef(dlt(function(t,n){return a.jsx(Xr.span,{...t,ref:n,style:{...flt,...t.style}})},"VisuallyHidden")),plt=hlt,mlt=Object.defineProperty,ld=(e,t)=>mlt(e,"name",{value:t,configurable:!0});function glt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ld(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,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 ld(r,"useContext"),[i,r]}ld(glt,"createContext");function qc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ld(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 a.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(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ld(d,"useContext"),[u,d]}ld(i,"createContext");const r=ld(()=>{const s=n.map(o=>p.createContext(o));return ld(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,mNe(r,...t)]}ld(qc,"createContextScope");function mNe(...e){const t=e[0];if(e.length===1)return t;const n=ld(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ld(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ld(mNe,"composeContextScopes");var blt=Object.defineProperty,To=(e,t)=>blt(e,"name",{value:t,configurable:!0});function AV(e){const t=e+"CollectionProvider",[n,i]=qc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=To(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Xp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=_r(v,x.collectionRef);return a.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Xp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),k=_r(v,O),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(O,{ref:O,...x}),()=>void S.itemMap.delete(O))),a.jsx(h,{[f]:"",ref:k,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((S,E)=>x.indexOf(S.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return To(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}To(AV,"createCollection");var cee=new WeakMap,Va,pu,X3=(pu=class extends Map{constructor(n){super(n);DG(this,Va);O5(this,Va,[...super.keys()]),cee.set(this,!0)}set(n,i){return cee.get(this)&&(this.has(n)?kl(this,Va)[kl(this,Va).indexOf(n)]=n:kl(this,Va).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Va).length,l=TV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-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=[...kl(this,Va)];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 o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new pu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new pu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new pu(i)}toReversed(){const n=new pu;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 pu(i)}slice(n,i){const r=new pu;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 o=n;o<=s;o++){const l=this.keyAt(o),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}},Va=new WeakMap,To(pu,"OrderedDict"),pu);function wN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=gNe(e,t);return n===-1?void 0:e[n]}To(wN,"at");function gNe(e,t){const n=e.length,i=TV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}To(gNe,"toSafeIndex");function TV(e){return e!==e||e===0?0:Math.trunc(e)}To(TV,"toSafeInteger");function ylt(e){const t=e+"CollectionProvider",[n,i]=qc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new X3,setItemMap:To(()=>{},"setItemMap")}),o=To(({state:x,...O})=>x?a.jsx(c,{...O,state:x}):a.jsx(l,{...O}),"CollectionProvider");o.displayName=t;const l=To(x=>{const O=v();return a.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=To(x=>{const{scope:O,children:k,state:S}=x,E=p.useRef(null),[C,j]=p.useState(null),T=_r(E,j),[R,A]=S;return p.useEffect(()=>{if(!C)return;const N=vNe(()=>{});return N.observe(C,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[C]),a.jsx(r,{scope:O,itemMap:R,setItemMap:A,collectionRef:T,collectionRefObject:E,collectionElement:C,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Xp(u),f=p.forwardRef((x,O)=>{const{scope:k,children:S}=x,E=s(u,k),C=_r(O,E.collectionRef);return a.jsx(d,{ref:C,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Xp(h),b=p.forwardRef((x,O)=>{const{scope:k,children:S,...E}=x,C=p.useRef(null),[j,T]=p.useState(null),R=_r(O,C,T),A=s(h,k),{setItemMap:N}=A,P=p.useRef(E);bNe(P.current,E)||(P.current=E);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(mB):(_.set(j,{...D,element:j}),_.toSorted(mB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new X3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:S})});b.displayName=h;function v(){return p.useState(new X3)}To(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return To(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}To(ylt,"createCollection");function bNe(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}To(bNe,"shallowEqual");function yNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}To(yNe,"isElementPreceding");function mB(e,t){return!e[1].element||!t[1].element?0:yNe(e[1].element,t[1].element)?-1:1}To(mB,"sortByDocumentPosition");function vNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}To(vNe,"getChildListObserver");var vlt=Object.defineProperty,W1=(e,t)=>vlt(e,"name",{value:t,configurable:!0}),xNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qn(e,t,{checkForDefaultPrevented:n=!0}={}){return W1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}W1(Qn,"composeEventHandlers");function xlt(e){var t;if(!xNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}W1(xlt,"getOwnerWindow");function gB(e){if(!xNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}W1(gB,"getOwnerDocument");function wNe(e,t=!1){const{activeElement:n}=gB(e);if(!(n!=null&&n.nodeName))return null;if(ONe(n)&&n.contentDocument)return wNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=gB(n).getElementById(i);if(r)return r}}return n}W1(wNe,"getActiveElement");function ONe(e){return e.tagName==="IFRAME"}W1(ONe,"isFrame");var Od=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},wlt=Object.defineProperty,Olt=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),uee=P0[" useEffectEvent ".trim().toString()],dee=P0[" useInsertionEffect ".trim().toString()];function kNe(e){if(typeof uee=="function")return uee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof dee=="function"?dee(()=>{t.current=e}):Od(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Olt(kNe,"useEffectEvent");var klt=Object.defineProperty,GA=(e,t)=>klt(e,"name",{value:t,configurable:!0}),Slt=P0[" useInsertionEffect ".trim().toString()]||Od;function Rd({prop:e,defaultProp:t,onChange:n=GA(()=>{},"onChange"),caller:i}){const[r,s,o]=SNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=ENe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}GA(Rd,"useControllableState");function SNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Slt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}GA(SNe,"useUncontrolledState");function ENe(e){return typeof e=="function"}GA(ENe,"isFunction");var fee=Symbol("RADIX:SYNC_STATE");function Elt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=kNe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===fee)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:fee,state:r})},[r,f.state,c]),[b,h]}GA(Elt,"useControllableStateReducer");var Clt=Object.defineProperty,Yp=(e,t)=>Clt(e,"name",{value:t,configurable:!0});function CNe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Yp(CNe,"useStateMachine");var jh=Yp(e=>{const{present:t,children:n}=e,i=ANe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=TNe(i.ref,_Ne(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function ANe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=CNe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ax(i.current),o.current=void 0):s.current="none"},[c]),Od(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ax(d);e?(o.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]),Od(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Yp(g=>{const v=ax(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=Yp(g=>{g.target===t&&(s.current=ax(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,o.current=ax(f)}else i.current=null;n(d)},[])}}Yp(ANe,"usePresence");function bB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Yp(bB,"setRef");function TNe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=bB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oAlt(e,"name",{value:t,configurable:!0}),_lt=P0[" useId ".trim().toString()]||(()=>{}),jlt=0;function nb(e){const[t,n]=p.useState(_lt());return Od(()=>{e||n(i=>i??String(jlt++))},[e]),e||(t?`radix-${t}`:"")}Tlt(nb,"useId");var Nlt=Object.defineProperty,Rlt=(e,t)=>Nlt(e,"name",{value:t,configurable:!0}),Ilt=p.createContext(void 0);function XA(e){const t=p.useContext(Ilt);return e||t||"ltr"}Rlt(XA,"useDirection");var Plt=Object.defineProperty,Dlt=(e,t)=>Plt(e,"name",{value:t,configurable:!0});function wf(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)},[])}Dlt(wf,"useCallbackRef");var Mlt=Object.defineProperty,Co=(e,t)=>Mlt(e,"name",{value:t,configurable:!0}),yB="dismissableLayer.update",Llt="dismissableLayer.pointerDownOutside",$lt="dismissableLayer.focusOutside",hee,jNe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_V=p.forwardRef(Co(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(jNe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=_r(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=O>=x,E=p.useRef(!1),C=NNe(A=>{o==null||o(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(A=>{if(!(A instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(A));return S&&!N},[f.branches,S])}),j=RNe(A=>{if(r&&E.current)return;const N=A.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),T=h?O===y.length-1:!1,R=wf(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(hee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),vB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=hee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),vB())},[h,f]),p.useEffect(()=>{const A=Co(()=>b({}),"handleUpdate");return document.addEventListener(yB,A),()=>document.removeEventListener(yB,A)},[]),a.jsx(Xr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:Qn(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Qn(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Qn(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function Flt(){const e=p.useContext(jNe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Co(Flt,"useDismissableLayerSurface");var Blt=Co(()=>!0,"IS_TRUE");function NNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Blt}=t,l=wf(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()}Co(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Co(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(S=>S.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Co(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}Co(b,"handleInteractionBubble");const v=Co(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const S=m();h(),S||jV(Llt,l,k,{discrete:!0})};if(Co(O,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={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,o]),{onPointerDownCapture:Co(()=>c.current=!0,"onPointerDownCapture")}}Co(NNe,"usePointerDownOutside");function RNe(e,t=globalThis==null?void 0:globalThis.document){const n=wf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Co(s=>{s.target&&!i.current&&jV($lt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Co(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Co(()=>i.current=!1,"onBlurCapture")}}Co(RNe,"useFocusOutside");function vB(){const e=new CustomEvent(yB);document.dispatchEvent(e)}Co(vB,"dispatchUpdate");function jV(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?CV(r,s):r.dispatchEvent(s)}Co(jV,"handleAndDispatchCustomEvent");var Ult=Object.defineProperty,rc=(e,t)=>Ult(e,"name",{value:t,configurable:!0}),Y3="focusScope.autoFocusOnMount",Z3="focusScope.autoFocusOnUnmount",pee={bubbles:!1,cancelable:!0},INe=p.forwardRef(rc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=wf(s),f=wf(o),h=p.useRef(null),m=_r(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 k=O.target;c.contains(k)?h.current=k:dp(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const k=O.relatedTarget;k!==null&&(c.contains(k)||dp(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&dp(c)};rc(v,"handleFocusIn"),rc(y,"handleFocusOut"),rc(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){mee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(Y3,pee);c.addEventListener(Y3,d),c.dispatchEvent(w),w.defaultPrevented||(PNe(FNe(NV(c)),{select:!0}),document.activeElement===v&&dp(c))}return()=>{c.removeEventListener(Y3,d),setTimeout(()=>{const w=new CustomEvent(Z3,pee);c.addEventListener(Z3,f),c.dispatchEvent(w),w.defaultPrevented||dp(v??document.body,{select:!0}),c.removeEventListener(Z3,f),mee.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,k]=DNe(x);O&&k?!v.shiftKey&&w===k?(v.preventDefault(),i&&dp(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&dp(k,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Xr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function PNe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(dp(i,{select:t}),document.activeElement!==n)return}rc(PNe,"focusFirst");function DNe(e){const t=NV(e),n=xB(t,e),i=xB(t.reverse(),e);return[n,i]}rc(DNe,"getTabbableEdges");function NV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:rc(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}rc(NV,"getTabbableCandidates");function xB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):MNe(i,{upTo:t})))return i}rc(xB,"findVisible");function MNe(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}rc(MNe,"isHidden");function LNe(e){return e instanceof HTMLInputElement&&"select"in e}rc(LNe,"isSelectableInput");function dp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LNe(e)&&t&&e.select()}}rc(dp,"focus");var mee=$Ne();function $Ne(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wB(e,t),e.unshift(t)},remove(t){var n;e=wB(e,t),(n=e[0])==null||n.resume()}}}rc($Ne,"createFocusScopesStack");function wB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}rc(wB,"arrayRemove");function FNe(e){return e.filter(t=>t.tagName!=="A")}rc(FNe,"removeLinks");var Qlt=Object.defineProperty,zlt=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),RV=p.forwardRef(zlt(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);Od(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?yi.createPortal(a.jsx(Xr.div,{...r,ref:n}),l):null},"Portal")),Vlt=Object.defineProperty,IV=(e,t)=>Vlt(e,"name",{value:t,configurable:!0}),u_=0,Qf=null;function Hlt(e){return rM(),e.children}IV(Hlt,"FocusGuards");function rM(){p.useEffect(()=>{Qf||(Qf={start:OB(),end:OB()});const{start:e,end:t}=Qf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),u_++,()=>{u_===1&&(Qf==null||Qf.start.remove(),Qf==null||Qf.end.remove(),Qf=null),u_=Math.max(0,u_-1)}},[])}IV(rM,"useFocusGuards");function OB(){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}IV(OB,"createFocusGuard");var Jf=function(){return Jf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return lct;var t=cct(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])}},dct=zNe(),cw="data-scroll-locked",fct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Wlt,` { + */const Bo=Cn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eee=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),oE=Object.freeze({modelName:"",current:eee,cumulative:eee}),not={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},iot=24,rot=64,sot=16;function a_(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),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function aot(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=a_(t),s=n.reduce((d,f)=>d+rot+a_(f),0),o=i.reduce((d,f)=>d+sot+a_(f.name)+a_(f.description??""),0);return iot+r+s+o}function oot({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),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function lot(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 o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*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:o,slices:u}})}function pO(e,t){const n=e,i=n[t]??n[not[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function cot(e){const t=pO(e,"promptTokenCount"),n=pO(e,"candidatesTokenCount"),i=pO(e,"thoughtsTokenCount");return{totalTokenCount:pO(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:pO(e,"cachedContentTokenCount")}}function uot(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 vV(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 o=cot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:uot(e.cumulative,o)}}function tee(e){return e.reduce((t,n)=>vV(t,n),oE)}function nee(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function dot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function fot(e,t){if(!t)return e;const n=new Set(e.filter(r=>dot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function dv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function mg(e){return typeof e=="string"?e:""}function Wje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function hot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=dv(t)??{};return dv(n.result)??n}function pot(e){var n;const t=(n=dv(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return mg((r=dv(i))==null?void 0:r.label)}):[]}function Kje(e,t,n){const i=pot(e),r=hot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=dv(s[c])??{};return{label:mg(u.label)||i[c]||`方向 ${c+1}`,content:mg(u.content),status:Wje(u.status,o),error:mg(u.error)}})}}function mot(e){const t=dv(e),n=dv(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:mg(n.requestId),branchIndex:n.branchIndex,label:mg(n.label),delta:mg(n.delta),status:Wje(n.status,"running"),error:mg(n.error)||void 0}}function got(e,t,n){return{branches:Kje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Yo(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Gje=28e4;function iee(e){try{return JSON.stringify(e).length}catch{return Gje}}function bot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+iee(r),0);for(;t.length>1&&n>Gje;)n-=iee(t.shift());return t}function Cu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ir(e){return typeof e=="string"?e:""}function xV(e,t=""){const n=ir(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function Xje(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 Yje(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=ir(e.command),n=ir(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 uy(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 Zje(e){const t=ir(e.id||e.itemId||e.item_id),n=ir(e.kind);if(!t||!n)return null;const i=xV(e.status),r=ir(e.text||e.detail||e.delta),s=!ir(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",thoughtKind:n==="reasoning"?"reasoning":"thought"},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 o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:ir(e.title)||Yo("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=Cu(l),u=ir(c==null?void 0:c.text);if(!u)return[];const d=ir(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 o=Yo(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Yje(e),c=Xje(e)??(n==="status"&&r||void 0);return{id:t,block:uy(ir(e.name||e.title)||o,t,i,l,c)}}return null}function Jje(e){const t=ir(e.type),n=Cu(e.item),i=ir(n==null?void 0:n.type),r=ir((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=xV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=ir(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...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=Cu(c),d=ir(u==null?void 0:u.text);if(!d)return[];const f=ir(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:Yo("planTitle"),summary:Yo("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Yo(`command.${s}`);return{id:r,block:uy(o,r,s,Yje(n??{}),Xje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Yo("projectFiles",{count:o.length}):Yo("projectFile"),c=Yo(`fileChange.${s}`,{subject:l});return{id:r,block:uy(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[ir(n==null?void 0:n.server),ir(n==null?void 0:n.tool)].filter(Boolean).join("/")||Yo("externalTool"),l=Yo(`mcp.${s}`,{tool:o}),c=Cu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:ir(c==null?void 0:c.message)||void 0;return{id:r,block:uy(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=ir(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Yo(`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:uy(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Yo(`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:uy(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=Cu(e.error),l=ir((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Yo("errorDetail");return{id:r,block:uy(Yo("errorTitle"),r,"failed",void 0,l)}}return null}function yot(e){const t=Cu(e),n=Cu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=ir(n.toolName),r=ir(n.requestId);if(!i||!r)return null;const s=Cu(n.event??n.activity);if(!s)return null;const o=Cu(s.item)||ir(s.type)?Jje(s):Zje(s);if(!o)return null;const l=ir(n.title||n.label),c=ir(s.agentSessionId??s.agent_session_id),u=ir(s.sandboxSessionId??s.sandbox_session_id),d=ir(s.threadId??s.thread_id),f=xV(s.status,ir(s.type)),m=ir(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:o}}function vot(e,t){const n=Cu(t),i=Cu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=ir(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=ir(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=ir(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=ir(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...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=Cu(d);if(!f)continue;const h=Cu(f.item)||ir(f.type)?Jje(f):Zje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(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:bot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",yN="adk_request_credential",Q3="transfer_to_agent";function xot(e){var i,r,s,o;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)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const wot=2048;function ree(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=lB(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=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function kot(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 see(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 bC=e=>e.functionCall??e.function_call,Zg=e=>e.functionResponse??e.function_response;function K1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Oot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function rg(e,t){const n=e[t];return typeof n=="string"?n:""}function eNe(e){return Oot(K1(e),"mpa")}function wV(e){const t=K1(e),n=eNe(e);return rg(t,"eventType")||rg(t,"event_type")||rg(n,"eventType")||rg(n,"event_type")||rg(n,"kind")}function lw(e){const t=K1(e),n=eNe(e);return rg(t,"source")==="sandbox"||rg(n,"source")==="sandbox"}function tNe(e){const t=wV(e);return t==="usage.updated"||t==="usage"}function fI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=Zg(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function aee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function Sot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function oee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Eot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function Cot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Aot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function XA(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 o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.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 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:Aot(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 Hy(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 Tot=new Set(["llm","sequential","parallel","loop","a2a"]);function _ot(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 o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Tot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function jot(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 Not(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 z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function mO(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function nNe(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(tNe(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(fI(t))return aee(i),mO(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=mot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=yot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const k=i[x];if(!(k.kind!=="tool"||k.done||k.name!==w.toolName||w.requestId&&k.callId&&k.callId!==w.requestId)){k.response=got(k.args,k.response,w),k.status="running";break}}for(const w of c)ree(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>bC(w)||Zg(w));if(t.partial&&!u){for(const w of o){const x=Hy(w),k=n.mpaA2a&&w.thought?rg(K1(t),"reasoningSegmentId"):"";if(k&&typeof x=="string"&&x){const S=i.find(O=>O.kind==="thinking"&&O.reasoningSegmentId===k);(S==null?void 0:S.kind)==="thinking"?S.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:k});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Hy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=bC(w),k=Zg(w),S=XA([w]),O=Hy(w);if(typeof O=="string"&&O)z3(i,w.thought?"thinking":"text",O,w.thought?V3(t):void 0);else if(S.length)mO(i),jot(i,S);else if(x)if(mO(i),x.name===Q3){const A=Cot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:A,done:!1})}else{if(x.name==="sandbox_task"&&lw(t))continue;if(x.name===yN){const A=x.args??{},E=A.authConfig??A.auth_config??A,T=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:xot(E),authConfig:E,done:!1})}else{const A=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((A==null?void 0:A.kind)==="tool"){A.name=x.name??A.name,A.args=x.args??A.args,A.response===void 0&&(A.done=!1,A.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?ree(i,T):j.push(T);s=j}}}else if(k){if(mO(i),k.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(k.name===yN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let A=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||k.id&&j.callId===k.id)&&(k.id&&j.callId&&j.callId===k.id||(!k.id||!j.callId)&&Sot(j.name,k.name??""))){const R=T?see(j.response):"",C=oee(k.response,t.partial===!0);if(j.done=C.done,j.response=k.response,j.status=C.status,T){j.codexActivity=vot(j.codexActivity,k.response),j.status=C.status==="running"?"running":kot(k.response);const N=see(k.response);N&&N!==R&&z3(i,"text",N)}A=!0;break}}if(!A&&k.name!==Q3&&k.name!==yN&&k.name!==cB){const E=oee(k.response,t.partial===!0);i.push({kind:"tool",name:k.name??"",callId:k.id,response:k.response,done:E.done,status:E.status})}if(k.name===cB){const E=((b=k.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Not(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),lw(t)&&wV(t)==="invocation.completed"&&aee(i),mO(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function Rot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(fI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Hy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||XA([b]).length>0}),r=n.some(b=>{var y;const v=Zg(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(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||o||l&&c}function iNe(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function lee(e){var n,i,r;if(iNe(e))return!0;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=>!!(Hy(s)||XA([s]).length>0||bC(s)||Zg(s)))}function Iot(e,t){var o;const n=K1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||lw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!bC(l)&&!Zg(l)&&XA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Pot(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Dot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>bC(i)||Zg(i))}function vN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=vV(oE,v).current.totalTokenCount;if(!y)return!1;const w=K1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,C,N;if(Dot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!lee(v)&&!((C=(R=v.content)==null?void 0:R.parts)!=null&&C.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(tNe(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>wot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let k=lw(v)?"":w,S=f(k,x),O=r.get(S);if(!O&&lw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(S=P[0],O=P[1],k=O.meta.author??"")}if(!O&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===k)&&(r.delete(l),l=void 0,O=P)}if(!O&&fI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O&&!lee(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O){const P=`${e}-${i++}`;O={acc:dB(),localId:P,meta:{author:k||void 0,invocationId:x||void 0}}}O.acc=nNe(n.mpaA2a?Iot(O.acc,v):O.acc,v,n);const A=v.usageMetadata??v.usage_metadata,E=Rot(v,O.acc.blocks);O.meta={...O.meta,author:k||O.meta.author,localId:O.localId,streaming:!E,a2aStatus:iNe(v),tokens:(A==null?void 0:A.totalTokenCount)||O.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:lw(v)&&wV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Hy(P)??"").join("").trim()||void 0:O.meta.mpaFinalAnswer}:{},ts:v.timestamp||O.meta.ts,invocationId:x||O.meta.invocationId,eventId:E&&v.id?v.id:O.meta.eventId};const j={role:"assistant",blocks:O.acc.blocks,meta:O.meta},T=E&&fI(v);return E&&!T?(r.delete(S),l=void 0):r.set(S,O),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Sy(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function cee(e,t={},n={}){var l;let i=[],r=0;const s=()=>vN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=Zg(b))==null?void 0:v.name)===yN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Hy).filter(b=>!!b).join(""),h=XA(d),m=_ot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Sy(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Sy(i,d.turn))}for(const c of o.finish())i=Sy(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function tM(e,t=bn.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(o=>o.text).find(Boolean);if(s)return s}return t}function Mot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Lot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Mot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function rNe(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=rNe(i,t,e);if(r)return r}}function $ot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=rNe(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 Fot(e,t){const n=[];return e.forEach((i,r)=>{const s=$ot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.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 Bot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var S;return(S=k.meta)!=null&&S.mpaFinalAnswer?[k.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(k=>{var O;const S=k.blocks.filter(A=>A.kind==="text").map(A=>A.text).join("").trim();return!((O=k.meta)!=null&&O.mpaFinalAnswer)&&S&&h.has(S)?{...k,blocks:k.blocks.filter(A=>A.kind!=="text")}:k}),g=[...m].reverse().find(k=>k.blocks.some(S=>S.kind==="text"&&S.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(k=>{var S;return(S=k.meta)==null?void 0:S.mpaUsage});for(const k of f){for(const[O,A]of Object.entries(((r=k.meta)==null?void 0:r.mpaUsage)??{}))b[O]=Math.max(b[O]??0,A);const S=(s=k.meta)==null?void 0:s.tokens;if(typeof S=="number"&&Number.isFinite(S)&&S>=0){const O=((o=k.meta)==null?void 0:o.invocationId)||"unidentified";v.set(O,Math.max(v.get(O)??0,S))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(k=>{var S;return(S=k.meta)!=null&&S.ts?[k.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(k=>k.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(k=>{var S;return((S=k.meta)==null?void 0:S.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((k,S)=>k+S,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function Uot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.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 sNe(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},kV=e=>{const t=Qot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,kV(s)):r}return i})},zot="_Badge_1viyg_1",Vot={Badge:zot},Za=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:qi(Vot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:kV(e)});var Hot=typeof lg=="object"&&lg&&lg.Object===Object&&lg,qot=typeof self=="object"&&self&&self.Object===Object&&self;Hot||qot||Function("return this")();var Wot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Kot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var uee={width:void 0,height:void 0};function aNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(uee),o=Kot(),l=p.useRef({...uee}),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=dee(d,f,"inlineSize"),m=dee(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):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function dee(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 OV(e,t){const n=p.useRef(e);Wot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const Got={DEV:!1,MODE:"production"},cw=typeof import.meta<"u"?Got:void 0,Xot=!!(cw!=null&&cw.DEV),Yot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",oNe=(cw==null?void 0:cw.MODE)==="test"||Yot,Zot=typeof window<"u",lNe=typeof document<"u",Jot=Zot&&lNe,SV=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())},hI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Jot||typeof window.requestAnimationFrame!="function"||lNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Fv=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),o_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Lp=e=>{e.preventDefault()},cNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),elt="_LoadingIndicator_7yl6f_1",tlt={LoadingIndicator:elt},YA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:qi(tlt.LoadingIndicator,e),style:i||Fv({"indicator-size":t,"indicator-stroke":n})});var nlt=Object.defineProperty,EV=(e,t)=>nlt(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}EV(fB,"setRef");function uNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rilt(e,"name",{value:t,configurable:!0});function Yp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof l_=="function"&&(r=l_(r._payload)),p.Children.forEach(r,h=>{var m;if(gNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof l_=="function"&&(b=l_(b._payload)),o=rlt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?mNe(o):void 0,d=Rr(i,u);if(!o){if(r||r===0)throw new Error(l?olt(e):alt(e));return r}const f=pNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Sf(Yp,"createSlot");var dNe=Yp("Slot"),fNe=Symbol.for("radix.slottable");function hNe(e){const t=Sf(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=fNe,t}Sf(hNe,"createSlottable");var rlt=Sf((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 pNe(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}}Sf(pNe,"mergeProps");function mNe(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)}Sf(mNe,"getElementRef");function gNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fNe}Sf(gNe,"isSlottable");var slt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===slt&&"_payload"in e&&bNe(e._payload)}Sf(hB,"isLazyComponent");function bNe(e){return typeof e=="object"&&e!==null&&"then"in e}Sf(bNe,"isPromiseLike");var alt=Sf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),olt=Sf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),l_=_v[" use ".trim().toString()],llt=Object.defineProperty,clt=(e,t)=>llt(e,"name",{value:t,configurable:!0}),ult=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=ult.reduce((e,t)=>{const n=Yp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function CV(e,t){e&&vi.flushSync(()=>e.dispatchEvent(t))}clt(CV,"dispatchDiscreteCustomEvent");var dlt=Object.defineProperty,flt=(e,t)=>dlt(e,"name",{value:t,configurable:!0}),hlt=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"}),plt=p.forwardRef(flt(function(t,n){return a.jsx(Jr.span,{...t,ref:n,style:{...hlt,...t.style}})},"VisuallyHidden")),mlt=plt,glt=Object.defineProperty,ud=(e,t)=>glt(e,"name",{value:t,configurable:!0});function blt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ud(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,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 ud(r,"useContext"),[i,r]}ud(blt,"createContext");function Qc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ud(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 a.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(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ud(d,"useContext"),[u,d]}ud(i,"createContext");const r=ud(()=>{const s=n.map(o=>p.createContext(o));return ud(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,yNe(r,...t)]}ud(Qc,"createContextScope");function yNe(...e){const t=e[0];if(e.length===1)return t;const n=ud(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ud(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ud(yNe,"composeContextScopes");var ylt=Object.defineProperty,Io=(e,t)=>ylt(e,"name",{value:t,configurable:!0});function AV(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Io(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Yp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),k=Rr(v,x.collectionRef);return a.jsx(c,{ref:k,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,k=p.useRef(null),S=Rr(v,k),O=s(d,y);return p.useEffect(()=>(O.itemMap.set(k,{ref:k,...x}),()=>void O.itemMap.delete(k))),a.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((O,A)=>x.indexOf(O.ref.current)-x.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return Io(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}Io(AV,"createCollection");var fee=new WeakMap,Ha,bu,G3=(bu=class extends Map{constructor(n){super(n);$G(this,Ha);w5(this,Ha,[...super.keys()]),fee.set(this,!0)}set(n,i){return fee.get(this)&&(this.has(n)?kl(this,Ha)[kl(this,Ha).indexOf(n)]=n:kl(this,Ha).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Ha).length,l=TV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-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=[...kl(this,Ha)];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 o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new bu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new bu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new bu(i)}toReversed(){const n=new bu;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 bu(i)}slice(n,i){const r=new bu;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 o=n;o<=s;o++){const l=this.keyAt(o),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}},Ha=new WeakMap,Io(bu,"OrderedDict"),bu);function xN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=vNe(e,t);return n===-1?void 0:e[n]}Io(xN,"at");function vNe(e,t){const n=e.length,i=TV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Io(vNe,"toSafeIndex");function TV(e){return e!==e||e===0?0:Math.trunc(e)}Io(TV,"toSafeInteger");function vlt(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:Io(()=>{},"setItemMap")}),o=Io(({state:x,...k})=>x?a.jsx(c,{...k,state:x}):a.jsx(l,{...k}),"CollectionProvider");o.displayName=t;const l=Io(x=>{const k=v();return a.jsx(c,{...x,state:k})},"CollectionInit");l.displayName=t+"Init";const c=Io(x=>{const{scope:k,children:S,state:O}=x,A=p.useRef(null),[E,j]=p.useState(null),T=Rr(A,j),[R,C]=O;return p.useEffect(()=>{if(!E)return;const N=kNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:k,itemMap:R,setItemMap:C,collectionRef:T,collectionRefObject:A,collectionElement:E,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Yp(u),f=p.forwardRef((x,k)=>{const{scope:S,children:O}=x,A=s(u,S),E=Rr(k,A.collectionRef);return a.jsx(d,{ref:E,children:O})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Yp(h),b=p.forwardRef((x,k)=>{const{scope:S,children:O,...A}=x,E=p.useRef(null),[j,T]=p.useState(null),R=Rr(k,E,T),C=s(h,S),{setItemMap:N}=C,P=p.useRef(A);xNe(P.current,A)||(P.current=A);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:O})});b.displayName=h;function v(){return p.useState(new G3)}Io(v,"useInitCollection");function y(x){const{itemMap:k}=s(e+"CollectionConsumer",x);return k}return Io(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Io(vlt,"createCollection");function xNe(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}Io(xNe,"shallowEqual");function wNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Io(wNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:wNe(e[1].element,t[1].element)?-1:1}Io(pB,"sortByDocumentPosition");function kNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Io(kNe,"getChildListObserver");var xlt=Object.defineProperty,G1=(e,t)=>xlt(e,"name",{value:t,configurable:!0}),ONe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Un(e,t,{checkForDefaultPrevented:n=!0}={}){return G1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}G1(Un,"composeEventHandlers");function wlt(e){var t;if(!ONe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}G1(wlt,"getOwnerWindow");function mB(e){if(!ONe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}G1(mB,"getOwnerDocument");function SNe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(ENe(n)&&n.contentDocument)return SNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}G1(SNe,"getActiveElement");function ENe(e){return e.tagName==="IFRAME"}G1(ENe,"isFrame");var Od=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},klt=Object.defineProperty,Olt=(e,t)=>klt(e,"name",{value:t,configurable:!0}),hee=_v[" useEffectEvent ".trim().toString()],pee=_v[" useInsertionEffect ".trim().toString()];function CNe(e){if(typeof hee=="function")return hee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof pee=="function"?pee(()=>{t.current=e}):Od(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Olt(CNe,"useEffectEvent");var Slt=Object.defineProperty,ZA=(e,t)=>Slt(e,"name",{value:t,configurable:!0}),Elt=_v[" useInsertionEffect ".trim().toString()]||Od;function Id({prop:e,defaultProp:t,onChange:n=ZA(()=>{},"onChange"),caller:i}){const[r,s,o]=ANe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=TNe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}ZA(Id,"useControllableState");function ANe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Elt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}ZA(ANe,"useUncontrolledState");function TNe(e){return typeof e=="function"}ZA(TNe,"isFunction");var mee=Symbol("RADIX:SYNC_STATE");function Clt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=CNe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===mee)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:mee,state:r})},[r,f.state,c]),[b,h]}ZA(Clt,"useControllableStateReducer");var Alt=Object.defineProperty,Zp=(e,t)=>Alt(e,"name",{value:t,configurable:!0});function _Ne(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Zp(_Ne,"useStateMachine");var Rh=Zp(e=>{const{present:t,children:n}=e,i=jNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=NNe(i.ref,RNe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function jNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=_Ne(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ox(i.current),o.current=void 0):s.current="none"},[c]),Od(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ox(d);e?(o.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]),Od(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Zp(g=>{const v=ox(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=Zp(g=>{g.target===t&&(s.current=ox(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,o.current=ox(f)}else i.current=null;n(d)},[])}}Zp(jNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Zp(gB,"setRef");function NNe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oTlt(e,"name",{value:t,configurable:!0}),jlt=_v[" useId ".trim().toString()]||(()=>{}),Nlt=0;function Jg(e){const[t,n]=p.useState(jlt());return Od(()=>{e||n(i=>i??String(Nlt++))},[e]),e||(t?`radix-${t}`:"")}_lt(Jg,"useId");var Rlt=Object.defineProperty,Ilt=(e,t)=>Rlt(e,"name",{value:t,configurable:!0}),Plt=p.createContext(void 0);function JA(e){const t=p.useContext(Plt);return e||t||"ltr"}Ilt(JA,"useDirection");var Dlt=Object.defineProperty,Mlt=(e,t)=>Dlt(e,"name",{value:t,configurable:!0});function yf(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)},[])}Mlt(yf,"useCallbackRef");var Llt=Object.defineProperty,No=(e,t)=>Llt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",$lt="dismissableLayer.pointerDownOutside",Flt="dismissableLayer.focusOutside",gee,INe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_V=p.forwardRef(No(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(INe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=Rr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,k=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,O=k>=x,A=p.useRef(!1),E=PNe(C=>{o==null||o(C),c==null||c(C),C.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:A,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(C=>{if(!(C instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(C));return O&&!N},[f.branches,O])}),j=DNe(C=>{if(r&&A.current)return;const N=C.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(C),c==null||c(C),C.defaultPrevented||u==null||u())},g),T=h?k===y.length-1:!1,R=yf(C=>{C.key==="Escape"&&(s==null||s(C),!C.defaultPrevented&&u&&(C.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=gee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const C=No(()=>b({}),"handleUpdate");return document.addEventListener(bB,C),()=>document.removeEventListener(bB,C)},[]),a.jsx(Jr.div,{...d,ref:v,style:{pointerEvents:S?O?"auto":"none":void 0,...t.style},onFocusCapture:Un(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Un(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Un(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Blt(){const e=p.useContext(INe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}No(Blt,"useDismissableLayerSurface");var Ult=No(()=>!0,"IS_TRUE");function PNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Ult}=t,l=yf(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()}No(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}No(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const k=x.target;k instanceof Node&&[...s].some(O=>O.contains(k))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}No(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}No(b,"handleInteractionBubble");const v=No(x=>{if(x.target&&!c.current){let k=function(){n.removeEventListener("click",f.current);const O=m();h(),O||jV($lt,l,S,{discrete:!0})};if(No(k,"handleAndDispatchPointerDownOutsideEvent"),!o(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?k():(n.removeEventListener("click",f.current),f.current=k,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,o]),{onPointerDownCapture:No(()=>c.current=!0,"onPointerDownCapture")}}No(PNe,"usePointerDownOutside");function DNe(e,t=globalThis==null?void 0:globalThis.document){const n=yf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=No(s=>{s.target&&!i.current&&jV(Flt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:No(()=>i.current=!0,"onFocusCapture"),onBlurCapture:No(()=>i.current=!1,"onBlurCapture")}}No(DNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}No(yB,"dispatchUpdate");function jV(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?CV(r,s):r.dispatchEvent(s)}No(jV,"handleAndDispatchCustomEvent");var Qlt=Object.defineProperty,tc=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",bee={bubbles:!1,cancelable:!0},MNe=p.forwardRef(tc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=yf(s),f=yf(o),h=p.useRef(null),m=Rr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(k){if(g.paused||!c)return;const S=k.target;c.contains(S)?h.current=S:pp(h.current,{select:!0})},y=function(k){if(g.paused||!c)return;const S=k.relatedTarget;S!==null&&(c.contains(S)||pp(h.current,{select:!0}))},w=function(k){if(document.activeElement===document.body)for(const O of k)O.removedNodes.length>0&&pp(c)};tc(v,"handleFocusIn"),tc(y,"handleFocusOut"),tc(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){yee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,bee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||(LNe(QNe(NV(c)),{select:!0}),document.activeElement===v&&pp(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,bee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||pp(v??document.body,{select:!0}),c.removeEventListener(Y3,f),yee.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,[k,S]=$Ne(x);k&&S?!v.shiftKey&&w===S?(v.preventDefault(),i&&pp(k,{select:!0})):v.shiftKey&&w===k&&(v.preventDefault(),i&&pp(S,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Jr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function LNe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(pp(i,{select:t}),document.activeElement!==n)return}tc(LNe,"focusFirst");function $Ne(e){const t=NV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}tc($Ne,"getTabbableEdges");function NV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:tc(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}tc(NV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):FNe(i,{upTo:t})))return i}tc(vB,"findVisible");function FNe(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}tc(FNe,"isHidden");function BNe(e){return e instanceof HTMLInputElement&&"select"in e}tc(BNe,"isSelectableInput");function pp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&BNe(e)&&t&&e.select()}}tc(pp,"focus");var yee=UNe();function UNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}tc(UNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}tc(xB,"arrayRemove");function QNe(e){return e.filter(t=>t.tagName!=="A")}tc(QNe,"removeLinks");var zlt=Object.defineProperty,Vlt=(e,t)=>zlt(e,"name",{value:t,configurable:!0}),RV=p.forwardRef(Vlt(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);Od(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?vi.createPortal(a.jsx(Jr.div,{...r,ref:n}),l):null},"Portal")),Hlt=Object.defineProperty,IV=(e,t)=>Hlt(e,"name",{value:t,configurable:!0}),c_=0,Uf=null;function qlt(e){return nM(),e.children}IV(qlt,"FocusGuards");function nM(){p.useEffect(()=>{Uf||(Uf={start:wB(),end:wB()});const{start:e,end:t}=Uf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),c_++,()=>{c_===1&&(Uf==null||Uf.start.remove(),Uf==null||Uf.end.remove(),Uf=null),c_=Math.max(0,c_-1)}},[])}IV(nM,"useFocusGuards");function wB(){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}IV(wB,"createFocusGuard");var eh=function(){return eh=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return cct;var t=uct(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])}},fct=qNe(),uw="data-scroll-locked",hct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Klt,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } - body[`).concat(cw,`] { + body[`).concat(uw,`] { overflow: hidden `).concat(i,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&` @@ -496,7 +496,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` } - .`).concat(ON,` { + .`).concat(wN,` { right: `).concat(l,"px ").concat(i,`; } @@ -504,7 +504,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== margin-right: `).concat(l,"px ").concat(i,`; } - .`).concat(ON," .").concat(ON,` { + .`).concat(wN," .").concat(wN,` { right: 0 `).concat(i,`; } @@ -512,165 +512,165 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== margin-right: 0 `).concat(i,`; } - body[`).concat(cw,`] { - `).concat(Klt,": ").concat(l,`px; + body[`).concat(uw,`] { + `).concat(Glt,": ").concat(l,`px; } -`)},bee=function(){var e=parseInt(document.body.getAttribute(cw)||"0",10);return isFinite(e)?e:0},hct=function(){p.useEffect(function(){return document.body.setAttribute(cw,(bee()+1).toString()),function(){var e=bee()-1;e<=0?document.body.removeAttribute(cw):document.body.setAttribute(cw,e.toString())}},[])},pct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;hct();var s=p.useMemo(function(){return uct(r)},[r]);return p.createElement(dct,{styles:fct(s,!t,r,n?"":"!important")})},kB=!1;if(typeof window<"u")try{var d_=Object.defineProperty({},"passive",{get:function(){return kB=!0,!0}});window.addEventListener("test",d_,d_),window.removeEventListener("test",d_,d_)}catch{kB=!1}var Pv=kB?{passive:!1}:!1,mct=function(e){return e.tagName==="TEXTAREA"},VNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!mct(e)&&n[t]==="visible")},gct=function(e){return VNe(e,"overflowY")},bct=function(e){return VNe(e,"overflowX")},yee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=HNe(e,i);if(r){var s=qNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},yct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},vct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},HNe=function(e,t){return e==="v"?gct(t):bct(t)},qNe=function(e,t){return e==="v"?yct(t):vct(t)},xct=function(e,t){return e==="h"&&t==="rtl"?-1:1},wct=function(e,t,n,i,r){var s=xct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=qNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&HNe(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},f_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vee=function(e){return[e.deltaX,e.deltaY]},xee=function(e){return e&&"current"in e?e.current:e},Oct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kct=function(e){return` +`)},xee=function(){var e=parseInt(document.body.getAttribute(uw)||"0",10);return isFinite(e)?e:0},pct=function(){p.useEffect(function(){return document.body.setAttribute(uw,(xee()+1).toString()),function(){var e=xee()-1;e<=0?document.body.removeAttribute(uw):document.body.setAttribute(uw,e.toString())}},[])},mct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;pct();var s=p.useMemo(function(){return dct(r)},[r]);return p.createElement(fct,{styles:hct(s,!t,r,n?"":"!important")})},kB=!1;if(typeof window<"u")try{var u_=Object.defineProperty({},"passive",{get:function(){return kB=!0,!0}});window.addEventListener("test",u_,u_),window.removeEventListener("test",u_,u_)}catch{kB=!1}var M0=kB?{passive:!1}:!1,gct=function(e){return e.tagName==="TEXTAREA"},WNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gct(e)&&n[t]==="visible")},bct=function(e){return WNe(e,"overflowY")},yct=function(e){return WNe(e,"overflowX")},wee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=KNe(e,i);if(r){var s=GNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},vct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},xct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},KNe=function(e,t){return e==="v"?bct(t):yct(t)},GNe=function(e,t){return e==="v"?vct(t):xct(t)},wct=function(e,t){return e==="h"&&t==="rtl"?-1:1},kct=function(e,t,n,i,r){var s=wct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=GNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&KNe(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},d_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kee=function(e){return[e.deltaX,e.deltaY]},Oee=function(e){return e&&"current"in e?e.current:e},Oct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sct=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Sct=0,Dv=[];function Ect(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Sct++)[0],s=p.useState(zNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=qlt([e.lockRef.current],(e.shards||[]).map(xee),!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!o.current.allowPinchZoom;var y=f_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],k,S=b.target,E=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&E==="h"&&S.type==="range")return!1;var C=window.getSelection(),j=C&&C.anchorNode,T=j?j===S||j.contains(S):!1;if(T)return!1;var R=yee(E,S);if(!R)return!0;if(R?k=E:(k=E==="v"?"h":"v",R=yee(E,S)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=k),!k)return!0;var A=i.current||k;return wct(A,v,b,A==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!Dv.length||Dv[Dv.length-1]!==s)){var y="deltaY"in v?vee(v):f_(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&Oct(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(xee).filter(Boolean).filter(function(k){return k.contains(v.target)}),O=x.length>0?l(v,x[0]):!o.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:Cct(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=f_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,vee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,f_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return Dv.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Pv),document.addEventListener("touchmove",c,Pv),document.addEventListener("touchstart",d,Pv),function(){Dv=Dv.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Pv),document.removeEventListener("touchmove",c,Pv),document.removeEventListener("touchstart",d,Pv)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:kct(r)}):null,m?p.createElement(pct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Cct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Act=tct(QNe,Ect);var PV=p.forwardRef(function(e,t){return p.createElement(sM,Jf({},e,{ref:t,sideCar:Act}))});PV.classNames=sM.classNames;var Tct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mv=new WeakMap,h_=new WeakMap,p_={},n4=0,WNe=function(e){return e&&(e.host||WNe(e.parentNode))},_ct=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=WNe(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})},jct=function(e,t,n,i){var r=_ct(t,Array.isArray(e)?e:[e]);p_[n]||(p_[n]=new WeakMap);var s=p_[n],o=[],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=(Mv.get(h)||0)+1,v=(s.get(h)||0)+1;Mv.set(h,b),s.set(h,v),o.push(h),b===1&&g&&h_.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(),n4++,function(){o.forEach(function(f){var h=Mv.get(f)-1,m=s.get(f)-1;Mv.set(f,h),s.set(f,m),h||(h_.has(f)||f.removeAttribute(i),h_.delete(f)),m||f.removeAttribute(n)}),n4--,n4||(Mv=new WeakMap,Mv=new WeakMap,h_=new WeakMap,p_={})}},KNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Tct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),jct(i,r,n,"aria-hidden")):function(){return null}},Nct=Object.defineProperty,Rct=(e,t)=>Nct(e,"name",{value:t,configurable:!0});function YA(e){const[t,n]=p.useState(void 0);return Od(()=>{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 o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Rct(YA,"useSize");var Ict=Object.defineProperty,Zp=(e,t)=>Ict(e,"name",{value:t,configurable:!0}),DV="Checkbox",[Pct,yhn]=qc(DV),[Dct,MV]=Pct(DV);function GNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Rd({prop:n,defaultProp:r??!1,onChange:c,caller:DV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(E=>E+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Lp(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(Dct,{scope:t,...S,children:XNe(f)?f(S):i})}Zp(GNe,"CheckboxProvider");var Mct="CheckboxTrigger",Lct=p.forwardRef(Zp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=MV(Mct,t),y=_r(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const O=Zp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[o,h]),a.jsx(Xr.button,{type:"button",role:"checkbox","aria-checked":Lp(u)?"mixed":u,"aria-required":d,"data-state":LV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Qn(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Qn(i,x=>{g(),h(O=>Lp(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),$ct=p.forwardRef(Zp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(GNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Lct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Qct,{__scopeCheckbox:i})]})})},"Checkbox")),Fct="CheckboxIndicator",Bct=p.forwardRef(Zp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=MV(Fct,i);return a.jsx(jh,{present:r||Lp(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{"data-state":LV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Uct="CheckboxBubbleInput",Qct=p.forwardRef(Zp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=MV(Uct,t),y=_r(r,v),w=YA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(C,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});E.indeterminate=Lp(c),T.call(E,Lp(c)?!1:c),E.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(Lp(c)?!1:c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,E=>{x.current&&E.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function XNe(e){return typeof e=="function"}Zp(XNe,"isFunction");function Lp(e){return e==="indeterminate"}Zp(Lp,"isIndeterminate");function LV(e){return Lp(e)?"indeterminate":e?"checked":"unchecked"}Zp(LV,"getState");var zct=Object.defineProperty,Dg=(e,t)=>zct(e,"name",{value:t,configurable:!0}),YNe="Popper",[ZNe,K1]=qc(YNe),[Vct,JNe]=ZNe(YNe),Hct=Dg(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Vct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),qct="PopperAnchor",Wct=p.forwardRef(Dg(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=JNe(qct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=_r(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=o.placementState&&aM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Xr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),eRe="PopperContent",[Kct,vhn]=ZNe(eRe),Gct=p.forwardRef(Dg(function(t,n){var X,V,ae,Y,K,te,ue;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="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=JNe(eRe,i),[w,x]=p.useState(null),O=_r(n,x),[k,S]=p.useState(null),E=YA(k),C=(E==null?void 0:E.width)??0,j=(E==null?void 0:E.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],N=A.length>0,P={padding:R,boundary:A.filter(tRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=X_e({strategy:"fixed",placement:T,whileElementsMounted:Dg((...fe)=>oB(...fe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[Y_e({mainAxis:s+j,alignmentAxis:l}),u&&Z_e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?J_e():void 0,...P}),u&&eje({...P}),tje({...P,apply:Dg(({elements:fe,rects:se,availableWidth:me,availableHeight:Ee})=>{const{width:xe,height:Ne}=se.reference,We=fe.floating.style;We.setProperty("--radix-popper-available-width",`${me}px`),We.setProperty("--radix-popper-available-height",`${Ee}px`),We.setProperty("--radix-popper-anchor-width",`${xe}px`),We.setProperty("--radix-popper-anchor-height",`${Ne}px`)},"apply")}),k&&ist({element:k,padding:c}),Xct({arrowWidth:C,arrowHeight:j}),m&&nst({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;Od(()=>(M(_),()=>{M(void 0)}),[_,M]);const[H,q]=aM(_),U=wf(b);Od(()=>{L&&(U==null||U())},[L,U]);const Z=(X=F.arrow)==null?void 0:X.x,z=(V=F.arrow)==null?void 0:V.y,J=((ae=F.arrow)==null?void 0:ae.centerOffset)!==0,[ne,W]=p.useState();return Od(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.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":[(Y=F.transformOrigin)==null?void 0:Y.x,(K=F.transformOrigin)==null?void 0:K.y].join(" "),...((te=F.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(Kct,{scope:i,placedSide:H,placedAlign:q,onArrowChange:S,arrowX:Z,arrowY:z,shouldHideArrow:J,children:a.jsx(Xr.div,{"data-side":H,"data-align":q,...v,ref:O,style:{...v.style,animation:L?(ue=v.style)==null?void 0:ue.animation:"none"}})})})},"PopperContent"));function tRe(e){return e!==null}Dg(tRe,"isNotNull");var Xct=Dg(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=aM(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=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function aM(e){const[t,n="center"]=e.split("-");return[t,n]}Dg(aM,"getSideAndAlignFromPlacement");var oM=Hct,$V=Wct,FV=Gct,Yct=Object.defineProperty,BV=(e,t)=>Yct(e,"name",{value:t,configurable:!0}),i4=!1;function nRe(){const[e,t]=p.useState(i4);return p.useEffect(()=>{i4||(i4=!0,t(!0))},[]),e}BV(nRe,"useIsHydrated");var iRe=P0[" useSyncExternalStore ".trim().toString()];function rRe(){return()=>{}}BV(rRe,"subscribe");function sRe(){return iRe(rRe,()=>!0,()=>!1)}BV(sRe,"useIsHydratedModern");var Zct=typeof iRe=="function"?sRe:nRe,Jct=Object.defineProperty,H0=(e,t)=>Jct(e,"name",{value:t,configurable:!0}),r4="rovingFocusGroup.onEntryFocus",eut={bubbles:!1,cancelable:!0},lM="RovingFocusGroup",[SB,aRe,tut]=AV(lM),[nut,G1]=qc(lM,[tut]),[iut,rut]=nut(lM),sut=p.forwardRef(H0(function(t,n){return a.jsx(SB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(SB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(aut,{...t,ref:n})})})},"RovingFocusGroup")),aut=p.forwardRef(H0(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=_r(n,m),b=XA(o),[v,y]=Rd({prop:l,defaultProp:c??null,onChange:u,caller:lM}),[w,x]=p.useState(!1),O=wf(d),k=aRe(i),S=p.useRef(!1),[E,C]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(r4,O),()=>j.removeEventListener(r4,O)},[O]),a.jsx(iut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>C(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>C(j=>j-1),[]),children:a.jsx(Xr.div,{tabIndex:w||E===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Qn(t.onMouseDown,()=>{S.current=!0}),onFocus:Qn(t.onFocus,j=>{const T=!S.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(r4,eut);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=k().filter(_=>_.focusable),N=A.find(_=>_.active),P=A.find(_=>_.id===v),D=[N,P,...A].filter(Boolean).map(_=>_.ref.current);UV(D,f)}}S.current=!1}),onBlur:Qn(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),out="RovingFocusGroupItem",lut=p.forwardRef(H0(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=nb(),d=o||u,f=rut(out,i),h=f.currentTabStopId===d,m=aRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Zct();return Od(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(SB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Xr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Qn(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Qn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Qn(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=lRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")k.reverse();else if(x==="prev"||x==="next"){x==="prev"&&k.reverse();const S=k.indexOf(w.currentTarget);k=f.loop?cRe(k,S+1):k.slice(S+1)}setTimeout(()=>UV(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),cut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}H0(oRe,"getDirectionAwareKey");function lRe(e,t,n){const i=oRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return cut[i]}H0(lRe,"getFocusIntent");function UV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}H0(UV,"focusFirst");function cRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}H0(cRe,"wrapArray");var QV=sut,zV=lut,uut=Object.defineProperty,fr=(e,t)=>uut(e,"name",{value:t,configurable:!0}),EB=["Enter"," "],dut=["ArrowDown","PageUp","Home"],uRe=["ArrowUp","PageDown","End"],fut=[...dut,...uRe],hut={ltr:[...EB,"ArrowRight"],rtl:[...EB,"ArrowLeft"]},put={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cM="Menu",[gC,mut,gut]=AV(cM),[q0,dRe]=qc(cM,[gut,K1,G1]),uM=K1(),fRe=G1(),[hRe,Cb]=q0(cM),[but,ZA]=q0(cM),yut=fr(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=uM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=wf(s),h=XA(r);return p.useEffect(()=>{const m=fr(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=fr(()=>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=fr(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(oM,{...l,children:a.jsx(hRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(but,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),pRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t,s=uM(i);return a.jsx($V,{...s,...r,ref:n})},"MenuAnchor")),mRe="MenuPortal",[vut,gRe]=q0(mRe,{forceMount:void 0}),xut=fr(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Cb(mRe,t);return a.jsx(vut,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),pf="MenuContent",[wut,VV]=q0(pf),Out=p.forwardRef(fr(function(t,n){const i=gRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Cb(pf,t.__scopeMenu),l=ZA(pf,t.__scopeMenu);return a.jsx(gC.Provider,{scope:t.__scopeMenu,children:a.jsx(jh,{present:r||o.open,children:a.jsx(gC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(kut,{...s,ref:n}):a.jsx(Sut,{...s,ref:n})})})})},"MenuContent")),kut=p.forwardRef(fr(function(t,n){const i=Cb(pf,t.__scopeMenu),r=p.useRef(null),s=_r(n,r);return p.useEffect(()=>{const o=r.current;if(o)return KNe(o)},[]),a.jsx(HV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Qn(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Sut=p.forwardRef(fr(function(t,n){const i=Cb(pf,t.__scopeMenu);return a.jsx(HV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Eut=Xp("MenuContent.ScrollLock"),HV=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Cb(pf,i),w=ZA(pf,i),x=uM(i),O=fRe(i),k=mut(i),[S,E]=p.useState(null),C=p.useRef(null),j=_r(n,C,y.onContentChange),T=p.useRef(0),R=p.useRef(""),A=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?PV:p.Fragment,_=b?{as:Eut,allowPinchZoom:!0}:void 0,L=fr(M=>{var W,X;const H=R.current+M,q=k().filter(V=>!V.disabled),U=document.activeElement,Z=(W=q.find(V=>V.ref.current===U))==null?void 0:W.textValue,z=q.map(V=>V.textValue),J=SRe(z,H,Z),ne=(X=q.find(V=>V.textValue===J))==null?void 0:X.ref.current;fr(function V(ae){R.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>V(""),1e3))},"updateSearch")(H),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),rM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&CRe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(wut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var H;F(M)||((H=C.current)==null||H.focus(),E(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(INe,{asChild:!0,trapped:s,onMountAutoFocus:Qn(o,M=>{var H;M.preventDefault(),(H=C.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(QV,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:Qn(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(FV,{role:"menu","aria-orientation":"vertical","data-state":WV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Qn(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&Z&&L(M.key));const z=C.current;if(M.target!==z||!fut.includes(M.key))return;M.preventDefault();const ne=k().filter(W=>!W.disabled).map(W=>W.ref.current);uRe.includes(M.key)&&ne.reverse(),ORe(ne)}),onBlur:Qn(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Qn(t.onPointerMove,Jw(M=>{const H=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(H)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Cut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"group",...r,ref:n})},"MenuGroup")),CB="MenuItem",wee="menu.itemSelect",qV=p.forwardRef(fr(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=ZA(CB,t.__scopeMenu),c=VV(CB,t.__scopeMenu),u=_r(n,o),d=p.useRef(!1),f=fr(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(wee,{bubbles:!0,cancelable:!0});h.addEventListener(wee,g=>r==null?void 0:r(g),{once:!0}),CV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(bRe,{...s,ref:u,disabled:i,onClick:Qn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Qn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Qn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||EB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),bRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=VV(CB,i),c=fRe(i),u=p.useRef(null),d=_r(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(gC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(zV,{asChild:!0,...c,focusable:!r,children:a.jsx(Xr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Qn(t.onPointerMove,Jw(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qn(t.onPointerLeave,Jw(b=>l.onItemLeave(b))),onFocus:Qn(t.onFocus,()=>h(!0)),onBlur:Qn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Aut=p.forwardRef(fr(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(vRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(qV,{role:"menuitemcheckbox","aria-checked":bC(i)?"mixed":i,...s,ref:n,"data-state":dM(i),onSelect:Qn(s.onSelect,()=>r==null?void 0:r(bC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Tut="MenuRadioGroup",[_ut,jut]=q0(Tut,{value:void 0,onValueChange:fr(()=>{},"onValueChange")}),Nut=p.forwardRef(fr(function(t,n){const{value:i,onValueChange:r,...s}=t,o=wf(r);return a.jsx(_ut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Cut,{...s,ref:n})})},"MenuRadioGroup")),Rut="MenuRadioItem",Iut=p.forwardRef(fr(function(t,n){const{value:i,...r}=t,s=jut(Rut,t.__scopeMenu),o=i===s.value;return a.jsx(vRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(qV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":dM(o),onSelect:Qn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),yRe="MenuItemIndicator",[vRe,Put]=q0(yRe,{checked:!1}),Dut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Put(yRe,i);return a.jsx(jh,{present:r||bC(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{...s,ref:n,"data-state":dM(o.checked)})})},"MenuItemIndicator")),Mut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),xRe="MenuSub",[Lut,wRe]=q0(xRe),$ut=fr(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Cb(xRe,t),o=uM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=wf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(oM,{...o,children:a.jsx(hRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Lut,{scope:t,contentId:nb(),triggerId:nb(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),m_="MenuSubTrigger",Fut=p.forwardRef(fr(function(t,n){const i=Cb(m_,t.__scopeMenu),r=ZA(m_,t.__scopeMenu),s=wRe(m_,t.__scopeMenu),o=VV(m_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,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=_r(n,s.onTriggerChange);return a.jsx(pRe,{asChild:!0,...d,children:a.jsx(bRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":WV(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:Qn(t.onPointerMove,Jw(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Qn(t.onPointerLeave,Jw(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"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||hut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),But="MenuSubContent",Uut=p.forwardRef(fr(function(t,n){const i=gRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Cb(pf,t.__scopeMenu),c=ZA(pf,t.__scopeMenu),u=wRe(But,t.__scopeMenu),d=p.useRef(null),f=_r(n,d);return a.jsx(gC.Provider,{scope:t.__scopeMenu,children:a.jsx(jh,{present:r||l.open,children:a.jsx(gC.Slot,{scope:t.__scopeMenu,children:a.jsx(HV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,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:Qn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Qn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Qn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=put[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function WV(e){return e?"open":"closed"}fr(WV,"getOpenState");function bC(e){return e==="indeterminate"}fr(bC,"isIndeterminate");function dM(e){return bC(e)?"indeterminate":e?"checked":"unchecked"}fr(dM,"getCheckedState");function ORe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}fr(ORe,"focusFirst");function kRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}fr(kRe,"wrapArray");function SRe(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 o=kRe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}fr(SRe,"getNextMatch");function ERe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}fr(ERe,"isPointInPolygon");function CRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ERe(n,t)}fr(CRe,"isPointerInGraceArea");function Jw(e){return t=>t.pointerType==="mouse"?e(t):void 0}fr(Jw,"whenMouse");var Qut=yut,zut=pRe,Vut=xut,Hut=Out,qut=qV,Wut=Aut,Kut=Nut,Gut=Iut,Xut=Dut,Yut=Mut,Zut=$ut,Jut=Fut,edt=Uut,tdt=Object.defineProperty,Bu=(e,t)=>tdt(e,"name",{value:t,configurable:!0}),KV="DropdownMenu",[ndt,xhn]=qc(KV,[dRe]),Uu=dRe(),[idt,ARe]=ndt(KV),rdt=Bu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Uu(t),u=p.useRef(null),[d,f]=Rd({prop:r,defaultProp:s??!1,onChange:o,caller:KV});return a.jsx(idt,{scope:t,triggerId:nb(),triggerRef:u,contentId:nb(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(Qut,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),sdt="DropdownMenuTrigger",adt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=ARe(sdt,i),l=Uu(i),c=_r(n,o.triggerRef);return a.jsx(zut,{asChild:!0,...l,children:a.jsx(Xr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Qn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Qn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),odt=Bu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Uu(t);return a.jsx(Vut,{...i,...n})},"DropdownMenuPortal"),ldt="DropdownMenuContent",cdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=ARe(ldt,i),o=Uu(i),l=p.useRef(!1);return a.jsx(Hut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Qn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Qn(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")),udt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(qut,{...s,...r,ref:n})},"DropdownMenuItem")),ddt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),fdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),hdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),pdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Xut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),mdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuSeparator")),gdt=Bu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Uu(t),[l,c]=Rd({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Zut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),bdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Jut,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),ydt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(edt,{...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")),vdt=rdt,xdt=adt,TRe=odt,wdt=cdt,_Re=udt,Odt=ddt,kdt=fdt,Sdt=hdt,jRe=pdt,Edt=mdt,Cdt=gdt,Adt=bdt,Tdt=ydt,_dt=Object.defineProperty,Ab=(e,t)=>_dt(e,"name",{value:t,configurable:!0}),GV="Popover",[NRe,whn]=qc(GV,[K1]),XV=K1(),[jdt,X1]=NRe(GV),Ndt=Ab(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=XV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Rd({prop:i,defaultProp:r??!1,onChange:s,caller:GV});return a.jsx(oM,{...l,children:a.jsx(jdt,{scope:t,contentId:nb(),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:o,children:n})})},"Popover"),Rdt="PopoverTrigger",Idt=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,...r}=t,s=X1(Rdt,i),o=XV(i),l=_r(n,s.triggerRef),c=a.jsx(Xr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":YV(s.open),...r,ref:l,onClick:Qn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx($V,{asChild:!0,...o,children:c})},"PopoverTrigger")),RRe="PopoverPortal",[Pdt,Ddt]=NRe(RRe,{forceMount:void 0}),Mdt=Ab(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=X1(RRe,t);return a.jsx(Pdt,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),yC="PopoverContent",Ldt=p.forwardRef(Ab(function(t,n){const i=Ddt(yC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=X1(yC,t.__scopePopover);return a.jsx(jh,{present:r||o.open,children:o.modal?a.jsx(Fdt,{...s,ref:n}):a.jsx(Bdt,{...s,ref:n})})},"PopoverContent")),$dt=Xp("PopoverContent.RemoveScroll"),Fdt=p.forwardRef(Ab(function(t,n){const i=X1(yC,t.__scopePopover),r=p.useRef(null),s=_r(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return KNe(l)},[]),a.jsx(PV,{as:$dt,allowPinchZoom:!0,children:a.jsx(IRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Qn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Qn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Bdt=p.forwardRef(Ab(function(t,n){const i=X1(yC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(IRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),IRe=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=X1(yC,i),g=XV(i);return rM(),a.jsx(INe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(FV,{"data-state":YV(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 YV(e){return e?"open":"closed"}Ab(YV,"getState");var PRe=Ndt,DRe=Idt,MRe=Mdt,LRe=Ldt,Udt=Object.defineProperty,_l=(e,t)=>Udt(e,"name",{value:t,configurable:!0}),$Re="Radio",[Qdt,FRe]=qc($Re),[zdt,fM]=Qdt($Re);function BRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,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:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:_l(()=>l==null?void 0:l(),"onCheck")};return a.jsx(zdt,{scope:t,...x,children:URe(d)?d(x):i})}_l(BRe,"RadioProvider");var Vdt="RadioTrigger",Hdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=fM(Vdt,t),g=_r(r,c);return a.jsx(Xr.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Qn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),qdt="RadioIndicator",Wdt=p.forwardRef(_l(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=fM(qdt,i);return a.jsx(jh,{present:r||o.checked,children:a.jsx(Xr.span,{"data-state":ZV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Kdt="RadioBubbleInput",Gdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=fM(Kdt,t),v=_r(r,m),y=YA(s),w=p.useRef(!1),x=p.useRef(o),O=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const E=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(E,"checked").set,T=b!==O.current;O.current=b;const R=x.current!==o;x.current=o;const A=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:A});j.call(S,o),S.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const k=p.useRef(o);return a.jsx(Xr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Qn(n,S=>{w.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function URe(e){return typeof e=="function"}_l(URe,"isFunction");function ZV(e){return e?"checked":"unchecked"}_l(ZV,"getState");var Xdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JV="RadioGroup",[Ydt,Ohn]=qc(JV,[G1,FRe]),QRe=G1(),hM=FRe(),[Zdt,Jdt]=Ydt(JV),eft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=QRe(i),v=XA(f),[y,w]=Rd({prop:l,defaultProp:o??null,onChange:m,caller:JV}),[x,O]=p.useState(null),k=_r(n,O),S=p.useRef(y);return p.useEffect(()=>{const E=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(E instanceof HTMLFormElement){const C=_l(()=>w(S.current),"reset");return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[x,s,w]),a.jsx(Zdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(QV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Xr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),tft="RadioGroupItemProvider",nft="RadioGroupItemTrigger";function zRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=Jdt(tft,t),l=hM(t),c=o.disabled||i;return a.jsx(BRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}_l(zRe,"RadioGroupItemProvider");var ift=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=QRe(i),o=hM(i),{checked:l,disabled:c}=fM(nft,o.__scopeRadio),u=p.useRef(null),d=_r(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=_l(g=>{Xdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=_l(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(zV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(Hdt,{...o,...r,ref:d,onKeyDown:Qn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Qn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),rft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(zRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(ift,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(sft,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),sft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Gdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),aft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Wdt,{...s,...r,ref:n})},"RadioGroupIndicator")),oft=Object.defineProperty,ib=(e,t)=>oft(e,"name",{value:t,configurable:!0}),eH="Switch",[lft,khn]=qc(eH),[cft,tH]=lft(eH);function VRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Rd({prop:n,defaultProp:r??!1,onChange:c,caller:eH}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(E=>E+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(cft,{scope:t,...S,children:HRe(f)?f(S):i})}ib(VRe,"SwitchProvider");var uft="SwitchTrigger",dft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=tH(uft,t),y=_r(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=ib(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,o,h]),a.jsx(Xr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":nH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Qn(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),fft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(VRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(dft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(gft,{__scopeSwitch:i})]})})},"Switch")),hft="SwitchThumb",pft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,...r}=t,s=tH(hft,i);return a.jsx(Xr.span,{"data-state":nH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),mft="SwitchBubbleInput",gft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=tH(mft,t),y=_r(r,v),w=YA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(C,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(E,c),E.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,E=>{x.current&&E.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function HRe(e){return typeof e=="function"}ib(HRe,"isFunction");function nH(e){return e?"checked":"unchecked"}ib(nH,"getState");var bft=Object.defineProperty,yft=(e,t)=>bft(e,"name",{value:t,configurable:!0}),vft="Toggle",xft=p.forwardRef(yft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Rd({prop:i,onChange:s,defaultProp:r??!1,caller:vft});return a.jsx(Xr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Qn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),wft=Object.defineProperty,rb=(e,t)=>wft(e,"name",{value:t,configurable:!0}),Y1="ToggleGroup",[qRe,Shn]=qc(Y1,[G1]),WRe=G1(),Oft=p.forwardRef(rb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(kft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Sft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Y1}\``)},"ToggleGroup")),[KRe,GRe]=qRe(Y1),kft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Rd({prop:i,defaultProp:r??"",onChange:s,caller:Y1});return a.jsx(KRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(XRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Sft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Rd({prop:i,defaultProp:r??[],onChange:s,caller:Y1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(KRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(XRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[Eft,Cft]=qRe(Y1),XRe=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=WRe(i),f=XA(l),h={dir:f,...u};return a.jsx(Eft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(QV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Xr.div,{...h,ref:n})}):a.jsx(Xr.div,{...h,ref:n})})},"ToggleGroupImpl")),AB="ToggleGroupItem",Aft=p.forwardRef(rb(function(t,n){const i=GRe(AB,t.__scopeToggleGroup),r=Cft(AB,t.__scopeToggleGroup),s=WRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(zV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(Oee,{...c,ref:n})}):a.jsx(Oee,{...c,ref:n})},"ToggleGroupItem")),Oee=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=GRe(AB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(xft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Tft=Object.defineProperty,No=(e,t)=>Tft(e,"name",{value:t,configurable:!0}),[iH,Ehn]=qc("Tooltip",[K1]),rH=K1(),_ft="TooltipProvider",jft=700,TB="tooltip.open",[Nft,sH]=iH(_ft),Rft=No(e=>{const{__scopeTooltip:t,delayDuration:n=jft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Nft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),_B="Tooltip",[Ift,JA]=iH(_B),Pft=No(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=sH(_B,e.__scopeTooltip),u=rH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=nb(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=Rd({prop:i,defaultProp:r??!1,onChange:No(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(TB))):c.onClose(),s==null||s(T)},"onChange"),caller:_B}),k=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),C=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 j=h??g;return a.jsx(oM,{...u,children:a.jsx(Ift,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:p.useCallback(()=>{v?E():(window.clearTimeout(b.current),b.current=0)},[E,v]),onOpen:S,onClose:E,disableHoverableContent:v,children:n})})},"Tooltip"),kee="TooltipTrigger",Dft=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,...r}=t,s=JA(kee,i),o=sH(kee,i),l=rH(i),c=p.useRef(null),u=_r(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]),a.jsx($V,{asChild:!0,...l,children:a.jsx(Xr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Qn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Qn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Qn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Qn(t.onBlur,s.onClose),onClick:Qn(t.onClick,s.onClose)})})},"TooltipTrigger")),YRe="TooltipPortal",[Mft,Lft]=iH(YRe,{forceMount:void 0}),$ft=No(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=JA(YRe,t);return a.jsx(Mft,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),vC="TooltipContent",Fft=p.forwardRef(No(function(t,n){const i=Lft(vC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=JA(vC,t.__scopeTooltip);return a.jsx(jh,{present:r||l.open,children:l.disableHoverableContent?a.jsx(ZRe,{side:s,...o,ref:n}):a.jsx(Bft,{side:s,...o,ref:n})})},"TooltipContent")),Bft=p.forwardRef(No(function(t,n){const i=JA(vC,t.__scopeTooltip),r=sH(vC,t.__scopeTooltip),s=p.useRef(null),o=_r(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=JRe(w,y.getBoundingClientRect()),O=eIe(w,x),k=tIe(v.getBoundingClientRect()),S=iIe([...O,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=No(y=>g(y,f),"handleTriggerLeave"),v=No(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=No(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=!nIe(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(ZRe,{...t,ref:o})},"TooltipContentHoverable")),Uft=uNe("TooltipContent"),ZRe=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=JA(vC,i),f=rH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(TB,h),()=>document.removeEventListener(TB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=No(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 Od(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(FV,{"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:[a.jsx(Uft,{children:r}),s?a.jsx(plt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function JRe(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")}}No(JRe,"getExitSideFromRect");function eIe(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}No(eIe,"getPaddedExitPoints");function tIe(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}]}No(tIe,"getPointsFromRect");function nIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}No(nIe,"isPointInPolygon");function iIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),rIe(t)}No(iIe,"getHull");function rIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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)}No(rIe,"getHullPresorted");var Qft=Rft,zft=Pft,sIe=Dft,Vft=$ft,Hft=Fft;function sb(e){const t=p.useRef(e);return t.current=e,t}let e1=[],g_=!1;const See=e=>{var t,n;if(e.key==="Escape"){const[i]=e1;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},aIe=()=>{e1.length>0&&!g_?(document.body.addEventListener("keydown",See),g_=!0):e1.length===0&&g_&&(document.body.removeEventListener("keydown",See),g_=!1)},qft=e=>{e1.unshift(e),aIe()},Wft=({id:e})=>{e1=e1.filter(t=>t.id!==e),aIe()},eT=(e,t)=>{const n=p.useId(),i=sb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return qft(r),()=>Wft(r)},[n,e,i])},Kft=p.createContext(null);function oIe(){const e=p.useContext(Kft);return(e==null?void 0:e.linkComponent)??"a"}function tT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Gft=()=>rNe,Eee=(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},Lv=()=>{},$v=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Xft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=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(o):o.concat(l)}function Yft(e,t,n){if((rNe||Got)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Zft="_TransitionGroupChild_1hv1z_1",Jft={TransitionGroupChild:Zft},lIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},eht=e=>({...lIe,enter:!e}),tht=(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 lIe}},nht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,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(tht,eht(o||!1)),x=p.useRef(!1),O=p.useRef(null),k=p.useRef(c);k.current=c;const S=p.useRef(u);S.current=u;const E=p.useRef(null),C=p.useCallback(j=>{const T=O.current;if(!(!T||j===E.current))switch(E.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return Ni.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),C("exit");const A=pI(()=>{w({type:"exit-active"}),C("exit-active"),R=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),C("enter");const T=pI(()=>{w({type:"enter-active"}),C("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),C("enter-complete")},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,C]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:tT([O,e]),className:Qi(i,Jft.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})},iht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return kV(()=>s(!0),r?null:i),r?a.jsx(nht,{...e}):null},Z1=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Gft()}=e,m=$v(e.onEnter??Lv),g=$v(e.onEnterActive??Lv),b=$v(e.onEnterComplete??Lv),v=$v(e.onExit??Lv),y=$v(e.onExitActive??Lv),w=$v(e.onExitComplete??Lv);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(E=>E.filter(C=>S.key!==C.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,k]=p.useState(()=>Eee(i).map(S=>({...x(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const E=Eee(i);return Xft(E,S,x,f)})},[i,f,x]),Yft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,S=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:S}))}):a.jsx(a.Fragment,{children:O.map(({component:S,...E})=>a.jsx(iht,{...E,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:S},S.key))})},rht="_Button_1864l_1",sht="_ButtonInner_1864l_4",aht="_ButtonLoader_1864l_749",s4={Button:rht,ButtonInner:sht,ButtonLoader:aht},_t=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="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,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return a.jsxs("button",{type:t,className:Qi(s4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"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:SV,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...x,children:[a.jsx(Z1,{className:s4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(KA,{},"loader")}),a.jsx("span",{className:s4.ButtonInner,children:OV(m)})]})},oht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function lht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function cht(e,t=document.body){if(typeof e=="string")return Cee(e,t);try{return oht()?(await navigator.clipboard.write([lht(e)]),!0):e["text/plain"]?Cee(e["text/plain"],t):!1}catch{return!1}}async function Cee(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 uht="_TransitionItem_1o7b1_1",dht={TransitionItem:uht},fht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=bht(e);return a.jsx(t,{className:Qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(Z1,{as:t,className:Qi(dht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},hht=400,pht=500,mht=200,ght=300;function bht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=K3(e),s=K3(t),o=K3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?pht:hht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?ght:mht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=V0({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":W3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":G3(t),"tg-enter-duration":l_(c),"tg-enter-delay":l_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":W3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":G3(n),"tg-exit-duration":l_(d),"tg-exit-delay":l_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":W3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":G3(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 aH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),cht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(_t,{...i,onClick:l,children:[a.jsx(fht,{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?a.jsx(hC,{},"copied-icon"):a.jsx(jje,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},yht="_Menu_1t4b0_1",vht="_MenuList_1t4b0_3",xht="_MenuItemContent_1t4b0_53",wht="_MenuItem_1t4b0_53",Oht="_ItemActions_1t4b0_98",kht="_PressableInner_1t4b0_117",Sht="_Separator_1t4b0_135",Eht="_SubMenuItem_1t4b0_139",Cht="_SubTriggerIcon_1t4b0_141",Aht="_RadioItem_1t4b0_151",Tht="_RadioIndicatorActive_1t4b0_158",_ht="_RadioIndicator_1t4b0_158",jht="_CheckboxItem_1t4b0_249",Nht="_CheckboxIndicator_1t4b0_256",Rht="_CheckboxCircle_1t4b0_269",js={Menu:yht,MenuList:vht,MenuItemContent:xht,MenuItem:wht,ItemActions:Oht,PressableInner:kht,Separator:Sht,SubMenuItem:Eht,SubTriggerIcon:Cht,RadioItem:Aht,RadioIndicatorActive:Tht,RadioIndicator:_ht,CheckboxItem:jht,CheckboxIndicator:Nht,CheckboxCircle:Rht},cIe=p.createContext(null),nT=()=>{const e=p.useContext(cIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},er=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=sb(n),u=sb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);eT(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(cIe.Provider,{value:f,children:a.jsx(vdt,{open:l,onOpenChange:d,modal:r,children:e})})},Iht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=nT(),o=l=>{s||l.preventDefault()};return i?a.jsx(_Re,{className:Qi(js.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:js.PressableInner,children:t})}):a.jsx("div",{className:Qi(js.MenuItemContent,e),children:t})},Pht=({className:e,children:t})=>a.jsx("div",{className:Qi(js.ItemActions,e),children:t}),Dht=({children:e,onClick:t})=>{const{setOpen:n}=nT();return a.jsx(_t,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Mht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=nT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=oIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(_Re,{asChild:!0,className:Qi(js.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:js.PressableInner,children:n})})})},Lht=({className:e})=>a.jsx(Edt,{className:Qi(js.Separator,e),role:"separator"}),$ht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=nT();return a.jsx(TRe,{forceMount:!0,children:a.jsx(Z1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(wdt,{forceMount:!0,className:js.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:Mp,style:V0({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Fht=({children:e,disabled:t})=>a.jsx(xdt,{asChild:!0,disabled:t,children:e}),uIe=p.createContext(null),dIe=()=>{const e=p.useContext(uIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Bht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=sb(n),u=sb(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]);eT(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(uIe.Provider,{value:f,children:a.jsx(Cdt,{open:l,onOpenChange:d,children:e})})},Uht=({className:e,children:t,disabled:n})=>{const{open:i}=nT(),{triggerRef:r}=dIe(),s=o=>{i||o.preventDefault()};return a.jsx(Adt,{ref:r,className:Qi(js.MenuItem,js.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:js.PressableInner,children:[t,a.jsx(Jst,{width:"16",height:"16",className:js.SubTriggerIcon})]})})},Qht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=dIe();return a.jsx(TRe,{forceMount:!0,children:a.jsx(Z1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(Tdt,{className:js.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Mp,style:V0({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},zht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(kdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Vht=({className:e,children:t,...n})=>a.jsx(Sdt,{className:Qi(js.MenuItem,js.RadioItem,e),...n,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.RadioIndicator,children:a.jsx(jRe,{className:js.RadioIndicatorActive})}),t]})}),Hht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(Odt,{className:Qi(js.MenuItem,js.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.CheckboxIndicator,children:a.jsx(jRe,{children:i==="ghost"?a.jsx(hC,{className:"size-4"}):a.jsx("div",{className:js.CheckboxCircle,children:a.jsx(hC,{className:"size-4"})})})}),t]})});er.Content=$ht;er.Item=Iht;er.ItemActions=Pht;er.ItemAction=Dht;er.Link=Mht;er.Separator=Lht;er.Trigger=Fht;er.Sub=Bht;er.SubTrigger=Uht;er.SubContent=Qht;er.CheckboxItem=Hht;er.RadioGroup=zht;er.RadioItem=Vht;const qht="_Tooltip_16g2y_1",Wht="_TriggerDecorator_16g2y_73",fIe={Tooltip:qht,TriggerDecorator:Wht},ka=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=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),[k,S]=p.useState(!1);kV(()=>S(!1),k?400:null);const E=r??x,C=T=>{typeof r!="boolean"&&(O(T),u&&S(T))},j=T=>{u&&k&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(hIe,{open:E,delayDuration:o,onOpenChange:C,disableHoverableContent:!l,children:[a.jsx(sIe,{asChild:!0,children:a.jsx(lNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(pIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},hIe=({children:e,open:t,onOpenChange:n,...i})=>(eT(t,()=>{n(!1)}),a.jsx(Qft,{children:a.jsx(zft,{open:t,onOpenChange:n,...i,children:e})})),pIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Vft,{children:a.jsx(Hft,{...u,className:Qi(fIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Mp,children:e})}),Kht=({children:e,asChild:t=!0,...n})=>a.jsx(sIe,{asChild:t,...n,children:e}),Ght=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(lNe,{ref:r,...s,className:Qi(fIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};ka.Root=hIe;ka.Content=pIe;ka.Trigger=Kht;ka.TriggerDecorator=Ght;const Xht=50,Aee=48;function Yht(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Zht(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 Q("search.untitledSession")}function Jht(e,t,n){const i=Math.max(0,t-Aee),r=Math.min(e.length,t+n+Aee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await aC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Yht(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Zht(l),snippet:Jht(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Xht)}async function tpt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await OTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function npt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await wTe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function ipt(e,t,n){return e==="session"?{results:await ept(n.userId,n.appId,t)}:e==="web"?tpt(n.appId,t):npt(e,n.appId,n.userId,t)}function mIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.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"}),a.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 rpt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(mIe,{})})}function spt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(mIe,{mirrored:!0})})}function apt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 opt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function lpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 gIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.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 bIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function cpt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function upt({open:e}){return a.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:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function dpt({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return a.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:[a.jsx(opt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function fpt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=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:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function mI(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 Tee(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 hpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=Te("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),[k,S]=p.useState(!1),E=p.useRef(0),C=p.useRef(null),j=fpt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{E.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function M(H){var q;(q=C.current)!=null&&q.contains(H.target)||S(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[k]);async function A(M,H){var z;const q=M.trim();if(!q||!((z=j.find(J=>J.id===H))!=null&&z.ready))return;const U=++E.current;w(!0),O(!0);let Z;try{Z=await ipt(H,q,{userId:e,appId:t})}catch(J){const ne=J instanceof Error?J.message:String(J);Z={results:[],note:o("search.failed",{message:ne})}}U===E.current&&(g(Z.results),v(Z.note),w(!1))}function N(M){E.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function P(M){E.current+=1,d(M),S(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?mI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:C,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(upt,{open:k})]}),k&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,Z;const H=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(Z=n==null?void 0:n.components)==null?void 0:Z.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=H?[H.name,H.backend?mI(H.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),A(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Bi,{className:"icon spin"}):a.jsx(cpt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,H)=>a.jsx(ppt,{result:M,agentLabel:r,onOpen:s,locale:c},H)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function ppt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Uje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Tee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(nM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(m0,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(_ee,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(_ee,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:"",e.ts?` · ${Tee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function _ee({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.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"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.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 mpt({filled:e=!1,...t}){return a.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:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.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 gpt({filled:e=!1,...t}){return a.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:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.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 yIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.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"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.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"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const pM="/assets/media/logo-DCsNZy-k.svg",oH="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 bpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const jee="(max-width: 860px)";function Nee({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)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function ypt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function vpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.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 xpt(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 wpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Opt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=wet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=xpt(h),b=Oet(n),v=b===d?"":b,y=xA(u.resolvedLanguage??u.language)??vA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(er,{modal:!0,children:[a.jsx(er.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(er.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${wpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(mm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(er.Sub,{children:[a.jsx(er.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(vpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(er.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(er.RadioGroup,{value:y,onChange:w=>{_qe(w)},indicatorPosition:"end",children:NU.map(w=>a.jsx(er.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(yIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Vat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(ka,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(lat,{className:"icon"})})}),a.jsx(ka,{compact:!0,content:c("sidebar:account.developerResources"),children:a.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:a.jsx(Xst,{className:"icon"})})})]})]})})}function kpt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,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:k,onSystemInfo:S,onUserManagement:E,onIssueFeedback:C,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:A}){const{t:N}=Te("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!E,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(jee).matches),[M,H]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||iM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,J)=>J.createdAt-z.createdAt),U=()=>{F.current=!1,H(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(jee),J=ne=>{ne.matches?H(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,H(!1))};return z.addEventListener("change",J),()=>z.removeEventListener("change",J)},[]);const Z=t==="byteplus"?oH:pM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||Z,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(spt,{className:"icon"}):a.jsx(rpt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.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:[a.jsx(apt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(dpt,{active:r==="search",onClick:f}),a.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:[a.jsx(lpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.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:[a.jsx(Sat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.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:[a.jsx(gIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.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:[a.jsx(pV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.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:[a.jsx(ypt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.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:[a.jsx(bpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:E,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx(Bot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.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:a.jsx(ic,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const J=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":J?"page":void 0,title:ne,disabled:W,children:[a.jsx(Nee,{title:ne}),J?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(GJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const J=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":J?"page":void 0,title:z.title,children:[a.jsx(Nee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(KA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(GJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(Opt,{activePage:r,access:o,userInfo:R,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onIssueFeedback:C,onLogout:A})})]})}const Spt={name:"studio_share_space"},Ept={name:"studio_review_space"},vIe={share:Spt,review:Ept},Cpt=vIe.share.name,xIe=vIe.review.name,Apt=[Cpt,xIe];function wIe(e){return Apt.includes(e.trim().toLowerCase())}function Tpt(e){return e.name===xIe}const _pt="/web/skill-management";class t1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function dc(e,t={},n=ho){return fetch(Ta(`${_pt}${e}`),{...t,headers:ul(uc(t.headers)),signal:po(t.signal,n)})}async function iT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new t1(n,e.status,i,e.statusText,r,s)}async function fc(e,t){if(!e.ok)throw await iT(e,t);return e.json()}async function jpt(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),fc(await dc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function Npt(e){if(wIe(e.name))throw new t1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function Rpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Ipt(e){return fc(await dc(`/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),Q("skills.submitReviewFailed"))}async function Ppt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},hr),Q("skills.reviewFilesFailed"))}async function Mpt(e){return fc(await dc(`/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),Q("skills.decideReviewFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function $pt(e){if(wIe(e.name))throw new t1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Fpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},hr),Q("skills.uploadFailed"))}async function Upt(e){return fc(await dc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},hr),Q("skills.validateFailed"))}async function Qpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function OIe(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 fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function zpt(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 dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},hr);n.ok||await fc(n,Q("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()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",the,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",ove,!0,!0);function Xt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Dc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function mM(e,t){const n=await fetch(Ta(e),{headers:ul(uc({accept:"application/json"})),signal:po(t,ho)});if(!n.ok)throw await iT(n,Xt("helpers.skills.agentKitRequestFailed"));return n.json()}async function kIe(){return((await mM("/web/skill-spaces")).items||[]).filter(t=>!Tpt(t))}async function SIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function EIe(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),mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Vpt(e,t,n,i,r,s,o){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)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function Hpt(e,t){const n=jy(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 jy(e){return e.skillId||e.skillName}function qpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Wpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function CIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Wpt,alt:"","aria-hidden":"true"})]})}async function AIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await iT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function Kpt(e){return AIe(e,{},ho)}function Gpt(e){return AIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},hr)}function Xpt({target:e,onClose:t,onSaved:n}){const{t:i}=Te("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),O=p.useRef(!1),k=p.useRef(!0),S=p.useRef({dirty:!1,onClose:t});S.current={dirty:r!==null&&o!==r.content,onClose:t};const E=p.useRef(null);function C(){O.current||(S.current.dirty?y(!0):S.current.onClose())}p.useEffect(()=>{var N,P;k.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function A(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),C()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",A),()=>{var I;k.current=!1,(I=E.current)==null||I.abort(),window.removeEventListener("keydown",A),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),Kpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(O.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;O.current=!0,f(!0),m("");const T=new AbortController;E.current=T;try{await Gpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),k.current&&(n(),t())}catch(R){k.current&&m(R instanceof t1&&R.status===409?"documentConflict":R instanceof t1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{O.current=!1,k.current&&f(!1)}}return yi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(Ci,{variant:"ghost",disabled:d,onClick:C,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(CIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(Ci,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(Ci,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(Ci,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(Ci,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function xC(e){return e.trimEnd().replace(/[。.]+$/,"")}function TIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,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 k=await kIe();O||(s(k),k.length>0&&u(k[0].id))}catch(k){O||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await SIe(c,O==null?void 0:O.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?qpt(v.id,v.region,n):"",w=(O,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===O&&(S.version||"")===k),x=O=>{if(!v)return;const k=jy(O);if(w(k,O.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===O.version)));else{const S=Hpt(v,O);t([...e,{source:"skillspace",folder:S.folder||O.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.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=>a.jsxs("option",{value:O.id,children:[Dc(O)||O.id,O.description?` — ${xC(O.description)}`:""]},O.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Oh(v.region,n)}),y&&a.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:a.jsx(m0,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(O=>{const k=jy(O),S=w(k,O.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>x(O),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(O.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(jat,{className:"cw-i cw-i-sm"})," ",Dc(v)||c]})]})]},`${k}/${O.version}`)})})]})})}function rT(e,t){return e.map(n=>({...n,get label(){return Xt(`${t}.${n.id}.label`)},get desc(){return Xt(`${t}.${n.id}.description`)}}))}function pd(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Xt(r)});return n}const _Ie="https://ark.cn-beijing.volces.com/api/v3/";pd({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const SN=[pd({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:_Ie}],gI=[],bI={get label(){return Xt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Ypt={get label(){return Xt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},jIe="https://api.vikingdb.cn-beijing.volces.com/openviking",Zpt=`{ +`)},Ect=0,L0=[];function Cct(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Ect++)[0],s=p.useState(qNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Wlt([e.lockRef.current],(e.shards||[]).map(Oee),!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!o.current.allowPinchZoom;var y=d_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],k="deltaY"in b?b.deltaY:w[1]-y[1],S,O=b.target,A=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&O.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===O||j.contains(O):!1;if(T)return!1;var R=wee(A,O);if(!R)return!0;if(R?S=A:(S=A==="v"?"h":"v",R=wee(A,O)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||k)&&(i.current=S),!S)return!0;var C=i.current||S;return kct(C,v,b,C==="h"?x:k)},[]),c=p.useCallback(function(b){var v=b;if(!(!L0.length||L0[L0.length-1]!==s)){var y="deltaY"in v?kee(v):d_(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Oct(S.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(Oee).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=x.length>0?l(v,x[0]):!o.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Act(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),d=p.useCallback(function(b){n.current=d_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,kee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,d_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return L0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,M0),document.addEventListener("touchmove",c,M0),document.addEventListener("touchstart",d,M0),function(){L0=L0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,M0),document.removeEventListener("touchmove",c,M0),document.removeEventListener("touchstart",d,M0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Sct(r)}):null,m?p.createElement(mct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Act(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tct=nct(HNe,Cct);var PV=p.forwardRef(function(e,t){return p.createElement(iM,eh({},e,{ref:t,sideCar:Tct}))});PV.classNames=iM.classNames;var _ct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$0=new WeakMap,f_=new WeakMap,h_={},t4=0,XNe=function(e){return e&&(e.host||XNe(e.parentNode))},jct=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=XNe(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})},Nct=function(e,t,n,i){var r=jct(t,Array.isArray(e)?e:[e]);h_[n]||(h_[n]=new WeakMap);var s=h_[n],o=[],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=($0.get(h)||0)+1,v=(s.get(h)||0)+1;$0.set(h,b),s.set(h,v),o.push(h),b===1&&g&&f_.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(),t4++,function(){o.forEach(function(f){var h=$0.get(f)-1,m=s.get(f)-1;$0.set(f,h),s.set(f,m),h||(f_.has(f)||f.removeAttribute(i),f_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||($0=new WeakMap,$0=new WeakMap,f_=new WeakMap,h_={})}},YNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=_ct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Nct(i,r,n,"aria-hidden")):function(){return null}},Rct=Object.defineProperty,Ict=(e,t)=>Rct(e,"name",{value:t,configurable:!0});function eT(e){const[t,n]=p.useState(void 0);return Od(()=>{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 o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Ict(eT,"useSize");var Pct=Object.defineProperty,Jp=(e,t)=>Pct(e,"name",{value:t,configurable:!0}),DV="Checkbox",[Dct,khn]=Qc(DV),[Mct,MV]=Dct(DV);function ZNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:DV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:$p(r)?!1:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(Mct,{scope:t,...O,children:JNe(f)?f(O):i})}Jp(ZNe,"CheckboxProvider");var Lct="CheckboxTrigger",$ct=p.forwardRef(Jp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=MV(Lct,t),y=Rr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const k=Jp(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[o,h]),a.jsx(Jr.button,{type:"button",role:"checkbox","aria-checked":$p(u)?"mixed":u,"aria-required":d,"data-state":LV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Un(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Un(i,x=>{g(),h(k=>$p(k)?!0:!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Fct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(ZNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx($ct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(zct,{__scopeCheckbox:i})]})})},"Checkbox")),Bct="CheckboxIndicator",Uct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=MV(Bct,i);return a.jsx(Rh,{present:r||$p(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{"data-state":LV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Qct="CheckboxBubbleInput",zct=p.forwardRef(Jp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=MV(Qct,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});A.indeterminate=$p(c),T.call(A,$p(c)?!1:c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef($p(c)?!1:c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function JNe(e){return typeof e=="function"}Jp(JNe,"isFunction");function $p(e){return e==="indeterminate"}Jp($p,"isIndeterminate");function LV(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}Jp(LV,"getState");var Vct=Object.defineProperty,Ig=(e,t)=>Vct(e,"name",{value:t,configurable:!0}),eRe="Popper",[tRe,X1]=Qc(eRe),[Hct,nRe]=tRe(eRe),qct=Ig(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Hct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Wct="PopperAnchor",Kct=p.forwardRef(Ig(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=nRe(Wct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=Rr(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=o.placementState&&rM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Jr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),iRe="PopperContent",[Gct,Ohn]=tRe(iRe),Xct=p.forwardRef(Ig(function(t,n){var X,le,V,Y,K,ue,te;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="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=nRe(iRe,i),[w,x]=p.useState(null),k=Rr(n,x),[S,O]=p.useState(null),A=eT(S),E=(A==null?void 0:A.width)??0,j=(A==null?void 0:A.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},C=Array.isArray(d)?d:[d],N=C.length>0,P={padding:R,boundary:C.filter(rRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=J_e({strategy:"fixed",placement:T,whileElementsMounted:Ig((...Oe)=>aB(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[eje({mainAxis:s+j,alignmentAxis:l}),u&&tje({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?nje():void 0,...P}),u&&ije({...P}),rje({...P,apply:Ig(({elements:Oe,rects:fe,availableWidth:pe,availableHeight:Se})=>{const{width:ve,height:Le}=fe.reference,He=Oe.floating.style;He.setProperty("--radix-popper-available-width",`${pe}px`),He.setProperty("--radix-popper-available-height",`${Se}px`),He.setProperty("--radix-popper-anchor-width",`${ve}px`),He.setProperty("--radix-popper-anchor-height",`${Le}px`)},"apply")}),S&&rst({element:S,padding:c}),Yct({arrowWidth:E,arrowHeight:j}),m&&ist({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;Od(()=>(M(_),()=>{M(void 0)}),[_,M]);const[H,q]=rM(_),U=yf(b);Od(()=>{L&&(U==null||U())},[L,U]);const Z=(X=F.arrow)==null?void 0:X.x,z=(le=F.arrow)==null?void 0:le.y,J=((V=F.arrow)==null?void 0:V.centerOffset)!==0,[ne,W]=p.useState();return Od(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.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":[(Y=F.transformOrigin)==null?void 0:Y.x,(K=F.transformOrigin)==null?void 0:K.y].join(" "),...((ue=F.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(Gct,{scope:i,placedSide:H,placedAlign:q,onArrowChange:O,arrowX:Z,arrowY:z,shouldHideArrow:J,children:a.jsx(Jr.div,{"data-side":H,"data-align":q,...v,ref:k,style:{...v.style,animation:L?(te=v.style)==null?void 0:te.animation:"none"}})})})},"PopperContent"));function rRe(e){return e!==null}Ig(rRe,"isNotNull");var Yct=Ig(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=rM(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=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function rM(e){const[t,n="center"]=e.split("-");return[t,n]}Ig(rM,"getSideAndAlignFromPlacement");var sM=qct,$V=Kct,FV=Xct,Zct=Object.defineProperty,BV=(e,t)=>Zct(e,"name",{value:t,configurable:!0}),n4=!1;function sRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}BV(sRe,"useIsHydrated");var aRe=_v[" useSyncExternalStore ".trim().toString()];function oRe(){return()=>{}}BV(oRe,"subscribe");function lRe(){return aRe(oRe,()=>!0,()=>!1)}BV(lRe,"useIsHydratedModern");var Jct=typeof aRe=="function"?lRe:sRe,eut=Object.defineProperty,Bv=(e,t)=>eut(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",tut={bubbles:!1,cancelable:!0},aM="RovingFocusGroup",[OB,cRe,nut]=AV(aM),[iut,Y1]=Qc(aM,[nut]),[rut,sut]=iut(aM),aut=p.forwardRef(Bv(function(t,n){return a.jsx(OB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(OB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(out,{...t,ref:n})})})},"RovingFocusGroup")),out=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=Rr(n,m),b=JA(o),[v,y]=Id({prop:l,defaultProp:c??null,onChange:u,caller:aM}),[w,x]=p.useState(!1),k=yf(d),S=cRe(i),O=p.useRef(!1),[A,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,k),()=>j.removeEventListener(i4,k)},[k]),a.jsx(rut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Jr.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Un(t.onMouseDown,()=>{O.current=!0}),onFocus:Un(t.onFocus,j=>{const T=!O.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,tut);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const C=S().filter(_=>_.focusable),N=C.find(_=>_.active),P=C.find(_=>_.id===v),D=[N,P,...C].filter(Boolean).map(_=>_.ref.current);UV(D,f)}}O.current=!1}),onBlur:Un(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),lut="RovingFocusGroupItem",cut=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=Jg(),d=o||u,f=sut(lut,i),h=f.currentTabStopId===d,m=cRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Jct();return Od(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(OB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Jr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Un(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Un(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Un(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=dRe(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(O=>O.focusable).map(O=>O.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const O=S.indexOf(w.currentTarget);S=f.loop?fRe(S,O+1):S.slice(O+1)}setTimeout(()=>UV(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),uut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bv(uRe,"getDirectionAwareKey");function dRe(e,t,n){const i=uRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return uut[i]}Bv(dRe,"getFocusIntent");function UV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Bv(UV,"focusFirst");function fRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Bv(fRe,"wrapArray");var QV=aut,zV=cut,dut=Object.defineProperty,br=(e,t)=>dut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],fut=["ArrowDown","PageUp","Home"],hRe=["ArrowUp","PageDown","End"],hut=[...fut,...hRe],put={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},mut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},oM="Menu",[yC,gut,but]=AV(oM),[Uv,pRe]=Qc(oM,[but,X1,Y1]),lM=X1(),mRe=Y1(),[gRe,Ob]=Uv(oM),[yut,tT]=Uv(oM),vut=br(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=lM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=yf(s),h=JA(r);return p.useEffect(()=>{const m=br(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=br(()=>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=br(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(sM,{...l,children:a.jsx(gRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(yut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),bRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t,s=lM(i);return a.jsx($V,{...s,...r,ref:n})},"MenuAnchor")),yRe="MenuPortal",[xut,vRe]=Uv(yRe,{forceMount:void 0}),wut=br(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Ob(yRe,t);return a.jsx(xut,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),df="MenuContent",[kut,VV]=Uv(df),Out=p.forwardRef(br(function(t,n){const i=vRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Ob(df,t.__scopeMenu),l=tT(df,t.__scopeMenu);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||o.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(Sut,{...s,ref:n}):a.jsx(Eut,{...s,ref:n})})})})},"MenuContent")),Sut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu),r=p.useRef(null),s=Rr(n,r);return p.useEffect(()=>{const o=r.current;if(o)return YNe(o)},[]),a.jsx(HV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Un(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Eut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu);return a.jsx(HV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Cut=Yp("MenuContent.ScrollLock"),HV=p.forwardRef(br(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Ob(df,i),w=tT(df,i),x=lM(i),k=mRe(i),S=gut(i),[O,A]=p.useState(null),E=p.useRef(null),j=Rr(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),C=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?PV:p.Fragment,_=b?{as:Cut,allowPinchZoom:!0}:void 0,L=br(M=>{var W,X;const H=R.current+M,q=S().filter(le=>!le.disabled),U=document.activeElement,Z=(W=q.find(le=>le.ref.current===U))==null?void 0:W.textValue,z=q.map(le=>le.textValue),J=ARe(z,H,Z),ne=(X=q.find(le=>le.textValue===J))==null?void 0:X.ref.current;br(function le(V){R.current=V,window.clearTimeout(T.current),V!==""&&(T.current=window.setTimeout(()=>le(""),1e3))},"updateSearch")(H),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),nM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&_Re(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(kut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var H;F(M)||((H=E.current)==null||H.focus(),A(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:C,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(MNe,{asChild:!0,trapped:s,onMountAutoFocus:Un(o,M=>{var H;M.preventDefault(),(H=E.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(QV,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Un(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(FV,{role:"menu","aria-orientation":"vertical","data-state":WV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Un(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&Z&&L(M.key));const z=E.current;if(M.target!==z||!hut.includes(M.key))return;M.preventDefault();const ne=S().filter(W=>!W.disabled).map(W=>W.ref.current);hRe.includes(M.key)&&ne.reverse(),ERe(ne)}),onBlur:Un(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Un(t.onPointerMove,t1(M=>{const H=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(H)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Aut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",See="menu.itemSelect",qV=p.forwardRef(br(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=tT(EB,t.__scopeMenu),c=VV(EB,t.__scopeMenu),u=Rr(n,o),d=p.useRef(!1),f=br(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(See,{bubbles:!0,cancelable:!0});h.addEventListener(See,g=>r==null?void 0:r(g),{once:!0}),CV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(xRe,{...s,ref:u,disabled:i,onClick:Un(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Un(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Un(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),xRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=VV(EB,i),c=mRe(i),u=p.useRef(null),d=Rr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(yC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(zV,{asChild:!0,...c,focusable:!r,children:a.jsx(Jr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Un(t.onPointerMove,t1(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Un(t.onPointerLeave,t1(b=>l.onItemLeave(b))),onFocus:Un(t.onFocus,()=>h(!0)),onBlur:Un(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Tut=p.forwardRef(br(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(kRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(qV,{role:"menuitemcheckbox","aria-checked":vC(i)?"mixed":i,...s,ref:n,"data-state":cM(i),onSelect:Un(s.onSelect,()=>r==null?void 0:r(vC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),_ut="MenuRadioGroup",[jut,Nut]=Uv(_ut,{value:void 0,onValueChange:br(()=>{},"onValueChange")}),Rut=p.forwardRef(br(function(t,n){const{value:i,onValueChange:r,...s}=t,o=yf(r);return a.jsx(jut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Aut,{...s,ref:n})})},"MenuRadioGroup")),Iut="MenuRadioItem",Put=p.forwardRef(br(function(t,n){const{value:i,...r}=t,s=Nut(Iut,t.__scopeMenu),o=i===s.value;return a.jsx(kRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(qV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":cM(o),onSelect:Un(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),wRe="MenuItemIndicator",[kRe,Dut]=Uv(wRe,{checked:!1}),Mut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Dut(wRe,i);return a.jsx(Rh,{present:r||vC(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{...s,ref:n,"data-state":cM(o.checked)})})},"MenuItemIndicator")),Lut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),ORe="MenuSub",[$ut,SRe]=Uv(ORe),Fut=br(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Ob(ORe,t),o=lM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=yf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(sM,{...o,children:a.jsx(gRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx($ut,{scope:t,contentId:Jg(),triggerId:Jg(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),p_="MenuSubTrigger",But=p.forwardRef(br(function(t,n){const i=Ob(p_,t.__scopeMenu),r=tT(p_,t.__scopeMenu),s=SRe(p_,t.__scopeMenu),o=VV(p_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,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=Rr(n,s.onTriggerChange);return a.jsx(bRe,{asChild:!0,...d,children:a.jsx(xRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":WV(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:Un(t.onPointerMove,t1(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Un(t.onPointerLeave,t1(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,k=g[w?"left":"right"],S=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:k,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:k,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Un(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||put[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Uut="MenuSubContent",Qut=p.forwardRef(br(function(t,n){const i=vRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Ob(df,t.__scopeMenu),c=tT(df,t.__scopeMenu),u=SRe(Uut,t.__scopeMenu),d=p.useRef(null),f=Rr(n,d);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||l.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:a.jsx(HV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,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:Un(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Un(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Un(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=mut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function WV(e){return e?"open":"closed"}br(WV,"getOpenState");function vC(e){return e==="indeterminate"}br(vC,"isIndeterminate");function cM(e){return vC(e)?"indeterminate":e?"checked":"unchecked"}br(cM,"getCheckedState");function ERe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}br(ERe,"focusFirst");function CRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}br(CRe,"wrapArray");function ARe(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 o=CRe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}br(ARe,"getNextMatch");function TRe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}br(TRe,"isPointInPolygon");function _Re(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return TRe(n,t)}br(_Re,"isPointerInGraceArea");function t1(e){return t=>t.pointerType==="mouse"?e(t):void 0}br(t1,"whenMouse");var zut=vut,Vut=bRe,Hut=wut,qut=Out,Wut=qV,Kut=Tut,Gut=Rut,Xut=Put,Yut=Mut,Zut=Lut,Jut=Fut,edt=But,tdt=Qut,ndt=Object.defineProperty,Vu=(e,t)=>ndt(e,"name",{value:t,configurable:!0}),KV="DropdownMenu",[idt,Shn]=Qc(KV,[pRe]),Hu=pRe(),[rdt,jRe]=idt(KV),sdt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Hu(t),u=p.useRef(null),[d,f]=Id({prop:r,defaultProp:s??!1,onChange:o,caller:KV});return a.jsx(rdt,{scope:t,triggerId:Jg(),triggerRef:u,contentId:Jg(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(zut,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),adt="DropdownMenuTrigger",odt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=jRe(adt,i),l=Hu(i),c=Rr(n,o.triggerRef);return a.jsx(Vut,{asChild:!0,...l,children:a.jsx(Jr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Un(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Un(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),ldt=Vu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Hu(t);return a.jsx(Hut,{...i,...n})},"DropdownMenuPortal"),cdt="DropdownMenuContent",udt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=jRe(cdt,i),o=Hu(i),l=p.useRef(!1);return a.jsx(qut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Un(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Un(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")),ddt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuItem")),fdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),hdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),pdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Xut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),mdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),gdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Zut,{...s,...r,ref:n})},"DropdownMenuSeparator")),bdt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Hu(t),[l,c]=Id({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Jut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),ydt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(edt,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),vdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(tdt,{...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")),xdt=sdt,wdt=odt,NRe=ldt,kdt=udt,RRe=ddt,Odt=fdt,Sdt=hdt,Edt=pdt,IRe=mdt,Cdt=gdt,Adt=bdt,Tdt=ydt,_dt=vdt,jdt=Object.defineProperty,Sb=(e,t)=>jdt(e,"name",{value:t,configurable:!0}),GV="Popover",[PRe,Ehn]=Qc(GV,[X1]),XV=X1(),[Ndt,Z1]=PRe(GV),Rdt=Sb(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=XV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Id({prop:i,defaultProp:r??!1,onChange:s,caller:GV});return a.jsx(sM,{...l,children:a.jsx(Ndt,{scope:t,contentId:Jg(),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:o,children:n})})},"Popover"),Idt="PopoverTrigger",Pdt=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,...r}=t,s=Z1(Idt,i),o=XV(i),l=Rr(n,s.triggerRef),c=a.jsx(Jr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":YV(s.open),...r,ref:l,onClick:Un(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx($V,{asChild:!0,...o,children:c})},"PopoverTrigger")),DRe="PopoverPortal",[Ddt,Mdt]=PRe(DRe,{forceMount:void 0}),Ldt=Sb(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Z1(DRe,t);return a.jsx(Ddt,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),xC="PopoverContent",$dt=p.forwardRef(Sb(function(t,n){const i=Mdt(xC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=Z1(xC,t.__scopePopover);return a.jsx(Rh,{present:r||o.open,children:o.modal?a.jsx(Bdt,{...s,ref:n}):a.jsx(Udt,{...s,ref:n})})},"PopoverContent")),Fdt=Yp("PopoverContent.RemoveScroll"),Bdt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(null),s=Rr(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return YNe(l)},[]),a.jsx(PV,{as:Fdt,allowPinchZoom:!0,children:a.jsx(MRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Un(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Un(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Un(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Udt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(MRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),MRe=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Z1(xC,i),g=XV(i);return nM(),a.jsx(MNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(FV,{"data-state":YV(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 YV(e){return e?"open":"closed"}Sb(YV,"getState");var LRe=Rdt,$Re=Pdt,FRe=Ldt,BRe=$dt,Qdt=Object.defineProperty,Tl=(e,t)=>Qdt(e,"name",{value:t,configurable:!0}),URe="Radio",[zdt,QRe]=Qc(URe),[Vdt,uM]=zdt(URe);function zRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,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(k=>k+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Tl(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Vdt,{scope:t,...x,children:VRe(d)?d(x):i})}Tl(zRe,"RadioProvider");var Hdt="RadioTrigger",qdt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=uM(Hdt,t),g=Rr(r,c);return a.jsx(Jr.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Un(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Wdt="RadioIndicator",Kdt=p.forwardRef(Tl(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=uM(Wdt,i);return a.jsx(Rh,{present:r||o.checked,children:a.jsx(Jr.span,{"data-state":ZV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Gdt="RadioBubbleInput",Xdt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=uM(Gdt,t),v=Rr(r,m),y=eT(s),w=p.useRef(!1),x=p.useRef(o),k=p.useRef(b);p.useEffect(()=>{const O=h;if(!O)return;const A=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(A,"checked").set,T=b!==k.current;k.current=b;const R=x.current!==o;x.current=o;const C=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:C});j.call(O,o),O.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const S=p.useRef(o);return a.jsx(Jr.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:Un(n,O=>{w.current&&O.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function VRe(e){return typeof e=="function"}Tl(VRe,"isFunction");function ZV(e){return e?"checked":"unchecked"}Tl(ZV,"getState");var Ydt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JV="RadioGroup",[Zdt,Chn]=Qc(JV,[Y1,QRe]),HRe=Y1(),dM=QRe(),[Jdt,eft]=Zdt(JV),tft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=HRe(i),v=JA(f),[y,w]=Id({prop:l,defaultProp:o??null,onChange:m,caller:JV}),[x,k]=p.useState(null),S=Rr(n,k),O=p.useRef(y);return p.useEffect(()=>{const A=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(A instanceof HTMLFormElement){const E=Tl(()=>w(O.current),"reset");return A.addEventListener("reset",E),()=>A.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Jdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(QV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Jr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:S})})})},"RadioGroup")),nft="RadioGroupItemProvider",ift="RadioGroupItemTrigger";function qRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=eft(nft,t),l=dM(t),c=o.disabled||i;return a.jsx(zRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}Tl(qRe,"RadioGroupItemProvider");var rft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=HRe(i),o=dM(i),{checked:l,disabled:c}=uM(ift,o.__scopeRadio),u=p.useRef(null),d=Rr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Tl(g=>{Ydt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Tl(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(zV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(qdt,{...o,...r,ref:d,onKeyDown:Un(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Un(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),sft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(qRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(rft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(aft,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),aft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Xdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),oft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Kdt,{...s,...r,ref:n})},"RadioGroupIndicator")),lft=Object.defineProperty,eb=(e,t)=>lft(e,"name",{value:t,configurable:!0}),eH="Switch",[cft,Ahn]=Qc(eH),[uft,tH]=cft(eH);function WRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:eH}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(uft,{scope:t,...O,children:KRe(f)?f(O):i})}eb(WRe,"SwitchProvider");var dft="SwitchTrigger",fft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=tH(dft,t),y=Rr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const k=eb(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[s,o,h]),a.jsx(Jr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":nH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Un(n,x=>{g(),h(k=>!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),hft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(WRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(fft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(bft,{__scopeSwitch:i})]})})},"Switch")),pft="SwitchThumb",mft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,...r}=t,s=tH(pft,i);return a.jsx(Jr.span,{"data-state":nH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),gft="SwitchBubbleInput",bft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=tH(gft,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(A,c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef(c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function KRe(e){return typeof e=="function"}eb(KRe,"isFunction");function nH(e){return e?"checked":"unchecked"}eb(nH,"getState");var yft=Object.defineProperty,vft=(e,t)=>yft(e,"name",{value:t,configurable:!0}),xft="Toggle",wft=p.forwardRef(vft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Id({prop:i,onChange:s,defaultProp:r??!1,caller:xft});return a.jsx(Jr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Un(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),kft=Object.defineProperty,tb=(e,t)=>kft(e,"name",{value:t,configurable:!0}),J1="ToggleGroup",[GRe,Thn]=Qc(J1,[Y1]),XRe=Y1(),Oft=p.forwardRef(tb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(Sft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Eft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${J1}\``)},"ToggleGroup")),[YRe,ZRe]=GRe(J1),Sft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??"",onChange:s,caller:J1});return a.jsx(YRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(JRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Eft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??[],onChange:s,caller:J1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(YRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(JRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[Cft,Aft]=GRe(J1),JRe=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=XRe(i),f=JA(l),h={dir:f,...u};return a.jsx(Cft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(QV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Jr.div,{...h,ref:n})}):a.jsx(Jr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",Tft=p.forwardRef(tb(function(t,n){const i=ZRe(CB,t.__scopeToggleGroup),r=Aft(CB,t.__scopeToggleGroup),s=XRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(zV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(Eee,{...c,ref:n})}):a.jsx(Eee,{...c,ref:n})},"ToggleGroupItem")),Eee=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=ZRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(wft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),_ft=Object.defineProperty,Mo=(e,t)=>_ft(e,"name",{value:t,configurable:!0}),[iH,_hn]=Qc("Tooltip",[X1]),rH=X1(),jft="TooltipProvider",Nft=700,AB="tooltip.open",[Rft,sH]=iH(jft),Ift=Mo(e=>{const{__scopeTooltip:t,delayDuration:n=Nft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Rft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Pft,nT]=iH(TB),Dft=Mo(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=sH(TB,e.__scopeTooltip),u=rH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Jg(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,k]=Id({prop:i,defaultProp:r??!1,onChange:Mo(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),S=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,k(!0)},[k]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,k(!0),b.current=0},y)},[y,k]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(sM,{...u,children:a.jsx(Pft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():O()},[c.isOpenDelayedRef,E,O]),onTriggerLeave:p.useCallback(()=>{v?A():(window.clearTimeout(b.current),b.current=0)},[A,v]),onOpen:O,onClose:A,disableHoverableContent:v,children:n})})},"Tooltip"),Cee="TooltipTrigger",Mft=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,...r}=t,s=nT(Cee,i),o=sH(Cee,i),l=rH(i),c=p.useRef(null),u=Rr(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]),a.jsx($V,{asChild:!0,...l,children:a.jsx(Jr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Un(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Un(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Un(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Un(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Un(t.onBlur,s.onClose),onClick:Un(t.onClick,s.onClose)})})},"TooltipTrigger")),eIe="TooltipPortal",[Lft,$ft]=iH(eIe,{forceMount:void 0}),Fft=Mo(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=nT(eIe,t);return a.jsx(Lft,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),wC="TooltipContent",Bft=p.forwardRef(Mo(function(t,n){const i=$ft(wC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=nT(wC,t.__scopeTooltip);return a.jsx(Rh,{present:r||l.open,children:l.disableHoverableContent?a.jsx(tIe,{side:s,...o,ref:n}):a.jsx(Uft,{side:s,...o,ref:n})})},"TooltipContent")),Uft=p.forwardRef(Mo(function(t,n){const i=nT(wC,t.__scopeTooltip),r=sH(wC,t.__scopeTooltip),s=p.useRef(null),o=Rr(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=nIe(w,y.getBoundingClientRect()),k=iIe(w,x),S=rIe(v.getBoundingClientRect()),O=aIe([...k,...S]);c(O),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=Mo(y=>g(y,f),"handleTriggerLeave"),v=Mo(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=Mo(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)),k=!sIe(w,l);x?m():k&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(tIe,{...t,ref:o})},"TooltipContentHoverable")),Qft=hNe("TooltipContent"),tIe=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=nT(wC,i),f=rH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Mo(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 Od(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(FV,{"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:[a.jsx(Qft,{children:r}),s?a.jsx(mlt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function nIe(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")}}Mo(nIe,"getExitSideFromRect");function iIe(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}Mo(iIe,"getPaddedExitPoints");function rIe(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}]}Mo(rIe,"getPointsFromRect");function sIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Mo(sIe,"isPointInPolygon");function aIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),oIe(t)}Mo(aIe,"getHull");function oIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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)}Mo(oIe,"getHullPresorted");var zft=Ift,Vft=Dft,lIe=Mft,Hft=Fft,qft=Bft;function nb(e){const t=p.useRef(e);return t.current=e,t}let n1=[],m_=!1;const Aee=e=>{var t,n;if(e.key==="Escape"){const[i]=n1;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},cIe=()=>{n1.length>0&&!m_?(document.body.addEventListener("keydown",Aee),m_=!0):n1.length===0&&m_&&(document.body.removeEventListener("keydown",Aee),m_=!1)},Wft=e=>{n1.unshift(e),cIe()},Kft=({id:e})=>{n1=n1.filter(t=>t.id!==e),cIe()},iT=(e,t)=>{const n=p.useId(),i=nb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Wft(r),()=>Kft(r)},[n,e,i])},Gft=p.createContext(null);function uIe(){const e=p.useContext(Gft);return(e==null?void 0:e.linkComponent)??"a"}function rT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Xft=()=>oNe,Tee=(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},F0=()=>{},B0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Yft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=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(o):o.concat(l)}function Zft(e,t,n){if((oNe||Xot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Jft="_TransitionGroupChild_1hv1z_1",eht={TransitionGroupChild:Jft},dIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},tht=e=>({...dIe,enter:!e}),nht=(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 dIe}},iht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,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(nht,tht(o||!1)),x=p.useRef(!1),k=p.useRef(null),S=p.useRef(c);S.current=c;const O=p.useRef(u);O.current=u;const A=p.useRef(null),E=p.useCallback(j=>{const T=k.current;if(!(!T||j===A.current))switch(A.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return Pi.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const C=hI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},O.current)});return()=>{C(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=hI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},S.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:rT([k,e]),className:qi(i,eht.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})},rht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(iht,{...e}):null},ek=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Xft()}=e,m=B0(e.onEnter??F0),g=B0(e.onEnterActive??F0),b=B0(e.onEnterComplete??F0),v=B0(e.onExit??F0),y=B0(e.onExitActive??F0),w=B0(e.onExitComplete??F0);p.Children.forEach(i,O=>{if(O&&!O.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(O=>({component:O,shouldRender:!0,removeChild:()=>{S(A=>A.filter(E=>O.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[k,S]=p.useState(()=>Tee(i).map(O=>({...x(O),preventMountTransition:u})));return p.useLayoutEffect(()=>{S(O=>{const A=Tee(i);return Yft(A,O,x,f)})},[i,f,x]),Zft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,O=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:O}))}):a.jsx(a.Fragment,{children:k.map(({component:O,...A})=>a.jsx(rht,{...A,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:O},O.key))})},sht="_Button_1864l_1",aht="_ButtonInner_1864l_4",oht="_ButtonLoader_1864l_749",r4={Button:sht,ButtonInner:aht,ButtonLoader:oht},At=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="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,k=v||w,S=p.useCallback(O=>{v||b==null||b(O)},[b,v]);return a.jsxs("button",{type:t,className:qi(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"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:SV,disabled:k,"aria-disabled":k,tabIndex:k?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...x,children:[a.jsx(ek,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(YA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:kV(m)})]})},lht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function cht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function uht(e,t=document.body){if(typeof e=="string")return _ee(e,t);try{return lht()?(await navigator.clipboard.write([cht(e)]),!0):e["text/plain"]?_ee(e["text/plain"],t):!1}catch{return!1}}async function _ee(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 dht="_TransitionItem_1o7b1_1",fht={TransitionItem:dht},hht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=yht(e);return a.jsx(t,{className:qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(ek,{as:t,className:qi(fht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},pht=400,mht=500,ght=200,bht=300;function yht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?mht:pht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?bht:ght),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Fv({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":o_(c),"tg-enter-delay":o_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":o_(d),"tg-exit-delay":o_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(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 aH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),uht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(At,{...i,onClick:l,children:[a.jsx(hht,{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?a.jsx(mC,{},"copied-icon"):a.jsx(Ije,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},vht="_Menu_1t4b0_1",xht="_MenuList_1t4b0_3",wht="_MenuItemContent_1t4b0_53",kht="_MenuItem_1t4b0_53",Oht="_ItemActions_1t4b0_98",Sht="_PressableInner_1t4b0_117",Eht="_Separator_1t4b0_135",Cht="_SubMenuItem_1t4b0_139",Aht="_SubTriggerIcon_1t4b0_141",Tht="_RadioItem_1t4b0_151",_ht="_RadioIndicatorActive_1t4b0_158",jht="_RadioIndicator_1t4b0_158",Nht="_CheckboxItem_1t4b0_249",Rht="_CheckboxIndicator_1t4b0_256",Iht="_CheckboxCircle_1t4b0_269",Ns={Menu:vht,MenuList:xht,MenuItemContent:wht,MenuItem:kht,ItemActions:Oht,PressableInner:Sht,Separator:Eht,SubMenuItem:Cht,SubTriggerIcon:Aht,RadioItem:Tht,RadioIndicatorActive:_ht,RadioIndicator:jht,CheckboxItem:Nht,CheckboxIndicator:Rht,CheckboxCircle:Iht},fIe=p.createContext(null),sT=()=>{const e=p.useContext(fIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},rr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=nb(n),u=nb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);iT(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(fIe.Provider,{value:f,children:a.jsx(xdt,{open:l,onOpenChange:d,modal:r,children:e})})},Pht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=sT(),o=l=>{s||l.preventDefault()};return i?a.jsx(RRe,{className:qi(Ns.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:Ns.PressableInner,children:t})}):a.jsx("div",{className:qi(Ns.MenuItemContent,e),children:t})},Dht=({className:e,children:t})=>a.jsx("div",{className:qi(Ns.ItemActions,e),children:t}),Mht=({children:e,onClick:t})=>{const{setOpen:n}=sT();return a.jsx(At,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Lht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=sT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=uIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(RRe,{asChild:!0,className:qi(Ns.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:Ns.PressableInner,children:n})})})},$ht=({className:e})=>a.jsx(Cdt,{className:qi(Ns.Separator,e),role:"separator"}),Fht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=sT();return a.jsx(NRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(kdt,{forceMount:!0,className:Ns.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:Lp,style:Fv({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Bht=({children:e,disabled:t})=>a.jsx(wdt,{asChild:!0,disabled:t,children:e}),hIe=p.createContext(null),pIe=()=>{const e=p.useContext(hIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Uht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=nb(n),u=nb(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]);iT(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(hIe.Provider,{value:f,children:a.jsx(Adt,{open:l,onOpenChange:d,children:e})})},Qht=({className:e,children:t,disabled:n})=>{const{open:i}=sT(),{triggerRef:r}=pIe(),s=o=>{i||o.preventDefault()};return a.jsx(Tdt,{ref:r,className:qi(Ns.MenuItem,Ns.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:Ns.PressableInner,children:[t,a.jsx(eat,{width:"16",height:"16",className:Ns.SubTriggerIcon})]})})},zht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=pIe();return a.jsx(NRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(_dt,{className:Ns.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:Fv({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Vht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(Sdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Hht=({className:e,children:t,...n})=>a.jsx(Edt,{className:qi(Ns.MenuItem,Ns.RadioItem,e),...n,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.RadioIndicator,children:a.jsx(IRe,{className:Ns.RadioIndicatorActive})}),t]})}),qht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(Odt,{className:qi(Ns.MenuItem,Ns.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.CheckboxIndicator,children:a.jsx(IRe,{children:i==="ghost"?a.jsx(mC,{className:"size-4"}):a.jsx("div",{className:Ns.CheckboxCircle,children:a.jsx(mC,{className:"size-4"})})})}),t]})});rr.Content=Fht;rr.Item=Pht;rr.ItemActions=Dht;rr.ItemAction=Mht;rr.Link=Lht;rr.Separator=$ht;rr.Trigger=Bht;rr.Sub=Uht;rr.SubTrigger=Qht;rr.SubContent=zht;rr.CheckboxItem=qht;rr.RadioGroup=Vht;rr.RadioItem=Hht;const Wht="_Tooltip_16g2y_1",Kht="_TriggerDecorator_16g2y_73",mIe={Tooltip:Wht,TriggerDecorator:Kht},Ca=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=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,k]=p.useState(!1),[S,O]=p.useState(!1);OV(()=>O(!1),S?400:null);const A=r??x,E=T=>{typeof r!="boolean"&&(k(T),u&&O(T))},j=T=>{u&&S&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(gIe,{open:A,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(lIe,{asChild:!0,children:a.jsx(dNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(bIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},gIe=({children:e,open:t,onOpenChange:n,...i})=>(iT(t,()=>{n(!1)}),a.jsx(zft,{children:a.jsx(Vft,{open:t,onOpenChange:n,...i,children:e})})),bIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Hft,{children:a.jsx(qft,{...u,className:qi(mIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Lp,children:e})}),Ght=({children:e,asChild:t=!0,...n})=>a.jsx(lIe,{asChild:t,...n,children:e}),Xht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(dNe,{ref:r,...s,className:qi(mIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};Ca.Root=gIe;Ca.Content=bIe;Ca.Trigger=Ght;Ca.TriggerDecorator=Xht;const Yht=50,jee=48;function Zht(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Jht(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 Q("search.untitledSession")}function ept(e,t,n){const i=Math.max(0,t-jee),r=Math.min(e.length,t+n+jee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await lC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Zht(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Jht(l),snippet:ept(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Yht)}async function npt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await ETe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function ipt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await STe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function rpt(e,t,n){return e==="session"?{results:await tpt(n.userId,n.appId,t)}:e==="web"?npt(n.appId,t):ipt(e,n.appId,n.userId,t)}function yIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.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"}),a.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 spt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(yIe,{})})}function apt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(yIe,{mirrored:!0})})}function opt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 lpt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function cpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 vIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.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 xIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function upt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dpt({open:e}){return a.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:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fpt({active:e=!1,onClick:t}){const{t:n}=_e("workspaceTools");return a.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:[a.jsx(lpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function hpt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=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:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function pI(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 Nee(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 ppt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,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,k]=p.useState(!1),[S,O]=p.useState(!1),A=p.useRef(0),E=p.useRef(null),j=hpt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{A.current+=1,d("session"),g([]),v(void 0),k(!1),w(!1),O(!1)},[t]),p.useEffect(()=>{if(!S)return;function M(H){var q;(q=E.current)!=null&&q.contains(H.target)||O(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[S]);async function C(M,H){var z;const q=M.trim();if(!q||!((z=j.find(J=>J.id===H))!=null&&z.ready))return;const U=++A.current;w(!0),k(!0);let Z;try{Z=await rpt(H,q,{userId:e,appId:t})}catch(J){const ne=J instanceof Error?J.message:String(J);Z={results:[],note:o("search.failed",{message:ne})}}U===A.current&&(g(Z.results),v(Z.note),w(!1))}function N(M){A.current+=1,h(M),g([]),v(void 0),k(!1),w(!1)}function P(M){A.current+=1,d(M),O(!1),g([]),v(void 0),k(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?pI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":S,onClick:()=>O(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(dpt,{open:S})]}),S&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,Z;const H=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(Z=n==null?void 0:n.components)==null?void 0:Z.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=H?[H.name,H.backend?pI(H.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),C(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void C(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Vi,{className:"icon spin"}):a.jsx(upt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,H)=>a.jsx(mpt,{result:M,agentLabel:r,onOpen:s,locale:c},H)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function mpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=_e("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Vje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(eM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(uv,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:"",e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Ree({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.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"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.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 gpt({filled:e=!1,...t}){return a.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:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.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 bpt({filled:e=!1,...t}){return a.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:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.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 wIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.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"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.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"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const fM="/assets/media/logo-DCsNZy-k.svg",oH="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 ypt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const Iee="(max-width: 860px)";function Pee({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)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function vpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function xpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.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 wpt(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 kpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Opt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=_e(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=ket(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=wpt(h),b=Oet(n),v=b===d?"":b,y=OA(u.resolvedLanguage??u.language)??kA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(rr,{modal:!0,children:[a.jsx(rr.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(rr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${kpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(gm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(rr.Sub,{children:[a.jsx(rr.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(xpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(rr.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(rr.RadioGroup,{value:y,onChange:w=>{jqe(w)},indicatorPosition:"end",children:NU.map(w=>a.jsx(rr.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(wIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Hat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(Ca,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(cat,{className:"icon"})})}),a.jsx(Ca,{compact:!0,content:c("sidebar:account.developerResources"),children:a.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:a.jsx(Yst,{className:"icon"})})})]})]})})}function Spt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,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:k,onDeveloperResources:S,onSystemInfo:O,onUserManagement:A,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:C}){const{t:N}=_e("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!A,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(Iee).matches),[M,H]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||tM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,J)=>J.createdAt-z.createdAt),U=()=>{F.current=!1,H(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(Iee),J=ne=>{ne.matches?H(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,H(!1))};return z.addEventListener("change",J),()=>z.removeEventListener("change",J)},[]);const Z=t==="byteplus"?oH:fM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||Z,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(apt,{className:"icon"}):a.jsx(spt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.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:[a.jsx(opt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(fpt,{active:r==="search",onClick:f}),a.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:[a.jsx(cpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.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:[a.jsx(Eat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.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:[a.jsx(vIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.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:[a.jsx(pV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.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:[a.jsx(vpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.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:[a.jsx(ypt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:A,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx(Uot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.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:a.jsx(ec,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const J=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":J?"page":void 0,title:ne,disabled:W,children:[a.jsx(Pee,{title:ne}),J?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const J=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":J?"page":void 0,title:z.title,children:[a.jsx(Pee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(YA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(Opt,{activePage:r,access:o,userInfo:R,onAgentKitCli:k,onDeveloperResources:S,onSystemInfo:O,onIssueFeedback:E,onLogout:C})})]})}const Ept={name:"studio_share_space"},Cpt={name:"studio_review_space"},kIe={share:Ept,review:Cpt},Apt=kIe.share.name,OIe=kIe.review.name,Tpt=[Apt,OIe];function SIe(e){return Tpt.includes(e.trim().toLowerCase())}function _pt(e){return e.name===OIe}const jpt="/web/skill-management";class i1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function lc(e,t={},n=eo){return fetch(Na(`${jpt}${e}`),{...t,headers:hl(oc(t.headers)),signal:po(t.signal,n)})}async function aT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new i1(n,e.status,i,e.statusText,r,s)}async function cc(e,t){if(!e.ok)throw await aT(e,t);return e.json()}async function Npt(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),cc(await lc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function Rpt(e){if(SIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function Ipt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Ppt(e){return cc(await lc(`/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})},yr),Q("skills.submitReviewFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Mpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},yr),Q("skills.reviewFilesFailed"))}async function Lpt(e){return cc(await lc(`/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||""})},yr),Q("skills.decideReviewFailed"))}async function $pt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Fpt(e){if(SIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function Upt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},yr),Q("skills.uploadFailed"))}async function Qpt(e){return cc(await lc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},yr),Q("skills.validateFailed"))}async function zpt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function EIe(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 cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Vpt(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 lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},yr);n.ok||await cc(n,Q("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()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",rhe,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",u0e,!0,!0);function Yt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Nc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function hM(e,t){const n=await fetch(Na(e),{headers:hl(oc({accept:"application/json"})),signal:po(t,eo)});if(!n.ok)throw await aT(n,Yt("helpers.skills.agentKitRequestFailed"));return n.json()}async function CIe(){return((await hM("/web/skill-spaces")).items||[]).filter(t=>!_pt(t))}async function AIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function TIe(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),hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Hpt(e,t,n,i,r,s,o){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)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function qpt(e,t){const n=Ey(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 Ey(e){return e.skillId||e.skillName}function Wpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Kpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function _Ie({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Kpt,alt:"","aria-hidden":"true"})]})}async function jIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await aT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function Gpt(e){return jIe(e,{},eo)}function Xpt(e){return jIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},yr)}function Ypt({target:e,onClose:t,onSaved:n}){const{t:i}=_e("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),k=p.useRef(!1),S=p.useRef(!0),O=p.useRef({dirty:!1,onClose:t});O.current={dirty:r!==null&&o!==r.content,onClose:t};const A=p.useRef(null);function E(){k.current||(O.current.dirty?y(!0):O.current.onClose())}p.useEffect(()=>{var N,P;S.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function C(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",C),()=>{var I;S.current=!1,(I=A.current)==null||I.abort(),window.removeEventListener("keydown",C),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),Gpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(k.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;k.current=!0,f(!0),m("");const T=new AbortController;A.current=T;try{await Xpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),S.current&&(n(),t())}catch(R){S.current&&m(R instanceof i1&&R.status===409?"documentConflict":R instanceof i1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{k.current=!1,S.current&&f(!1)}}return vi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(ki,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(_Ie,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(ki,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(ki,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(ki,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(ki,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function kC(e){return e.trimEnd().replace(/[。.]+$/,"")}function NIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=_e("create"),[r,s]=p.useState([]),[o,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 k=!1;return(async()=>{f(!0),b(null);try{const S=await CIe();k||(s(S),S.length>0&&u(S[0].id))}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||f(!1)}})(),()=>{k=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const k=r.find(O=>O.id===c);let S=!1;return(async()=>{m(!0),b(null);try{const O=await AIe(c,k==null?void 0:k.region);S||l(O)}catch(O){S||b(O instanceof Error?O.message:i("skills.space.loadError"))}finally{S||m(!1)}})(),()=>{S=!0}},[c,r,i]);const v=r.find(k=>k.id===c),y=v?Wpt(v.id,v.region,n):"",w=(k,S)=>e.some(O=>O.source==="skillspace"&&O.skillId===k&&(O.version||"")===S),x=k=>{if(!v)return;const S=Ey(k);if(w(S,k.version))t(e.filter(O=>!(O.source==="skillspace"&&O.skillId===S&&(O.version||"")===k.version)));else{const O=qpt(v,k);t([...e,{source:"skillspace",folder:O.folder||k.skillName,name:O.name,description:O.description,skillSpaceId:O.skillSpaceId,skillSpaceName:O.skillSpaceName,skillSpaceRegion:O.skillSpaceRegion,skillId:O.skillId,version:O.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:k=>u(k.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(k=>a.jsxs("option",{value:k.id,children:[Nc(k)||k.id,k.description?` — ${kC(k.description)}`:""]},k.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Sh(v.region,n)}),y&&a.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:a.jsx(uv,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(k=>{const S=Ey(k),O=w(S,k.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${O?"is-on":""}`,onClick:()=>x(k),"aria-pressed":O,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:O?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[k.skillName,k.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",k.version]})]}),k.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Nat,{className:"cw-i cw-i-sm"})," ",Nc(v)||c]})]})]},`${S}/${k.version}`)})})]})})}function oT(e,t){return e.map(n=>({...n,get label(){return Yt(`${t}.${n.id}.label`)},get desc(){return Yt(`${t}.${n.id}.description`)}}))}function md(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Yt(r)});return n}const RIe="https://ark.cn-beijing.volces.com/api/v3/";md({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const ON=[md({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:RIe}],mI=[],gI={get label(){return Yt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Zpt={get label(){return Yt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},IIe="https://api.vikingdb.cn-beijing.volces.com/openviking",Jpt=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,Jpt=[{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}],emt=[pd({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),pd({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),pd({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],dS=[pd({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),pd({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],uw={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function gM(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:uw.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return uw}const NIe=[pd({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),pd({key:"REGISTRY_TOP_K",required:!1,placeholder:uw.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),pd({key:"REGISTRY_REGION",required:!1,placeholder:uw.region},{comment:"traditional.catalog.env.registryRegion.comment"}),pd({key:"REGISTRY_ENDPOINT",required:!1,placeholder:uw.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],sT=rT([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:gI},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:gI},{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 Xt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Xt("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"),tmt=new Set(["web_scraper","text_to_speech","vesearch"]),nmt=new Set(["web_search","parallel_web_search"]),imt=sT.filter(e=>!tmt.has(e.id));function RIe(e="volcengine"){const t=e==="byteplus"?nmt:new Set;return imt.filter(n=>!t.has(n.id))}const dw=rT([{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"),jB=rT([{id:"local",env:SN,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},...SN],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},...SN],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:emt},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:jIe,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:bI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:bI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Zpt,get comment(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:Ypt}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),Mg="viking",NB=rT([{id:"viking",env:Jpt},{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},...SN],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...gI,{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:jIe,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:bI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:bI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Xt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Xt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),rmt=rT([{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:[...gI,pd({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function kd(e="volcengine"){return{name:"",description:Xt("defaults.description"),instruction:Xt("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:Gp(e),modelFallbacks:[],modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:Mg,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function pk(e){return{id:e,get displayName(){return Xt(`traditional.optimization.options.${e}.label`)},get description(){return Xt(`traditional.optimization.options.${e}.description`)}}}const lH=[pk("context_engine"),pk("compressor"),pk("verifier"),pk("long_run_control"),pk("mcp_resilience")],smt=[{id:"quality",get displayName(){return Xt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Xt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Xt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],J1=lH.map(e=>e.id);function amt(e){return e==="byteplus"?Xt("traditional.optimization.bytePlusUnavailable"):null}const IIe=["context_engine","compressor","verifier","long_run_control"],omt=new Set(["1","true","yes","on"]),cH=[{id:"default",get displayName(){return Xt("traditional.optimization.profiles.default.label")},get description(){return Xt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Xt("traditional.optimization.profiles.ops.label")},get description(){return Xt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function EN(e){var t;return((t=lH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function lmt(e){var t;return((t=cH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function uH(e){const t=cH.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Ny(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(J1.map(r=>[r,n.has(r)]))}}function dH(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?uH(t):J1.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Ny(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function a4(e){return omt.has((e==null?void 0:e.trim().toLowerCase())??"")}function cmt(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 umt(e){var o;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=((o=t.get("HARNESS_PROFILE"))==null?void 0:o.trim())==="ops"?"ops":"default";if(!a4(n))return Ny([],i);const r=cmt(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Ny(J1.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?dH(l)??l:l}if(i==="ops")return Ny(uH(i),i);const s=[...a4(t.get("HARNESS_MODEL_PROXY_ENABLED"))?IIe:[],...a4(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Ny(s,i),enabled:!0}}function dmt(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function fmt(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function yI(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?J1.filter(i=>t[i]):[]}function hmt(e){const t=new Set(yI(e));return IIe.filter(n=>t.has(n))}function pmt(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var o,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((o=r.url)==null?void 0:o.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 eO(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 fH(e){return eO(e).modelName}function PIe(e,t,n,i=!1){var c,u,d,f;const r=eO((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],o=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&o==="llm"?"a2a":o??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)=>PIe(h,s[m],void 0,i))}}function mmt(e,t){const n=new Map(t.map(({key:o,value:l})=>[o,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(o=>n.has(o)))return e;const r=(o,l)=>n.has(o)?n.get(o)??"":l??"",s=o=>{var l;return{...o,...(l=o.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...o.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",o.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",o.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",o.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",o.a2aRegistry.registryEndpoint)}}:{},subAgents:o.subAgents.map(s)}};return s(e)}function RB(e,t){var c,u,d;const n=e.cloudProvider??t,i=kd(n),r=e.deployment,s=r==null?void 0:r.network,o=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:dH(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>RB(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,...o??{},cliTools:[...(o==null?void 0:o.cliTools)??[]],dockerfile:typeof(o==null?void 0:o.dockerfile)=="string"?o.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:RB(f.agent,n)}))}}:{}}}const gmt=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],bmt=["collect_resources","create_agents","handoff_to"];function ymt(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function vmt(e){const t=gmt.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,o=ymt(e.slice(i,s));return bmt.every(l=>o.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function xmt(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?vmt(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 DIe(e,t){var l,c;const n=kd(t),i=[...e.tools??[]],r=sT.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),o=eO(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:o.modelName,modelProvider:o.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=>DIe(u,t))}}function hH(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=eO(e.model),s=e.draft?RB(e.draft,i):e.graph?DIe(e.graph,i):{...kd(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||kd(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))??[]},o=e.draft&&s.dynamicAgentDelegation===!0?xmt(s):s;return pmt(PIe(o,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function wmt(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(o=>({...o,agent:n(o.agent)}))}}:{}}};return n(e)}const vI=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],MIe=[{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 基础镜像"}],pH="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",LIe={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"},$Ie=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],Omt={"python-3.10":"3.10.18","python-3.12":"3.12.11"},mH=[{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"}]}],kmt=mH.flatMap(e=>e.options),Smt=["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"],Emt=["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"],Cmt={"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 mk(e,t){for(const n of t)e.includes(n)||e.push(n)}function Amt(e,t,n,i,r){const s=["ca-certificates"];r||mk(s,i?[`python${n}`,`python${n}-venv`]:Smt);for(const o of t)o.id==="playwright"||o.id==="chromium"||(o.installer==="apt"&&mk(s,[o.packageName]),o.id==="opencli"&&mk(s,["curl","xz-utils"]));return e.optionIds.some(o=>o==="playwright"||o==="chromium")&&(mk(s,Emt),mk(s,Cmt[e.operatingSystem])),s}const o4={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function $p(e){var t;return((t=$Ie.find(n=>n.id===e))==null?void 0:t.label)??e}function IB(e){var t;return((t=vI.find(n=>n.id===e))==null?void 0:t.label)??e}function PB(e){var t;return((t=MIe.find(n=>n.id===e))==null?void 0:t.label)??e}function Tmt(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 gH(e,t="volcengine"){const n=kmt.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,o=s?"python-3.12":e.language,l=o.replace("python-",""),c=Omt[o],u=vI.find(b=>b.id===e.operatingSystem)??vI[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=Amt(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${pH}`,"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=${LIe[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 _mt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function jmt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function DB(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.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"}),a.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 FIe(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Nmt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ree(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Iee(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.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 Ac(e){return`${e.environment_id}\0${e.environment_version_id}`}function aE(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function CN(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?aE(i):null;return r?[r]:[]})}function Rmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:o,onClose:l}){const{t:c}=Te("workspaceTools"),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(""),b=p.useId(),v=p.useMemo(()=>new Map(e.map(A=>[A.id,A])),[e]),[y,w]=p.useState(()=>new Set(i)),[x,O]=p.useState(()=>{const A=new Set(t.filter(N=>i.includes(N.id)).flatMap(N=>N.environmentIds));return new Set(n.filter(N=>!A.has(N.environment_id)).map(Ac))}),k=p.useMemo(()=>new Set(t.filter(A=>y.has(A.id)).flatMap(A=>A.environmentIds)),[y,t]),S=p.useMemo(()=>{const A=new Set(x);for(const N of t)if(y.has(N.id))for(const P of CN(N,v))A.add(Ac(P));return A},[x,y,v,t]),E=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?e.filter(N=>`${N.name} ${N.description} ${$p(N.language)}`.toLocaleLowerCase().includes(A)):e},[e,u]),C=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?t.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=v.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):t},[v,u,t]);p.useEffect(()=>{const A=document.body.style.overflow,N=P=>{P.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",N),()=>{document.body.style.overflow=A,document.removeEventListener("keydown",N)}},[l,f]);const j=A=>{const N=aE(A);if(!N)return;const P=Ac(N);k.has(A.id)||O(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})},T=A=>{const N=CN(A,v);N.length!==0&&(w(P=>{const I=new Set(P);return I.has(A.id)?I.delete(A.id):I.add(A.id),I}),O(P=>{const I=new Set(P);for(const D of N)I.delete(Ac(D));return I}))},R=async()=>{const A=new Map(n.map(P=>[Ac(P),P])),N=e.flatMap(P=>{const I=aE(P);if(!I||!S.has(Ac(I)))return[];const D=A.get(Ac(I));return[{...I,mount_instance_id:(D==null?void 0:D.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await o(N,[...y]),l()}catch(P){g(P instanceof Error?P.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return yi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),a.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[a.jsxs("header",{className:"studio-tool-dialog-head",children:[a.jsx("span",{className:"studio-tool-dialog-mark",children:a.jsx(DB,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),a.jsx("p",{children:c("sessionEnvironment.description")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:a.jsx(_mt,{})})]}),a.jsxs("div",{className:"studio-tool-dialog-body",children:[a.jsxs("label",{className:"studio-tool-search",children:[a.jsx(jmt,{}),a.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:A=>d(A.target.value)})]}),a.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?a.jsx("div",{className:"studio-tool-empty",children:s}):E.length===0&&C.length===0?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):a.jsxs(a.Fragment,{children:[C.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[a.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),C.map(A=>{const N=CN(A,v),P=y.has(A.id),I=N.length===0;return a.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${P?" is-selected":""}${I?" is-disabled":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(FIe,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:A.description||c("sessionEnvironment.reuseAll")}),a.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:N.length})})]}),a.jsx("input",{type:"checkbox",checked:P,disabled:I,"aria-label":c("sessionEnvironment.selectWorkspace",{name:A.name}),onChange:()=>T(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Iee,{})})]},A.id)})]}),E.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[a.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),E.map(A=>{const N=aE(A);if(!N)return null;const P=t.filter(_=>y.has(_.id)&&_.environmentIds.includes(A.id)),I=P.length>0,D=S.has(Ac(N));return a.jsxs("label",{className:`studio-tool-option session-environment-option${D?" is-selected":""}${I?" is-covered":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(DB,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:I?c("sessionEnvironment.includedByWorkspaces",{names:P.map(_=>_.name).join(c("sessionEnvironment.nameSeparator"))}):A.description||$p(A.language)}),a.jsxs("small",{children:[$p(A.language)," · ",N.environment_version_id]})]}),a.jsx("input",{type:"checkbox",checked:D,disabled:I,"aria-label":c("sessionEnvironment.selectEnvironment",{name:A.name}),onChange:()=>j(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Iee,{})})]},Ac(N))})]})]})})]}),a.jsxs("footer",{className:"session-environment-dialog__footer",children:[a.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:S.size})})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),a.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void R(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function Imt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:o="",onChange:l,onRefresh:c}){const{t:u}=Te("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(C=>{const j=aE(C);return j?[[Ac(j),C]]:[]})),[e]),w=p.useMemo(()=>new Map(e.map(C=>[C.id,C])),[e]),x=t.filter(C=>i.includes(C.id)),O=new Set(x.flatMap(C=>C.environmentIds)),k=n.filter(C=>!O.has(C.environment_id)),S=()=>{f(!1),requestAnimationFrame(()=>{var C;return(C=v.current)==null?void 0:C.focus()})},E=async(C,j)=>{if(l){m(!0),b("");try{await l(C,j)}catch(T){b(T instanceof Error?T.message:u("sessionEnvironment.mountFailed"))}finally{m(!1)}}};return a.jsxs("div",{className:"session-environment-select",children:[n.length>0&&a.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[x.map(C=>{const j=new Set(CN(C,w).map(T=>T.environment_id));return a.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(FIe,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:C.name}),a.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:j.size})})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:C.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const T=i.filter(A=>A!==C.id),R=new Set(t.filter(A=>T.includes(A.id)).flatMap(A=>A.environmentIds));E(n.filter(A=>!j.has(A.environment_id)||R.has(A.environment_id)),T)},children:a.jsx(Ree,{})})]},`workspace:${C.id}`)}),k.map(C=>{const j=y.get(Ac(C));return a.jsxs("div",{className:"session-environment-item",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(DB,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:(j==null?void 0:j.name)??C.environment_id}),a.jsx("small",{children:j?$p(j.language):C.environment_version_id})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(j==null?void 0:j.name)??C.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void E(n.filter(T=>Ac(T)!==Ac(C)),[...i]),children:a.jsx(Ree,{})})]},Ac(C))})]}),l&&a.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:[a.jsx(Nmt,{}),a.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&a.jsx("p",{className:"is-error",role:"alert",children:g}),(r||o||e.length===0)&&a.jsx("p",{className:o?"is-error":void 0,role:o?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):o||u("sessionEnvironment.empty")}),d&&a.jsx(Rmt,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:o,onConfirm:(C,j)=>l==null?void 0:l(C,j),onClose:S})]})}function Pmt(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function l4({title:e,count:t}){const{t:n}=Te("workspaceTools");return a.jsxs("div",{className:"topo-module-title",children:[a.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&a.jsx("span",{className:"topo-section-count","aria-label":n("agentTopology.itemCount",{count:t}),children:t})]})}function Dmt({info:e,loading:t,boundSkills:n,onRefresh:i,onOpenSkill:r,variant:s="rail",selectedSessionSkills:o=[],onSessionSkillsChange:l,environments:c=[],workspaces:u=[],selectedEnvironments:d=[],selectedEnvironmentWorkspaceIds:f=[],environmentsLoading:h=!1,environmentsDisabled:m=!1,environmentsError:g="",onEnvironmentsChange:b,onEnvironmentsRefresh:v}){var R,A,N,P,I;const{t:y}=Te("workspaceTools"),[w,x]=p.useState(null);if(t&&!e)return a.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.info"),"aria-live":"polite",children:a.jsx(cn,{as:"span",className:"topo-loading-label",duration:2.2,children:y("agentTopology.loadingInfo")})});if(!e)return null;const O=fH(e.model),k=e.agentCategory==="mpa",S=((R=e.mpa)==null?void 0:R.agentsMdStatus)??"unsupported",E=k?((A=e.mpa)==null?void 0:A.agentsMd)??"":((N=e.graph)==null?void 0:N.instruction)??((P=e.draft)==null?void 0:P.instruction)??"",C=k?(n==null?void 0:n.skills)??[]:Pmt([...e.skills,...o.map(D=>({name:D.name,description:D.description??""}))]),j=n==null?void 0:n.error,T=j==="forbidden"?"accessDenied":j==="unsupported"?"skillsUnsupported":j==="degraded"?"skillsDegraded":"loadFailed";return a.jsx(a.Fragment,{children:a.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.infoAndTopology"),children:[a.jsxs("section",{className:"topo-agent-card","aria-label":y("agentTopology.info"),children:[a.jsxs("div",{className:"topo-agent-heading",children:[a.jsx("h2",{title:e.name,children:e.name||y("agentTopology.unnamedAgent")}),O&&a.jsx("span",{title:O,children:O})]}),e.description&&a.jsx("p",{className:"topo-description",title:e.description,children:e.description}),i&&a.jsx("button",{type:"button",className:"topo-refresh",onClick:i,disabled:t||(n==null?void 0:n.loading),children:y("agentTopology.refresh")})]}),a.jsxs("div",{className:"topo-module-stack",children:[a.jsxs("section",{className:"topo-module-card topo-agents-md-card","aria-label":y("agentTopology.agentsMd"),children:[a.jsx(l4,{title:y("agentTopology.agentsMd")}),a.jsx("div",{className:"topo-module-scroll topo-agents-md-scroll",role:"region","aria-label":y("agentTopology.agentsMd"),tabIndex:0,children:k&&S!=="ready"?a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${S==="forbidden"?"accessDenied":S==="unsupported"?"documentUnsupported":"loadFailed"}`)}):E.trim()?a.jsx("pre",{className:"topo-agents-md-content",children:E}):a.jsx("div",{className:"topo-empty",children:y("agentTopology.notConfigured")})})]}),a.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":y("agentTopology.skills"),children:[a.jsx(l4,{title:y("agentTopology.skills"),count:k?n!=null&&n.complete?C.length:void 0:e.skillsPreviewSupported?C.length:void 0}),a.jsxs("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":y("agentTopology.skillList"),tabIndex:0,children:[k&&(n!=null&&n.loading)&&!C.length?a.jsx(cn,{as:"span",children:y("agentTopology.loadingSkills")}):!k&&!e.skillsPreviewSupported?a.jsx("div",{className:"topo-empty",children:y("agentTopology.previewUnsupported")}):C.length>0?a.jsx("div",{className:"topo-skill-list",children:C.map((D,_)=>{var L;return a.jsxs("div",{className:"topo-skill",title:D.description||D.name,children:[a.jsx("div",{className:"topo-skill-title",children:k&&r&&((L=n==null?void 0:n.skills[_])!=null&&L.skillId)&&!n.skills[_].lookupByName?a.jsx("button",{type:"button",className:"topo-skill-name topo-skill-open",onClick:()=>r(_),children:D.name}):a.jsx("span",{className:"topo-skill-name",children:D.name})}),D.description&&a.jsx("span",{className:"topo-skill-description",children:D.description})]},`${D.name}:${D.description}:${_}`)})}):j?null:a.jsx("div",{className:"topo-empty",children:y(k?(I=e.mpa)!=null&&I.skillSpaces.length?"agentTopology.noBoundSkills":"agentTopology.noBoundSpace":"agentTopology.notConfigured")}),j&&a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${T}`)}),k&&(n==null?void 0:n.loading)&&C.length>0&&a.jsx("span",{role:"status",children:y("agentTopology.loadingSkills")})]}),!k&&l&&a.jsx("div",{className:"topo-capability-add-dock",children:a.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":y("agentTopology.addSkill"),disabled:m,onClick:()=>x("skill"),children:[a.jsx("span",{"aria-hidden":"true",children:"+"}),a.jsx("span",{children:y("agentTopology.addSkillHere")})]})})]}),(b||d.length>0)&&a.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":y("agentTopology.sessionEnvironment"),children:[a.jsx(l4,{title:y("agentTopology.environment"),count:d.length}),a.jsx(Imt,{environments:c,workspaces:u,value:d,selectedWorkspaceIds:f,loading:h,disabled:m,error:g,onChange:b,onRefresh:v})]})]}),w==="skill"&&l&&yi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":y("agentTopology.close"),onClick:()=>x(null)}),a.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true",children:[a.jsxs("header",{className:"studio-tool-dialog-head is-iconless",children:[a.jsxs("div",{children:[a.jsx("h2",{children:y("agentTopology.addSkill")}),a.jsx("p",{children:y("agentTopology.skillMountNextTurn")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":y("agentTopology.close"),onClick:()=>x(null),children:a.jsx(Do,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"studio-tool-dialog-body",children:a.jsx(TIe,{selected:[...o],onChange:l})})]})]}),document.body)]})})}function Mmt(e){var i;if(((i=e.info)==null?void 0:i.agentCategory)!=="mpa")return null;const t=e.info.mpa,n=JSON.stringify([t==null?void 0:t.skillSpacesStatus,t==null?void 0:t.skillSpaces]);return a.jsx(Lmt,{...e,info:e.info},n)}function Lmt(e){const[t,n]=p.useState(null),[i,r]=p.useState(0),[s,o]=p.useState({skills:[],loading:!0,complete:!1}),l=e.info.mpa;return p.useEffect(()=>{const c=new AbortController;if((l==null?void 0:l.skillSpacesStatus)!=="ready")return o({skills:[],loading:!1,complete:!1,error:(l==null?void 0:l.skillSpacesStatus)??"unsupported"}),()=>c.abort();o(d=>({...d,loading:!0,error:void 0}));const u=new Map;return(async()=>{let d=!1;for(const f of l.skillSpaces){let h=0;for(let m=1;;m++){if(m>100)throw new Error("Skill pagination limit reached");const g=await EIe(f.id,{region:f.region,page:m,pageSize:100,signal:c.signal});if(c.signal.aborted)return;if(!Array.isArray(g.items)||!Number.isInteger(g.totalCount)||g.totalCount<0)throw new Error("Invalid SkillSpace page");const b=u.size;for(const v of g.items){if(typeof v.skillName!="string"||!v.skillName.trim())throw new Error("Invalid skill name");u.set(`${f.region}:${f.id}:${v.skillId||v.skillName}`,{spaceId:f.id,region:f.region,skillId:v.skillId,version:v.version,lookupByName:v.lookupByName,name:v.skillName,description:v.skillDescription||""})}if(h+=g.items.length,d||(d=g.degraded===!0),o({skills:[...u.values()],loading:!0,complete:!1}),h>=g.totalCount)break;if(!g.items.length||u.size===b)throw new Error("Skill pagination made no progress")}}c.signal.aborted||o({skills:[...u.values()],loading:!1,complete:!d,error:d?"degraded":void 0})})().catch(d=>{if(c.signal.aborted)return;const f=d instanceof t1&&[401,403].includes(d.status);o(h=>({skills:f?[]:u.size?[...u.values()]:h.skills,loading:!1,complete:!1,error:f?"forbidden":"error"}))}),()=>c.abort()},[l,i]),a.jsxs(a.Fragment,{children:[a.jsx(Dmt,{...e,boundSkills:s,onOpenSkill:c=>n(s.skills[c]),onRefresh:()=>{e.onRefresh?e.onRefresh():r(c=>c+1)}}),t&&a.jsx(Xpt,{target:t,onClose:()=>n(null),onSaved:()=>r(c=>c+1)})]})}const aT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function Pee(e){return a.jsxs("svg",{...aT,...e,children:[a.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),a.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function $mt(e){return a.jsxs("svg",{...aT,...e,children:[a.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),a.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function Fmt(e){return a.jsxs("svg",{...aT,...e,children:[a.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),a.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"}),a.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function xI(e){return a.jsxs("svg",{...aT,...e,children:[a.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"}),a.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function BIe(e){return a.jsx("svg",{...aT,...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const Bmt=180,Dee=500,c4=10,Mee=32;function Umt(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function Qmt({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=Te("workspaceTools"),[o,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 j,T;const S=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus(),(T=y.current)==null||T.select();const C=R=>{if(R.key==="Escape"&&!w.current){R.preventDefault(),x.current();return}if(R.key!=="Tab")return;const A=v.current;if(!A)return;const N=Array.from(A.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(D=>D.getClientRects().length>0);if(N.length===0){R.preventDefault();return}const P=N[0],I=N[N.length-1];R.shiftKey&&document.activeElement===P?(R.preventDefault(),I.focus()):!R.shiftKey&&document.activeElement===I&&(R.preventDefault(),P.focus())};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C),document.body.style.overflow=S,E!=null&&E.isConnected&&E.focus()}},[]);const O=S=>{var j;S.preventDefault();const E=o.trim(),C=Umt(d);if(!E){m(s("artifactEdit.nameRequired")),(j=y.current)==null||j.focus();return}if(C.length>c4){m(s("artifactEdit.tooManyTags",{max:c4}));return}if(C.some(T=>T.length>Mee)){m(s("artifactEdit.tagTooLong",{max:Mee}));return}m(""),r({name:E,description:c.trim(),tags:C})},k=h||n;return yi.createPortal(a.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!t&&i()},children:a.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:[a.jsxs("header",{className:"artifact-edit-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:g,children:s("artifactEdit.title")}),a.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),a.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:a.jsx(BIe,{})})]}),a.jsxs("form",{onSubmit:O,children:[a.jsxs("div",{className:"artifact-edit-dialog__body",children:[a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.name")}),a.jsx("input",{ref:y,value:o,maxLength:Bmt,disabled:t,"aria-invalid":!!k||void 0,onChange:S=>{l(S.target.value),m("")}})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.description")}),a.jsx("textarea",{value:c,maxLength:Dee,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:S=>u(S.target.value)}),a.jsxs("small",{children:[c.length,"/",Dee]})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.tags")}),a.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:c4}),onChange:S=>{f(S.target.value),m("")}})]}),k?a.jsx("div",{className:"artifact-edit-error",role:"alert",children:k}):null]}),a.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[a.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function UIe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:a.jsx(nat,{"aria-hidden":"true"})})}),a.jsxs(er.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[a.jsx("span",{className:"sr-only",children:t}),n.map(r=>a.jsx(er.Item,{disabled:r.disabled,onSelect:r.onSelect,children:a.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const zmt="_Alert_1tr02_1",Vmt="_Content_1tr02_145",Hmt="_Indicator_1tr02_156",qmt="_Message_1tr02_159",Wmt="_Title_1tr02_162",Kmt="_Description_1tr02_168",Gmt="_Actions_1tr02_173",Yb={Alert:zmt,Content:Vmt,Indicator:Hmt,Message:qmt,Title:Wmt,Description:Kmt,Actions:Gmt},Lg=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:o,className:l,actionsClassName:c,ref:u,...d})=>{const f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=iNe({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]),a.jsxs("div",{ref:tT([u,f]),className:Qi(Yb.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[o===!1?null:a.jsx("div",{className:Yb.Indicator,children:o??a.jsx(Xmt,{color:e})}),a.jsxs("div",{className:Yb.Content,children:[a.jsxs("div",{className:Yb.Message,children:[n&&a.jsx("div",{className:Yb.Title,children:n}),i&&a.jsx("div",{className:Yb.Description,children:i})]}),r&&a.jsx("div",{className:Qi(Yb.Actions,c),ref:h,children:r})]})]})},Xmt=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return a.jsx(Pje,{});case"success":return a.jsx(_je,{});default:return a.jsx(Nje,{})}};function Td({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:o="warning",busy:l=!1,confirmDisabled:c=!1,onCancel:u,onConfirm:d}){const{t:f}=Te("shell"),h=r??f("confirm.cancel"),m=s??f("confirm.close"),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(l),w=p.useRef(u);return p.useEffect(()=>{y.current=l,w.current=u},[l,u]),p.useEffect(()=>{var S;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=v.current)==null||S.focus();const k=E=>{E.key==="Escape"&&!y.current&&w.current()};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",k),O!=null&&O.isConnected&&O.focus()}},[]),yi.createPortal(a.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&u()},children:a.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${o}`,role:"alertdialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":l||void 0,children:[a.jsxs("header",{className:"studio-confirm-head",children:[a.jsxs("div",{className:"studio-confirm-title-wrap",children:[a.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:a.jsx(Pje,{})}),a.jsx("h2",{id:g,children:e})]}),a.jsx(_t,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:u,disabled:l,"aria-label":m,children:a.jsx(mV,{})})]}),a.jsxs("div",{className:"studio-confirm-body",children:[a.jsx("div",{id:b,children:t}),n?a.jsx(Lg,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),a.jsxs("footer",{className:"studio-confirm-actions",children:[a.jsx(_t,{ref:v,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:l,children:h}),a.jsx(_t,{type:"button",className:"studio-confirm-primary",color:o==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:d,disabled:l||c,children:i})]})]})}),document.body)}const Ymt="_Container_1a6nz_1",Zmt="_Input_1a6nz_229",Lee={Container:Ymt,Input:Zmt},_s=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:o="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=o==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:w,onAutofill:x,autoSelect:O,startAdornment:k,endAdornment:S,pill:E,opticallyAlign:C,ref:j,...T}=e,R=I=>{const D=t.current;if(!I.target||!(I.target instanceof Element)||!D||D.contains(I.target)||I.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;I.preventDefault(),document.activeElement!==D&&D.focus();const{left:_,top:L}=D.getBoundingClientRect(),{clientX:F,clientY:M}=I,H=M{var I;O&&((I=t.current)==null||I.select())},[O]);const P=I=>{w==null||w(I),I.animationName==="native-autofill-in"&&(x==null||x())};return a.jsxs("div",{className:Qi(Lee.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":A,"data-disabled":h?"":void 0,"data-readonly":m?"":void 0,"data-invalid":g?"":void 0,"data-pill":E?"":void 0,"data-optically-align":C,"data-has-start-adornment":k?"":void 0,"data-has-end-adornment":S?"":void 0,onMouseDown:R,children:[k,a.jsx("input",{...T,ref:tT([j,t]),id:r||(b?void 0:i),className:Lee.Input,type:o,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:I=>{N(!0),v==null||v(I)},onBlur:I=>{N(!1),y==null||y(I)},onAnimationStart:P,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),S]})},Jmt="_SelectControl_1tyi7_1",egt="_Clear_1tyi7_436",tgt="_DropdownIcon_1tyi7_437",ngt="_TriggerText_1tyi7_468",igt="_IndicatorWrapper_1tyi7_476",rgt="_StartIcon_1tyi7_482",sgt="_DropdownIconChevron_1tyi7_534",agt="_LoadingIndicator_1tyi7_537",pp={SelectControl:Jmt,Clear:egt,DropdownIcon:tgt,TriggerText:ngt,IndicatorWrapper:igt,StartIcon:rgt,DropdownIconChevron:sgt,LoadingIndicator:agt},ogt=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:o,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),S=!!b&&v&&!g&&!o,E=w&&w!=="none"&&!g,C=S||g||E,j=!g&&!o,T=A=>{var N;switch(A.key){case"ArrowDown":case"ArrowUp":case" ":A.stopPropagation(),A.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(A)}},R=A=>{var N;A.button!==2&&(A.stopPropagation(),r?(A.preventDefault(),r()):(t==null||t(A),(N=x.onClick)==null||N.call(x,A)))};return a.jsxs("span",{ref:tT([O,e]),className:Qi(pp.SelectControl,c),role:"button",tabIndex:o?-1:0,onPointerEnter:A=>{SV(A),i==null||i(A)},onPointerDown:j?R:void 0,onKeyDown:j?T: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":o?"":void 0,"aria-disabled":o,...x,onClick:void 0,children:[y&&a.jsx(y,{className:pp.StartIcon}),a.jsx("span",{className:pp.TriggerText,children:l}),C&&a.jsxs("div",{className:pp.IndicatorWrapper,children:[S&&a.jsx(_t,{"aria-label":"Clear current value",className:pp.Clear,onPointerDown:A=>{A.stopPropagation()},onClick:A=>{A.stopPropagation(),A.preventDefault(),b()},color:"secondary",variant:E?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":E?void 0:"",children:a.jsx(mV,{})}),g&&a.jsx(KA,{className:pp.LoadingIndicator}),E&&a.jsx(lgt,{iconType:w})]})]})},lgt=({iconType:e})=>e==="chevronDown"?a.jsx(Yst,{className:Qi(pp.DropdownIcon,pp.DropdownIconChevron)}):a.jsx(iat,{className:pp.DropdownIcon}),cgt="_Menu_n4tw6_3",ugt="_MenuList_n4tw6_5",dgt="_MenuInner_n4tw6_50",fgt="_OptionsList_n4tw6_64",hgt="_Option_n4tw6_64",pgt="_PressableInner_n4tw6_111",mgt="_OptionInner_n4tw6_113",ggt="_OptionCheck_n4tw6_118",bgt="_OptionIndicatorSlot_n4tw6_123",ygt="_OptionGroupHeading_n4tw6_128",vgt="_OptionHardLimitHeading_n4tw6_140",xgt="_OptionsLimit_n4tw6_147",wgt="_Action_n4tw6_152",Ogt="_ActionInner_n4tw6_218",kgt="_ActionsContainer_n4tw6_224",Sgt="_Search_n4tw6_244",Egt="_SearchEmpty_n4tw6_247",ys={Menu:cgt,MenuList:ugt,MenuInner:dgt,OptionsList:fgt,Option:hgt,PressableInner:pgt,OptionInner:mgt,OptionCheck:ggt,OptionIndicatorSlot:bgt,OptionGroupHeading:ygt,OptionHardLimitHeading:vgt,OptionsLimit:xgt,Action:wgt,ActionInner:Ogt,ActionsContainer:kgt,Search:Sgt,SearchEmpty:Egt},QIe=p.createContext(null),Tb=()=>{const e=p.use(QIe);if(!e)throw new Error("Select components must be wrapped in ");return e},Agt=({label:e})=>a.jsx(a.Fragment,{children:e}),Tgt=({label:e})=>a.jsx(a.Fragment,{children:e}),_gt=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return a.jsx(a.Fragment,{children:n})},ma=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:o="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:k,optionClassName:S,OptionView:O=Agt,TriggerStartIcon:A,triggerClassName:E,opticallyAlign:j,TriggerView:T,searchPlaceholder:R="",searchPredicate:C=Ugt,searchEmptyMessage:N="No results found.",listMaxWidth:P="auto"}=e,I=e.block??o!=="ghost",D=e.align??(I?"center":"start"),_=e.alignOffset??(D==="center"?0:-5),L=e.listMinWidth??(I?"auto":300),F=nb((le,V)=>{if(s){if(!le.value){k([]);return}if(V){const Y=i.filter(ue=>ue!==le.value),K=DB(v,Y);k(K)}else{const Y=DB(v,i);k(Y.concat(le))}}else k(le)}),M=p.useRef(C);M.current=C;const H=p.useMemo(()=>y,[y.length]),q=p.useRef(y);q.current=y;const U=p.useCallback(le=>{var V;(V=q.current.find(Y=>Y.id===le))==null||V.onSelect(le)},[]),Z=p.useMemo(()=>bH(v)?v.reduce((le,V)=>le+V.options.length,0):v.length,[v]),J=`select-trigger-${p.useId()}`,ne=Z>15,W=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:T??_gt}:{multiple:!1,value:i,TriggerView:T??Tgt},[s,i,T]),X=p.useMemo(()=>({...W,triggerId:J,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:o,pill:g,size:l,dropdownIconType:c,block:I,align:D,alignOffset:_,side:w,avoidCollisions:x,listWidth:b,listMinWidth:L,listMaxWidth:P,searchPlaceholder:R,searchEmptyMessage:N,TriggerStartIcon:A,triggerClassName:E,opticallyAlign:j,optionClassName:S,OptionView:O,actions:H,onActionSelect:U,onSelectRef:F,searchPredicateRef:M,searchable:ne,disabled:f}),[W,J,t,n,r,v,h,m,u,d,o,g,l,c,I,D,_,w,x,b,L,P,R,N,A,E,j,S,O,H,U,F,ne,f]);return a.jsx(HIe.Provider,{value:X,children:a.jsx(Ngt,{})})},jgt=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:o,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:k,TriggerView:S,onSelectRef:O}=Eb(),{onOpenChange:A,...E}=e,j=s?r[0]:r,T=l?v:b,R=p.useMemo(()=>zgt(o,j)||{value:"",label:T},[j,o,T]),C=s?r.length>0:!!r,N=l||!C,P=p.useMemo(()=>YIe(),[]),I=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const L=DB(o,r),F=o.flatMap(M=>"options"in M?M.options:M);return{values:L.length?L:[{value:"",label:T}],selectedAll:F.length<=r.length}},[s,o,r,T]),D=L=>{const F=L.key;if(!s&&ZIe(F)){const M=P(F);L.stopPropagation();const H=JIe(o,M,j);H&&O.current(H)}},_=()=>{O.current({value:"",label:""}),A==null||A(!1)};return a.jsxs(lgt,{id:t,className:x,selected:!N,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:k,opticallyAlign:w,dropdownIconType:g,onClearClick:u?_:void 0,onInteract:A,onKeyDown:D,...E,children:[s?a.jsx(S,{...I}):a.jsx(S,{...R}),(d||n)&&a.jsx("input",{id:n,name:d,value:j,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"})]})},Ngt=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:o,listMinWidth:l,listMaxWidth:c}=Eb(),[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 iT(u,()=>{h(!1)}),a.jsxs(LRe,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[a.jsx($Re,{asChild:!0,children:a.jsx(jgt,{onOpenChange:h})}),a.jsx(FRe,{forceMount:!0,children:a.jsx(ek,{className:ks.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&a.jsx(BRe,{ref:f,forceMount:!0,className:ks.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:Lp,onCloseAutoFocus:Lp,onEscapeKeyDown:Lp,style:Fv({"select-list-width":o,"select-list-min-width":l,"select-list-max-width":c}),children:a.jsx(Rgt,{onOpenChange:h})},"dropdown")})})]})},qIe=p.createContext(null),ik=()=>{const e=p.use(qIe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},Rgt=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Eb(),o=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 j;return((t?n[0]:n)||((j=g_(i))==null?void 0:j.value))??""}),g=p.useMemo(()=>YIe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),w=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),x=p.useMemo(()=>Qgt(i,w,s.current),[i,w,s]),k=p.useMemo(()=>g_(x),[x]),S=p.useRef(!1),O=E=>{const j=E.key,T=t?n[0]:n,R=h||(k==null?void 0:k.value)||T,C=document.activeElement===u.current,N=l.current;if(!N)return;const P=()=>{const _=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),L=mp(h,N);L==null||L.dispatchEvent(_)},I=(_,L)=>{m(_),L.scrollIntoView({block:"nearest"})},D=()=>{const _=t?n[0]:n;if(_){const F=mp(_,N);if(F){I(_,F);return}}const L=g_(i);if(L){const F=mp(L.value,N);F&&I(L.value,F)}};switch(j){case"ArrowDown":{if(E.preventDefault(),!h||!mp(h,N)){D();return}const _=Vgt(h,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"ArrowUp":{if(E.preventDefault(),!h||!mp(h,N)){D();return}const _=Hgt(R,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"Enter":E.preventDefault(),P();return;case" ":if(w&&C)return;E.preventDefault(),P();return}if(ZIe(j)){if(C)return;const _=g(j);E.stopPropagation();const L=JIe(i,_,h);if(L){const F=mp(L.value,N);F&&(m(L.value),F.scrollIntoView({block:"nearest"}))}}},A=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:o,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{hI(()=>{if(!l.current)return;const j=mp(h,l.current);j==null||j.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=g_(x);E&&m(E.value)},[x]),a.jsx(qIe,{value:A,children:a.jsxs("div",{id:v,className:ks.MenuInner,onKeyDown:O,ref:l,tabIndex:0,children:[r&&a.jsx(Igt,{value:d,onChange:f}),a.jsx(Pgt,{filteredOptions:x}),a.jsx(Fgt,{})]})})},Igt=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Eb(),{listId:i,searchInputRef:r}=ik(),s=o=>{t(o.target.value)};return a.jsx("div",{className:ks.Search,children:a.jsx(js,{startAdornment:a.jsx(pat,{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})})},uT=e=>"options"in e,bH=e=>e[0]&&uT(e[0]),hw=300,Pgt=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Eb(),{listRef:n}=ik();if(!e.length)return typeof t=="string"?a.jsx("p",{className:ks.SearchEmpty,"data-text-only":!0,children:t}):a.jsx("div",{className:ks.SearchEmpty,children:t});const i=bH(e),r=!i&&e.length>hw,s=i?e.map(o=>a.jsx(Mgt,{...o},o.label)):e.slice(0,hw).map(o=>a.jsx(KIe,{...o},o.value));return a.jsxs("div",{className:ks.OptionsList,ref:n,children:[s,r&&a.jsx(WIe,{numHidden:e.length-hw})]})},Dgt={limit:100,label:"Show all"},Mgt=({label:e,options:t,optionsLimit:n=Dgt})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=ik(),[o,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ks.OptionGroupHeading,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),e]}),d.map(h=>a.jsx(KIe,{...h},h.value)),c&&a.jsx(Lgt,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&a.jsx(WIe,{numHidden:t.length-hw})]})},WIe=({numHidden:e})=>a.jsxs("div",{className:ks.OptionHardLimitHeading,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),Lgt=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=ik(),s=e===i,o=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return a.jsx("div",{className:qi(ks.Option,ks.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:o,onPointerLeave:l,children:a.jsxs("div",{className:qi(ks.PressableInner,ks.OptionInner),children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),t]})})},$gt="data-option-id",KIe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Eb(),{valueRef:o,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=ik(),{value:d,disabled:f,tooltip:h}=e,m=o.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 a.jsx("div",{className:qi(ks.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[$gt]: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:a.jsxs("div",{className:ks.PressableInner,children:[a.jsxs("div",{className:ks.OptionInner,children:[a.jsx("div",{className:ks.OptionIndicatorSlot,children:g&&a.jsx(mC,{className:ks.OptionCheck})}),a.jsx(n,{...e}),h&&a.jsx(Ca,{content:h.content,maxWidth:h.maxWidth,side:"right",children:a.jsx(Pje,{})})]}),e.description&&a.jsxs("div",{className:ks.OptionInner,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),e.description]})]})})},Fgt=()=>{const{actions:e}=Eb();return e.length===0?null:a.jsx("div",{className:ks.ActionsContainer,children:e.map(t=>a.jsx(Bgt,{...t},t.id))})},Bgt=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Eb(),{requestCloseRef:s}=ik(),o=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 a.jsx("div",{className:ks.Action,onPointerUp:l,onKeyDown:o,tabIndex:0,children:a.jsxs("div",{className:qi(ks.ActionInner,i),children:[n&&a.jsx(n,{role:"presentation"}),t]})})},Ugt=(e,t)=>e.label.toLowerCase().includes(t),Qgt=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return bH(e)?e.reduce((s,o)=>{const l=o.options.filter(r);return l.length&&s.push({...o,options:l}),s},[]):e.reduce((s,o)=>(r(o)&&s.push(o),s),[])},g_=e=>{if(!e.length)return;let t;for(const n of e)if(uT(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},zgt=(e,t)=>{let n;for(const i of e)if(uT(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},DB=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(uT(r)){const s=r.options.filter(o=>i.has(o.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},GIe=40,mp=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),XIe=e=>e.matches("[data-option-id]:not([data-disabled])"),Vgt=(e,t)=>{const n=mp(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=mp(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},ZIe=e=>/^[a-zA-Z0-9]$/.test(e),JIe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const o=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(uT(l)){for(const c of l.options)if(o(c))if(s){r=c;break}else i=i||c}else if(o(l))if(s){r=l;break}else i=i||l;return r||i};function to(...e){return e.filter(Boolean).join(" ")}const Uee=[["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 qgt(e){let t=2166136261;for(const o of e)t^=o.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=Uee[n%Uee.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 r1({seed:e,className:t}){return a.jsx("span",{className:to("resource-card__identity-mark",t),style:qgt(e),"aria-hidden":"true"})}function Wgt(e){return a.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{transform:"translate(0.875 0.875)",children:[a.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"}),a.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ch({className:e,...t}){return a.jsx("section",{className:to("resource-page",e),...t})}function Qv({title:e,description:t,className:n}){return a.jsxs("header",{className:to("resource-page__header",n),children:[a.jsx("h1",{children:e}),t?a.jsx("p",{children:t}):null]})}function Kgt({className:e,...t}){return a.jsx("div",{className:to("resource-detail",e),...t})}function Ggt({className:e,...t}){return a.jsx("header",{className:to("resource-detail__header",e),...t})}function Xgt({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:o}=_e("ui"),l=r??o("resourceCollection.back");return a.jsxs("div",{className:"resource-detail__heading",children:[s?a.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:a.jsx(Tat,{"aria-hidden":"true"})}):null,a.jsxs("div",{className:"resource-detail__heading-copy",children:[a.jsxs("div",{className:"resource-detail__title-row",children:[a.jsx("span",{className:"resource-detail__identity",children:a.jsx(r1,{seed:n})}),a.jsx("h1",{children:e}),i?a.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?a.jsx("p",{children:t}):null]})]})}function Ygt({className:e,...t}){return a.jsx("div",{className:to("resource-detail__actions",e),...t})}function Zgt({className:e,...t}){return a.jsx("div",{className:to("resource-detail__body",e),...t})}function dT({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:o,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(k=>k.key===f))==null?void 0:x.content,w=h??b("resourceCollection.detailNavigation");return a.jsxs(Kgt,{className:l,children:[a.jsxs(Ggt,{children:[a.jsx(Xgt,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),o?a.jsx(Ygt,{className:c,children:o}):null]}),a.jsx(Zgt,{className:to(v&&"is-split",u),children:v?a.jsxs(a.Fragment,{children:[a.jsx("nav",{className:"resource-detail__navigation","aria-label":w,children:d==null?void 0:d.map(k=>a.jsx(At,{type:"button",color:"secondary",variant:k.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":k.key===f?"page":void 0,disabled:k.disabled,onClick:()=>m==null?void 0:m(k.key),children:a.jsx("span",{className:"resource-detail__navigation-label",children:k.label})},k.key))}),a.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function yH({className:e,...t}){return a.jsx("dl",{className:to("resource-detail__summary",e),...t})}function ePe({title:e,description:t,actions:n,className:i}){return a.jsxs("header",{className:to("resource-detail__section-header",i),children:[a.jsxs("div",{children:[a.jsx("h2",{children:e}),t?a.jsx("p",{children:t}):null]}),n]})}function vH({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:o,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 a.jsxs("div",{className:"resource-data-table",children:[a.jsxs("div",{className:"resource-data-table__toolbar",children:[a.jsx("div",{className:"resource-data-table__search",children:a.jsx(js,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:o,"aria-label":l})}),c,u?a.jsx(At,{type:"button",color:"primary",disabled:u.disabled,title:u.title,onClick:u.onClick,children:u.label}):null]}),a.jsxs("div",{ref:f,className:"resource-data-table__frame","aria-busy":m||void 0,onScroll:h,children:[a.jsxs("table",{className:"resource-data-table__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[i.map(x=>a.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),y?a.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:a.jsx("span",{className:"sr-only",children:v("resourceCollection.actions")})}):null]})}),a.jsx("tbody",{children:e.length===0?a.jsx("tr",{children:a.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(y?1:0),children:w})}):e.map(x=>{const k=t(x),S=(n==null?void 0:n(x))??k;return a.jsxs("tr",{children:[i.map(O=>a.jsx("td",{className:O.className,children:O.render(x)},O.key)),d?a.jsx("td",{className:"resource-data-table__actions",children:a.jsx(VIe,{label:v("resourceCollection.moreActions",{label:S}),menuLabel:v("resourceCollection.actionsFor",{label:S}),items:d(x)})}):null]},k)})})]}),g]})]})}function ib({className:e,...t}){return a.jsx("div",{className:to("resource-toolbar",e),...t})}function rb({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const o=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 a.jsx("nav",{className:to("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>a.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:()=>o(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function em({className:e,...t}){return a.jsxs("label",{className:to("resource-search",e),children:[a.jsx(Wgt,{}),a.jsx("input",{type:"search",...t})]})}const Jgt=150,ebt=200;function Qee(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function sb({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:o=!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"&&Qee(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,ebt))},[h,g]),v=p.useCallback(y=>{var k;if(o||!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&&!((k=l.current)!=null&&k.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,Qee(S))},Jgt))},[h,f,o,m]);return p.useEffect(()=>{const y=w=>{var A;if(!d.current)return;const x=m();if(!x||x.getAttribute("data-state")!=="open"){d.current=!1,h();return}const k=w.target;if(!(k instanceof Node))return;const S=x.getAttribute("aria-controls"),O=S?document.getElementById(S):null;if((A=l.current)!=null&&A.contains(k)||O!=null&&O.contains(k)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),a.jsxs("div",{ref:l,className:to("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[a.jsx("label",{className:"sr-only",htmlFor:e,children:t}),a.jsx(ma,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:o,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const tm=p.forwardRef(function({className:t,...n},i){return a.jsx("section",{ref:i,className:to("resource-results",t),...n})});function fl(){const{t:e}=_e("ui");return a.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[a.jsx(YA,{size:16}),a.jsx(on,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function zv({className:e,...t}){return a.jsx("div",{className:to("resource-grid",e),...t})}function xH({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...o}){return a.jsxs("article",{className:to("resource-card",r&&"is-interactive",e),...o,children:[r&&i?a.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,a.jsx("div",{className:"resource-card__content",children:s}),t||n?a.jsxs("footer",{className:"resource-card__footer",children:[t,n?a.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function CN({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return a.jsx("button",{type:"button",className:to("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function MB({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...o}){const l=t==="play"?a.jsx(fat,{}):t==="plus"?a.jsx(Mje,{}):a.jsx(Gst,{});return a.jsx(CN,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...o,children:r??l})}function wH({leading:e,title:t,titleText:n,subtitle:i,status:r}){return a.jsxs("div",{className:"resource-card__header",children:[a.jsxs("div",{className:"resource-card__identity",children:[e,a.jsxs("div",{className:"resource-card__title-copy",children:[a.jsx("h3",{title:n,children:t}),i]})]}),r]})}function kH({children:e,title:t}){return a.jsx("p",{className:"resource-card__description",title:t,children:e})}function tPe({items:e,className:t}){return a.jsx("dl",{className:to("resource-card__metadata",t),children:e.map((n,i)=>a.jsxs("div",{className:n.className,children:[a.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),a.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function ab({className:e,icon:t,children:n,...i}){return a.jsxs("button",{type:"button",className:to("resource-create-card",e),...i,children:[a.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),a.jsx("span",{children:n})]})}const tbt=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),nbt=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),ibt=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function nPe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function xI(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function rbt(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function sbt(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function abt(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function obt(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function zee(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),o=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(o)return`${e}${o}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function lbt(e,t){const n=obt(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",o=[],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://")&&o.push({name:zee(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;o.push({name:zee(u||"generated-video",c,s),url:c,type:s,taskId:u})}return o}function Vee(e,t){return new Date(xI(e,t)||Date.now()).toISOString()}function cbt(e,t){var r;const n=[],i=new Set;for(const s of e)for(const o of s.sessions){const l=xI(o.lastUpdateTime,Date.now()),c=tM(o.events,t);for(const u of o.events??[])for(const d of abt(u)){const f=(d==null?void 0:d.name)??"";for(const h of lbt(f,d==null?void 0:d.response)){const m=`${o.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:o.id,sessionTitle:c,sessionUpdatedAt:Vee(o.lastUpdateTime,l),createdAt:Vee(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 iPe(e){const t=nPe(e);return tbt.has(t)?"image":nbt.has(t)?"video":"document"}function ubt(e){const t=iPe(e);return t==="image"?"image":t==="video"?"video":ibt.has(nPe(e))?"frame":"unavailable"}function dbt(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const o of s.sessions){const l=xI(o.lastUpdateTime,0),c=new Map;for(const u of o.events??[]){const d=rbt(u);if(!d)continue;const f=xI(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(sbt(u.filename)),f=d??u,h=d?"image":ubt(u.filename);i.push({id:`${s.appName}:${o.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:o.id,sessionTitle:tM(o.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:iPe(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,o)=>o.createdAt-s.createdAt||s.name.localeCompare(o.name,n))}function rPe(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 sPe(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 c4=40;function fbt(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 hbt(e,t){return e(`artifactLibrary.types.${t}`)}function b_(e){return e instanceof Error?e.message:String(e)}function aPe({artifact:e,large:t=!1}){return a.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?a.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:a.jsx(Lee,{})}):null]}):e.type==="document"?a.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[a.jsx("span",{className:"is-title"}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{className:"is-short"})]}):e.type==="image"?a.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-image-sun"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):a.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-video-orbit"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),a.jsx("span",{className:"artifact-video-play",children:a.jsx(Lee,{})})]})})}function pbt({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:o,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return a.jsxs("tr",{className:"library-artifact-row",children:[a.jsx("td",{className:"library-artifact-file",children:a.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[a.jsx("div",{className:"library-artifact-thumbnail",children:a.jsx(aPe,{artifact:e})}),a.jsxs("div",{className:"library-artifact-row-title",children:[a.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),a.jsx("span",{className:"library-artifact-row-size",children:sPe(e.sizeBytes)||"—"})]})]})}),a.jsx("td",{className:"library-artifact-source-cell",children:l?a.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[a.jsx("span",{children:e.agentName}),a.jsx("span",{"aria-hidden":"true",children:"/"}),a.jsx("span",{children:e.sessionTitle})]}):a.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),a.jsx("td",{className:"library-artifact-time",children:rPe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),a.jsx("td",{className:"library-artifact-actions-cell",children:a.jsx("div",{className:"library-artifact-actions",children:a.jsx(VIe,{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}]:[],...o?[{label:c("artifactLibrary.delete"),onSelect:()=>o(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function mbt({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:o="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:m,toolbarFilters:g}){var Be,he;const{t:b,i18n:v}=_e("workspaceTools"),y=v.resolvedLanguage||v.language,[w,x]=p.useState("all"),[k,S]=p.useState(""),[O,A]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(""),[D,_]=p.useState({}),[L,F]=p.useState(()=>new Set),[M,H]=p.useState(null),[q,U]=p.useState(!1),[Z,z]=p.useState(""),[J,ne]=p.useState(null),[W,X]=p.useState(!1),[le,V]=p.useState(c4),Y=p.useRef(null),K=p.useRef(null),ue=p.useRef(0),te=p.useRef(null),Oe=p.useRef(null),fe=p.useRef(!1),pe=p.useCallback(()=>{ue.current+=1,A(null),j(""),R("")},[]),Se=p.useMemo(()=>t?[...t]:dbt(e,b("library.untitledSession"),y),[t,y,e,b]),ve=p.useMemo(()=>Se.filter(ie=>!L.has(ie.id)).map(ie=>D[ie.id]??ie),[Se,D,L]);p.useEffect(()=>()=>{ue.current+=1},[]),p.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),p.useEffect(()=>{var Ue;if(!O)return;const ie=document.activeElement,we=document.body.style.overflow;document.body.style.overflow="hidden",(Ue=Y.current)==null||Ue.focus();const Re=_t=>{if(_t.key==="Escape"){_t.preventDefault(),pe();return}if(_t.key!=="Tab")return;const Pt=K.current;if(!Pt)return;const Gt=Array.from(Pt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(qe=>qe.getClientRects().length>0);if(Gt.length===0){_t.preventDefault();return}const St=Gt[0],Lt=Gt[Gt.length-1];_t.shiftKey&&document.activeElement===St?(_t.preventDefault(),Lt.focus()):!_t.shiftKey&&document.activeElement===Lt&&(_t.preventDefault(),St.focus())};return document.addEventListener("keydown",Re),()=>{document.removeEventListener("keydown",Re),document.body.style.overflow=we,ie!=null&&ie.isConnected&&ie.focus()}},[pe,O]);const Le=async ie=>{const we=ue.current+1;if(ue.current=we,N(""),j(""),A(ie),ie.preview.mode!=="unavailable"){if(ie.contentUrl){j(ie.contentUrl);return}R(`preview:${ie.id}`);try{const Re=await Cz(ie.appName,n,ie.sessionId,ie.preview.filename,ie.preview.version);if(ue.current!==we){URL.revokeObjectURL(Re);return}j(Re)}catch(Re){ue.current===we&&N(b("artifactLibrary.previewFailed",{name:ie.name,message:b_(Re)}))}finally{ue.current===we&&R("")}}},He=async ie=>{N(""),R(`download:${ie.id}`);try{d?await d(ie):await Ez(ie.appName,n,ie.sessionId,ie.name,ie.version),I(b("artifactLibrary.downloadStarted",{name:ie.name}))}catch(we){N(b("artifactLibrary.downloadFailed",{name:ie.name,message:b_(we)}))}finally{R("")}},Ge=async ie=>{if(!(!M||!c)){U(!0),z("");try{const Re=await c(M,ie)??{...M,...ie,updatedAt:Date.now()};_(Ue=>({...Ue,[M.id]:Re})),I(b("artifactLibrary.updated",{name:Re.name})),H(null)}catch(we){z(b_(we))}finally{U(!1)}}},De=async()=>{if(!(!J||!u)){X(!0),N("");try{await u(J),F(ie=>new Set([...ie,J.id])),I(b("artifactLibrary.deleted",{name:J.name})),(O==null?void 0:O.id)===J.id&&pe(),ne(null)}catch(ie){N(b("artifactLibrary.deleteFailed",{name:J.name,message:b_(ie)})),ne(null)}finally{X(!1)}}},se=p.useMemo(()=>{const ie=k.trim().toLocaleLowerCase();return ve.filter(we=>{var Re;return(Re=we.origin)!=null&&Re.region&&we.origin.region!==h||w!=="all"&&we.type!==w?!1:ie?[we.name,we.sessionTitle,we.agentName].some(Ue=>Ue.toLocaleLowerCase().includes(ie)):!0})},[w,ve,k,h]),ce=p.useMemo(()=>se.slice(0,le),[se,le]),ye=le{fe.current||(fe.current=!0,V(ie=>ie+c4))},[]);p.useEffect(()=>{V(c4)},[r,w,k,se.length]),p.useEffect(()=>{fe.current=!1},[le]),p.useEffect(()=>{const ie=Oe.current,we=te.current;if(!i||!ie||!we||!ye)return;const Re=new IntersectionObserver(([Ue])=>{Ue.isIntersecting&&Ae()},{root:we,rootMargin:"240px 0px",threshold:.01});return Re.observe(ie),()=>Re.disconnect()},[i,ye,Ae,le]);const Ee=()=>{const ie=te.current;!i||!ie||!ye||ie.scrollHeight-ie.scrollTop-ie.clientHeight<=240&&Ae()},Ce=!!k.trim()||w!=="all"||ve.some(ie=>{var we;return((we=ie.origin)==null?void 0:we.region)&&ie.origin.region!==h});return a.jsxs("div",{className:"artifact-library-page resource-collection",children:[a.jsxs(ib,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(sb,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:w,options:fbt(b),onChange:x}),g,a.jsx(em,{"aria-label":b("artifactLibrary.searchAria"),value:k,onChange:ie=>S(ie.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),o&&ve.length>0?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,C?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:C}),a.jsx("button",{type:"button",onClick:()=>N(""),children:b("artifactLibrary.close")})]}):null,a.jsx(tm,{ref:te,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:Ee,children:a.jsxs("div",{className:"artifact-library-panel",children:[s&&ve.length===0?a.jsx(fl,{}):o&&ve.length===0?a.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[a.jsx("p",{children:b("artifactLibrary.loadFailed")}),a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):se.length===0?a.jsxs("div",{className:"artifact-library-empty",children:[a.jsx("p",{children:b(Ce?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),a.jsx("span",{children:b(Ce?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):a.jsx("div",{className:"artifact-library-list",children:a.jsxs("table",{className:"artifact-library-table",children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"artifact-library-table__file-column"}),a.jsx("col",{className:"artifact-library-table__source-column"}),a.jsx("col",{className:"artifact-library-table__time-column"}),a.jsx("col",{className:"artifact-library-table__actions-column"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),a.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),a.jsx("tbody",{children:ce.map(ie=>a.jsx(pbt,{artifact:ie,pendingAction:T,disabled:!n&&!t,onPreview:we=>void Le(we),onDownload:we=>void He(we),onEdit:c?we=>{z(""),H(we)}:void 0,onDelete:u?ne:void 0,onOpenSource:f,t:b,locale:y},ie.id))})]})}),ye?a.jsx("div",{ref:Oe,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),a.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:P}),O?a.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[a.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:pe}),a.jsxs("div",{ref:K,className:"artifact-library-preview-panel",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"artifact-library-preview-title",children:O.name}),a.jsx("p",{children:b("artifactLibrary.preview.meta",{type:hbt(b,O.type),version:O.version})})]}),a.jsx("button",{ref:Y,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:pe,children:a.jsx(zIe,{})})]}),a.jsxs("div",{className:"artifact-library-preview-content",children:[a.jsx("div",{className:"artifact-library-preview-canvas",children:T===`preview:${O.id}`?a.jsx(on,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):E&&O.preview.mode==="image"?a.jsx("img",{src:E,alt:b("artifactLibrary.preview.alt",{name:O.name})}):E&&O.preview.mode==="video"?a.jsx("video",{src:E,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:O.name})}):E&&O.preview.mode==="frame"?a.jsx("iframe",{src:E,title:b("artifactLibrary.preview.alt",{name:O.name})}):a.jsxs("div",{className:"artifact-library-preview-unavailable",children:[a.jsx(aPe,{artifact:O,large:!0}),a.jsx("p",{children:b(C?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),a.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[O.description?a.jsx("p",{className:"artifact-library-preview-description",children:O.description}):null,a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.agent")}),a.jsx("dd",{title:O.agentName,children:O.agentName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.session")}),a.jsx("dd",{title:O.sessionTitle,children:O.sessionTitle})]}),(Be=O.origin)!=null&&Be.toolName?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.tool")}),a.jsx("dd",{children:O.origin.toolName})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),a.jsx("dd",{children:rPe(O.createdAt,y,b("artifactLibrary.unknownTime"))})]}),O.sizeBytes?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),a.jsx("dd",{children:sPe(O.sizeBytes)})]}):null]}),(he=O.tags)!=null&&he.length?a.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:O.tags.map(ie=>a.jsx("span",{children:ie},ie))}):null]})]}),a.jsxs("footer",{children:[a.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?a.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const ie=O;pe(),f(ie)},children:[a.jsx(Bmt,{}),b("artifactLibrary.preview.viewSession")]}):null,c?a.jsxs("button",{type:"button",className:"is-secondary",disabled:O.canManage===!1,onClick:()=>{const ie=O;pe(),z(""),H(ie)},children:[a.jsx(vI,{}),b("artifactLibrary.edit")]}):null]}),a.jsxs("button",{type:"button",disabled:T.startsWith("download:")||!n&&!t,onClick:()=>void He(O),children:[a.jsx(Fmt,{}),b("artifactLibrary.download")]})]})]})]}):null,M?a.jsx(zmt,{artifact:M,busy:q,error:Z,onClose:()=>{q||H(null)},onSave:ie=>void Ge(ie)}):null,J?a.jsx(_d,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:J.name}),confirmLabel:b(W?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:W,onCancel:()=>{W||ne(null)},onConfirm:()=>void De()}):null]})}bn.hasResourceBundle("en-US","workspaceTools")||bn.addResourceBundle("en-US","workspaceTools",Bbe,!0,!0);bn.hasResourceBundle("zh-CN","workspaceTools")||bn.addResourceBundle("zh-CN","workspaceTools",qke,!0,!0);function Cb(e,t={}){return bn.t(e,{...t,ns:"workspaceTools"})}function gbt(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 fT(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(gbt(n,Cb("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function u4(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 oPe(e){const t=e;return{...t,createdAt:u4(t.createdAt),updatedAt:u4(t.updatedAt),sessionUpdatedAt:u4(t.sessionUpdatedAt)}}async function lPe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(oPe):[]}async function bbt(){const e=await fT(await yn("/web/artifacts"),Cb("artifactLibrary.api.listFailed"));return lPe(e)}async function ybt(e){if(e.length===0)return bbt();const t=await fT(await yn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Cb("artifactLibrary.api.syncFailed"));return lPe(t)}async function vbt(e,t){const n=await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Cb("artifactLibrary.api.updateFailed"));return oPe(await n.json())}async function xbt(e){await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Cb("artifactLibrary.api.deleteFailed"))}async function wbt(e){const n=await(await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Cb("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 cPe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class mM extends Error{constructor(n,i,r={}){super(n);Zt(this,"status");Zt(this,"errorCode");Zt(this,"requestId");Zt(this,"diagnostics");Zt(this,"detail");Zt(this,"payload");Zt(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 uPe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||Q("knowledge.loadFailed")}`).join(` +`));Zt(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const kbt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),Obt=6,Hee=50,dPe=4e3;function Sbt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Ebt(e){const t=Sbt(e);return kbt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function Cbt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function pS(e){if(Cbt(e))return Q("knowledge.htmlHidden");const t=Q("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 LB(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return pS(e).slice(0,dPe);if(typeof e!="object")return;if(t>=Obt)return Q("knowledge.depthTruncated");if(n.has(e))return Q("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,Hee).map(r=>LB(r,t+1,n));const i={};return Object.entries(e).slice(0,Hee).forEach(([r,s])=>{i[r]=Ebt(r)?Q("knowledge.redacted"):LB(s,t+1,n)}),i}function qee(e){if(e===void 0)return"";const t=LB(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,dPe)}catch{return Q("knowledge.diagnosticsUnavailable")}}function Sl(e,t){if(e instanceof uPe)return e.failures.map(({region:o,error:l})=>`${o} +${Sl(l,t)}`).join(` + +`);if(!(e instanceof mM))return(e instanceof Error?pS(e.message):"")||t;const n=pS(e.message)||t,i=[Number.isFinite(e.status)?Q("knowledge.statusCode",{status:e.status}):"",e.errorCode?Q("knowledge.errorCode",{code:pS(e.errorCode)}):"",e.requestId?Q("knowledge.requestId",{requestId:pS(e.requestId)}):""].filter(Boolean).join(" · "),r=qee(e.diagnostics),s=qee(e.detail);return[n,i,r?Q("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?Q("knowledge.detail",{detail:s}):""].filter(Boolean).join(` +`)}function AN(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function Abt(e){return Array.isArray(e)?e.map(t=>{const n=jd(t),i=AN(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 Tbt(e,t=!0){const n=jd(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=jd(i);return{message:typeof i=="string"?t?i.trim():"":AN(r.message,n.message,Abt(i)),errorCode:AN(r.errorCode,n.errorCode),requestId:AN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function jd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function cr(e){return typeof e=="string"?e:""}function OC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function OH(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),description:cr(t.description),providerType:cr(t.providerType),providerKnowledgeId:cr(t.providerKnowledgeId),projectName:cr(t.projectName),region:cr(t.region),status:cr(t.status),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),ownerId:cr(t.ownerId),ownerLabel:cr(t.ownerLabel),canManage:t.canManage===!0}}function hT(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),type:cr(t.type),sizeBytes:OC(t.sizeBytes,0),status:cr(t.status),url:cr(t.url),tosPath:cr(t.tosPath),metadata:jd(t.metadata),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),sourceMarkdown:cr(t.sourceMarkdown)}}function _bt(e){const t=jd(e),n=t.attachment,i=jd(n);return{id:cr(t.id),title:cr(t.title),content:cr(t.content),attachmentUrl:cr(t.attachmentUrl)||cr(i.url)||cr(i.previewUrl),attachmentType:cr(t.attachmentType)||cr(i.type)||cr(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Ef(e,t={},n=eo){var f;const i=hl(oc(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:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=Tbt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new mM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function Vv(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function jbt(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 Ef(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=jd(n);return{items:Array.isArray(i.items)?i.items.map(OH):[],nextToken:cr(i.nextToken)}}function Nbt(e){return`${e.region}\0${e.id}`}async function Rbt(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 jbt({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={},o=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(Q("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};o.set(Nbt(m),m)})}),r.length===n.length)throw new uPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function Ibt(e){return Ef("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},yr).then(OH)}function Pbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(OH)}function Dbt(e,t){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"DELETE"},yr)}async function Mbt(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 Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=jd(i);return{items:Array.isArray(r.items)?r.items.map(hT):[],offset:OC(r.offset,0),limit:OC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function Lbt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=jd(r);return{document:hT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(_bt):[],sourceMarkdown:cr(s.sourceMarkdown),offset:OC(s.offset,0),limit:OC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function $bt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${Vv(t)}`,{method:"POST",body:JSON.stringify(n)},yr).then(hT)}async function Fbt(e,t,n){const i=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${Vv(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},yr),r=jd(i);return{name:cr(r.name),url:cr(r.url),sourceMarkdown:cr(r.sourceMarkdown)}}function Bbt(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)),Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${Vv(t)}`,{method:"POST",body:i},yr).then(hT)}function Ubt(e,t,n,i){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hT)}function Qbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"DELETE"},yr)}function Hv({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(xH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(tPe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(MB,{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,o?a.jsx(MB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(kH,{title:i,children:i})]})}function jhn(){}function Wee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function fPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const zbt=/[$_\p{ID_Start}]/u,Vbt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Hbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,qbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hPe={};function Nhn(e){return e?zbt.test(String.fromCodePoint(e)):!1}function Rhn(e,t){const i=(t||hPe).jsx?Hbt:Vbt;return e?i.test(String.fromCodePoint(e)):!1}function Kee(e,t){return(hPe.jsx?Wbt:qbt).test(e)}const Kbt=/[ \t\n\f\r]/g;function Gbt(e){return typeof e=="object"?e.type==="text"?Gee(e.value):!1:Gee(e)}function Gee(e){return e.replace(Kbt,"")===""}let pT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};pT.prototype.normal={};pT.prototype.property={};pT.prototype.space=void 0;function pPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new pT(n,i,t)}function SC(e){return e.toLowerCase()}class zc{constructor(t,n){this.attribute=n,this.property=t}}zc.prototype.attribute="";zc.prototype.booleanish=!1;zc.prototype.boolean=!1;zc.prototype.commaOrSpaceSeparated=!1;zc.prototype.commaSeparated=!1;zc.prototype.defined=!1;zc.prototype.mustUseProperty=!1;zc.prototype.number=!1;zc.prototype.overloadedBoolean=!1;zc.prototype.property="";zc.prototype.spaceSeparated=!1;zc.prototype.space=void 0;let Xbt=0;const Ii=qv(),qa=qv(),$B=qv(),qt=qv(),vs=qv(),pw=qv(),fu=qv();function qv(){return 2**++Xbt}const FB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ii,booleanish:qa,commaOrSpaceSeparated:fu,commaSeparated:pw,number:qt,overloadedBoolean:$B,spaceSeparated:vs},Symbol.toStringTag,{value:"Module"})),d4=Object.keys(FB);class SH extends zc{constructor(t,n,i,r){let s=-1;if(super(t,n),Xee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&tyt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Yee,iyt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Yee.test(s)){let o=s.replace(eyt,nyt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=SH}return new r(i,t)}function nyt(e){return"-"+e.toLowerCase()}function iyt(e){return e.charAt(1).toUpperCase()}const mT=pPe([mPe,Ybt,yPe,vPe,xPe],"html"),Ab=pPe([mPe,Zbt,yPe,vPe,xPe],"svg");function Zee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function wPe(e){return e.join(" ").trim()}var EH={},Jee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ryt=/\n/g,syt=/^\s*/,ayt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oyt=/^:\s*/,lyt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,cyt=/^[;\s]*/,uyt=/^\s+|\s+$/g,dyt=` +`,ete="/",tte="*",gy="",fyt="comment",hyt="declaration";function pyt(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(ryt);b&&(n+=b.length);var v=g.lastIndexOf(dyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.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(syt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(ete!=e.charAt(0)||tte!=e.charAt(1))){for(var b=2;gy!=e.charAt(b)&&(tte!=e.charAt(b)||ete!=e.charAt(b+1));)++b;if(b+=2,gy===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:fyt,comment:v})}}function h(){var g=s(),b=c(ayt);if(b){if(f(),!c(oyt))return l("property missing ':'");var v=c(lyt),y=g({type:hyt,property:nte(b[0].replace(Jee,gy)),value:v?nte(v[0].replace(Jee,gy)):gy});return c(cyt),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 nte(e){return e?e.replace(uyt,gy):gy}var myt=pyt,gyt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EH,"__esModule",{value:!0});EH.default=yyt;const byt=gyt(myt);function yyt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,byt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var bM={};Object.defineProperty(bM,"__esModule",{value:!0});bM.camelCase=void 0;var vyt=/^--[a-zA-Z0-9_-]+$/,xyt=/-([a-z])/g,wyt=/^[^-]+$/,kyt=/^-(webkit|moz|ms|o|khtml)-/,Oyt=/^-(ms)-/,Syt=function(e){return!e||wyt.test(e)||vyt.test(e)},Eyt=function(e,t){return t.toUpperCase()},ite=function(e,t){return"".concat(t,"-")},Cyt=function(e,t){return t===void 0&&(t={}),Syt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Oyt,ite):e=e.replace(kyt,ite),e.replace(xyt,Eyt))};bM.camelCase=Cyt;var Ayt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Tyt=Ayt(EH),_yt=bM;function BB(e,t){var n={};return!e||typeof e!="string"||(0,Tyt.default)(e,function(i,r){i&&r&&(n[(0,_yt.camelCase)(i,t)]=r)}),n}BB.default=BB;var jyt=BB;const Nyt=N1(jyt),yM=kPe("end"),Ih=kPe("start");function kPe(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 Ryt(e){const t=Ih(e),n=yM(e);if(t&&n)return{start:t,end:n}}function cE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rte(e.position):"start"in e||"end"in e?rte(e):"line"in e||"column"in e?UB(e):""}function UB(e){return ste(e&&e.line)+":"+ste(e&&e.column)}function rte(e){return UB(e&&e.start)+"-"+UB(e&&e.end)}function ste(e){return e&&typeof e=="number"?e:1}class jl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!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&&(o=!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=cE(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=o&&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}}jl.prototype.file="";jl.prototype.name="";jl.prototype.reason="";jl.prototype.message="";jl.prototype.stack="";jl.prototype.column=void 0;jl.prototype.line=void 0;jl.prototype.ancestors=void 0;jl.prototype.cause=void 0;jl.prototype.fatal=void 0;jl.prototype.place=void 0;jl.prototype.ruleId=void 0;jl.prototype.source=void 0;const CH={}.hasOwnProperty,Iyt=new Map,Pyt=/[A-Z]/g,Dyt=new Set(["table","tbody","thead","tfoot","tr"]),Myt=new Set(["td","th"]),OPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lyt(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=Hyt(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=Vyt(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"?Ab:mT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=SPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function SPe(e,t,n){if(t.type==="element")return $yt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Fyt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Uyt(e,t,n);if(t.type==="mdxjsEsm")return Byt(e,t);if(t.type==="root")return Qyt(e,t,n);if(t.type==="text")return zyt(e,t)}function $yt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=CPe(e,t.tagName,!1),o=qyt(e,t);let l=TH(e,t);return Dyt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Gbt(c):!0})),EPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Fyt(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)}EC(e,t.position)}function Byt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);EC(e,t.position)}function Uyt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:CPe(e,t.name,!0),o=Wyt(e,t),l=TH(e,t);return EPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Qyt(e,t,n){const i={};return AH(i,TH(e,t)),e.create(t,e.Fragment,i,n)}function zyt(e,t){return t.value}function EPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function AH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Vyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Hyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=Ih(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function qyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&CH.call(t.properties,r)){const s=Kyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Myt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Wyt(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 o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else EC(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 EC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function TH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:Iyt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(Du(e,e.length,0,t),e):t}const lte={}.hasOwnProperty;function TPe(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 ff(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xl=Tb(/[A-Za-z]/),Al=Tb(/[\dA-Za-z]/),ivt=Tb(/[#-'*+\--9=?A-Z^-~]/);function wI(e){return e!==null&&(e<32||e===127)}const QB=Tb(/\d/),rvt=Tb(/[\dA-Fa-f]/),svt=Tb(/[!-/:-@[-`{-~]/);function Wn(e){return e!==null&&e<-2}function ds(e){return e!==null&&(e<0||e===32)}function Zi(e){return e===-2||e===-1||e===32}const vM=Tb(new RegExp("\\p{P}|\\p{S}","u")),fv=Tb(/\s/);function Tb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sk(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?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function gr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Zi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Zi(c)&&s++o))return;const A=t.events.length;let E=A,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),O=A;Ox;){const S=n[k];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 uvt(e,t,n){return gr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function s1(e){if(e===null||ds(e)||fv(e))return 1;if(vM(e))return 2}function xM(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};ute(f,-c),ute(h,c),o={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:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=sd(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=sd(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=sd(u,xM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=sd(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=sd(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Du(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Zi(O)?gr(e,w,"linePrefix",s+1)(O):w(O)}function w(O){return O===null||Wn(O)?e.check(dte,b,k)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||Wn(O)?(e.exit("codeFlowValue"),w(O)):(e.consume(O),x)}function k(O){return e.exit("codeFenced"),t(O)}function S(O,A,E){let j=0;return T;function T(I){return O.enter("lineEnding"),O.consume(I),O.exit("lineEnding"),R}function R(I){return O.enter("codeFencedFence"),Zi(I)?gr(O,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):C(I)}function C(I){return I===l?(O.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,O.consume(I),N):j>=o?(O.exit("codeFencedFenceSequence"),Zi(I)?gr(O,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||Wn(I)?(O.exit("codeFencedFence"),A(I)):E(I)}}}function kvt(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const h4={name:"codeIndented",tokenize:Svt},Ovt={partial:!0,tokenize:Evt};function Svt(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),gr(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?o(u):n(u)}function o(u){return u===null?c(u):Wn(u)?e.attempt(Ovt,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Wn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Evt(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):gr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Wn(o)?r(o):n(o)}}const Cvt={name:"codeText",previous:Tvt,resolve:Avt,tokenize:_vt};function Avt(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&&yO(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),yO(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yO(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(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function PPe(e,t,n,i,r,s,o,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||wI(y)?n(y):(e.enter(i),e.enter(o),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||Wn(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||ds(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Wn(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||Wn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Zi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function MPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Wn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),gr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Wn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function uE(e,t){let n;return i;function i(r){return Wn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Zi(r)?gr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const Lvt={name:"definition",tokenize:Fvt},$vt={partial:!0,tokenize:Bvt};function Fvt(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return DPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=ff(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 ds(m)?uE(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($vt,f,f)(m)}function f(m){return Zi(m)?gr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Wn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function Bvt(e,t,n){return i;function i(l){return ds(l)?uE(e,r)(l):n(l)}function r(l){return MPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Zi(l)?gr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Wn(l)?t(l):n(l)}}const Uvt={name:"hardBreakEscape",tokenize:Qvt};function Qvt(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Wn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const zvt={name:"headingAtx",resolve:Vvt,tokenize:Hvt};function Vvt(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"},Du(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Hvt(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ds(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Wn(d)?(e.exit("atxHeading"),t(d)):Zi(d)?gr(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||ds(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const qvt=["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"],hte=["pre","script","style","textarea"],Wvt={concrete:!0,name:"htmlFlow",resolveTo:Xvt,tokenize:Yvt},Kvt={partial:!0,tokenize:Jvt},Gvt={partial:!0,tokenize:Zvt};function Xvt(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 Yvt(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Xl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const Z="CDATA[";return U===Z.charCodeAt(l++)?(e.consume(U),l===Z.length?i.interrupt?t:C:g):n(U)}function b(U){return Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||ds(U)){const Z=U===47,z=o.toLowerCase();return!Z&&!s&&hte.includes(z)?(r=1,i.interrupt?t(U):C(U)):qvt.includes(o.toLowerCase())?(r=6,Z?(e.consume(U),y):i.interrupt?t(U):C(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Al(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:C):n(U)}function w(U){return Zi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Xl(U)?(e.consume(U),k):Zi(U)?(e.consume(U),x):T(U)}function k(U){return U===45||U===46||U===58||U===95||Al(U)?(e.consume(U),k):S(U)}function S(U){return U===61?(e.consume(U),O):Zi(U)?(e.consume(U),S):x(U)}function O(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,A):Zi(U)?(e.consume(U),O):E(U)}function A(U){return U===c?(e.consume(U),c=null,j):U===null||Wn(U)?n(U):(e.consume(U),A)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ds(U)?S(U):(e.consume(U),E)}function j(U){return U===47||U===62||Zi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Wn(U)?C(U):Zi(U)?(e.consume(U),R):n(U)}function C(U){return U===45&&r===2?(e.consume(U),D):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),H):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Wn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Kvt,q,N)(U)):U===null||Wn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),C)}function N(U){return e.check(Gvt,P,q)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Wn(U)?N(U):(e.enter("htmlFlowData"),C(U))}function D(U){return U===45?(e.consume(U),M):C(U)}function _(U){return U===47?(e.consume(U),o="",L):C(U)}function L(U){if(U===62){const Z=o.toLowerCase();return hte.includes(Z)?(e.consume(U),H):C(U)}return Xl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):C(U)}function F(U){return U===93?(e.consume(U),M):C(U)}function M(U){return U===62?(e.consume(U),H):U===45&&r===2?(e.consume(U),M):C(U)}function H(U){return U===null||Wn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),H)}function q(U){return e.exit("htmlFlow"),t(U)}}function Zvt(e,t,n){const i=this;return r;function r(o){return Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function Jvt(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(gT,t,n)}}const e0t={name:"htmlText",tokenize:t0t};function t0t(e,t,n){const i=this;let r,s,o;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):Xl(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):Xl(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):Wn(M)?(o=f,_(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):Wn(M)?(o=b,_(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):Wn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),k):Wn(M)?(o=x,_(M)):(e.consume(M),x)}function k(M){return M===62?D(M):x(M)}function S(M){return Xl(M)?(e.consume(M),O):n(M)}function O(M){return M===45||Al(M)?(e.consume(M),O):A(M)}function A(M){return Wn(M)?(o=A,_(M)):Zi(M)?(e.consume(M),A):D(M)}function E(M){return M===45||Al(M)?(e.consume(M),E):M===47||M===62||ds(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Xl(M)?(e.consume(M),T):Wn(M)?(o=j,_(M)):Zi(M)?(e.consume(M),j):D(M)}function T(M){return M===45||M===46||M===58||M===95||Al(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),C):Wn(M)?(o=R,_(M)):Zi(M)?(e.consume(M),R):j(M)}function C(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Wn(M)?(o=C,_(M)):Zi(M)?(e.consume(M),C):(e.consume(M),P)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Wn(M)?(o=N,_(M)):(e.consume(M),N)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ds(M)?j(M):(e.consume(M),P)}function I(M){return M===47||M===62||ds(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Zi(M)?gr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const NH={name:"labelEnd",resolveAll:s0t,resolveTo:a0t,tokenize:o0t},n0t={tokenize:l0t},i0t={tokenize:c0t},r0t={tokenize:u0t};function s0t(e){let t=-1;const n=[];for(;++t=3&&(u===null||Wn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Zi(u)?gr(e,l,"whitespace")(u):l(u))}}const yc={continuation:{tokenize:x0t},exit:k0t,name:"list",tokenize:v0t},b0t={partial:!0,tokenize:O0t},y0t={partial:!0,tokenize:w0t};function v0t(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,o=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:QB(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(TN,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 QB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<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(gT,i.interrupt?n:d,e.attempt(b0t,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Zi(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 x0t(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(gT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,gr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Zi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(y0t,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,gr(e,e.attempt(yc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function w0t(e,t,n){const i=this;return gr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function k0t(e){e.exit(this.containerState.type)}function O0t(e,t,n){const i=this;return gr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Zi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const pte={name:"setextUnderline",resolveTo:S0t,tokenize:E0t};function S0t(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 o={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",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function E0t(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,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Zi(u)?gr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Wn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const C0t={tokenize:A0t};function A0t(e){const t=this,n=e.attempt(gT,i,e.attempt(this.parser.constructs.flowInitial,r,gr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Rvt,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 T0t={resolveAll:$Pe()},_0t=LPe("string"),j0t=LPe("text");function LPe(e){return{resolveAll:$Pe(e==="text"?N0t:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(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=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function V0t(e,t){let n=-1;const i=[];let r;for(;++n0){const Ue=Se.tokenStack[Se.tokenStack.length-1];(Ue[1]||hte).call(Se,void 0,Ue[0])}for(ve.position={start:Lm(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Lm(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e0&&(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 ixt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=iO(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=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(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function axt(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 oxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $Pe(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 o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function lxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $Pe(e,t);const r={src:iO(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 cxt(e,t){const n={src:iO(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 uxt(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 dxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $Pe(e,t);const r={href:iO(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 fxt(e,t){const n={href:iO(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 hxt(e,t,n){const i=e.all(t),r=n?pxt(n):FPe(t),s={},o=[];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 Be=Ae.tokenStack[Ae.tokenStack.length-1];(Be[1]||gte).call(Ae,void 0,Be[0])}for(ye.position={start:Dm(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Dm(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce0&&(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 rxt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function axt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=sk(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=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(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function oxt(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 lxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function UPe(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 o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function cxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return UPe(e,t);const r={src:sk(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 uxt(e,t){const n={src:sk(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 dxt(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 fxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return UPe(e,t);const r={href:sk(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 hxt(e,t){const n={href:sk(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 pxt(e,t,n){const i=e.all(t),r=n?mxt(n):QPe(t),s={},o=[];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 mxt(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 o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Nh(t.children[1]),c=xM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function xxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.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(gte(t.slice(r),r>0,!1)),s.join("")}function gte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===pte||s===mte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===pte||s===mte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function kxt(e,t){const n={type:"text",value:Oxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ext={blockquote:ext,break:txt,code:nxt,delete:ixt,emphasis:rxt,footnoteReference:sxt,heading:axt,html:oxt,imageReference:lxt,image:cxt,inlineCode:uxt,linkReference:dxt,link:fxt,listItem:hxt,list:mxt,paragraph:gxt,root:bxt,strong:yxt,table:vxt,tableCell:wxt,tableRow:xxt,text:kxt,thematicBreak:Sxt,toml:v_,yaml:v_,definition:v_,footnoteDefinition:v_};function v_(){}const BPe=-1,kM=0,cE=1,kI=2,RH=3,IH=4,PH=5,DH=6,UPe=7,QPe=8,Cxt=typeof self=="object"?self:globalThis,bte=(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 Cxt[e](t)},Axt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case kM:case BPe:return n(o,r);case cE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case RH:return n(new Date(o),r);case IH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case PH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case DH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case UPe:{const{name:l,message:c}=o;return n(bte(l,c),r)}case QPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(bte(s,o),r)};return i},yte=e=>Axt(new Map,e)(0),Fv="",{toString:Txt}={},{keys:_xt}=Object,bk=e=>{const t=typeof e;if(t!=="object"||!e)return[kM,t];const n=Txt.call(e).slice(8,-1);switch(n){case"Array":return[cE,Fv];case"Object":return[kI,Fv];case"Date":return[RH,Fv];case"RegExp":return[IH,Fv];case"Map":return[PH,Fv];case"Set":return[DH,Fv];case"DataView":return[cE,n]}return n.includes("Array")?[cE,n]:n.includes("Error")?[UPe,n]:[kI,n]},x_=([e,t])=>e===kM&&(t==="function"||t==="symbol"),jxt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=bk(o);switch(l){case kM:{let d=o;switch(c){case"bigint":l=QPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([BPe],o)}return r([l,d],o)}case cE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of _xt(o))(e||!x_(bk(o[h])))&&d.push([s(h),s(o[h])]);return f}case RH:return r([l,o.toISOString()],o);case IH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case PH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(x_(bk(h))||x_(bk(m))))&&d.push([s(h),s(m)]);return f}case DH:{const d=[],f=r([l,d],o);for(const h of o)(e||!x_(bk(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},vte=(e,{json:t,lossy:n}={})=>{const i=[];return jxt(!(t||n),!!t,new Map,i)(e),i},r1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yte(vte(e,t)):structuredClone(e):(e,t)=>yte(vte(e,t));function Nxt(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 Rxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ixt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Nxt,i=e.options.footnoteBackLabel||Rxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=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:{...r1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function mxt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function gxt(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 o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Ih(t.children[1]),c=yM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function wxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.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(vte(t.slice(r),r>0,!1)),s.join("")}function vte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===bte||s===yte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===bte||s===yte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function Sxt(e,t){const n={type:"text",value:Oxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ext(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Cxt={blockquote:txt,break:nxt,code:ixt,delete:rxt,emphasis:sxt,footnoteReference:axt,heading:oxt,html:lxt,imageReference:cxt,image:uxt,inlineCode:dxt,linkReference:fxt,link:hxt,listItem:pxt,list:gxt,paragraph:bxt,root:yxt,strong:vxt,table:xxt,tableCell:kxt,tableRow:wxt,text:Sxt,thematicBreak:Ext,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const zPe=-1,wM=0,dE=1,kI=2,RH=3,IH=4,PH=5,DH=6,VPe=7,HPe=8,Axt=typeof self=="object"?self:globalThis,xte=(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 Axt[e](t)},Txt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case wM:case zPe:return n(o,r);case dE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case RH:return n(new Date(o),r);case IH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case PH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case DH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case VPe:{const{name:l,message:c}=o;return n(xte(l,c),r)}case HPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(xte(s,o),r)};return i},wte=e=>Txt(new Map,e)(0),U0="",{toString:_xt}={},{keys:jxt}=Object,vO=e=>{const t=typeof e;if(t!=="object"||!e)return[wM,t];const n=_xt.call(e).slice(8,-1);switch(n){case"Array":return[dE,U0];case"Object":return[kI,U0];case"Date":return[RH,U0];case"RegExp":return[IH,U0];case"Map":return[PH,U0];case"Set":return[DH,U0];case"DataView":return[dE,n]}return n.includes("Array")?[dE,n]:n.includes("Error")?[VPe,n]:[kI,n]},v_=([e,t])=>e===wM&&(t==="function"||t==="symbol"),Nxt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=vO(o);switch(l){case wM:{let d=o;switch(c){case"bigint":l=HPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([zPe],o)}return r([l,d],o)}case dE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of jxt(o))(e||!v_(vO(o[h])))&&d.push([s(h),s(o[h])]);return f}case RH:return r([l,o.toISOString()],o);case IH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case PH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(v_(vO(h))||v_(vO(m))))&&d.push([s(h),s(m)]);return f}case DH:{const d=[],f=r([l,d],o);for(const h of o)(e||!v_(vO(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},kte=(e,{json:t,lossy:n}={})=>{const i=[];return Nxt(!(t||n),!!t,new Map,i)(e),i},a1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wte(kte(e,t)):structuredClone(e):(e,t)=>wte(kte(e,t));function Rxt(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 Ixt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Pxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Rxt,i=e.options.footnoteBackLabel||Ixt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=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:{...a1(o),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 pT=function(e){if(e==null)return Lxt;if(typeof e=="function")return SM(e);if(typeof e=="object")return Array.isArray(e)?Pxt(e):Dxt(e);if(typeof e=="string")return Mxt(e);throw new Error("Expected function, string, or object as test")};function Pxt(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=zPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Uxt(n(c,d)),m[0]===HB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==Bxt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=qPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Qxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==Uxt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function xte(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wte(e,t){const n=zxt(e,t),i=n.one(e,void 0),r=Ixt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function Kxt(e,t){return e&&"run"in e?async function(n,i){const r=wte(n,{file:i,...t});await e.run(r,i)}:function(n,i){return wte(n,{file:i,...e||t})}}function Ote(e){if(e)throw e}var jN=Object.prototype.hasOwnProperty,HPe=Object.prototype.toString,kte=Object.defineProperty,Ste=Object.getOwnPropertyDescriptor,Ete=function(t){return typeof Array.isArray=="function"?Array.isArray(t):HPe.call(t)==="[object Array]"},Cte=function(t){if(!t||HPe.call(t)!=="[object Object]")return!1;var n=jN.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&jN.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||jN.call(t,r)},Ate=function(t,n){kte&&n.name==="__proto__"?kte(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Tte=function(t,n){if(n==="__proto__")if(jN.call(t,n)){if(Ste)return Ste(t,n).value}else return;return t[n]},Gxt=function e(){var t,n,i,r,s,o,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={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}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(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Gf={basename:Zxt,dirname:Jxt,extname:ewt,join:twt,sep:"/"};function Zxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gT(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 o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Jxt(e){if(gT(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 ewt(e){gT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!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 twt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iwt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){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=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function gT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rwt={cwd:swt};function swt(){return"/"}function KB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function awt(e){if(typeof e=="string")e=new URL(e);else if(!KB(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 owt(e)}function owt(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];WB(b)&&WB(m)&&(m=g4(!0,b,m)),i[h]=[u,m,...g]}}}}const dwt=new MH().freeze();function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function w4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function O4(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 jte(e){if(!WB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Nte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function w_(e){return fwt(e)?e:new qPe(e)}function fwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hwt(e){return typeof e=="string"||pwt(e)}function pwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rte=[],Ite={allowDangerousHtml:!0},gwt=/^(https?|ircs?|mailto|xmpp)$/i,bwt=[{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 WPe(e){const t=ywt(e),n=vwt(e);return xwt(t.runSync(t.parse(n),n),e)}function ywt(e){const t=e.rehypePlugins||Rte,n=e.remarkPlugins||Rte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ite}:Ite;return dwt().use(Jvt).use(n).use(Kxt,i).use(t)}function vwt(e){const t=e.children||"",n=new qPe;return typeof t=="string"&&(n.value=t),n}function xwt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||wwt;for(const d of bwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+mwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),mT(e,u),Myt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in h4)if(Object.hasOwn(h4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=h4[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 wwt(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||gwt.test(e.slice(0,t))?e:""}function Pte(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 Owt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kwt(e,t,n){const r=pT((n||{}).ignore||[]),s=Swt(t);let o=-1;for(;++o0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(S)?w.push(...S):S&&w.push(S),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=Pte(e,"(");let s=Pte(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 KPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||b0(n)||wM(n))&&(!t||n!==47)}GPe.peek=Wwt;function Fwt(){this.buffer()}function Bwt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Uwt(){this.buffer()}function Qwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vwt(e){this.exit(e)}function Hwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qwt(e){this.exit(e)}function Wwt(){return"["}function GPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function Kwt(){return{enter:{gfmFootnoteCallString:Fwt,gfmFootnoteCall:Bwt,gfmFootnoteDefinitionLabelString:Uwt,gfmFootnoteDefinition:Qwt},exit:{gfmFootnoteCallString:zwt,gfmFootnoteCall:Vwt,gfmFootnoteDefinitionLabelString:Hwt,gfmFootnoteDefinition:qwt}}}function Gwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);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?XPe:Xwt))),u(),c}}function Xwt(e,t,n){return t===0?e:XPe(e,t,n)}function XPe(e,t,n){return(n?"":" ")+e}const Ywt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];YPe.peek=n1t;function Zwt(){return{canContainEols:["delete"],enter:{strikethrough:e1t},exit:{strikethrough:t1t}}}function Jwt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ywt}],handlers:{delete:YPe}}}function e1t(e){this.enter({type:"delete",children:[]},e)}function t1t(e){this.exit(e)}function YPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function n1t(){return"~"}function i1t(e){return e.length}function r1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||i1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[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}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),o1t);return r(),o}function o1t(e,t,n){return">"+(n?"":" ")+e}function l1t(e,t){return Lte(e,t.inConstruct,!0)&&!Lte(e,t.notInConstruct,!1)}function Lte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function u1t(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 d1t(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 f1t(e,t,n,i){const r=d1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(u1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,h1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(c1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function Ote(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ste(e,t){const n=Vxt(e,t),i=n.one(e,void 0),r=Pxt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` +`},r),s}function Gxt(e,t){return e&&"run"in e?async function(n,i){const r=Ste(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Ste(n,{file:i,...e||t})}}function Ete(e){if(e)throw e}var _N=Object.prototype.hasOwnProperty,KPe=Object.prototype.toString,Cte=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Tte=function(t){return typeof Array.isArray=="function"?Array.isArray(t):KPe.call(t)==="[object Array]"},_te=function(t){if(!t||KPe.call(t)!=="[object Object]")return!1;var n=_N.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_N.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||_N.call(t,r)},jte=function(t,n){Cte&&n.name==="__proto__"?Cte(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Nte=function(t,n){if(n==="__proto__")if(_N.call(t,n)){if(Ate)return Ate(t,n).value}else return;return t[n]},Xxt=function e(){var t,n,i,r,s,o,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={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}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(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Kf={basename:Jxt,dirname:ewt,extname:twt,join:nwt,sep:"/"};function Jxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vT(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 o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function ewt(e){if(vT(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 twt(e){vT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!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 nwt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rwt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){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=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function vT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const swt={cwd:awt};function awt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function owt(e){if(typeof e=="string")e=new URL(e);else if(!WB(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 lwt(e)}function lwt(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];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const fwt=new MH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(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 Ite(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function x_(e){return hwt(e)?e:new GPe(e)}function hwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pwt(e){return typeof e=="string"||mwt(e)}function mwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dte=[],Mte={allowDangerousHtml:!0},bwt=/^(https?|ircs?|mailto|xmpp)$/i,ywt=[{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 XPe(e){const t=vwt(e),n=xwt(e);return wwt(t.runSync(t.parse(n),n),e)}function vwt(e){const t=e.rehypePlugins||Dte,n=e.remarkPlugins||Dte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mte}:Mte;return fwt().use(ext).use(n).use(Gxt,i).use(t)}function xwt(e){const t=e.children||"",n=new GPe;return typeof t=="string"&&(n.value=t),n}function wwt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||kwt;for(const d of ywt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+gwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yT(e,u),Lyt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[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 kwt(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||bwt.test(e.slice(0,t))?e:""}function Lte(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 Owt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Swt(e,t,n){const r=bT((n||{}).ignore||[]),s=Ewt(t);let o=-1;for(;++o0?{type:"text",value:O}:void 0),O===!1?h.lastIndex=k+1:(g!==k&&w.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(O)?w.push(...O):O&&w.push(O),g=k+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=Lte(e,"(");let s=Lte(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 YPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fv(n)||vM(n))&&(!t||n!==47)}ZPe.peek=Kwt;function Bwt(){this.buffer()}function Uwt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Qwt(){this.buffer()}function zwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hwt(e){this.exit(e)}function qwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Wwt(e){this.exit(e)}function Kwt(){return"["}function ZPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function Gwt(){return{enter:{gfmFootnoteCallString:Bwt,gfmFootnoteCall:Uwt,gfmFootnoteDefinitionLabelString:Qwt,gfmFootnoteDefinition:zwt},exit:{gfmFootnoteCallString:Vwt,gfmFootnoteCall:Hwt,gfmFootnoteDefinitionLabelString:qwt,gfmFootnoteDefinition:Wwt}}}function Xwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);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?JPe:Ywt))),u(),c}}function Ywt(e,t,n){return t===0?e:JPe(e,t,n)}function JPe(e,t,n){return(n?"":" ")+e}const Zwt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];eDe.peek=i1t;function Jwt(){return{canContainEols:["delete"],enter:{strikethrough:t1t},exit:{strikethrough:n1t}}}function e1t(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zwt}],handlers:{delete:eDe}}}function t1t(e){this.enter({type:"delete",children:[]},e)}function n1t(e){this.exit(e)}function eDe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function i1t(){return"~"}function r1t(e){return e.length}function s1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||r1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[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}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),l1t);return r(),o}function l1t(e,t,n){return">"+(n?"":" ")+e}function c1t(e,t){return Bte(e,t.inConstruct,!0)&&!Bte(e,t.notInConstruct,!1)}function Bte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function d1t(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 f1t(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 h1t(e,t,n,i){const r=f1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(d1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,p1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(u1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);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 h1t(e,t,n){return(n?"":" ")+e}function LH(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 p1t(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=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()),o(),u}function m1t(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 SC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function SI(e,t,n){const i=i1(e),r=i1(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}}JPe.peek=g1t;function JPe(e,t,n,i){const r=m1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=SC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+SC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function g1t(e,t,n){return n.options.emphasis||"*"}function b1t(e,t){let n=!1;return mT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,HB}),!!((!e.depth||e.depth<3)&&_H(e)&&(t.options.setext||n))}function y1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(b1t(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 p1t(e,t,n){return(n?"":" ")+e}function LH(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 m1t(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=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()),o(),u}function g1t(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 CC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function OI(e,t,n){const i=s1(e),r=s1(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}}nDe.peek=b1t;function nDe(e,t,n,i){const r=g1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function b1t(e,t,n){return n.options.emphasis||"*"}function y1t(e,t){let n=!1;return yT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&_H(e)&&(t.options.setext||n))}function v1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(y1t(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 o="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=SC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}eDe.peek=v1t;function eDe(e){return e.value||""}function v1t(){return"<"}tDe.peek=x1t;function tDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=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(")"),o(),u}function x1t(){return"!"}nDe.peek=w1t;function nDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=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+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),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 w1t(){return"!"}iDe.peek=O1t;function iDe(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))}sDe.peek=k1t;function sDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(rDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function k1t(e,t,n){return rDe(e,n)?"<":"["}aDe.peek=S1t;function aDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=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+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),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 S1t(){return"["}function $H(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 E1t(e){const t=$H(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 C1t(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 oDe(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 A1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?C1t(n):$H(n);const l=e.ordered?o==="."?")":".":E1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&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),oDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);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(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function j1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const N1t=pT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R1t(e,t,n,i){return(e.children.some(function(o){return N1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function I1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lDe.peek=P1t;function lDe(e,t,n,i){const r=I1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=SC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+SC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function P1t(e,t,n){return n.options.strong||"*"}function D1t(e,t,n,i){return n.safe(e.value,i)}function M1t(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 L1t(e,t,n){const i=(oDe(n)+(n.options.ruleSpaces?" ":"")).repeat(M1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const cDe={blockquote:a1t,break:$te,code:f1t,definition:p1t,emphasis:JPe,hardBreak:$te,heading:y1t,html:eDe,image:tDe,imageReference:nDe,inlineCode:iDe,link:sDe,linkReference:aDe,list:A1t,listItem:_1t,paragraph:j1t,root:R1t,strong:lDe,text:D1t,thematicBreak:L1t};function $1t(){return{enter:{table:F1t,tableData:Fte,tableHeader:Fte,tableRow:U1t},exit:{codeText:Q1t,table:B1t,tableData:C4,tableHeader:C4,tableRow:C4}}}function F1t(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 B1t(e){this.exit(e),this.data.inTable=void 0}function U1t(e){this.enter({type:"tableRow",children:[]},e)}function C4(e){this.exit(e)}function Fte(e){this.enter({type:"tableCell",children:[]},e)}function Q1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,z1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function z1t(e,t){return t==="|"?t:e}function V1t(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=CC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}iDe.peek=x1t;function iDe(e){return e.value||""}function x1t(){return"<"}rDe.peek=w1t;function rDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=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(")"),o(),u}function w1t(){return"!"}sDe.peek=k1t;function sDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=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+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),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 k1t(){return"!"}aDe.peek=O1t;function aDe(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))}lDe.peek=S1t;function lDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(oDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function S1t(e,t,n){return oDe(e,n)?"<":"["}cDe.peek=E1t;function cDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=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+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),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 E1t(){return"["}function $H(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 C1t(e){const t=$H(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 A1t(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 uDe(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 T1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?A1t(n):$H(n);const l=e.ordered?o==="."?")":".":C1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&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),uDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);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(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function N1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const R1t=bT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function I1t(e,t,n,i){return(e.children.some(function(o){return R1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function P1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dDe.peek=D1t;function dDe(e,t,n,i){const r=P1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function D1t(e,t,n){return n.options.strong||"*"}function M1t(e,t,n,i){return n.safe(e.value,i)}function L1t(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 $1t(e,t,n){const i=(uDe(n)+(n.options.ruleSpaces?" ":"")).repeat(L1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const fDe={blockquote:o1t,break:Ute,code:h1t,definition:m1t,emphasis:nDe,hardBreak:Ute,heading:v1t,html:iDe,image:rDe,imageReference:sDe,inlineCode:aDe,link:lDe,linkReference:cDe,list:T1t,listItem:j1t,paragraph:N1t,root:I1t,strong:dDe,text:M1t,thematicBreak:$1t};function F1t(){return{enter:{table:B1t,tableData:Qte,tableHeader:Qte,tableRow:Q1t},exit:{codeText:z1t,table:U1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function B1t(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 U1t(e){this.exit(e),this.data.inTable=void 0}function Q1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function Qte(e){this.enter({type:"tableCell",children:[]},e)}function z1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,V1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function V1t(e,t){return t==="|"?t:e}function H1t(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:o,tableCell:c,tableRow:l}};function o(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 r1t(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 lOt={tokenize:gOt,partial:!0};function cOt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hOt,continuation:{tokenize:pOt},exit:mOt}},text:{91:{name:"gfmFootnoteCall",tokenize:fOt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uOt,resolveTo:dOt}}}}function uOt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=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(!o||!o._balanced)return n(c);const u=mf(i.sliceSerialize({start:o.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 dOt(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)},o={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",o,t],["exit",o,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 fOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;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&&!o||f===null||f===91||cs(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(mf(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return cs(f)||(o=!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 hOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=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(o>999||g===93&&!l||g===null||g===91||cs(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=mf(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return cs(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),dr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function pOt(e,t,n){return e.check(hT,t,e.attempt(lOt,t,n))}function mOt(e){e.exit("gfmFootnoteDefinition")}function gOt(e,t,n){const i=this;return dr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function bOt(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(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=i1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class yOt{constructor(){this.map=[]}add(t,n,i){vOt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[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 vOt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const A=R>-1?i.events[R][1].type:null,N=A==="tableHead"||A==="tableRow"?S:c;return N===S&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Kn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Gi(T)?dr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||cs(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Gi(T)?dr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):k(T)}function b(T){return Gi(T)?dr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Kn(T)?O(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):k(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Gi(T)?dr(e,O,"whitespace")(T):O(T)}function O(T){return T===124?g(T):T===null||Kn(T)?!o||r!==s?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function S(T){return e.enter("tableRow"),E(T)}function E(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),E):T===null||Kn(T)?(e.exit("tableRow"),t(T)):Gi(T)?dr(e,E,"whitespace")(T):(e.enter("data"),C(T))}function C(T){return T===null||T===124||cs(T)?(e.exit("data"),E(T)):(e.consume(T),T===92?j:C)}function j(T){return T===92||T===124?(e.consume(T),C):C(T)}}function kOt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new yOt;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({},ox(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Ute(e,t,n,i,r){const s=[],o=ox(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function ox(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const SOt={name:"tasklistCheck",tokenize:COt};function EOt(){return{text:{91:SOt}}}function COt(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 cs(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Kn(c)?t(c):Gi(c)?e.check({tokenize:AOt},t,n)(c):n(c)}}function AOt(e,t,n){return dr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function TOt(e){return EPe([J1t(),cOt(),bOt(e),wOt(),EOt()])}const _Ot={};function yDe(e){const t=this,n=e||_Ot,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(TOt(n)),s.push(G1t()),o.push(X1t(n))}const Qte=function(e,t,n){const i=pT(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 xDe(e,t,n){return e.type==="element"?LOt(e,t,n):e.type==="text"?n.whitespace==="normal"?wDe(e,n):$Ot(e):[]}function LOt(e,t,n){const i=ODe(e,n),r=e.children||[];let s=-1,o=[];if(DOt(e))return o;let l,c;for(XB(e)||qte(e)&&Qte(t,e,qte)?c=` -`:POt(e)?(l=2,c=2):vDe(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},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+o+"[\\*&\\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 VOt(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=zOt(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 EM(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"}}),o={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"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...O,...k]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function HOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+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:"("+o+"[\\*&\\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 qOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!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},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+o+"[\\*&\\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 WOt(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"],o={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:o},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:o,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:o,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:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const KOt=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_-]*/}}),GOt=["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"],XOt=["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"],YOt=[...GOt,...XOt],ZOt=["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(),JOt=["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(),ekt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tkt=["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 SDe(e){const t=e.regex,n=KOt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[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:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+JOt.join("|")+")"},{begin:":(:)?("+ekt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tkt.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:ZOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+YOt.join("|")+")\\b"}]}}function EDe(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:"ADe(e,t,n-1))}function TDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+ADe("(?:<"+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,Wte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Wte,u]}}const Kte="[A-Za-z$_][0-9A-Za-z$_]*",ikt=["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"],rkt=["true","false","null","undefined","NaN","Infinity"],_De=["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"],jDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],skt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],akt=[].concat(NDe,_De,jDe);function QH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Kte,keyword:ikt,literal:rkt,built_in:akt,"variable.language":skt},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),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._De,...jDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...NDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={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:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{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:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,E,I,{match:/\$[(.]/}]}}function zH(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 cx="[0-9](_*[0-9])*",E_=`\\.(${cx})`,C_="[0-9a-fA-F](_*[0-9a-fA-F])*",okt={className:"number",variants:[{begin:`(\\b(${cx})((${E_})|\\.)?|(${E_}))[eE][+-]?(${cx})[fFdD]?\\b`},{begin:`\\b(${cx})((${E_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${E_})[fFdD]?\\b`},{begin:`\\b(${cx})[fFdD]\\b`},{begin:`\\b0[xX]((${C_})\\.?|(${C_})?\\.(${C_}))[pP][+-]?(${cx})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${C_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function lkt(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},o={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(o);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(o,{className:"string"}),"self"]}]},u=okt,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,o,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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const ckt=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_-]*/}}),ukt=["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"],dkt=["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"],fkt=[...ukt,...dkt],hkt=["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(),RDe=["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(),IDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pkt=["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(),mkt=RDe.concat(IDe).sort().reverse();function gkt(e){const t=ckt(e),n=mkt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,k){return{className:x,begin:O,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:hkt.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:o}),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("+pkt.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("+fkt.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:":("+RDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+IDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.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:o}}function bkt(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 VH(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},o={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,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ykt(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 vkt(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},o={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}),o,{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,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function xkt(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),o={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":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[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:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},k=P=>P.map(I=>I.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(i,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[j,o,C,e.C_BLOCK_COMMENT_MODE,g,b,S]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const A=[j,C,e.C_BLOCK_COMMENT_MODE,g,b,S],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",...A]},...A,{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/},o,R,C,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",N,o,C,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function wkt(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 PDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qH(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 Okt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kkt(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 Skt(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+)*/),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"]},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:o},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:o}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{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:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const T=[{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(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(S)}}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*\(/))},o="([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 Ekt=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_-]*/}}),Ckt=["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"],Akt=["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"],Tkt=[...Ckt,...Akt],_kt=["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(),jkt=["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(),Nkt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rkt=["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 MDe(e){const t=Ekt(e),n=Nkt,i=jkt,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("+Tkt.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("+Rkt.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:_kt.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 Ikt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function LDe(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"],o=["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(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(k,{exceptions:S,when:E}={}){const C=E;return S=S||[],k.map(j=>j.match(/\|\d+$/)||S.includes(j)?j:C(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function $De(e){return e?typeof e=="string"?e:e.source:null}function yk(e){return qr("(?=",e,")")}function qr(...e){return e.map(n=>$De(n)).join("")}function Pkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Gl(...e){return"("+(Pkt(e).capture?"":"?:")+e.map(i=>$De(i)).join("|")+")"}const WH=e=>qr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Dkt=["Protocol","Type"].map(WH),Gte=["init","self"].map(WH),Mkt=["Any","Self"],A4=["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"],Xte=["false","nil","true"],Lkt=["assignment","associativity","higherThan","left","lowerThan","none","right"],$kt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Yte=["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"],FDe=Gl(/[/=\-+!*%<>&|^~?]/,/[\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]/),BDe=Gl(FDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),T4=qr(FDe,BDe,"*"),UDe=Gl(/[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]/),EI=Gl(UDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Wf=qr(UDe,EI,"*"),A_=qr(/[A-Z]/,EI,"*"),Fkt=["attached","autoclosure",qr(/convention\(/,Gl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",qr(/objc\(/,Wf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Bkt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ukt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Gl(...Dkt,...Gte)],className:{2:"keyword"}},s={match:qr(/\./,Gl(...A4)),relevance:0},o=A4.filter(fe=>typeof fe=="string").concat(["_|0"]),l=A4.filter(fe=>typeof fe!="string").concat(Mkt).map(WH),c={variants:[{className:"keyword",match:Gl(...l,...Gte)}]},u={$pattern:Gl(/\b\w+/,/#\w+/),keyword:o.concat($kt),literal:Xte},d=[r,s,c],f={match:qr(/\./,Gl(...Yte)),relevance:0},h={className:"built_in",match:qr(/\b/,Gl(...Yte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:T4},{match:`\\.(\\.|${BDe})+`}]},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=(fe="")=>({className:"subst",variants:[{match:qr(/\\/,fe,/[0\\tnr"']/)},{match:qr(/\\/,fe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(fe="")=>({className:"subst",match:qr(/\\/,fe,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(fe="")=>({className:"subst",label:"interpol",begin:qr(/\\/,fe,/\(/),end:/\)/}),E=(fe="")=>({begin:qr(fe,/"""/),end:qr(/"""/,fe),contains:[O(fe),k(fe),S(fe)]}),C=(fe="")=>({begin:qr(fe,/"/),end:qr(/"/,fe),contains:[O(fe),S(fe)]}),j={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},A=fe=>{const se=qr(fe,/\//),me=qr(/\//,fe);return{begin:se,end:me,contains:[...T,{scope:"comment",begin:`#(?!.*${me})`,end:/$/}]}},N={scope:"regexp",variants:[A("###"),A("##"),A("#"),R]},P={match:qr(/`/,Wf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${EI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Bkt,contains:[...v,x,j]}]}},F={scope:"keyword",match:qr(/@/,Gl(...Fkt),yk(Gl(/\(/,/\s+/)))},M={scope:"meta",match:qr(/@/,Wf)},H=[L,F,M],q={match:yk(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:qr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EI,"+")},{className:"type",match:A_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:qr(/\s+&\s+/,yk(A_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...H,g,q]};q.contains.push(U);const Z={match:qr(Wf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...i,N,...d,...m,...v,x,j,..._,...H,q]},J={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:Gl(yk(qr(Wf,/\s*:/)),yk(qr(Wf,/\s+/,Wf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Wf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...H,q,z],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,Gl(P.match,Wf,T4)],className:{1:"keyword",3:"title.function"},contains:[J,W,t],illegal:[/\[/,/%/]},V={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,W,t],illegal:/\[|%/},ae={match:[/operator/,/\s+/,T4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,A_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Lkt,...Xte],end:/}/},K={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+/,Wf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:A_},...d],relevance:0}]};for(const fe of j.variants){const se=fe.contains.find(Ee=>Ee.label==="interpol");se.keywords=u;const me=[...d,...m,...v,x,j,..._];se.contains=[...me,{begin:/\(/,end:/\)/,contains:["self",...me]}]}return{name:"Swift",keywords:u,contains:[...i,X,V,K,te,ue,ae,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...H,q,z]}}const CI="[A-Za-z$_][0-9A-Za-z$_]*",QDe=["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"],zDe=["true","false","null","undefined","NaN","Infinity"],VDe=["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"],qDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],WDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KDe=[].concat(qDe,VDe,HDe);function Qkt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:CI,keyword:QDe,literal:zDe,built_in:KDe,"variable.language":WDe},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),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...VDe,...HDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...qDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={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:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{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:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,E,I,{match:/\$[(.]/}]}}function KH(e){const t=e.regex,n=Qkt(e),i=CI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={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:CI,keyword:QDe.concat(c),literal:zDe,built_in:KDe.concat(r),"variable.language":WDe},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,o,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 zkt(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}/,o=/(\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(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,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 Vkt(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_]+/},o={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,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function GDe(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/}]},o=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,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,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 GH(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}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{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,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Hkt={arduino:VOt,bash:EM,c:HOt,cpp:qOt,csharp:WOt,css:SDe,diff:EDe,go:CDe,graphql:nkt,ini:UH,java:TDe,javascript:QH,json:zH,kotlin:lkt,less:gkt,lua:bkt,makefile:VH,markdown:HH,objectivec:ykt,perl:vkt,php:xkt,"php-template":wkt,plaintext:PDe,python:qH,"python-repl":Okt,r:kkt,ruby:Skt,rust:DDe,scss:MDe,shell:Ikt,sql:LDe,swift:Ukt,typescript:KH,vbnet:zkt,wasm:Vkt,xml:GDe,yaml:GH};function XDe(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)&&XDe(n)}),e}let Zte=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function YDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function yg(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 qkt="",Jte=e=>!!e.scope,Wkt=(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 Kkt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=YDe(t)}openNode(t){if(!Jte(t))return;const n=Wkt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Jte(t)&&(this.buffer+=qkt)}value(){return this.buffer}span(t){this.buffer+=``}}const ene=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class XH{constructor(){this.rootNode=ene(),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=ene({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=>{XH._collapse(n)}))}}class Gkt extends XH{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 Kkt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function EC(e){return e?typeof e=="string"?e:e.source:null}function ZDe(e){return J0("(?=",e,")")}function Xkt(e){return J0("(?:",e,")*")}function Ykt(e){return J0("(?:",e,")?")}function J0(...e){return e.map(n=>EC(n)).join("")}function Zkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function YH(...e){return"("+(Zkt(e).capture?"":"?:")+e.map(i=>EC(i)).join("|")+")"}function JDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function Jkt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const eSt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ZH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=EC(i),o="";for(;s.length>0;){const l=eSt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const tSt=/\b\B/,eMe="[a-zA-Z]\\w*",JH="[a-zA-Z_]\\w*",tMe="\\b\\d+(\\.\\d+)?",nMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",iMe="\\b(0b[01]+)",nSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",iSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=J0(t,/.*\b/,e.binary,/\b.*/)),yg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},CC={begin:"\\\\[\\s\\S]",relevance:0},rSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[CC]},sSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[CC]},aSt={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/},CM=function(e,t,n={}){const i=yg({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=YH("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:J0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},oSt=CM("//","$"),lSt=CM("/\\*","\\*/"),cSt=CM("#","$"),uSt={scope:"number",begin:tMe,relevance:0},dSt={scope:"number",begin:nMe,relevance:0},fSt={scope:"number",begin:iMe,relevance:0},hSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[CC,{begin:/\[/,end:/\]/,relevance:0,contains:[CC]}]},pSt={scope:"title",begin:eMe,relevance:0},mSt={scope:"title",begin:JH,relevance:0},gSt={begin:"\\.\\s*"+JH,relevance:0},bSt=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 T_=Object.freeze({__proto__:null,APOS_STRING_MODE:rSt,BACKSLASH_ESCAPE:CC,BINARY_NUMBER_MODE:fSt,BINARY_NUMBER_RE:iMe,COMMENT:CM,C_BLOCK_COMMENT_MODE:lSt,C_LINE_COMMENT_MODE:oSt,C_NUMBER_MODE:dSt,C_NUMBER_RE:nMe,END_SAME_AS_BEGIN:bSt,HASH_COMMENT_MODE:cSt,IDENT_RE:eMe,MATCH_NOTHING_RE:tSt,METHOD_GUARD:gSt,NUMBER_MODE:uSt,NUMBER_RE:tMe,PHRASAL_WORDS_MODE:aSt,QUOTE_STRING_MODE:sSt,REGEXP_MODE:hSt,RE_STARTERS_RE:nSt,SHEBANG:iSt,TITLE_MODE:pSt,UNDERSCORE_IDENT_RE:JH,UNDERSCORE_TITLE_MODE:mSt});function ySt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function vSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function xSt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ySt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function wSt(e,t){Array.isArray(e.illegal)&&(e.illegal=YH(...e.illegal))}function OSt(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 kSt(e,t){e.relevance===void 0&&(e.relevance=1)}const SSt=(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=J0(n.beforeMatch,ZDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ESt=["of","and","for","in","not","or","if","then","parent","list","value"],CSt="keyword";function rMe(e,t,n=CSt){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,rMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ASt(c[0],c[1])]})}}function ASt(e,t){return t?Number(t):TSt(e)?0:1}function TSt(e){return ESt.includes(e.toLowerCase())}const tne={},Yy=e=>{console.error(e)},nne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Bv=(e,t)=>{tne[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),tne[`${e}/${t}`]=!0)},AI=new Error;function sMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=JDe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function _St(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Yy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),AI;if(typeof e.beginScope!="object"||e.beginScope===null)throw Yy("beginScope must be object"),AI;sMe(e,e.begin,{key:"beginScope"}),e.begin=ZH(e.begin,{joinWith:""})}}function jSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Yy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),AI;if(typeof e.endScope!="object"||e.endScope===null)throw Yy("endScope must be object"),AI;sMe(e,e.end,{key:"endScope"}),e.end=ZH(e.end,{joinWith:""})}}function NSt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function RSt(e){NSt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_St(e),jSt(e)}function ISt(e){function t(o,l){return new RegExp(EC(o),"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+=JDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ZH(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(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[vSt,OSt,RSt,SSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[xSt,wSt,kSt].forEach(d=>d(o,l)),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=rMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=EC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return PSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.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=yg(e.classNameAliases||{}),s(e)}function aMe(e){return e?e.endsWithParent||aMe(e.starts):!1}function PSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return yg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:aMe(e)?yg(e,{starts:e.starts?yg(e.starts):null}):Object.isFrozen(e)?yg(e):e}var DSt="11.11.1";class MSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const _4=YDe,ine=yg,rne=Symbol("nomatch"),LSt=7,oMe=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?",o={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:Gkt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=C(L[1]);return F||(nne(s.replace("{}",L[1])),nne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||C(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Bv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Bv("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const H={code:F,language:M};P("before:highlight",H);const q=H.result?H.result:f(H.language,H.code,L);return q.code=H.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function H(ce,ve){return ce.keywords[ve]}function q(){if(!me.keywords){xe.addText(Ne);return}let ce=0;me.keywordPatternRe.lastIndex=0;let ve=me.keywordPatternRe.exec(Ne),Se="";for(;ve;){Se+=Ne.substring(ce,ve.index);const oe=ue.case_insensitive?ve[0].toLowerCase():ve[0],$e=H(me,oe);if($e){const[Ue,be]=$e;if(xe.addText(Se),Se="",M[oe]=(M[oe]||0)+1,M[oe]<=LSt&&(We+=be),Ue.startsWith("_"))Se+=ve[0];else{const ke=ue.classNameAliases[Ue]||Ue;z(ve[0],ke)}}else Se+=ve[0];ce=me.keywordPatternRe.lastIndex,ve=me.keywordPatternRe.exec(Ne)}Se+=Ne.substring(ce),xe.addText(Se)}function U(){if(Ne==="")return;let ce=null;if(typeof me.subLanguage=="string"){if(!t[me.subLanguage]){xe.addText(Ne);return}ce=f(me.subLanguage,Ne,!0,Ee[me.subLanguage]),Ee[me.subLanguage]=ce._top}else ce=m(Ne,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(We+=ce.relevance),xe.__addSublanguage(ce._emitter,ce.language)}function Z(){me.subLanguage!=null?U():q(),Ne=""}function z(ce,ve){ce!==""&&(xe.startScope(ve),xe.addText(ce),xe.endScope())}function J(ce,ve){let Se=1;const oe=ve.length-1;for(;Se<=oe;){if(!ce._emit[Se]){Se++;continue}const $e=ue.classNameAliases[ce[Se]]||ce[Se],Ue=ve[Se];$e?z(Ue,$e):(Ne=Ue,q(),Ne=""),Se++}}function ne(ce,ve){return ce.scope&&typeof ce.scope=="string"&&xe.openNode(ue.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(z(Ne,ue.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Ne=""):ce.beginScope._multi&&(J(ce.beginScope,ve),Ne="")),me=Object.create(ce,{parent:{value:me}}),me}function W(ce,ve,Se){let oe=Jkt(ce.endRe,Se);if(oe){if(ce["on:end"]){const $e=new Zte(ce);ce["on:end"](ve,$e),$e.isMatchIgnored&&(oe=!1)}if(oe){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return W(ce.parent,ve,Se)}function X(ce){return me.matcher.regexIndex===0?(Ne+=ce[0],1):(re=!0,0)}function V(ce){const ve=ce[0],Se=ce.rule,oe=new Zte(Se),$e=[Se.__beforeBegin,Se["on:begin"]];for(const Ue of $e)if(Ue&&(Ue(ce,oe),oe.isMatchIgnored))return X(ve);return Se.skip?Ne+=ve:(Se.excludeBegin&&(Ne+=ve),Z(),!Se.returnBegin&&!Se.excludeBegin&&(Ne=ve)),ne(Se,ce),Se.returnBegin?0:ve.length}function ae(ce){const ve=ce[0],Se=_.substring(ce.index),oe=W(me,ce,Se);if(!oe)return rne;const $e=me;me.endScope&&me.endScope._wrap?(Z(),z(ve,me.endScope._wrap)):me.endScope&&me.endScope._multi?(Z(),J(me.endScope,ce)):$e.skip?Ne+=ve:($e.returnEnd||$e.excludeEnd||(Ne+=ve),Z(),$e.excludeEnd&&(Ne=ve));do me.scope&&xe.closeNode(),!me.skip&&!me.subLanguage&&(We+=me.relevance),me=me.parent;while(me!==oe.parent);return oe.starts&&ne(oe.starts,ce),$e.returnEnd?0:ve.length}function Y(){const ce=[];for(let ve=me;ve!==ue;ve=ve.parent)ve.scope&&ce.unshift(ve.scope);ce.forEach(ve=>xe.openNode(ve))}let K={};function te(ce,ve){const Se=ve&&ve[0];if(Ne+=ce,Se==null)return Z(),0;if(K.type==="begin"&&ve.type==="end"&&K.index===ve.index&&Se===""){if(Ne+=_.slice(ve.index,ve.index+1),!r){const oe=new Error(`0 width match regex (${D})`);throw oe.languageName=D,oe.badRule=K.rule,oe}return 1}if(K=ve,ve.type==="begin")return V(ve);if(ve.type==="illegal"&&!L){const oe=new Error('Illegal lexeme "'+Se+'" for mode "'+(me.scope||"")+'"');throw oe.mode=me,oe}else if(ve.type==="end"){const oe=ae(ve);if(oe!==rne)return oe}if(ve.type==="illegal"&&Se==="")return Ne+=` -`,1;if(Re>1e5&&Re>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ne+=Se,Se.length}const ue=C(D);if(!ue)throw Yy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const fe=ISt(ue);let se="",me=F||fe;const Ee={},xe=new l.__emitter(l);Y();let Ne="",We=0,Xe=0,Re=0,re=!1;try{if(ue.__emitTokens)ue.__emitTokens(_,xe);else{for(me.matcher.considerAll();;){Re++,re?re=!1:me.matcher.considerAll(),me.matcher.lastIndex=Xe;const ce=me.matcher.exec(_);if(!ce)break;const ve=_.substring(Xe,ce.index),Se=te(ve,ce);Xe=ce.index+Se}te(_.substring(Xe))}return xe.finalize(),se=xe.toHTML(),{language:D,value:se,relevance:We,illegal:!1,_emitter:xe,_top:me}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:D,value:_4(_),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Xe,context:_.slice(Xe-100,Xe+100),mode:ce.mode,resultSoFar:se},_emitter:xe};if(r)return{language:D,value:_4(_),illegal:!1,relevance:0,errorRaised:ce,_emitter:xe,_top:me};throw ce}}function h(D){const _={value:_4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(C).filter(T).map(Z=>f(Z,D,!1));F.unshift(L);const M=F.sort((Z,z)=>{if(Z.relevance!==z.relevance)return z.relevance-Z.relevance;if(Z.language&&z.language){if(C(Z.language).supersetOf===z.language)return 1;if(C(z.language).supersetOf===Z.language)return-1}return 0}),[H,q]=M,U=H;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("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 MSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);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}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=ine(l,D)}const y=()=>{O(),Bv("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),Bv("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 k(D,_){let L=null;try{L=_(e)}catch(F){if(Yy("Language definition for '{}' could not be registered.".replace("{}",D)),r)Yy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function S(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function E(){return Object.keys(t)}function C(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=C(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function A(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Bv("10.7.0","highlightBlock will be removed entirely in v12.0"),Bv("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:k,unregisterLanguage:S,listLanguages:E,getLanguage:C,registerAliases:j,autoDetection:T,inherit:ine,addPlugin:A,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=DSt,e.regex={concat:J0,lookahead:ZDe,either:YH,optional:Ykt,anyNumberOfTimes:Xkt};for(const D in T_)typeof T_[D]=="object"&&XDe(T_[D]);return Object.assign(e,T_),e},s1=oMe({});s1.newInstance=()=>oMe({});var $St=s1;s1.HighlightJS=s1;s1.default=s1;const al=_1($St),sne={},FSt="hljs-";function BSt(e){const t=al.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||sne,h=typeof f.prefix=="string"?f.prefix:FSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:USt,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||sne).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 o(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 USt{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(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),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 QSt={};function ane(e){const t=e||QSt,n=t.aliases,i=t.detect||!1,r=t.languages||Hkt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=BSt(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){mT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=zSt(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=MOt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,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 zSt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=cne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}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(o=55296&&e<=57343}function mEt(e){return e>=56320&&e<=57343}function gEt(e,t){return(e-55296)*1024+9216+t}function hMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function pMe(e){return e>=64976&&e<=65007||pEt.has(e)}var dt;(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"})(dt||(dt={}));const bEt=65536;class yEt{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=bEt,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,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,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(mEt(n))return this.pos++,this._addGap(),gEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Oe.EOF;return this._err(dt.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Oe.EOF;const i=this.html.charCodeAt(n);return i===Oe.CARRIAGE_RETURN?Oe.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Oe.EOF;let t=this.html.charCodeAt(this.pos);return t===Oe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Oe.LINE_FEED):t===Oe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,fMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===Oe.LINE_FEED||t===Oe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){hMe(t)?this._err(dt.controlCharacterInInputStream):pMe(t)&&this._err(dt.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 vEt=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))),xEt=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 wEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=xEt.get(e))!==null&&t!==void 0?t:e}var _o;(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"})(_o||(_o={}));const OEt=32;var vg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vg||(vg={}));function ZB(e){return e>=_o.ZERO&&e<=_o.NINE}function kEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_F||e>=_o.LOWER_A&&e<=_o.LOWER_F}function SEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_Z||e>=_o.LOWER_A&&e<=_o.LOWER_Z||ZB(e)}function EEt(e){return e===_o.EQUALS||SEt(e)}var Oo;(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"})(Oo||(Oo={}));var vp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vp||(vp={}));class CEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vp.Strict}startEntity(t){this.decodeMode=t,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Oo.EntityStart:return t.charCodeAt(n)===_o.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(t,n));case Oo.NumericStart:return this.stateNumericStart(t,n);case Oo.NumericDecimal:return this.stateNumericDecimal(t,n);case Oo.NumericHex:return this.stateNumericHex(t,n);case Oo.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|OEt)===_o.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Oo.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(o===_o.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vp.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]&vg.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]&~vg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}}function AEt(e,t,n,i){const r=(t&vg.BRANCH_LENGTH)>>7,s=t&vg.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 o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var Rt;(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/"})(Rt||(Rt={}));var Zy;(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"})(Zy||(Zy={}));var rd;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(rd||(rd={}));var Je;(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"})(Je||(Je={}));var B;(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"})(B||(B={}));const TEt=new Map([[Je.A,B.A],[Je.ADDRESS,B.ADDRESS],[Je.ANNOTATION_XML,B.ANNOTATION_XML],[Je.APPLET,B.APPLET],[Je.AREA,B.AREA],[Je.ARTICLE,B.ARTICLE],[Je.ASIDE,B.ASIDE],[Je.B,B.B],[Je.BASE,B.BASE],[Je.BASEFONT,B.BASEFONT],[Je.BGSOUND,B.BGSOUND],[Je.BIG,B.BIG],[Je.BLOCKQUOTE,B.BLOCKQUOTE],[Je.BODY,B.BODY],[Je.BR,B.BR],[Je.BUTTON,B.BUTTON],[Je.CAPTION,B.CAPTION],[Je.CENTER,B.CENTER],[Je.CODE,B.CODE],[Je.COL,B.COL],[Je.COLGROUP,B.COLGROUP],[Je.DD,B.DD],[Je.DESC,B.DESC],[Je.DETAILS,B.DETAILS],[Je.DIALOG,B.DIALOG],[Je.DIR,B.DIR],[Je.DIV,B.DIV],[Je.DL,B.DL],[Je.DT,B.DT],[Je.EM,B.EM],[Je.EMBED,B.EMBED],[Je.FIELDSET,B.FIELDSET],[Je.FIGCAPTION,B.FIGCAPTION],[Je.FIGURE,B.FIGURE],[Je.FONT,B.FONT],[Je.FOOTER,B.FOOTER],[Je.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[Je.FORM,B.FORM],[Je.FRAME,B.FRAME],[Je.FRAMESET,B.FRAMESET],[Je.H1,B.H1],[Je.H2,B.H2],[Je.H3,B.H3],[Je.H4,B.H4],[Je.H5,B.H5],[Je.H6,B.H6],[Je.HEAD,B.HEAD],[Je.HEADER,B.HEADER],[Je.HGROUP,B.HGROUP],[Je.HR,B.HR],[Je.HTML,B.HTML],[Je.I,B.I],[Je.IMG,B.IMG],[Je.IMAGE,B.IMAGE],[Je.INPUT,B.INPUT],[Je.IFRAME,B.IFRAME],[Je.KEYGEN,B.KEYGEN],[Je.LABEL,B.LABEL],[Je.LI,B.LI],[Je.LINK,B.LINK],[Je.LISTING,B.LISTING],[Je.MAIN,B.MAIN],[Je.MALIGNMARK,B.MALIGNMARK],[Je.MARQUEE,B.MARQUEE],[Je.MATH,B.MATH],[Je.MENU,B.MENU],[Je.META,B.META],[Je.MGLYPH,B.MGLYPH],[Je.MI,B.MI],[Je.MO,B.MO],[Je.MN,B.MN],[Je.MS,B.MS],[Je.MTEXT,B.MTEXT],[Je.NAV,B.NAV],[Je.NOBR,B.NOBR],[Je.NOFRAMES,B.NOFRAMES],[Je.NOEMBED,B.NOEMBED],[Je.NOSCRIPT,B.NOSCRIPT],[Je.OBJECT,B.OBJECT],[Je.OL,B.OL],[Je.OPTGROUP,B.OPTGROUP],[Je.OPTION,B.OPTION],[Je.P,B.P],[Je.PARAM,B.PARAM],[Je.PLAINTEXT,B.PLAINTEXT],[Je.PRE,B.PRE],[Je.RB,B.RB],[Je.RP,B.RP],[Je.RT,B.RT],[Je.RTC,B.RTC],[Je.RUBY,B.RUBY],[Je.S,B.S],[Je.SCRIPT,B.SCRIPT],[Je.SEARCH,B.SEARCH],[Je.SECTION,B.SECTION],[Je.SELECT,B.SELECT],[Je.SOURCE,B.SOURCE],[Je.SMALL,B.SMALL],[Je.SPAN,B.SPAN],[Je.STRIKE,B.STRIKE],[Je.STRONG,B.STRONG],[Je.STYLE,B.STYLE],[Je.SUB,B.SUB],[Je.SUMMARY,B.SUMMARY],[Je.SUP,B.SUP],[Je.TABLE,B.TABLE],[Je.TBODY,B.TBODY],[Je.TEMPLATE,B.TEMPLATE],[Je.TEXTAREA,B.TEXTAREA],[Je.TFOOT,B.TFOOT],[Je.TD,B.TD],[Je.TH,B.TH],[Je.THEAD,B.THEAD],[Je.TITLE,B.TITLE],[Je.TR,B.TR],[Je.TRACK,B.TRACK],[Je.TT,B.TT],[Je.U,B.U],[Je.UL,B.UL],[Je.SVG,B.SVG],[Je.VAR,B.VAR],[Je.WBR,B.WBR],[Je.XMP,B.XMP]]);function sO(e){var t;return(t=TEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,_Et={[Rt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[Rt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[Rt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[Rt.XLINK]:new Set,[Rt.XML]:new Set,[Rt.XMLNS]:new Set},JB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);Je.STYLE,Je.SCRIPT,Je.XMP,Je.IFRAME,Je.NOEMBED,Je.NOFRAMES,Je.PLAINTEXT;var Ce;(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"})(Ce||(Ce={}));const Ea={DATA:Ce.DATA,RCDATA:Ce.RCDATA,RAWTEXT:Ce.RAWTEXT,SCRIPT_DATA:Ce.SCRIPT_DATA,PLAINTEXT:Ce.PLAINTEXT,CDATA_SECTION:Ce.CDATA_SECTION};function jEt(e){return e>=Oe.DIGIT_0&&e<=Oe.DIGIT_9}function hS(e){return e>=Oe.LATIN_CAPITAL_A&&e<=Oe.LATIN_CAPITAL_Z}function NEt(e){return e>=Oe.LATIN_SMALL_A&&e<=Oe.LATIN_SMALL_Z}function Vm(e){return NEt(e)||hS(e)}function dne(e){return Vm(e)||jEt(e)}function __(e){return e+32}function gMe(e){return e===Oe.SPACE||e===Oe.LINE_FEED||e===Oe.TABULATION||e===Oe.FORM_FEED}function fne(e){return gMe(e)||e===Oe.SOLIDUS||e===Oe.GREATER_THAN_SIGN}function REt(e){return e===Oe.NULL?dt.nullCharacterReference:e>1114111?dt.characterReferenceOutsideUnicodeRange:fMe(e)?dt.surrogateCharacterReference:pMe(e)?dt.noncharacterCharacterReference:hMe(e)||e===Oe.CARRIAGE_RETURN?dt.controlCharacterReference:null}class IEt{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=Ce.DATA,this.returnState=Ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new yEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CEt(vEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(dt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(dt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=REt(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(dt.endTagWithAttributes),t.selfClosing&&this._err(dt.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 Fi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Fi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Fi.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:Fi.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=gMe(t)?Fi.WHITESPACE_CHARACTER:t===Oe.NULL?Fi.NULL_CHARACTER:Fi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Fi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vp.Attribute:vp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Ce.DATA:{this._stateData(t);break}case Ce.RCDATA:{this._stateRcdata(t);break}case Ce.RAWTEXT:{this._stateRawtext(t);break}case Ce.SCRIPT_DATA:{this._stateScriptData(t);break}case Ce.PLAINTEXT:{this._statePlaintext(t);break}case Ce.TAG_OPEN:{this._stateTagOpen(t);break}case Ce.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Ce.TAG_NAME:{this._stateTagName(t);break}case Ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Ce.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Ce.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Ce.COMMENT_START:{this._stateCommentStart(t);break}case Ce.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Ce.COMMENT:{this._stateComment(t);break}case Ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Ce.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Ce.COMMENT_END:{this._stateCommentEnd(t);break}case Ce.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Ce.DOCTYPE:{this._stateDoctype(t);break}case Ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Ce.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Ce.CDATA_SECTION:{this._stateCdataSection(t);break}case Ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.TAG_OPEN;break}case Oe.AMPERSAND:{this._startCharacterReference();break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitCodePoint(t);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case Oe.AMPERSAND:{this._startCharacterReference();break}case Oe.LESS_THAN_SIGN:{this.state=Ce.RCDATA_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.RAWTEXT_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Vm(t))this._createStartTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case Oe.EXCLAMATION_MARK:{this.state=Ce.MARKUP_DECLARATION_OPEN;break}case Oe.SOLIDUS:{this.state=Ce.END_TAG_OPEN;break}case Oe.QUESTION_MARK:{this._err(dt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ce.BOGUS_COMMENT,this._stateBogusComment(t);break}case Oe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(dt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ce.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Vm(t))this._createEndTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case Oe.GREATER_THAN_SIGN:{this._err(dt.missingEndTagName),this.state=Ce.DATA;break}case Oe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("");break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case Oe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Oe.SOLIDUS?this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Vm(t)?(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Vm(t)?(this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case Oe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Oe.SOLIDUS?(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(wc.SCRIPT,!1)&&fne(this.preprocessor.peek(wc.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])!==Rt.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($Et,Rt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(LEt,Rt.HTML)}clearBackToTableRowContext(){this.clearBackTo(MEt,Rt.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]===B.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]===B.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 Rt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case Rt.SVG:{if(mne.has(r))return!1;break}case Rt.MATHML:{if(pne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,TI)}hasInListItemScope(t){return this.hasInDynamicScope(t,PEt)}hasInButtonScope(t){return this.hasInDynamicScope(t,DEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Rt.HTML:{if(JB.has(n))return!0;if(TI.has(n))return!1;break}case Rt.SVG:{if(mne.has(n))return!1;break}case Rt.MATHML:{if(pne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Rt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&bMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&hne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&hne.has(this.currentTagId);)this.pop()}}const j4=3;var Xf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Xf||(Xf={}));const gne={type:Xf.Marker};class UEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=j4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(gne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Xf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Xf.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(gne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Xf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Xf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Xf.Element&&n.element===t)}}const Hm={createDocument(){return{nodeName:"#document",mode:rd.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};Hm.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(Hm.isTextNode(n)){n.value+=t;return}}Hm.appendChild(e,Hm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Hm.isTextNode(i)?i.value+=t:Hm.insertBefore(e,Hm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function WEt(e){return e.name===yMe&&e.publicId===null&&(e.systemId===null||e.systemId===QEt)}function KEt(e){if(e.name!==yMe)return rd.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===zEt)return rd.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),HEt.has(n))return rd.QUIRKS;let i=t===null?VEt:vMe;if(bne(n,i))return rd.QUIRKS;if(i=t===null?xMe:qEt,bne(n,i))return rd.LIMITED_QUIRKS}return rd.NO_QUIRKS}const yne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},GEt="definitionurl",XEt="definitionURL",YEt=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])),ZEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Rt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Rt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Rt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Rt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Rt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Rt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Rt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Rt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Rt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Rt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Rt.XMLNS}]]),JEt=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])),eCt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function tCt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Zy.COLOR||i===Zy.SIZE||i===Zy.FACE)||eCt.has(t)}function wMe(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,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Rt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Rt.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=Ea.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)===Je.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Rt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ea.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ea.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ea.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ea.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 o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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,Rt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Rt.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(Je.HTML,Rt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.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,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,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===Fi.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===B.SVG&&this.treeAdapter.getTagName(n)===Je.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Rt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Rt.HTML)}_processToken(t){switch(t.type){case Fi.CHARACTER:{this.onCharacter(t);break}case Fi.NULL_CHARACTER:{this.onNullCharacter(t);break}case Fi.COMMENT:{this.onComment(t);break}case Fi.DOCTYPE:{this.onDoctype(t);break}case Fi.START_TAG:{this._processStartTag(t);break}case Fi.END_TAG:{this.onEndTag(t);break}case Fi.EOF:{this.onEof(t);break}case Fi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return sCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Xf.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(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Ie.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case B.BODY:{this.insertionMode=Ie.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case B.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===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return kMe.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 B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Rt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.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 _Et[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{EMe(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:{N4(this,t);break}case Ie.IN_TABLE_TEXT:{NMe(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$At(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{N4(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){e9(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:{e9(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.AFTER_BODY:{gCt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{bCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{yCt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,dt.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,dt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?BAt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{vCt(this,t);break}case Ie.BEFORE_HEAD:{wCt(this,t);break}case Ie.IN_HEAD:{_f(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{SCt(this,t);break}case Ie.AFTER_HEAD:{CCt(this,t);break}case Ie.IN_BODY:{Rl(this,t);break}case Ie.IN_TABLE:{a1(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_CAPTION:{OAt(this,t);break}case Ie.IN_COLUMN_GROUP:{sq(this,t);break}case Ie.IN_TABLE_BODY:{_M(this,t);break}case Ie.IN_ROW:{jM(this,t);break}case Ie.IN_CELL:{EAt(this,t);break}case Ie.IN_SELECT:{PMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{AAt(this,t);break}case Ie.IN_TEMPLATE:{_At(this,t);break}case Ie.AFTER_BODY:{NAt(this,t);break}case Ie.IN_FRAMESET:{RAt(this,t);break}case Ie.AFTER_FRAMESET:{PAt(this,t);break}case Ie.AFTER_AFTER_BODY:{MAt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{LAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?UAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{xCt(this,t);break}case Ie.BEFORE_HEAD:{OCt(this,t);break}case Ie.IN_HEAD:{kCt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{ECt(this,t);break}case Ie.AFTER_HEAD:{ACt(this,t);break}case Ie.IN_BODY:{TM(this,t);break}case Ie.TEXT:{fAt(this,t);break}case Ie.IN_TABLE:{AC(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_CAPTION:{kAt(this,t);break}case Ie.IN_COLUMN_GROUP:{SAt(this,t);break}case Ie.IN_TABLE_BODY:{t9(this,t);break}case Ie.IN_ROW:{IMe(this,t);break}case Ie.IN_CELL:{CAt(this,t);break}case Ie.IN_SELECT:{DMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{TAt(this,t);break}case Ie.IN_TEMPLATE:{jAt(this,t);break}case Ie.AFTER_BODY:{LMe(this,t);break}case Ie.IN_FRAMESET:{IAt(this,t);break}case Ie.AFTER_FRAMESET:{DAt(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(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:{_Me(this,t);break}case Ie.TEXT:{hAt(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_TEMPLATE:{MMe(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:{rq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Oe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case 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:{SMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{N4(this,t);break}case Ie.IN_TABLE_TEXT:{jMe(this,t);break}}}};function uCt(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):TMe(e,t),n}function dCt(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 fCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=lCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=hCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function hCt(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 pCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=sO(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===Rt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function mCt(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 iq(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],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function yCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?rd.QUIRKS:KEt(t);WEt(t)||e._err(t,dt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function vk(e,t){e._err(t,dt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,rd.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function vCt(e,t){t.tagID===B.HTML?(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.BEFORE_HEAD):uE(e,t)}function xCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&uE(e,t)}function uE(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function wCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.HEAD:{e._insertElement(t,Rt.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:dE(e,t)}}function OCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?dE(e,t):e._err(t,dt.endTagWithoutMatchingOpenElement)}function dE(e,t){e._insertFakeElement(Je.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function _f(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ea.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ea.RAWTEXT):(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ea.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ea.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:fE(e,t)}}function kCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{fE(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function ev(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,dt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,dt.endTagWithoutMatchingOpenElement)}function fE(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function SCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{_f(e,t);break}case B.NOSCRIPT:{e._err(t,dt.nestedNoscriptInHead);break}default:hE(e,t)}}function ECt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case B.BR:{hE(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function hE(e,t){const n=t.type===Fi.EOF?dt.openElementsLeftAfterEof:dt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function CCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BODY:{e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,dt.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),_f(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:pE(e,t)}}function ACt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{pE(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function pE(e,t){e._insertFakeElement(Je.BODY,B.BODY),e.insertionMode=Ie.IN_BODY,AM(e,t)}function AM(e,t){switch(t.type){case Fi.CHARACTER:{EMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{SMe(e,t);break}case Fi.COMMENT:{e9(e,t);break}case Fi.START_TAG:{Rl(e,t);break}case Fi.END_TAG:{TM(e,t);break}case Fi.EOF:{_Me(e,t);break}}}function SMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function EMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function TCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function _Ct(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function jCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET)}function NCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function RCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&JB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Rt.HTML)}function ICt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function PCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),n||(e.formElement=e.openElements.current))}function DCt(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===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function MCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.tokenizer.state=Ea.PLAINTEXT}function LCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1}function $Ct(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Je.A);n&&(iq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BCt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(iq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function QCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==rd.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function CMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function AMe(e){const t=mMe(e,Zy.TYPE);return t!=null&&t.toLowerCase()===aCt}function zCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),AMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function VCt(e,t){e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0}function HCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qCt(e,t){t.tagName=Je.IMG,t.tagID=B.IMG,CMe(e,t)}function WCt(e,t){e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ea.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function KCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function GCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function wne(e,t){e._switchToTextParsing(t,Ea.RAWTEXT)}function XCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.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 YCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function ZCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Rt.HTML)}function JCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,Rt.HTML)}function eAt(e,t){e._reconstructActiveFormattingElements(),wMe(t),nq(t),t.selfClosing?e._appendElement(t,Rt.MATHML):e._insertElement(t,Rt.MATHML),t.ackSelfClosing=!0}function tAt(e,t){e._reconstructActiveFormattingElements(),OMe(t),nq(t),t.selfClosing?e._appendElement(t,Rt.SVG):e._insertElement(t,Rt.SVG),t.ackSelfClosing=!0}function One(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function Rl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{FCt(e,t);break}case B.A:{$Ct(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{RCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{NCt(e,t);break}case B.LI:case B.DD:case B.DT:{DCt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{CMe(e,t);break}case B.HR:{HCt(e,t);break}case B.RB:case B.RTC:{ZCt(e,t);break}case B.RT:case B.RP:{JCt(e,t);break}case B.PRE:case B.LISTING:{ICt(e,t);break}case B.XMP:{KCt(e,t);break}case B.SVG:{tAt(e,t);break}case B.HTML:{TCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{_f(e,t);break}case B.BODY:{_Ct(e,t);break}case B.FORM:{PCt(e,t);break}case B.NOBR:{BCt(e,t);break}case B.MATH:{eAt(e,t);break}case B.TABLE:{QCt(e,t);break}case B.INPUT:{zCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{VCt(e,t);break}case B.IMAGE:{qCt(e,t);break}case B.BUTTON:{LCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{UCt(e,t);break}case B.IFRAME:{GCt(e,t);break}case B.SELECT:{XCt(e,t);break}case B.OPTION:case B.OPTGROUP:{YCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{wne(e,t);break}case B.FRAMESET:{jCt(e,t);break}case B.TEXTAREA:{WCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?wne(e,t):One(e,t);break}case B.PLAINTEXT:{MCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:One(e,t)}}function nAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function iAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,LMe(e,t))}function rAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function sAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function aAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(Je.P,B.P),e._closePElement()}function oAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function lAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function cAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function uAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function dAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Je.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function TMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function TM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{iq(e,t);break}case B.P:{aAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{rAt(e,t);break}case B.LI:{oAt(e);break}case B.DD:case B.DT:{lAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{cAt(e);break}case B.BR:{dAt(e);break}case B.BODY:{nAt(e,t);break}case B.HTML:{iAt(e,t);break}case B.FORM:{sAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{uAt(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:TMe(e,t)}}function _Me(e,t){e.tmplInsertionModeStack.length>0?MMe(e,t):rq(e,t)}function fAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function hAt(e,t){e._err(t,dt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function N4(e,t){if(e.openElements.currentTagId!==void 0&&kMe.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 Fi.CHARACTER:{NMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{jMe(e,t);break}}else bT(e,t)}function pAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_CAPTION}function mAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.COLGROUP,B.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,sq(e,t)}function bAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function yAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.TBODY,B.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t)}function vAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function xAt(e,t){AMe(t)?e._appendElement(t,Rt.HTML):bT(e,t),t.ackSelfClosing=!0}function wAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Rt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function a1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{yAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{_f(e,t);break}case B.COL:{gAt(e,t);break}case B.FORM:{wAt(e,t);break}case B.TABLE:{vAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{bAt(e,t);break}case B.INPUT:{xAt(e,t);break}case B.CAPTION:{pAt(e,t);break}case B.COLGROUP:{mAt(e,t);break}default:bT(e,t)}}function AC(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{ev(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:bT(e,t)}}function bT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,AM(e,t),e.fosterParentingEnabled=n}function jMe(e,t){e.pendingCharacterTokens.push(t)}function NMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function xk(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{ev(e,t);break}}}function AAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):PMe(e,t)}function TAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):DMe(e,t)}function _At(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{_f(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,a1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,sq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,jM(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,Rl(e,t)}}function jAt(e,t){t.tagID===B.TEMPLATE&&ev(e,t)}function MMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):rq(e,t)}function NAt(e,t){t.tagID===B.HTML?Rl(e,t):jI(e,t)}function LMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.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 jI(e,t)}function jI(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function RAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.FRAMESET:{e._insertElement(t,Rt.HTML);break}case B.FRAME:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{_f(e,t);break}}}function IAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function PAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function DAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function MAt(e,t){t.tagID===B.HTML?Rl(e,t):RN(e,t)}function RN(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function LAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function $At(e,t){t.chars=Fs,e._insertCharacters(t)}function FAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function $Me(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Rt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function BAt(e,t){if(tCt(t))$Me(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Rt.MATHML?wMe(t):i===Rt.SVG&&(nCt(t),OMe(t)),nq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function UAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){$Me(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)===Rt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Je.AREA,Je.BASE,Je.BASEFONT,Je.BGSOUND,Je.BR,Je.COL,Je.EMBED,Je.FRAME,Je.HR,Je.IMG,Je.INPUT,Je.KEYGEN,Je.LINK,Je.META,Je.PARAM,Je.SOURCE,Je.TRACK,Je.WBR;const QAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,zAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),kne={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function FMe(e,t){const n=JAt(e),i=ZPe("type",{handlers:{root:VAt,element:HAt,text:qAt,comment:UMe,doctype:WAt,raw:GAt},unknown:XAt}),r={parser:n?new xne(kne):xne.getFragmentParser(void 0,kne),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),aO(r,Nh());const s=n?r.parser.document:r.parser.getFragment(),o=eEt(s,{file:r.options.file});return r.stitches&&mT(o,"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}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function BMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Fi.CHARACTER,chars:e.value,location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function WAt(e,t){const n={type:Fi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function KAt(e,t){t.stitches=!0;const n=eTt(e);if("children"in e&&"children"in n){const i=FMe({type:"root",children:e.children},t.options);n.children=i.children}UMe({type:"comment",value:{stitch:n}},t)}function UMe(e,t){const n=e.value,i={type:Fi.COMMENT,data:n,location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function GAt(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,QMe(t,Nh(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(QAt,"<$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 XAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))KAt(n,t);else{let i="";throw zAt.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 aO(e,t){QMe(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=Ea.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 QMe(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 YAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ea.PLAINTEXT)return;aO(t,Nh(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ry.html;r===Ry.html&&n==="svg"&&(r=Ry.svg);const s=sEt({...e,children:[]},{space:r===Ry.svg?"svg":"html"}),o={type:Fi.START_TAG,tagName:n,tagID:sO(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:yT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function ZAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&hEt.includes(n)||t.parser.tokenizer.state===Ea.PLAINTEXT)return;aO(t,xM(e));const i={type:Fi.END_TAG,tagName:n,tagID:sO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:yT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ea.RCDATA||t.parser.tokenizer.state===Ea.RAWTEXT||t.parser.tokenizer.state===Ea.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ea.DATA)}function JAt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function yT(e){const t=Nh(e)||{line:void 0,column:void 0,offset:void 0},n=xM(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 eTt(e){return"children"in e?r1({...e,children:[]}):r1(e)}function tTt(e){return function(t,n){return FMe(t,{...e,file:n})}}const nTt="modulepreload",iTt=function(e){return"/"+e},Sne={},Zs=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=iTt(c),c in Sne)return;Sne[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":nTt,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(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var rTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,sTt=/[\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]/,aTt=/[\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]/,R4={Space_Separator:rTt,ID_Start:sTt,ID_Continue:aTt},va={isSpaceSeparator(e){return typeof e=="string"&&R4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||R4.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==="‍"||R4.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 n9,ec,xp,NI,ub,gf,ko,aq,mE;var oTt=function(t,n){n9=String(t),ec="start",xp=[],NI=0,ub=1,gf=0,ko=void 0,aq=void 0,mE=void 0;do ko=lTt(),dTt[ec]();while(ko.type!=="eof");return typeof n=="function"?i9({"":mE},"",n):mE};function i9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Fp();if(!va.isHexDigit(n))throw As(Tt());e+=Tt()}return String.fromCodePoint(parseInt(e,16))}const dTt={start(){if(ko.type==="eof")throw ey();I4()},beforePropertyName(){switch(ko.type){case"identifier":case"string":aq=ko.value,ec="afterPropertyName";return;case"punctuator":j_();return;case"eof":throw ey()}},afterPropertyName(){if(ko.type==="eof")throw ey();ec="beforePropertyValue"},beforePropertyValue(){if(ko.type==="eof")throw ey();I4()},beforeArrayValue(){if(ko.type==="eof")throw ey();if(ko.type==="punctuator"&&ko.value==="]"){j_();return}I4()},afterPropertyValue(){if(ko.type==="eof")throw ey();switch(ko.value){case",":ec="beforePropertyName";return;case"}":j_()}},afterArrayValue(){if(ko.type==="eof")throw ey();switch(ko.value){case",":ec="beforeArrayValue";return;case"]":j_()}},end(){}};function I4(){let e;switch(ko.type){case"punctuator":switch(ko.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ko.value;break}if(mE===void 0)mE=e;else{const t=xp[xp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,aq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")xp.push(e),Array.isArray(e)?ec="beforeArrayValue":ec="beforePropertyName";else{const t=xp[xp.length-1];t==null?ec="end":Array.isArray(t)?ec="afterArrayValue":ec="afterPropertyValue"}}function j_(){xp.pop();const e=xp[xp.length-1];e==null?ec="end":Array.isArray(e)?ec="afterArrayValue":ec="afterPropertyValue"}function As(e){return RI(e===void 0?`JSON5: invalid end of input at ${ub}:${gf}`:`JSON5: invalid character '${VMe(e)}' at ${ub}:${gf}`)}function ey(){return RI(`JSON5: invalid end of input at ${ub}:${gf}`)}function Ene(){return gf-=5,RI(`JSON5: invalid identifier character at ${ub}:${gf}`)}function fTt(e){console.warn(`JSON5: '${VMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function VMe(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 RI(e){const t=new SyntaxError(e);return t.lineNumber=ub,t.columnNumber=gf,t}var hTt=function(t,n,i){const r=[];let s="",o,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)){o=[];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&&o.indexOf(v)<0&&o.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=o||Object.keys(b),w=[];for(const O of y){const k=d(O,b);if(k!==void 0){let S=m(O)+":";c!==""&&(S+=" "),S+=k,w.push(S)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let k=`, -`+s;O=w.join(k),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(!va.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;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"&&bTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)II(n,t+1);return}if(mS(e))for(const[n,i]of Object.entries(e)){if(gTt.has(n))throw new Error("ECharts option contains an unsafe key");II(i,t+1)}}function yTt(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 vTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(xTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="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:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function OTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lmTt)throw new Error("ECharts option is too large");const n=kTt(yTt(e));let i;try{i=HMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!mS(i))throw new Error("ECharts option must be a data object");II(i);const r={...i};r.aria={...mS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return mS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>mS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let P4;function STt(){return P4??(P4=Zs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw P4=void 0,e})),P4}function ETt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=qMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return STt().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||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(cn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const CTt=p.memo(ETt);let Cne,Ane=Promise.resolve(),ATt=0;function TTt(){return Cne??(Cne=Zs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-BCOT9Ja2.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))),Cne}function _Tt(e){const t=Ane.then(async()=>{const n=await TTt(),i=`mermaid-diagram-${ATt+=1}`;return n.render(i,e)});return Ane=t.then(()=>{},()=>{}),t}function jTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),_Tt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(cn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const NTt=p.memo(jTt),RTt="_SegmentedControl_1sl7d_1",ITt="_SegmentedControlOption_1sl7d_140",PTt="_SegmentedControlThumb_1sl7d_219",s9={SegmentedControl:RTt,SegmentedControlOption:ITt,SegmentedControlThumb:PTt},cd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,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 k=w*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+x;(ES+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);iNe({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||pI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(Oft,{ref:d,className:Qi(s9.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":o,...u,children:[a.jsx("div",{className:s9.SegmentedControlThumb,ref:f}),n]})},DTt=({children:e,...t})=>a.jsx(Aft,{className:s9.SegmentedControlOption,...t,onPointerEnter:SV,children:a.jsx("span",{className:"relative",children:e})});cd.Option=DTt;function MTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(cd,{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:[a.jsx(cd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(cd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const LTt=p.memo(MTt);function WMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const KMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function a9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(a9).join(""):p.isValidElement(e)?a9(e.props.children):""}function $Tt(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 WMe(n==null?void 0:n.slice(9))}function GMe(e){if(!e)return!1;try{const t=e.toLowerCase();return KMe.some(n=>t.includes(n))}catch{return!1}}function FTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(GMe(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 KMe.some(s=>r.includes(s))}return!1}function BTt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Tje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(WPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[yDe],rehypePlugins:n?[tTt,ane]:[ane],components:{pre:({node:f,children:h,...m})=>{const g=$Tt(h);if(g==="mermaid"||g==="echarts"){const b=a9(h).replace(/\n$/,"");return a.jsx(LTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(NTt,{source:b}):a.jsx(CTt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&Hst(m);if(g)return a.jsx(qst,{...s,path:g,children:h.children});if(m&&(GMe(m)||FTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(LAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(tM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Do,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const jd=p.memo(BTt);function D4(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownSource")}function XMe(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownCreator")}function UTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function QTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function zTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function VTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function vT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=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()}},[]),yi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(zTt,{})})]}),t]})}),document.body)}function TC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function o9(e){return e instanceof DOMException&&e.name==="AbortError"}function HTt(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 YMe=[".jpg",".jpeg",".png"].join(","),qTt=new Set(YMe.split(",")),ZMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),WTt=new Set(ZMe.split(",")),KTt=200*1024*1024;function l9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function GTt(e,t,n){return e.size>KTt?n("knowledge.errors.fileTooLarge"):t==="image"?qTt.has(l9(e.name))?"":n("knowledge.errors.invalidImageType"):WTt.has(l9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function oq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function c9(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 XTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,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:o.trim()||void 0,region:e};try{n(await Rbt(w))}catch(x){m(El(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(vT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.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)})]}),a.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")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(TC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function YTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Ibt(e.id,e.region,{description:r.trim()}))}catch(h){u(El(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(vT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(TC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function JMe(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 ZTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=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(""),[k,S]=p.useState(""),[E,C]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;E&&!N&&((L=R.current)==null||L.focus())},[N,E]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=GTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(l9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=JMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(El(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const M={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await Lbt(e.id,e.region,M),n()}else{const M=await $bt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:M,metadata:F})}else m&&(await Fbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof bM&&M.errorCode===aPe?i(M):S(El(M,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(C(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(vT,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:E?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:E.preview.name,children:E.preview.name}),a.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(jd,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(TC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.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,F])=>a.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:()=>P(L),onKeyDown:M=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=H.indexOf(L),U=M.key==="Home"?H[0]:M.key==="End"?H[H.length-1]:H[(q+(M.key==="ArrowRight"?1:-1)+H.length)%H.length];P(U),requestAnimationFrame(()=>{var Z;return(Z=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:Z.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(cn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?YMe:ZMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:oq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(cn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(TC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.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 JTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=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=JMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(El(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await Bbt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(El(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(vT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(TC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const eLe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),tLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),nLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),e2t=new Set(["pdf"]),t2t=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),n2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),i2t=new Set(["error","failed","unavailable"]);function Tne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function N_(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 r2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Tne);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>N_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[N_(s)])}}const n=Tne(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>N_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,N_(s)])}}function iLe(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 s2t(e){const t=iLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function a2t(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 eLe.has(i)?"image":tLe.has(i)?"audio":nLe.has(i)?"video":e2t.has(i)?"pdf":t||i?"file":"none"}function o2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(n2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(i2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=c9(e).toLocaleLowerCase();return i==="pdf"||t2t.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:eLe.has(i)||tLe.has(i)||nLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function l2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=iLe(e.attachmentUrl),s=a2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.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)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function c2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,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(C=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,C>0?m(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await Mbt(e.id,t.id,{region:e.region,offset:C,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>C>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!o9(A)&&w.current===T&&y(El(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var C;(C=x.current)==null||C.abort(),w.current+=1}),[O]);const k=s2t(o.url||t.url),S=o2t(o,i),E=o.metadata._veadk_content_format==="markdown";return a.jsx(vT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:oq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(jd,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(cn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,j)=>{const T=r2t(C.tableFields,i),R=C.id||`${j}:${C.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:j+1})})}),C.content?E?a.jsx(jd,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(l2t,{chunk:C})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(cn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function u2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("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(""),[k,S]=p.useState(""),[E,C]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[H,q]=p.useState(""),[U,Z]=p.useState(!1),[z,J]=p.useState(!1),[ne,W]=p.useState(!1),[X,V]=p.useState(null),[ae,Y]=p.useState(null),[K,te]=p.useState(null),[ue,fe]=p.useState(null),[se,me]=p.useState(null),[Ee,xe]=p.useState(!1),Ne=p.useRef(0),We=p.useRef(0),Xe=p.useRef([]),Re=p.useRef(!1),re=p.useRef(!1),ce=p.useRef(null),ve=p.useRef(null),Se=p.useRef({}),oe=p.useRef(!1),$e=p.useRef(null),Ue=p.useRef(null),be=p.useRef(null),ke=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),He=p.useCallback(Ke=>`${Ke.region}\0${Ke.id}`,[]),Qe=u.find(Ke=>He(Ke)===b)??null,jt=!!(Qe&&H===He(Qe));p.useEffect(()=>{r==null||r(!!Qe)},[r,Qe]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const Ke=x.trim().toLocaleLowerCase();return Ke?u.filter(St=>[St.name,St.description,St.ownerLabel,St.providerKnowledgeId].some(qe=>qe.toLocaleLowerCase().includes(Ke))):u},[u,x]),Kt=p.useMemo(()=>{const Ke=k.trim().toLocaleLowerCase();return Ke?N.filter(St=>[St.name,St.id,c9(St)].some(qe=>qe.toLocaleLowerCase().includes(Ke))):N},[k,N]);p.useEffect(()=>{Y(null)},[Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const Ct=p.useCallback(async(Ke=!1)=>{var nt;if(Ke&&(oe.current||Object.keys(Se.current).length===0))return;(nt=ce.current)==null||nt.abort();const St=new AbortController;ce.current=St;const qe=Ne.current+1;Ne.current=qe,oe.current=!0,Ke?T(!0):C(!0),A(""),Ke||g([]);try{const et=await Nbt({regions:Ae,nextTokens:Ke?Se.current:void 0,signal:St.signal});if(Ne.current!==qe)return;d(Et=>Ke?[...Et,...et.items.filter(At=>!Et.some(It=>He(It)===He(At)))]:et.items),Se.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:Et,error:At})=>`${Oh(Et,e)}: ${El(At,l("common.loadFailed"))}`);g(Et=>Ke?[...new Set([...Et,...ft])]:ft),Ke||v(Et=>et.items.some(At=>He(At)===Et)?Et:"")}catch(et){if(o9(et))return;Ne.current===qe&&(Ke?g(ft=>[...new Set([...ft,El(et,l("knowledge.errors.loadMoreBases"))])]):A(El(et,l("knowledge.errors.loadBases"))))}finally{Ne.current===qe&&(oe.current=!1,C(!1),T(!1))}},[He,e,Ae,l]),xt=p.useCallback(async(Ke,St=!1)=>{var et;if(St&&Re.current)return;(et=ve.current)==null||et.abort();const qe=new AbortController;ve.current=qe;const nt=We.current+1;We.current=nt,St||(Xe.current=[],re.current=!1,P([]),Z(!1),M("")),Re.current=!0,D(!0),St?M(""):L("");try{const ft=await Dbt(Ke.id,{region:Ke.region,offset:St?Xe.current.length:0,signal:qe.signal});if(We.current!==nt)return;q(Gt=>Gt===He(Ke)?"":Gt);const Et=Xe.current,At=St?[...Et,...ft.items.filter(Gt=>!Gt.id||!Et.some(Ye=>Ye.id===Gt.id))]:ft.items,It=ft.hasMore&&(!St||At.length>Et.length);Xe.current=At,re.current=It,P(At),Z(It)}catch(ft){if(o9(ft))return;We.current===nt&&(ft instanceof bM&&ft.errorCode===aPe&&(q(He(Ke)),V(At=>At&&He(At)===He(Ke)?null:At)),St?M(El(ft,l("knowledge.errors.loadMoreData"))):L(El(ft,l("knowledge.errors.loadData"))))}finally{We.current===nt&&(Re.current=!1,D(!1))}},[He,l]);p.useEffect(()=>{var Ke;(Ke=ce.current)==null||Ke.abort(),Ne.current+=1,oe.current=!1,Se.current={},d([]),h({}),g([]),v(""),q(""),A(""),C(!0)},[e]),p.useEffect(()=>{if(n)return Ct(),()=>{var Ke;(Ke=ce.current)==null||Ke.abort(),Ne.current+=1,oe.current=!1}},[n,i,Ct]),p.useEffect(()=>{var Ke,St;if(!n){(Ke=ve.current)==null||Ke.abort(),We.current+=1,Re.current=!1;return}if(!Qe){(St=ve.current)==null||St.abort(),We.current+=1,Xe.current=[],Re.current=!1,re.current=!1,P([]),Z(!1),M("");return}return xt(Qe),()=>{var qe;(qe=ve.current)==null||qe.abort(),We.current+=1,Re.current=!1}},[n,i,Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const tt=n&&!Qe&&!x.trim()&&!E&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const Ke=Ue.current,St=$e.current;if(!Ke||!St||!tt)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Ct(!0)},{root:St,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[tt,Ct]);const mt=()=>{const Ke=$e.current;!Ke||!tt||Ke.scrollHeight-Ke.scrollTop-Ke.clientHeight<=240&&Ct(!0)},_e=!!(Qe&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const Ke=ke.current,St=be.current;if(!Qe||!Ke||!St||!_e)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&xt(Qe,!0)},{root:be.current,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[_e,xt,Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const Ot=()=>{const Ke=be.current;if(!Qe||!Ke||!re.current||Re.current||F)return;const{scrollHeight:St,scrollTop:qe,clientHeight:nt}=Ke;St-qe-nt<=240&&xt(Qe,!0)},Nt=Ke=>{d(St=>St.map(qe=>He(qe)===He(Ke)?Ke:qe))},Yt=async()=>{if(ue){xe(!0);try{await Pbt(ue.id,ue.region),d(Ke=>Ke.filter(St=>He(St)!==He(ue))),q(Ke=>Ke===He(ue)?"":Ke),b===He(ue)&&v(""),fe(null)}catch(Ke){A(El(Ke,l("knowledge.errors.deleteBase"))),fe(null)}finally{xe(!1)}}},xn=async()=>{if(!(!Qe||!se)){xe(!0);try{await Ubt(Qe.id,se.id,Qe.region);const Ke=Xe.current.filter(St=>St.id!==se.id);Xe.current=Ke,P(Ke),me(null)}catch(Ke){L(El(Ke,l("knowledge.errors.deleteDocument"))),me(null)}finally{xe(!1)}}};return a.jsxs("section",{className:`knowledge-library${Qe?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Qe?a.jsx(lT,{className:"knowledge-library__detail",title:Qe.name,description:Qe.description||l("common.noDescription"),identitySeed:Qe.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(yH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Qe.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Qe.providerKnowledgeId,children:Qe.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Qe.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:D4(Qe.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:HTt(Qe.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),jt&&Qe.canManage?a.jsx("button",{type:"button",onClick:()=>fe(Qe),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void xt(Qe),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(QTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Qe.canManage&&a.jsx("button",{type:"button",onClick:()=>V(Qe),children:l("knowledge.addFirstData")})]}):a.jsx(vH,{rows:Kt,rowKey:Ke=>Ke.id,rowLabel:Ke=>Ke.name||Ke.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:Ke=>a.jsx("span",{title:Ke.name||Ke.id,children:Ke.name||Ke.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:Ke=>c9(Ke)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:Ke=>oq(Ke.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Qe.canManage?{label:l(jt?"knowledge.associationInvalid":"knowledge.addData"),disabled:jt,title:jt?l("knowledge.providerMissing"):void 0,onClick:()=>V(Qe)}:void 0,rowActions:Ke=>[{label:l("common.preview"),onSelect:()=>Y(Ke)},...Qe.canManage?[{label:l("common.edit"),onSelect:()=>te(Ke)},{label:l("common.delete"),onSelect:()=>me(Ke),danger:!0}]:[]],scrollRef:be,onScroll:Ot,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void xt(Qe,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:ke,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Qe.canManage?a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>fe(Qe),children:l("common.delete")}),a.jsx(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(Jp,{value:x,onChange:Ke=>O(Ke.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(em,{ref:$e,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!E&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}),E&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(UTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(K0,{children:[x.trim()?null:a.jsx(cb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(VTt,{}),onClick:()=>J(!0),children:l("knowledge.createBase")}),Pt.map(Ke=>a.jsx(X0,{className:"knowledge-card",title:Ke.name,description:Ke.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:D4(Ke.ownerLabel),title:D4(Ke.ownerLabel)},{label:l("knowledge.project"),value:Ke.projectName||"default",title:Ke.projectName||"default"}],action:{label:H===He(Ke)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!Ke.canManage||H===He(Ke),title:Ke.canManage?H===He(Ke)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>V(Ke)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(He(Ke))}},He(Ke)))]}),tt||j?a.jsx("div",{ref:Ue,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(XTt,{region:t,onClose:()=>J(!1),onCreated:Ke=>{d(St=>[Ke,...St]),v(He(Ke)),J(!1)}}),Qe&&ne&&a.jsx(YTt,{item:Qe,onClose:()=>W(!1),onUpdated:Ke=>{Nt(Ke),W(!1)}}),Qe&&ae&&a.jsx(c2t,{base:Qe,item:ae,onClose:()=>Y(null)}),X&&a.jsx(ZTt,{base:X,onClose:()=>V(null),onAssociationInvalid:Ke=>{q(He(X)),Qe&&He(Qe)===He(X)&&L(El(Ke,l("knowledge.associationInvalid"))),V(null)},onCreated:()=>{Qe&&He(Qe)===He(X)&&xt(Qe),V(null)}}),Qe&&K&&a.jsx(JTt,{base:Qe,item:K,onClose:()=>te(null),onUpdated:Ke=>{const St=Xe.current.map(qe=>qe.id===Ke.id?Ke:qe);Xe.current=St,P(St),te(null)}}),ue&&a.jsx(Td,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ue.name}),confirmLabel:l(Ee?"common.deleting":"common.delete"),variant:"danger",busy:Ee,onCancel:()=>fe(null),onConfirm:()=>void Yt()}),se&&a.jsx(Td,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:se.name||se.id}),confirmLabel:l(Ee?"common.deleting":"common.delete"),variant:"danger",busy:Ee,onCancel:()=>me(null),onConfirm:()=>void xn()})]})}const d2t="_EmptyMessage_1r5gu_1",f2t="_IconBadge_1r5gu_16",h2t="_Title_1r5gu_54",p2t="_Description_1r5gu_69",m2t="_ActionRow_1r5gu_77",xT={EmptyMessage:d2t,IconBadge:f2t,Title:h2t,Description:p2t,ActionRow:m2t},Wn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Qi(xT.EmptyMessage,t),"data-fill":n,children:e}),g2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Qi(xT.IconBadge,i),"data-size":e,"data-color":t,children:n}),b2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Qi(xT.Title,t),"data-color":n,children:e}),y2t=({children:e,className:t})=>a.jsx("div",{className:Qi(xT.Description,t),children:e}),v2t=({children:e,className:t})=>a.jsx("div",{className:Qi(xT.ActionRow,t),children:e});Wn.Icon=g2t;Wn.Title=b2t;Wn.Description=y2t;Wn.ActionRow=v2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",Vme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Xwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const x2t="/web/skill-workbench";class u9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Sd(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function _ne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function w2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Eh(e,t={},n=ho){return fetch(Ta(`${x2t}${e}`),{...t,headers:uc(t.headers),signal:po(t.signal,n)})}async function lq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Sd(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Sd(r.detail,en("api.errorDetails")):r;return new u9(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])||en("api.missingContentType");return new u9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function db(e,t){if(!e.ok)throw await lq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function O2t(e){return Array.isArray(e)?e.map(t=>{const n=Sd(t,en("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(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("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(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function k2t(e){if(e==null)return;const t=Sd(e,en("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"||!AD(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("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 _C(e){const t=Sd(e,en("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(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Sd(l,en("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(en("api.unknownTaskState"));const r=_ne(t.toolId,"Tool ID"),s=_ne(t.sessionId,"Session ID"),o=w2t(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}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:O2t(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:k2t(t.publication)}:{}}}async function NM(e){const t=Sd(await db(await Eh("/capabilities",{signal:e}),en("api.loadCapability")),en("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 S2t(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 Eh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},hr);return _C(await db(i,en("api.startOptimization")))}const t=await Eh("/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 _C(await db(t,en("api.startTask")))}async function E2t(e,t){return _C(await db(await Eh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function M4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Sd(await db(await Eh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("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(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Sd(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("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 L4(e){const t=await Eh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},hr);return _C(await db(t,en("api.refine")))}async function C2t(e){const t=await Eh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return _C(await db(t,en("api.stop")))}async function A2t(e){const t=await Eh(`/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 lq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Sd(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Sd(d.error,en("api.publishError"));throw new u9(typeof m.message=="string"?m.message:en("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(en("api.unknownPublishEvent"));const f=Sd(d.result,en("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"||!AD(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("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+=o.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function T2t(e){await db(await Eh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function _2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Eh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},hr);if(!r.ok)throw await lq(r,en("api.download"));const o=((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=o,u.click()}finally{URL.revokeObjectURL(l)}}const rLe=p.createContext(void 0);function tv(e){const t=p.useContext(rLe);if(t===void 0&&!e)throw new Error(Hc(47));return t}const j2t={...gje,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 N2t extends BD{constructor(n,i,r){const s=new uV;super(R2t(n,s,i,r),I2t(s),j2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===gu,s=i.reason===Zw&&i.event.detail===0,o=!n&&(i.reason===__e||i.reason==null),l=ost(i),c=this.select("activeTriggerId");if(!n&&i.reason===T_e&&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};oje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Dit,()=>{this.set("stickIfOpen",!1)}),yi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===uC&&(d="focus"),this.set("instantType",d)})}}function R2t(e,t,n,i=!1){const r={...hje(),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=pje(t,n,i),r}function I2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new $u,triggerElements:e}}function jne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=D2t(l,{modal:o,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),fje(d,f),cje(d);const{forceUnmount:g}=uje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,fa(j_e))}),[g,d]);const b=f||h;return a.jsxs(rLe.Provider,{value:d,children:[l&&a.jsx(aje,{handle:l,store:d}),b&&a.jsx(M2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function P2t(e){return tv(!0)?a.jsx(jne,{props:e}):a.jsx(prt,{children:a.jsx(jne,{props:e})})}function D2t(e,t){const n=sje((i,r)=>new N2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function M2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=Q_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return dje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const L2t=300;function tm(e){return HA(e,"base-ui")}function $2t(e,t){const n=p.useRef(null);function i(s){yi.flushSync(()=>{e.setOpen(!1,fa(uC,s.nativeEvent,s.currentTarget))});const o=dit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&sw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{yi.flushSync(()=>{e.setOpen(!1,fa(uC,s.nativeEvent,s.currentTarget))});let c=uit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=eV(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function F2t(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 sLe(e,t){const n=ci((s,o)=>{(typeof e=="function"?e():e)||t(o||(HD?"touch":""))}),{onClick:i,onPointerDown:r}=F2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const B2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=L2t,closeDelay:h=0,id:m,...g}=t,b=tv(!0),y=bje(c)??b;if(!y)throw new Error(Hc(74));const w=tm(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),E=p.useRef(null),{registerTrigger:C,isMountedByThisTrigger:j}=lje(w,E,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=pst(O,{enabled:!o&&d&&(A!=="touch"||T!==Zw),mouseOnly:!0,move:!1,handleClose:bst(),restMs:f,delay:{close:h},triggerElementRef:E,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=U_e(O,{stickIfOpen:R}),D=sLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=GD({disabled:o,native:l}),M={open(ne){return ne&&T===Zw?Nst.open(ne):wje.open(ne)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=$2t(y,E),z=Ra("button",t,{state:{disabled:o,open:k},ref:[F,n,C,E],props:[I.reference,P,_,D,{[aV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),J=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(h0,{ref:H,onFocus:q}),J,a.jsx(h0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):J}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(e===void 0)throw new Error(Hc(45));return e}const Q2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return tv().useState("mounted")||i?a.jsx(aLe.Provider,{value:i,children:a.jsx(P_e,{ref:n,...r})}):null}),oLe=p.createContext(void 0);function z2t(){const e=p.useContext(oLe);if(!e)throw new Error(Hc(46));return e}const lLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`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 a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Nne={},Rne={},Ine="";function RM(e,t){return QA(e)?e:t}function Pne(e,t,n){return/hidden|clip/.test(e.getComputedStyle(RM(t,n)).overflowY)}function V2t(e){if(typeof document>"u")return!1;const t=kr(e);return ta(t).innerWidth-t.documentElement.clientWidth>0}function H2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=kr(e),i=n.documentElement,r=n.body,s=RM(i,r),o=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=o,i.style.scrollbarGutter=l,c===u}function q2t(e){const t=kr(e),n=t.documentElement,i=t.body,r=RM(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 W2t(e){var m;const t=kr(e),n=t.documentElement,i=t.body,r=ta(n);let s=0,o=0,l=!1;const c=jc.create();if(V1&&(((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,o=n.scrollLeft,Nne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ine=n.style.scrollBehavior,Rne={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,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",E=Math.max(0,r.innerWidth-i.clientWidth),C=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=RM(n,i);if(l=H2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||C?`calc(100dvh - ${j+C}px)`:"100dvh",width:T||E?`calc(100vw - ${T+E}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Nne),Object.assign(i.style,Rne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ine)}function f(){d(),c.request(u)}u();const h=Ri(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class K2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",$u.create());Zt(this,"timeoutUnlock",$u.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(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=kr(t),i=n.documentElement,r=n.body,s=ta(i);if(Pne(s,i,r)){const l=new s.MutationObserver(()=>{Pne(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 o=HD||!V2t(t);this.restore=o?q2t(t):W2t(t)}}const G2t=new K2t;function cLe(e=!0,t=null){Jn(()=>{if(e)return G2t.acquire(t)},[e,t])}const X2t=20;function Y2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=kr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-X2t)},[e,t,n]),cLe(e&&(!t||r),i)}const Z2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,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=Uit,...w}=t,x=tv(),O=U2t(),k=frt(),S=x.useState("floatingRootContext"),E=x.useState("mounted"),C=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=sV(N),F=Sst({anchor:o,floatingRootContext:S,positionMethod:l,mounted:E,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const z=M,J=_.current;if(z&&(_.current=z),J&&z&&z!==J){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=R===!0&&j!==gu;Y2t(C&&H,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},Z=Rst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!E,inert:!C});return a.jsxs(oLe.Provider,{value:F,children:[E&&H&&a.jsx(lLe,{inert:rV(!C),cutout:T}),a.jsx(hrt,{id:k,children:Z})]})}),J2t="ArrowUp",e_t="ArrowDown",t_t="ArrowLeft",n_t="ArrowRight",i_t="Home",r_t="End",uLe=new Set([J2t,e_t,t_t,n_t,i_t,r_t]),s_t=p.createContext(void 0);function a_t(e){return p.useContext(s_t)}const o_t=p.createContext(void 0);function l_t(){const[e,t]=p.useState(0),n=ci(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=tv(),d=z2t(),f=a_t()!=null,{context:h,hasClosePart:m}=l_t(),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"),k=u.useState("modal"),S=u.useState("mounted"),E=u.useState("openChangeReason"),C=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");VA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),fst(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?rje(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Ra("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...ije,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&uLe.has(F.key)&&F.stopPropagation()}},kje(y),c],stateAttributesMapping:Oje});return a.jsx(B_e,{context:j,openInteractionType:b,modal:I,disabled:!S||E===gu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Js(C)?C:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(o_t.Provider,{value:h,children:L})})}),u_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=tv(),c=tm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Ra("h2",t,{ref:n,props:[{id:c},o]})}),d_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=tv(),c=tm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Ra("p",t,{ref:n,props:[{id:c},o]})});function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.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 f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.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 cq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.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"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.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 b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.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"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.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"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function v_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function x_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Lne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function oO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function w_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=V2e,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 a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(P2t,{open:i,onOpenChange:r,children:[a.jsxs(B2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(oO,{className:"development-token-chevron"})]}),a.jsx(Q2t,{children:a.jsx(Z2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(c_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(u_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(d_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function uq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.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 IM({kind:e,...t}){return e==="thinking"?a.jsx(uq,{...t}):a.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"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.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 O_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=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"?H2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(oO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{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?a.jsx(cn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.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:V2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function k_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=rnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(O_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"thinking"})}),a.jsx(cn,{children:c||r("developmentRuns.processing")})]})]})}const S_t={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 E_t(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 C_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function A_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dq(e,t){if(C_t(e))return E_t(t,e.path);if(A_t(e)){const n=S_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=dq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function T_t(e,t){const n=dq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const dLe=new Map;function nv(e,t){dLe.set(e,t)}function __t(e){return dLe.get(e)}function j_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sdq(i,e.dataModel),resolveString:i=>T_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=__t(r.component)??N_t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function hLe(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 PM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(pC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Do,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Lje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Do,{})}):null]}):null]})}function fq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function pLe(e){var n,i,r,s;const t=fq(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 mLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function gLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?pTe(t,e.uri):""}function I_t({kind:e}){return e==="image"?a.jsx(yV,{}):e==="video"?a.jsx(Fje,{}):e==="pdf"?a.jsx(Mat,{}):a.jsx(gV,{})}function DM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=fq(l.mimeType),u=gLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Qje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(I_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:pLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):mLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(rE,{className:"media-card-open"}):null]});return a.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?a.jsx(LAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Do,{})}):null]},l.id)})}),a.jsx(hf,{children:s?a.jsx(P_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function P_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>gLe(t,e),[e,t]),s=fq(t.mimeType),[o,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]),a.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:a.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:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[pLe(t),t.sizeBytes?` · ${mLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(tM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Do,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Bi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(jd,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function D_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(cn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(oO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Ru(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function qn(e){return typeof e=="string"?e:""}function $ne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function ud(e){return Array.isArray(e)?e:[]}function d9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Ru(t)??{};return Ru(n.result)??n}function MM(e){if(typeof e=="string")try{return MM(JSON.parse(e))}catch{return e}const t=Ru(e);if(!t)return"";const n=Ru(t.result);return qn(t.error)||qn(t.message)||qn(n==null?void 0:n.error)||qn(n==null?void 0:n.message)}function M_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Ru(e.metadata),n=qn(t==null?void 0:t.source_type).toLowerCase(),i=qn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const bLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function L_t(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 $_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function F_t(e,t=bLe){const n=d9(e),i=Ru(n.capabilities)??{},r=ud(n.resources).flatMap(o=>{const l=Ru(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:qn(l.ref),kind:c,category:M_t(l),name:qn(l.name)||qn(l.ref)||t.unnamedResource,description:qn(l.description),source:qn(l.source),version:qn(l.version)}]}),s=ud(n.sources).flatMap(o=>{const l=Ru(o);if(!l)return[];const c=qn(l.source),u=qn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:$_t(c),label:L_t(c,t),status:d,count:$ne(l.count),message:qn(l.message),searchKeywords:ud(l.search_keywords).map(qn).filter(Boolean)}]});return{collectionId:qn(n.collection_id),capabilities:{googleAdkVersion:qn(i.google_adk_version),agentTypes:ud(i.agent_types).map(qn).filter(Boolean),maxOrchestrationDepth:$ne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function B_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function yLe(e,t,n=bLe){const i=d9(e),r=d9(t),s=new Map(ud(r.results).flatMap(d=>{const f=Ru(d),h=qn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=ud(i.agents).flatMap(d=>{const f=Ru(d),h=qn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>qn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=qn(d.name),h=ud(d.nodes).flatMap(E=>{const C=Ru(E);return C?[C]:[]}),m=qn(d.root_node),g=h.find(E=>qn(E.id)===m),b=h.filter(E=>qn(E.id)!==m).map(E=>({id:qn(E.id)||n.unnamedAgent,type:qn(E.type)||"llm",description:qn(E.description)})),v=s.get(f),y=qn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=Fne(v==null?void 0:v.resources),O=x.length>0?x:Fne(h.flatMap(E=>ud(E.resources))),k=Bne(v==null?void 0:v.python_tools),S=k.length>0?k:Bne(h.flatMap(E=>ud(E.python_tools)));return{name:f,description:qn(v==null?void 0:v.description)||qn(g==null?void 0:g.description)||qn(d.task),task:qn(d.task),rootType:qn(v==null?void 0:v.root_type)||qn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(E=>E.kind==="skill"),knowledgeBases:O.filter(E=>E.kind==="knowledge_base"),builtinTools:O.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:qn(v==null?void 0:v.output),error:qn(v==null?void 0:v.error)}});return{collectionId:qn(r.collection_id)||qn(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 U_t(e,t){return!!MM(t)||yLe(e,t).failedCount>0}function Fne(e){const t=new Set;return ud(e).flatMap(n=>{const i=Ru(n),r=qn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=qn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:qn(i==null?void 0:i.name)||l[l.length-1]||r,description:qn(i==null?void 0:i.description),version:qn(i==null?void 0:i.version),source:qn(i==null?void 0:i.source)}]})}function Bne(e){const t=new Set;return ud(e).flatMap(n=>{const i=Ru(n),r=qn(i==null?void 0:i.name),s=qn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:qn(i.description),code:s,entrypoint:qn(i.entrypoint)||r,dependencies:ud(i.dependencies).map(qn).filter(Boolean)}])})}function Q_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(jd,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function z_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Hje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.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:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(Q_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(_t,{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 vLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const xLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function V_t(){return p.useContext(xLe)}function H_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=ci(r),[,o]=p.useState(!1),l=Ad(W_t).current,c=Ad(q_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=ci(()=>{d.current||(d.current=!0,o(k=>!k))}),g=ci((k,S)=>{c.set(k,S),m()}),b=ci(k=>{c.delete(k),m()}),v=ci(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,j;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((j=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:j.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!X_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&wLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const E=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=ci(()=>{const[k,S]=K_t(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=ci(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(xLe.Provider,{value:O,children:t})}function q_t(){return new Map}function W_t(){return new Set}function K_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>wLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function G_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function X_t(e){for(const t of e)for(let n=0;nnull},SLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,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]=vLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=ci((C,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(C),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==C);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===C?[]:[C];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),E=Ra("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Y_t});return a.jsx(OLe.Provider,{value:S,children:a.jsx(H_t,{elementsRef:y,children:E})})});function Z_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=vLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=nje(s,!0,!0),d=tm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=ci(b=>{const v=!s,y=fa(Zw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const ELe=p.createContext(void 0);function CLe(){const e=p.useContext(ELe);if(e===void 0)throw new Error(Hc(15));return e}function J_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=V_t(),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&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{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 ALe=p.createContext(void 0);function hq(){const e=p.useContext(ALe);if(e===void 0)throw new Error(Hc(9));return e}let pq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e}({}),ejt=function(e){return e.panelOpen="data-panel-open",e}({});const tjt={[pq.open]:""},njt={[pq.closed]:""},ijt={open(e){return e?{[ejt.panelOpen]:""}:null}},rjt={open(e){return e?tjt:njt}};let sjt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const mq={...rjt,index:e=>({[sjt.index]:String(e)}),...KD,value:()=>null},TLe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=J_t(),h=Yw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=kLe(),y=tm(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=ci((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=Z_t({open:O,onOpenChange:k,disabled:x}),E=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=p.useMemo(()=>({...S,onOpenChange:k,state:E}),[S,E,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=tm(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Ra("div",t,{state:j,ref:h,props:u,stateAttributesMapping:mq});return a.jsx(ELe.Provider,{value:C,children:a.jsx(ALe.Provider,{value:P,children:I})})}),_Le=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=hq();return Ra("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:mq})}),jLe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=CLe(),g=i||m,{getButtonProps:b,buttonRef:v}=GD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=hq(),O=s||void 0,k=O??y;return Jn(()=>(x(C=>O??(C===null?void 0:C)),()=>{x(C=>C===O?null:C)}),[O,x]),Ra("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:ijt})}),wk={height:void 0,width:void 0};function ajt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(wk),b=p.useRef(wk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Yw(t,f),E=Zl(l),C=sV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=ci((F,M=!0)=>{M&&(b.current=F),g(F)}),I=ci(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=ci(F=>{I(),k.current=()=>{k.current=null,F()}}),_=ci(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=ojt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=Uv(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(Uv(F)),O(!0);return}if(M==="css-transition"){const J=ljt(F);if(P(Uv(F)),!U)return J;const ne=R_(F,"transition-duration","0s");return D(ne),O(!0),J}P(Uv(F));const Z=R_(F,"animation-name","none");if(!U){Z();return}const z=R_(F,"animation-duration","0s");Z(),D(z),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(wk,!1),c(!1);return}P(Uv(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const H=Uv(F);if(!(H.height>0||H.width>0)){c(!1);return}P(H),M==="css-animation"&&R_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),VA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(wk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let H=-1;function q(){E.current||(c(!1),P(wk,!1))}return H=jc.request(()=>{C(q,M.signal)}),()=>{jc.cancel(H),M.abort()}},[E,s,l,T,C,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function H(q){const U=fa(C_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ri(M,"beforematch",H)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[pq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function Uv(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ojt(e,t){const n=ta(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Une(n.animationDuration),r=Une(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Une(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function R_(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 ljt(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=jc.request(n);return()=>{jc.cancel(i),n()}}let Qne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const NLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=kLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=CLe(),O=r??d,k=s??f,S=o||void 0,E=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:C,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=ajt({externalRef:n,hiddenUntilFound:O,id:E,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=hq(),_={...I,transitionStatus:N},L=g_e(c,_),F=Ra("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Qne.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[Qne.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mq});return A?F:null}),cjt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ujt(i,n.getBoundingClientRect()),s=djt(i,r),o=fjt(t.getBoundingClientRect());return pjt([...s,...o])};function ujt(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 djt(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 fjt(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 hjt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function pjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),mjt(t)}function mjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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 gjt="_Transition_1wdpp_1",bjt="_Popover_1wdpp_3",RLe={Transition:gjt,Popover:bjt},ILe=p.createContext(null),LM=()=>{const e=p.use(ILe);if(!e)throw new Error("Popover components must be wrapped in ");return e},$g=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=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);kV(()=>v(!1),b?500:null);const y=sb(t),w=sb(E=>{var C,j;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(j=y.current)==null||j.call(y,E),o(E),n&&v(E))}),x=p.useCallback(E=>{w.current(E)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(ILe,{value:S,children:a.jsx(PRe,{open:g,onOpenChange:x,modal:!1,children:r})})},yjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=LM(),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&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(DRe,{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})},PLe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=LM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=aNe(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]),a.jsx(LRe,{forceMount:!0,ref:g,className:Qi(RLe.Popover,d),style:V0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Mp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Mp,onEscapeKeyDown:Mp,onKeyDown:b,children:e})},vjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=LM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=cjt(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(!o)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=!hjt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=aNe(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]),a.jsx(PLe,{...e})},xjt=e=>{const{open:t,showOnHover:n,setOpen:i}=LM();return eT(t,()=>{i(!1)}),a.jsx(MRe,{forceMount:!0,children:a.jsx(Z1,{enterDuration:600,exitDuration:300,className:RLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(vjt,{...e},"popover-hover"):a.jsx(PLe,{...e},"popover"))})})};$g.Trigger=yjt;$g.Content=xjt;const wjt=["skill_hub","skill_space","knowledge_base","tool"];function DLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function MLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function Ojt(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 $4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:Ojt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function kjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(SLe,{children:e.map((n,i)=>a.jsxs(TLe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(_Le,{className:"create-agent-card__python-tool-header",children:a.jsxs(jLe,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(DLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(NLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Sjt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function I_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.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,a.jsx("span",{children:t})]});return t===0?s:a.jsxs($g,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx($g.Trigger,{children:s}),a.jsx($g.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function Ejt({response:e,status:t}){const{t:n}=Te("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(()=>F_t(e,i),[i,e]),s=p.useMemo(()=>wjt.map(c=>{const u=B_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?MM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(MLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(SLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(TLe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(_Le,{className:"create-agent-card__accordion-header",children:a.jsxs(jLe,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{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}),a.jsx(DLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(NLe,{className:"create-agent-card__accordion-content",children:a.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?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.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=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Cjt({args:e,response:t,status:n}){const{t:i}=Te("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(()=>yLe(e,t,r),[e,r,t]),o=n==="failed"?MM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.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"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(xH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(wH,{leading:a.jsx(n1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(OH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(I_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(gN,{"aria-hidden":"true"}),children:a.jsx($4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(I_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(gIe,{"aria-hidden":"true"}),children:a.jsx($4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(I_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(gat,{"aria-hidden":"true"}),children:[a.jsx($4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(kjt,{tools:l.pythonTools})]}),a.jsx(I_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(yat,{"aria-hidden":"true"}),children:a.jsx(Sjt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(MLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ajt={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:b_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:v_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:x_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Lne},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:Lne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:f_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:cq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:h_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:p_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:m_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:g_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:y_t,detailRenderer:Ejt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Mne,detailRenderer:Cjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Mne,detailRenderer:z_t,hideHeader:!0}};function gq(e){return Ajt[e]}function Tjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function _jt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function jjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Rb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function LLe(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function F4(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function Njt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function Rjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function wT(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Ijt(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.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 Pjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function $Le(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Djt=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>OFe),void 0)),Mjt=p.lazy(()=>Zs(()=>import("../chunks/CodeDiffEditor-Bg6VpuGF.js"),[])),FLe="veadk-code-workspace-theme";function Ljt(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,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function $jt(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 Fjt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(FLe)==="dark"?"dark":"light"}catch{return"light"}}function Bjt(e){return e===""?0:e.split(` -`).length}function o1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Fjt),m=p.useMemo(()=>s?jjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Ljt(g),[g]),k=g.find(P=>P.path===v)??null,S=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(FLe,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],H=F[F.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=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function C(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return $jt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const H=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx(F4,{}),a.jsx("span",{children:_.name}),C(H)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>E(L),"aria-expanded":!M,children:[a.jsx(Rjt,{className:M?"":"is-open"}),a.jsx(Njt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return yi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(LLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Pjt,{}):a.jsx(Ijt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(wT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx(F4,{}),a.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx(F4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Mjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Djt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:Bjt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Ujt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(LLe,{}),a.jsx("span",{children:l})]}),a.jsx(o1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const gy="••••••••",P_=5,Qv=8e3,Qjt=8,zjt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,BLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,ULe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,QLe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Vjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),Hjt=new Set(["web_search","search","grep","rg"]),qjt=new Set(["read_file","read","list_files","glob","ls"]),Wjt=new Set(["apply_patch","file_change","fileChange"]),Kjt=new Set(["create_goal","update_goal","get_goal"]);function xg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function y0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function B4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function PI(e){const t=xg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=xg(t[i]);r&&n.push(r)}return n}function gE(e,...t){return y0(...e.flatMap(n=>t.map(i=>n[i])))}function Gjt(e){let t=e.replace(BLe,"").replace(ULe,"").replace(QLe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${gy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${gy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,gy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${gy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${gy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${gy}`)),t}function sf(e){return Gjt(e).replace(BLe,"").replace(ULe,"").replace(QLe,"")}function DI(e,t=0,n=new WeakSet){if(t>=Qjt)return"[truncated: maximum depth]";if(typeof e=="string")return sf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>DI(r,t+1,n));const i=xg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,zjt.test(r)?gy:DI(s,t+1,n)])):e}function U4(e){const t=sf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Qv*2?{text:t.slice(0,Qv)+t.slice(-Qv),head:[t.slice(0,Qv)],tail:[t.slice(-Qv)],omittedLines:0,omittedCharacters:t.length-Qv*2}:n.length<=P_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,P_),tail:n.slice(-P_),omittedLines:n.length-P_*2,omittedCharacters:0}}function Xjt(e){return Kjt.has(e)?"goal":Vjt.has(e)?"command":Hjt.has(e)||/search/i.test(e)?"search":qjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Wjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Yjt(e,t){if(e.status)return e.status;const n=y0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function zne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=xg(t),i=y0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Zjt(e,t,n,i,r){const s=[...PI(n),...PI(i)];return e==="goal"?sf(gE(s,"objective","title","name")):e==="command"?sf(gE(s,"command","cmd","script","commandPreview","binary")):e==="search"?sf(gE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(sf).join(", "):sf(e==="mcp"?y0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):y0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function bq(e){const t=xg(e.args),n=xg(e.response),i=e.args===void 0?void 0:DI(e.args),r=e.response===void 0?void 0:DI(e.response),s=[...PI(e.args),...PI(e.response)],o=Xjt(e.name),l=Yjt(e,n),c=xg(n==null?void 0:n.display)??xg(t==null?void 0:t.display),u=y0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...zne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...zne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=B4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=B4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=B4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Zjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?sf(y0(gE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&sf(gE(s,"cwd"))||void 0,output:U4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(sf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:U4(Vne(i)),rawResponsePreview:r===void 0?void 0:U4(Vne(r))}}function Vne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Hne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Id(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Jjt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function zLe(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function eNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function tNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function nNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function iNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function qne(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function yq(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function VLe(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function rNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function sNt(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function aNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const oNt={goal:qne,command:Jjt,read:zLe,search:eNt,"file-change":tNt,mcp:nNt,authorization:iNt,generic:qne};function lNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function HLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function cNt({status:e}){return e==="running"||e==="queued"?a.jsx(sNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(rNt,{className:"tool-activity__status-icon"}):a.jsx(VLe,{className:"tool-activity__status-icon"})}function uNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:HLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(yq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(aNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(Wne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(Wne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function Wne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` -`))??HLe(t),n&&n.omittedCharacters>0?` +`))}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 s1t(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 ckt={tokenize:bkt,partial:!0};function ukt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pkt,continuation:{tokenize:mkt},exit:gkt}},text:{91:{name:"gfmFootnoteCall",tokenize:hkt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dkt,resolveTo:fkt}}}}function dkt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=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(!o||!o._balanced)return n(c);const u=ff(i.sliceSerialize({start:o.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 fkt(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)},o={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",o,t],["exit",o,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 hkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;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&&!o||f===null||f===91||ds(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(ff(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ds(f)||(o=!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 pkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=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(o>999||g===93&&!l||g===null||g===91||ds(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=ff(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ds(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),gr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function mkt(e,t,n){return e.check(gT,t,e.attempt(ckt,t,n))}function gkt(e){e.exit("gfmFootnoteDefinition")}function bkt(e,t,n){const i=this;return gr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function ykt(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(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=s1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class vkt{constructor(){this.map=[]}add(t,n,i){xkt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[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 xkt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const C=R>-1?i.events[R][1].type:null,N=C==="tableHead"||C==="tableRow"?O:c;return N===O&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Wn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Zi(T)?gr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ds(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Zi(T)?gr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):S(T)}function b(T){return Zi(T)?gr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Wn(T)?k(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):S(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Zi(T)?gr(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Wn(T)?!o||r!==s?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function O(T){return e.enter("tableRow"),A(T)}function A(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),A):T===null||Wn(T)?(e.exit("tableRow"),t(T)):Zi(T)?gr(e,A,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||ds(T)?(e.exit("data"),A(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function Skt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new vkt;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({},lx(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Vte(e,t,n,i,r){const s=[],o=lx(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function lx(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const Ekt={name:"tasklistCheck",tokenize:Akt};function Ckt(){return{text:{91:Ekt}}}function Akt(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 ds(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Wn(c)?t(c):Zi(c)?e.check({tokenize:Tkt},t,n)(c):n(c)}}function Tkt(e,t,n){return gr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function _kt(e){return TPe([ekt(),ukt(),ykt(e),kkt(),Ckt()])}const jkt={};function wDe(e){const t=this,n=e||jkt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(_kt(n)),s.push(X1t()),o.push(Y1t(n))}const Hte=function(e,t,n){const i=bT(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 ODe(e,t,n){return e.type==="element"?$kt(e,t,n):e.type==="text"?n.whitespace==="normal"?SDe(e,n):Fkt(e):[]}function $kt(e,t,n){const i=EDe(e,n),r=e.children||[];let s=-1,o=[];if(Mkt(e))return o;let l,c;for(GB(e)||Gte(e)&&Hte(t,e,Gte)?c=` +`:Dkt(e)?(l=2,c=2):kDe(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"],k={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*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Hkt(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=Vkt(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 OM(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"}}),o={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"],k=["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",...k,...S]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function qkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+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:"("+o+"[\\*&\\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 Wkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!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"],k={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*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Kkt(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"],o={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:o},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+")*>)?(\\[\\])?",k={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,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:o,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:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const Gkt=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_-]*/}}),Xkt=["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"],Ykt=["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"],Zkt=[...Xkt,...Ykt],Jkt=["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(),eOt=["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(),tOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nOt=["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=Gkt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[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:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+eOt.join("|")+")"},{begin:":(:)?("+tOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nOt.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:Jkt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Zkt.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 _De(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:"jDe(e,t,n-1))}function NDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+jDe("(?:<"+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,Xte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Xte,u]}}const Yte="[A-Za-z$_][0-9A-Za-z$_]*",rOt=["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"],sOt=["true","false","null","undefined","NaN","Infinity"],RDe=["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"],IDe=["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"],aOt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oOt=[].concat(PDe,RDe,IDe);function QH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Yte,keyword:rOt,literal:sOt,built_in:oOt,"variable.language":aOt},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 k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={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:{_:[...RDe,...IDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...PDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={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:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};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}),j,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},_,{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:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function zH(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 ux="[0-9](_*[0-9])*",S_=`\\.(${ux})`,E_="[0-9a-fA-F](_*[0-9a-fA-F])*",lOt={className:"number",variants:[{begin:`(\\b(${ux})((${S_})|\\.)?|(${S_}))[eE][+-]?(${ux})[fFdD]?\\b`},{begin:`\\b(${ux})((${S_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S_})[fFdD]?\\b`},{begin:`\\b(${ux})[fFdD]\\b`},{begin:`\\b0[xX]((${E_})\\.?|(${E_})?\\.(${E_}))[pP][+-]?(${ux})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${E_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cOt(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},o={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(o);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(o,{className:"string"}),"self"]}]},u=lOt,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,o,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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const uOt=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_-]*/}}),dOt=["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"],fOt=["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"],hOt=[...dOt,...fOt],pOt=["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(),DDe=["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(),MDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mOt=["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(),gOt=DDe.concat(MDe).sort().reverse();function bOt(e){const t=uOt(e),n=gOt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,k,S){return{className:x,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:i,attribute:pOt.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:o}),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("+mOt.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("+hOt.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:":("+DDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+MDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.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:o}}function yOt(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 VH(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},o={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,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function vOt(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 xOt(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},o={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}),o,{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,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function wOt(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),o={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":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[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"],k={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},S=P=>P.map(I=>I.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],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"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,O]},R={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:[T]};T.contains.push(R);const C=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,O],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",...C]},...C,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:k,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/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},O,{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:k,contains:["self",N,o,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 kOt(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 LDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qH(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 OOt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function SOt(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 EOt(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+)*/),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"]},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:o},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:o}]},O=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{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:o},{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=O,b.contains=O;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:O}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(O)}}function $De(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*\(/))},o="([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 COt=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_-]*/}}),AOt=["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"],TOt=["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"],_Ot=[...AOt,...TOt],jOt=["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(),NOt=["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(),ROt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IOt=["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=COt(e),n=ROt,i=NOt,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("+_Ot.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("+IOt.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:jOt.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 POt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function BDe(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"],o=["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(O=>O.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function k(S,{exceptions:O,when:A}={}){const E=A;return O=O||[],S.map(j=>j.match(/\|\d+$/)||O.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function UDe(e){return e?typeof e=="string"?e:e.source:null}function xO(e){return Gr("(?=",e,")")}function Gr(...e){return e.map(n=>UDe(n)).join("")}function DOt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ql(...e){return"("+(DOt(e).capture?"":"?:")+e.map(i=>UDe(i)).join("|")+")"}const WH=e=>Gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),MOt=["Protocol","Type"].map(WH),Zte=["init","self"].map(WH),LOt=["Any","Self"],C4=["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"],Jte=["false","nil","true"],$Ot=["assignment","associativity","higherThan","left","lowerThan","none","right"],FOt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ene=["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"],QDe=ql(/[/=\-+!*%<>&|^~?]/,/[\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]/),zDe=ql(QDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=Gr(QDe,zDe,"*"),VDe=ql(/[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]/),SI=ql(VDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qf=Gr(VDe,SI,"*"),C_=Gr(/[A-Z]/,SI,"*"),BOt=["attached","autoclosure",Gr(/convention\(/,ql("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Gr(/objc\(/,qf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],UOt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function QOt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ql(...MOt,...Zte)],className:{2:"keyword"}},s={match:Gr(/\./,ql(...C4)),relevance:0},o=C4.filter(Oe=>typeof Oe=="string").concat(["_|0"]),l=C4.filter(Oe=>typeof Oe!="string").concat(LOt).map(WH),c={variants:[{className:"keyword",match:ql(...l,...Zte)}]},u={$pattern:ql(/\b\w+/,/#\w+/),keyword:o.concat(FOt),literal:Jte},d=[r,s,c],f={match:Gr(/\./,ql(...ene)),relevance:0},h={className:"built_in",match:Gr(/\b/,ql(...ene),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${zDe})+`}]},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/}]},k=(Oe="")=>({className:"subst",variants:[{match:Gr(/\\/,Oe,/[0\\tnr"']/)},{match:Gr(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(Oe="")=>({className:"subst",match:Gr(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(Oe="")=>({className:"subst",label:"interpol",begin:Gr(/\\/,Oe,/\(/),end:/\)/}),A=(Oe="")=>({begin:Gr(Oe,/"""/),end:Gr(/"""/,Oe),contains:[k(Oe),S(Oe),O(Oe)]}),E=(Oe="")=>({begin:Gr(Oe,/"/),end:Gr(/"/,Oe),contains:[k(Oe),O(Oe)]}),j={className:"string",variants:[A(),A("#"),A("##"),A("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},C=Oe=>{const fe=Gr(Oe,/\//),pe=Gr(/\//,Oe);return{begin:fe,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},N={scope:"regexp",variants:[C("###"),C("##"),C("#"),R]},P={match:Gr(/`/,qf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${SI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:UOt,contains:[...v,x,j]}]}},F={scope:"keyword",match:Gr(/@/,ql(...BOt),xO(ql(/\(/,/\s+/)))},M={scope:"meta",match:Gr(/@/,qf)},H=[L,F,M],q={match:xO(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,SI,"+")},{className:"type",match:C_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Gr(/\s+&\s+/,xO(C_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...H,g,q]};q.contains.push(U);const Z={match:Gr(qf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...i,N,...d,...m,...v,x,j,..._,...H,q]},J={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:ql(xO(Gr(qf,/\s*:/)),xO(Gr(qf,/\s+/,qf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...H,q,z],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,ql(P.match,qf,A4)],className:{1:"keyword",3:"title.function"},contains:[J,W,t],illegal:[/\[/,/%/]},le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,W,t],illegal:/\[|%/},V={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,C_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...$Ot,...Jte],end:/}/},K={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:C_},...d],relevance:0}]};for(const Oe of j.variants){const fe=Oe.contains.find(Se=>Se.label==="interpol");fe.keywords=u;const pe=[...d,...m,...v,x,j,..._];fe.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...i,X,le,K,ue,te,V,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...H,q,z]}}const EI="[A-Za-z$_][0-9A-Za-z$_]*",HDe=["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"],qDe=["true","false","null","undefined","NaN","Infinity"],WDe=["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"],KDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],GDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],YDe=[].concat(GDe,WDe,KDe);function zOt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:EI,keyword:HDe,literal:qDe,built_in:YDe,"variable.language":XDe},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 k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={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:{_:[...WDe,...KDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...GDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={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:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};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}),j,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},_,{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:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function KH(e){const t=e.regex,n=zOt(e),i=EI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={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:EI,keyword:HDe.concat(c),literal:qDe,built_in:YDe.concat(r),"variable.language":XDe},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,o,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 VOt(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}/,o=/(\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(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,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 HOt(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_]+/},o={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,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function ZDe(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/}]},o=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,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,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 GH(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}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{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,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const qOt={arduino:Hkt,bash:OM,c:qkt,cpp:Wkt,csharp:Kkt,css:ADe,diff:TDe,go:_De,graphql:iOt,ini:UH,java:NDe,javascript:QH,json:zH,kotlin:cOt,less:bOt,lua:yOt,makefile:VH,markdown:HH,objectivec:vOt,perl:xOt,php:wOt,"php-template":kOt,plaintext:LDe,python:qH,"python-repl":OOt,r:SOt,ruby:EOt,rust:$De,scss:FDe,shell:POt,sql:BDe,swift:QOt,typescript:KH,vbnet:VOt,wasm:HOt,xml:ZDe,yaml:GH};function JDe(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)&&JDe(n)}),e}let tne=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function eMe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gg(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 WOt="",nne=e=>!!e.scope,KOt=(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 GOt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=eMe(t)}openNode(t){if(!nne(t))return;const n=KOt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){nne(t)&&(this.buffer+=WOt)}value(){return this.buffer}span(t){this.buffer+=``}}const ine=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class XH{constructor(){this.rootNode=ine(),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=ine({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=>{XH._collapse(n)}))}}class XOt extends XH{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 GOt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function AC(e){return e?typeof e=="string"?e:e.source:null}function tMe(e){return Kv("(?=",e,")")}function YOt(e){return Kv("(?:",e,")*")}function ZOt(e){return Kv("(?:",e,")?")}function Kv(...e){return e.map(n=>AC(n)).join("")}function JOt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function YH(...e){return"("+(JOt(e).capture?"":"?:")+e.map(i=>AC(i)).join("|")+")"}function nMe(e){return new RegExp(e.toString()+"|").exec("").length-1}function eSt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const tSt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ZH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=AC(i),o="";for(;s.length>0;){const l=tSt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const nSt=/\b\B/,iMe="[a-zA-Z]\\w*",JH="[a-zA-Z_]\\w*",rMe="\\b\\d+(\\.\\d+)?",sMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",aMe="\\b(0b[01]+)",iSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",rSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Kv(t,/.*\b/,e.binary,/\b.*/)),gg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},TC={begin:"\\\\[\\s\\S]",relevance:0},sSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[TC]},aSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[TC]},oSt={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/},SM=function(e,t,n={}){const i=gg({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=YH("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:Kv(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},lSt=SM("//","$"),cSt=SM("/\\*","\\*/"),uSt=SM("#","$"),dSt={scope:"number",begin:rMe,relevance:0},fSt={scope:"number",begin:sMe,relevance:0},hSt={scope:"number",begin:aMe,relevance:0},pSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[TC,{begin:/\[/,end:/\]/,relevance:0,contains:[TC]}]},mSt={scope:"title",begin:iMe,relevance:0},gSt={scope:"title",begin:JH,relevance:0},bSt={begin:"\\.\\s*"+JH,relevance:0},ySt=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 A_=Object.freeze({__proto__:null,APOS_STRING_MODE:sSt,BACKSLASH_ESCAPE:TC,BINARY_NUMBER_MODE:hSt,BINARY_NUMBER_RE:aMe,COMMENT:SM,C_BLOCK_COMMENT_MODE:cSt,C_LINE_COMMENT_MODE:lSt,C_NUMBER_MODE:fSt,C_NUMBER_RE:sMe,END_SAME_AS_BEGIN:ySt,HASH_COMMENT_MODE:uSt,IDENT_RE:iMe,MATCH_NOTHING_RE:nSt,METHOD_GUARD:bSt,NUMBER_MODE:dSt,NUMBER_RE:rMe,PHRASAL_WORDS_MODE:oSt,QUOTE_STRING_MODE:aSt,REGEXP_MODE:pSt,RE_STARTERS_RE:iSt,SHEBANG:rSt,TITLE_MODE:mSt,UNDERSCORE_IDENT_RE:JH,UNDERSCORE_TITLE_MODE:gSt});function vSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function xSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wSt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=vSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function kSt(e,t){Array.isArray(e.illegal)&&(e.illegal=YH(...e.illegal))}function OSt(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 SSt(e,t){e.relevance===void 0&&(e.relevance=1)}const ESt=(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=Kv(n.beforeMatch,tMe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},CSt=["of","and","for","in","not","or","if","then","parent","list","value"],ASt="keyword";function oMe(e,t,n=ASt){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,oMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,TSt(c[0],c[1])]})}}function TSt(e,t){return t?Number(t):_St(e)?0:1}function _St(e){return CSt.includes(e.toLowerCase())}const rne={},qy=e=>{console.error(e)},sne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Q0=(e,t)=>{rne[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),rne[`${e}/${t}`]=!0)},CI=new Error;function lMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=nMe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function jSt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw qy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),CI;if(typeof e.beginScope!="object"||e.beginScope===null)throw qy("beginScope must be object"),CI;lMe(e,e.begin,{key:"beginScope"}),e.begin=ZH(e.begin,{joinWith:""})}}function NSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw qy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),CI;if(typeof e.endScope!="object"||e.endScope===null)throw qy("endScope must be object"),CI;lMe(e,e.end,{key:"endScope"}),e.end=ZH(e.end,{joinWith:""})}}function RSt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function ISt(e){RSt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),jSt(e),NSt(e)}function PSt(e){function t(o,l){return new RegExp(AC(o),"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+=nMe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ZH(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(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[xSt,OSt,ISt,ESt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[wSt,kSt,SSt].forEach(d=>d(o,l)),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=oMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=AC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return DSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.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=gg(e.classNameAliases||{}),s(e)}function cMe(e){return e?e.endsWithParent||cMe(e.starts):!1}function DSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return gg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:cMe(e)?gg(e,{starts:e.starts?gg(e.starts):null}):Object.isFrozen(e)?gg(e):e}var MSt="11.11.1";class LSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=eMe,ane=gg,one=Symbol("nomatch"),$St=7,uMe=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?",o={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:XOt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(sne(s.replace("{}",L[1])),sne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.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,F=_),L===void 0&&(L=!0);const H={code:F,language:M};P("before:highlight",H);const q=H.result?H.result:f(H.language,H.code,L);return q.code=H.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function H(ce,ye){return ce.keywords[ye]}function q(){if(!pe.keywords){ve.addText(Le);return}let ce=0;pe.keywordPatternRe.lastIndex=0;let ye=pe.keywordPatternRe.exec(Le),Ae="";for(;ye;){Ae+=Le.substring(ce,ye.index);const Ee=te.case_insensitive?ye[0].toLowerCase():ye[0],Ce=H(pe,Ee);if(Ce){const[Be,he]=Ce;if(ve.addText(Ae),Ae="",M[Ee]=(M[Ee]||0)+1,M[Ee]<=$St&&(He+=he),Be.startsWith("_"))Ae+=ye[0];else{const ie=te.classNameAliases[Be]||Be;z(ye[0],ie)}}else Ae+=ye[0];ce=pe.keywordPatternRe.lastIndex,ye=pe.keywordPatternRe.exec(Le)}Ae+=Le.substring(ce),ve.addText(Ae)}function U(){if(Le==="")return;let ce=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){ve.addText(Le);return}ce=f(pe.subLanguage,Le,!0,Se[pe.subLanguage]),Se[pe.subLanguage]=ce._top}else ce=m(Le,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(He+=ce.relevance),ve.__addSublanguage(ce._emitter,ce.language)}function Z(){pe.subLanguage!=null?U():q(),Le=""}function z(ce,ye){ce!==""&&(ve.startScope(ye),ve.addText(ce),ve.endScope())}function J(ce,ye){let Ae=1;const Ee=ye.length-1;for(;Ae<=Ee;){if(!ce._emit[Ae]){Ae++;continue}const Ce=te.classNameAliases[ce[Ae]]||ce[Ae],Be=ye[Ae];Ce?z(Be,Ce):(Le=Be,q(),Le=""),Ae++}}function ne(ce,ye){return ce.scope&&typeof ce.scope=="string"&&ve.openNode(te.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(z(Le,te.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Le=""):ce.beginScope._multi&&(J(ce.beginScope,ye),Le="")),pe=Object.create(ce,{parent:{value:pe}}),pe}function W(ce,ye,Ae){let Ee=eSt(ce.endRe,Ae);if(Ee){if(ce["on:end"]){const Ce=new tne(ce);ce["on:end"](ye,Ce),Ce.isMatchIgnored&&(Ee=!1)}if(Ee){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return W(ce.parent,ye,Ae)}function X(ce){return pe.matcher.regexIndex===0?(Le+=ce[0],1):(se=!0,0)}function le(ce){const ye=ce[0],Ae=ce.rule,Ee=new tne(Ae),Ce=[Ae.__beforeBegin,Ae["on:begin"]];for(const Be of Ce)if(Be&&(Be(ce,Ee),Ee.isMatchIgnored))return X(ye);return Ae.skip?Le+=ye:(Ae.excludeBegin&&(Le+=ye),Z(),!Ae.returnBegin&&!Ae.excludeBegin&&(Le=ye)),ne(Ae,ce),Ae.returnBegin?0:ye.length}function V(ce){const ye=ce[0],Ae=_.substring(ce.index),Ee=W(pe,ce,Ae);if(!Ee)return one;const Ce=pe;pe.endScope&&pe.endScope._wrap?(Z(),z(ye,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(Z(),J(pe.endScope,ce)):Ce.skip?Le+=ye:(Ce.returnEnd||Ce.excludeEnd||(Le+=ye),Z(),Ce.excludeEnd&&(Le=ye));do pe.scope&&ve.closeNode(),!pe.skip&&!pe.subLanguage&&(He+=pe.relevance),pe=pe.parent;while(pe!==Ee.parent);return Ee.starts&&ne(Ee.starts,ce),Ce.returnEnd?0:ye.length}function Y(){const ce=[];for(let ye=pe;ye!==te;ye=ye.parent)ye.scope&&ce.unshift(ye.scope);ce.forEach(ye=>ve.openNode(ye))}let K={};function ue(ce,ye){const Ae=ye&&ye[0];if(Le+=ce,Ae==null)return Z(),0;if(K.type==="begin"&&ye.type==="end"&&K.index===ye.index&&Ae===""){if(Le+=_.slice(ye.index,ye.index+1),!r){const Ee=new Error(`0 width match regex (${D})`);throw Ee.languageName=D,Ee.badRule=K.rule,Ee}return 1}if(K=ye,ye.type==="begin")return le(ye);if(ye.type==="illegal"&&!L){const Ee=new Error('Illegal lexeme "'+Ae+'" for mode "'+(pe.scope||"")+'"');throw Ee.mode=pe,Ee}else if(ye.type==="end"){const Ee=V(ye);if(Ee!==one)return Ee}if(ye.type==="illegal"&&Ae==="")return Le+=` +`,1;if(De>1e5&&De>ye.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Le+=Ae,Ae.length}const te=E(D);if(!te)throw qy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const Oe=PSt(te);let fe="",pe=F||Oe;const Se={},ve=new l.__emitter(l);Y();let Le="",He=0,Ge=0,De=0,se=!1;try{if(te.__emitTokens)te.__emitTokens(_,ve);else{for(pe.matcher.considerAll();;){De++,se?se=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Ge;const ce=pe.matcher.exec(_);if(!ce)break;const ye=_.substring(Ge,ce.index),Ae=ue(ye,ce);Ge=ce.index+Ae}ue(_.substring(Ge))}return ve.finalize(),fe=ve.toHTML(),{language:D,value:fe,relevance:He,illegal:!1,_emitter:ve,_top:pe}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Ge,context:_.slice(Ge-100,Ge+100),mode:ce.mode,resultSoFar:fe},_emitter:ve};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:ce,_emitter:ve,_top:pe};throw ce}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(Z=>f(Z,D,!1));F.unshift(L);const M=F.sort((Z,z)=>{if(Z.relevance!==z.relevance)return z.relevance-Z.relevance;if(Z.language&&z.language){if(E(Z.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===Z.language)return-1}return 0}),[H,q]=M,U=H;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("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 LSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);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}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=ane(l,D)}const y=()=>{k(),Q0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){k(),Q0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function D(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(D,_){let L=null;try{L=_(e)}catch(F){if(qy("Language definition for '{}' could not be registered.".replace("{}",D)),r)qy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function O(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function A(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function C(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}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:k,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:O,listLanguages:A,getLanguage:E,registerAliases:j,autoDetection:T,inherit:ane,addPlugin:C,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=MSt,e.regex={concat:Kv,lookahead:tMe,either:YH,optional:ZOt,anyNumberOfTimes:YOt};for(const D in A_)typeof A_[D]=="object"&&JDe(A_[D]);return Object.assign(e,A_),e},o1=uMe({});o1.newInstance=()=>uMe({});var FSt=o1;o1.HighlightJS=o1;o1.default=o1;const cl=N1(FSt),lne={},BSt="hljs-";function USt(e){const t=cl.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||lne,h=typeof f.prefix=="string"?f.prefix:BSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:QSt,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||lne).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 o(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 QSt{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(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),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 zSt={};function cne(e){const t=e||zSt,n=t.aliases,i=t.detect||!1,r=t.languages||qOt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=USt(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){yT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=VSt(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=Lkt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,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 VSt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=fne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}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(o=55296&&e<=57343}function gEt(e){return e>=56320&&e<=57343}function bEt(e,t){return(e-55296)*1024+9216+t}function gMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function bMe(e){return e>=64976&&e<=65007||mEt.has(e)}var ht;(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"})(ht||(ht={}));const yEt=65536;class vEt{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=yEt,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,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,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(gEt(n))return this.pos++,this._addGap(),bEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ke.EOF;return this._err(ht.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,ke.EOF;const i=this.html.charCodeAt(n);return i===ke.CARRIAGE_RETURN?ke.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,ke.EOF;let t=this.html.charCodeAt(this.pos);return t===ke.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ke.LINE_FEED):t===ke.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,mMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===ke.LINE_FEED||t===ke.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gMe(t)?this._err(ht.controlCharacterInInputStream):bMe(t)&&this._err(ht.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 xEt=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))),wEt=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 kEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wEt.get(e))!==null&&t!==void 0?t:e}var Po;(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"})(Po||(Po={}));const OEt=32;var bg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bg||(bg={}));function YB(e){return e>=Po.ZERO&&e<=Po.NINE}function SEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_F||e>=Po.LOWER_A&&e<=Po.LOWER_F}function EEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_Z||e>=Po.LOWER_A&&e<=Po.LOWER_Z||YB(e)}function CEt(e){return e===Po.EQUALS||EEt(e)}var Ao;(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"})(Ao||(Ao={}));var xp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(xp||(xp={}));class AEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ao.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xp.Strict}startEntity(t){this.decodeMode=t,this.state=Ao.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ao.EntityStart:return t.charCodeAt(n)===Po.NUM?(this.state=Ao.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ao.NamedEntity,this.stateNamedEntity(t,n));case Ao.NumericStart:return this.stateNumericStart(t,n);case Ao.NumericDecimal:return this.stateNumericDecimal(t,n);case Ao.NumericHex:return this.stateNumericHex(t,n);case Ao.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|OEt)===Po.LOWER_X?(this.state=Ao.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ao.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(o===Po.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==xp.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]&bg.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]&~bg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ao.NamedEntity:return this.result!==0&&(this.decodeMode!==xp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ao.NumericDecimal:return this.emitNumericEntity(0,2);case Ao.NumericHex:return this.emitNumericEntity(0,3);case Ao.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ao.EntityStart:return 0}}}function TEt(e,t,n,i){const r=(t&bg.BRANCH_LENGTH)>>7,s=t&bg.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 o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var jt;(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/"})(jt||(jt={}));var Wy;(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"})(Wy||(Wy={}));var ad;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ad||(ad={}));var et;(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"})(et||(et={}));var B;(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"})(B||(B={}));const _Et=new Map([[et.A,B.A],[et.ADDRESS,B.ADDRESS],[et.ANNOTATION_XML,B.ANNOTATION_XML],[et.APPLET,B.APPLET],[et.AREA,B.AREA],[et.ARTICLE,B.ARTICLE],[et.ASIDE,B.ASIDE],[et.B,B.B],[et.BASE,B.BASE],[et.BASEFONT,B.BASEFONT],[et.BGSOUND,B.BGSOUND],[et.BIG,B.BIG],[et.BLOCKQUOTE,B.BLOCKQUOTE],[et.BODY,B.BODY],[et.BR,B.BR],[et.BUTTON,B.BUTTON],[et.CAPTION,B.CAPTION],[et.CENTER,B.CENTER],[et.CODE,B.CODE],[et.COL,B.COL],[et.COLGROUP,B.COLGROUP],[et.DD,B.DD],[et.DESC,B.DESC],[et.DETAILS,B.DETAILS],[et.DIALOG,B.DIALOG],[et.DIR,B.DIR],[et.DIV,B.DIV],[et.DL,B.DL],[et.DT,B.DT],[et.EM,B.EM],[et.EMBED,B.EMBED],[et.FIELDSET,B.FIELDSET],[et.FIGCAPTION,B.FIGCAPTION],[et.FIGURE,B.FIGURE],[et.FONT,B.FONT],[et.FOOTER,B.FOOTER],[et.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[et.FORM,B.FORM],[et.FRAME,B.FRAME],[et.FRAMESET,B.FRAMESET],[et.H1,B.H1],[et.H2,B.H2],[et.H3,B.H3],[et.H4,B.H4],[et.H5,B.H5],[et.H6,B.H6],[et.HEAD,B.HEAD],[et.HEADER,B.HEADER],[et.HGROUP,B.HGROUP],[et.HR,B.HR],[et.HTML,B.HTML],[et.I,B.I],[et.IMG,B.IMG],[et.IMAGE,B.IMAGE],[et.INPUT,B.INPUT],[et.IFRAME,B.IFRAME],[et.KEYGEN,B.KEYGEN],[et.LABEL,B.LABEL],[et.LI,B.LI],[et.LINK,B.LINK],[et.LISTING,B.LISTING],[et.MAIN,B.MAIN],[et.MALIGNMARK,B.MALIGNMARK],[et.MARQUEE,B.MARQUEE],[et.MATH,B.MATH],[et.MENU,B.MENU],[et.META,B.META],[et.MGLYPH,B.MGLYPH],[et.MI,B.MI],[et.MO,B.MO],[et.MN,B.MN],[et.MS,B.MS],[et.MTEXT,B.MTEXT],[et.NAV,B.NAV],[et.NOBR,B.NOBR],[et.NOFRAMES,B.NOFRAMES],[et.NOEMBED,B.NOEMBED],[et.NOSCRIPT,B.NOSCRIPT],[et.OBJECT,B.OBJECT],[et.OL,B.OL],[et.OPTGROUP,B.OPTGROUP],[et.OPTION,B.OPTION],[et.P,B.P],[et.PARAM,B.PARAM],[et.PLAINTEXT,B.PLAINTEXT],[et.PRE,B.PRE],[et.RB,B.RB],[et.RP,B.RP],[et.RT,B.RT],[et.RTC,B.RTC],[et.RUBY,B.RUBY],[et.S,B.S],[et.SCRIPT,B.SCRIPT],[et.SEARCH,B.SEARCH],[et.SECTION,B.SECTION],[et.SELECT,B.SELECT],[et.SOURCE,B.SOURCE],[et.SMALL,B.SMALL],[et.SPAN,B.SPAN],[et.STRIKE,B.STRIKE],[et.STRONG,B.STRONG],[et.STYLE,B.STYLE],[et.SUB,B.SUB],[et.SUMMARY,B.SUMMARY],[et.SUP,B.SUP],[et.TABLE,B.TABLE],[et.TBODY,B.TBODY],[et.TEMPLATE,B.TEMPLATE],[et.TEXTAREA,B.TEXTAREA],[et.TFOOT,B.TFOOT],[et.TD,B.TD],[et.TH,B.TH],[et.THEAD,B.THEAD],[et.TITLE,B.TITLE],[et.TR,B.TR],[et.TRACK,B.TRACK],[et.TT,B.TT],[et.U,B.U],[et.UL,B.UL],[et.SVG,B.SVG],[et.VAR,B.VAR],[et.WBR,B.WBR],[et.XMP,B.XMP]]);function ok(e){var t;return(t=_Et.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,jEt={[jt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[jt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[jt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[jt.XLINK]:new Set,[jt.XML]:new Set,[jt.XMLNS]:new Set},ZB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);et.STYLE,et.SCRIPT,et.XMP,et.IFRAME,et.NOEMBED,et.NOFRAMES,et.PLAINTEXT;var Te;(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"})(Te||(Te={}));const Ta={DATA:Te.DATA,RCDATA:Te.RCDATA,RAWTEXT:Te.RAWTEXT,SCRIPT_DATA:Te.SCRIPT_DATA,PLAINTEXT:Te.PLAINTEXT,CDATA_SECTION:Te.CDATA_SECTION};function NEt(e){return e>=ke.DIGIT_0&&e<=ke.DIGIT_9}function mS(e){return e>=ke.LATIN_CAPITAL_A&&e<=ke.LATIN_CAPITAL_Z}function REt(e){return e>=ke.LATIN_SMALL_A&&e<=ke.LATIN_SMALL_Z}function Qm(e){return REt(e)||mS(e)}function pne(e){return Qm(e)||NEt(e)}function T_(e){return e+32}function vMe(e){return e===ke.SPACE||e===ke.LINE_FEED||e===ke.TABULATION||e===ke.FORM_FEED}function mne(e){return vMe(e)||e===ke.SOLIDUS||e===ke.GREATER_THAN_SIGN}function IEt(e){return e===ke.NULL?ht.nullCharacterReference:e>1114111?ht.characterReferenceOutsideUnicodeRange:mMe(e)?ht.surrogateCharacterReference:bMe(e)?ht.noncharacterCharacterReference:gMe(e)||e===ke.CARRIAGE_RETURN?ht.controlCharacterReference:null}class PEt{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=Te.DATA,this.returnState=Te.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new vEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new AEt(xEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ht.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ht.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=IEt(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(ht.endTagWithAttributes),t.selfClosing&&this._err(ht.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 zi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case zi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case zi.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:zi.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=vMe(t)?zi.WHITESPACE_CHARACTER:t===ke.NULL?zi.NULL_CHARACTER:zi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(zi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Te.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xp.Attribute:xp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Te.DATA:{this._stateData(t);break}case Te.RCDATA:{this._stateRcdata(t);break}case Te.RAWTEXT:{this._stateRawtext(t);break}case Te.SCRIPT_DATA:{this._stateScriptData(t);break}case Te.PLAINTEXT:{this._statePlaintext(t);break}case Te.TAG_OPEN:{this._stateTagOpen(t);break}case Te.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Te.TAG_NAME:{this._stateTagName(t);break}case Te.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Te.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Te.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Te.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Te.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Te.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Te.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Te.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Te.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Te.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Te.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Te.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Te.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Te.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Te.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Te.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Te.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Te.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Te.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Te.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Te.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Te.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Te.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Te.COMMENT_START:{this._stateCommentStart(t);break}case Te.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Te.COMMENT:{this._stateComment(t);break}case Te.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Te.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Te.COMMENT_END:{this._stateCommentEnd(t);break}case Te.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Te.DOCTYPE:{this._stateDoctype(t);break}case Te.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Te.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Te.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Te.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Te.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Te.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Te.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Te.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Te.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Te.CDATA_SECTION:{this._stateCdataSection(t);break}case Te.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Te.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Te.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Te.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.TAG_OPEN;break}case ke.AMPERSAND:{this._startCharacterReference();break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitCodePoint(t);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case ke.AMPERSAND:{this._startCharacterReference();break}case ke.LESS_THAN_SIGN:{this.state=Te.RCDATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.RAWTEXT_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.SCRIPT_DATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Qm(t))this._createStartTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.EXCLAMATION_MARK:{this.state=Te.MARKUP_DECLARATION_OPEN;break}case ke.SOLIDUS:{this.state=Te.END_TAG_OPEN;break}case ke.QUESTION_MARK:{this._err(ht.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Te.BOGUS_COMMENT,this._stateBogusComment(t);break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ht.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Te.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Qm(t))this._createEndTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.GREATER_THAN_SIGN:{this._err(ht.missingEndTagName),this.state=Te.DATA;break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===ke.SOLIDUS?this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Qm(t)?(this._emitChars("<"),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Te.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Qm(t)?(this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===ke.SOLIDUS?(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(bc.SCRIPT,!1)&&mne(this.preprocessor.peek(bc.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])!==jt.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(FEt,jt.HTML)}clearBackToTableBodyContext(){this.clearBackTo($Et,jt.HTML)}clearBackToTableRowContext(){this.clearBackTo(LEt,jt.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]===B.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]===B.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 jt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case jt.SVG:{if(yne.has(r))return!1;break}case jt.MATHML:{if(bne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,AI)}hasInListItemScope(t){return this.hasInDynamicScope(t,DEt)}hasInButtonScope(t){return this.hasInDynamicScope(t,MEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case jt.HTML:{if(ZB.has(n))return!0;if(AI.has(n))return!1;break}case jt.SVG:{if(yne.has(n))return!1;break}case jt.MATHML:{if(bne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===jt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&xMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&gne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&gne.has(this.currentTagId);)this.pop()}}const _4=3;var Gf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gf||(Gf={}));const vne={type:Gf.Marker};class QEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(vne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gf.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(vne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gf.Element&&n.element===t)}}const zm={createDocument(){return{nodeName:"#document",mode:ad.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};zm.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(zm.isTextNode(n)){n.value+=t;return}}zm.appendChild(e,zm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&zm.isTextNode(i)?i.value+=t:zm.insertBefore(e,zm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function KEt(e){return e.name===wMe&&e.publicId===null&&(e.systemId===null||e.systemId===zEt)}function GEt(e){if(e.name!==wMe)return ad.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===VEt)return ad.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),qEt.has(n))return ad.QUIRKS;let i=t===null?HEt:kMe;if(xne(n,i))return ad.QUIRKS;if(i=t===null?OMe:WEt,xne(n,i))return ad.LIMITED_QUIRKS}return ad.NO_QUIRKS}const wne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},XEt="definitionurl",YEt="definitionURL",ZEt=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])),JEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:jt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:jt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:jt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:jt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:jt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:jt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:jt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:jt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:jt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:jt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:jt.XMLNS}]]),eCt=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])),tCt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function nCt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Wy.COLOR||i===Wy.SIZE||i===Wy.FACE)||tCt.has(t)}function SMe(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,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===jt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,jt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Pe.TEXT}switchToPlaintextParsing(){this.insertionMode=Pe.TEXT,this.originalInsertionMode=Pe.IN_BODY,this.tokenizer.state=Ta.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)===et.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==jt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ta.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ta.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ta.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ta.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 o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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,jt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,jt.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(et.HTML,jt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.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,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,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===zi.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===B.SVG&&this.treeAdapter.getTagName(n)===et.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===jt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,jt.HTML)}_processToken(t){switch(t.type){case zi.CHARACTER:{this.onCharacter(t);break}case zi.NULL_CHARACTER:{this.onNullCharacter(t);break}case zi.COMMENT:{this.onComment(t);break}case zi.DOCTYPE:{this.onDoctype(t);break}case zi.START_TAG:{this._processStartTag(t);break}case zi.END_TAG:{this.onEndTag(t);break}case zi.EOF:{this.onEof(t);break}case zi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return aCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Gf.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=Pe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Pe.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Pe.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Pe.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Pe.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Pe.IN_TABLE;return}case B.BODY:{this.insertionMode=Pe.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Pe.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Pe.AFTER_HEAD:Pe.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Pe.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Pe.IN_HEAD;return}break}}this.insertionMode=Pe.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Pe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Pe.IN_SELECT}_isElementCausesFosterParenting(t){return CMe.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 B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===jt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.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 jEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BAt(this,t);return}switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.IN_BODY:case Pe.IN_CAPTION:case Pe.IN_CELL:case Pe.IN_TEMPLATE:{TMe(this,t);break}case Pe.TEXT:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_TABLE_TEXT:{PMe(this,t);break}case Pe.IN_COLUMN_GROUP:{TI(this,t);break}case Pe.AFTER_BODY:{_I(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FAt(this,t);return}switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.TEXT:{this._insertCharacters(t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_COLUMN_GROUP:{TI(this,t);break}case Pe.AFTER_BODY:{_I(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case Pe.INITIAL:case Pe.BEFORE_HTML:case Pe.BEFORE_HEAD:case Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:case Pe.IN_BODY:case Pe.IN_TABLE:case Pe.IN_CAPTION:case Pe.IN_COLUMN_GROUP:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:case Pe.IN_CELL:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:case Pe.IN_TEMPLATE:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:{JB(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.AFTER_BODY:{bCt(this,t);break}case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{yCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Pe.INITIAL:{vCt(this,t);break}case Pe.BEFORE_HEAD:case Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:{this._err(t,ht.misplacedDoctype);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ht.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?UAt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{xCt(this,t);break}case Pe.BEFORE_HEAD:{kCt(this,t);break}case Pe.IN_HEAD:{Cf(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{ECt(this,t);break}case Pe.AFTER_HEAD:{ACt(this,t);break}case Pe.IN_BODY:{Nl(this,t);break}case Pe.IN_TABLE:{l1(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_CAPTION:{OAt(this,t);break}case Pe.IN_COLUMN_GROUP:{sq(this,t);break}case Pe.IN_TABLE_BODY:{AM(this,t);break}case Pe.IN_ROW:{TM(this,t);break}case Pe.IN_CELL:{CAt(this,t);break}case Pe.IN_SELECT:{LMe(this,t);break}case Pe.IN_SELECT_IN_TABLE:{TAt(this,t);break}case Pe.IN_TEMPLATE:{jAt(this,t);break}case Pe.AFTER_BODY:{RAt(this,t);break}case Pe.IN_FRAMESET:{IAt(this,t);break}case Pe.AFTER_FRAMESET:{DAt(this,t);break}case Pe.AFTER_AFTER_BODY:{LAt(this,t);break}case Pe.AFTER_AFTER_FRAMESET:{$At(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?QAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{wCt(this,t);break}case Pe.BEFORE_HEAD:{OCt(this,t);break}case Pe.IN_HEAD:{SCt(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{CCt(this,t);break}case Pe.AFTER_HEAD:{TCt(this,t);break}case Pe.IN_BODY:{CM(this,t);break}case Pe.TEXT:{hAt(this,t);break}case Pe.IN_TABLE:{_C(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_CAPTION:{SAt(this,t);break}case Pe.IN_COLUMN_GROUP:{EAt(this,t);break}case Pe.IN_TABLE_BODY:{e9(this,t);break}case Pe.IN_ROW:{MMe(this,t);break}case Pe.IN_CELL:{AAt(this,t);break}case Pe.IN_SELECT:{$Me(this,t);break}case Pe.IN_SELECT_IN_TABLE:{_At(this,t);break}case Pe.IN_TEMPLATE:{NAt(this,t);break}case Pe.AFTER_BODY:{BMe(this,t);break}case Pe.IN_FRAMESET:{PAt(this,t);break}case Pe.AFTER_FRAMESET:{MAt(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onEof(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.IN_BODY:case Pe.IN_TABLE:case Pe.IN_CAPTION:case Pe.IN_COLUMN_GROUP:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:case Pe.IN_CELL:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:{RMe(this,t);break}case Pe.TEXT:{pAt(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_TEMPLATE:{FMe(this,t);break}case Pe.AFTER_BODY:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{rq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===ke.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 Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:case Pe.TEXT:case Pe.IN_COLUMN_GROUP:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:{this._insertCharacters(t);break}case Pe.IN_BODY:case Pe.IN_CAPTION:case Pe.IN_CELL:case Pe.IN_TEMPLATE:case Pe.AFTER_BODY:case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{AMe(this,t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_TABLE_TEXT:{IMe(this,t);break}}}};function dCt(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):NMe(e,t),n}function fCt(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 hCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=cCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=pCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function pCt(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 mCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=ok(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===jt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function gCt(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 iq(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],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function vCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?ad.QUIRKS:GEt(t);KEt(t)||e._err(t,ht.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Pe.BEFORE_HTML}function wO(e,t){e._err(t,ht.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ad.QUIRKS),e.insertionMode=Pe.BEFORE_HTML,e._processToken(t)}function xCt(e,t){t.tagID===B.HTML?(e._insertElement(t,jt.HTML),e.insertionMode=Pe.BEFORE_HEAD):fE(e,t)}function wCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&fE(e,t)}function fE(e,t){e._insertFakeRootElement(),e.insertionMode=Pe.BEFORE_HEAD,e._processToken(t)}function kCt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.HEAD:{e._insertElement(t,jt.HTML),e.headElement=e.openElements.current,e.insertionMode=Pe.IN_HEAD;break}default:hE(e,t)}}function OCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?hE(e,t):e._err(t,ht.endTagWithoutMatchingOpenElement)}function hE(e,t){e._insertFakeElement(et.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Pe.IN_HEAD,e._processToken(t)}function Cf(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ta.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ta.RAWTEXT):(e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ta.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ta.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Pe.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Pe.IN_TEMPLATE);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:pE(e,t)}}function SCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Pe.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{pE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function Gv(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,ht.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ht.endTagWithoutMatchingOpenElement)}function pE(e,t){e.openElements.pop(),e.insertionMode=Pe.AFTER_HEAD,e._processToken(t)}function ECt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{Cf(e,t);break}case B.NOSCRIPT:{e._err(t,ht.nestedNoscriptInHead);break}default:mE(e,t)}}function CCt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Pe.IN_HEAD;break}case B.BR:{mE(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function mE(e,t){const n=t.type===zi.EOF?ht.openElementsLeftAfterEof:ht.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Pe.IN_HEAD,e._processToken(t)}function ACt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BODY:{e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=Pe.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,ht.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Cf(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:gE(e,t)}}function TCt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{gE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function gE(e,t){e._insertFakeElement(et.BODY,B.BODY),e.insertionMode=Pe.IN_BODY,EM(e,t)}function EM(e,t){switch(t.type){case zi.CHARACTER:{TMe(e,t);break}case zi.WHITESPACE_CHARACTER:{AMe(e,t);break}case zi.COMMENT:{JB(e,t);break}case zi.START_TAG:{Nl(e,t);break}case zi.END_TAG:{CM(e,t);break}case zi.EOF:{RMe(e,t);break}}}function AMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function TMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function _Ct(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function jCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function NCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_FRAMESET)}function RCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function ICt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,jt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function DCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),n||(e.formElement=e.openElements.current))}function MCt(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===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function LCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.tokenizer.state=Ta.PLAINTEXT}function $Ct(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1}function FCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(et.A);n&&(iq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UCt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(iq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function QCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function zCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==ad.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=Pe.IN_TABLE}function _Me(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jMe(e){const t=yMe(e,Wy.TYPE);return t!=null&&t.toLowerCase()===oCt}function VCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),jMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function HCt(e,t){e._appendElement(t,jt.HTML),t.ackSelfClosing=!0}function qCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function WCt(e,t){t.tagName=et.IMG,t.tagID=B.IMG,_Me(e,t)}function KCt(e,t){e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ta.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Pe.TEXT}function GCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function XCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function Sne(e,t){e._switchToTextParsing(t,Ta.RAWTEXT)}function YCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Pe.IN_TABLE||e.insertionMode===Pe.IN_CAPTION||e.insertionMode===Pe.IN_TABLE_BODY||e.insertionMode===Pe.IN_ROW||e.insertionMode===Pe.IN_CELL?Pe.IN_SELECT_IN_TABLE:Pe.IN_SELECT}function ZCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function JCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,jt.HTML)}function eAt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,jt.HTML)}function tAt(e,t){e._reconstructActiveFormattingElements(),SMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.MATHML):e._insertElement(t,jt.MATHML),t.ackSelfClosing=!0}function nAt(e,t){e._reconstructActiveFormattingElements(),EMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.SVG):e._insertElement(t,jt.SVG),t.ackSelfClosing=!0}function Ene(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function Nl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{BCt(e,t);break}case B.A:{FCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{ICt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{RCt(e,t);break}case B.LI:case B.DD:case B.DT:{MCt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{_Me(e,t);break}case B.HR:{qCt(e,t);break}case B.RB:case B.RTC:{JCt(e,t);break}case B.RT:case B.RP:{eAt(e,t);break}case B.PRE:case B.LISTING:{PCt(e,t);break}case B.XMP:{GCt(e,t);break}case B.SVG:{nAt(e,t);break}case B.HTML:{_Ct(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{Cf(e,t);break}case B.BODY:{jCt(e,t);break}case B.FORM:{DCt(e,t);break}case B.NOBR:{UCt(e,t);break}case B.MATH:{tAt(e,t);break}case B.TABLE:{zCt(e,t);break}case B.INPUT:{VCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{HCt(e,t);break}case B.IMAGE:{WCt(e,t);break}case B.BUTTON:{$Ct(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{QCt(e,t);break}case B.IFRAME:{XCt(e,t);break}case B.SELECT:{YCt(e,t);break}case B.OPTION:case B.OPTGROUP:{ZCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{Sne(e,t);break}case B.FRAMESET:{NCt(e,t);break}case B.TEXTAREA:{KCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?Sne(e,t):Ene(e,t);break}case B.PLAINTEXT:{LCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:Ene(e,t)}}function iAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Pe.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function rAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Pe.AFTER_BODY,BMe(e,t))}function sAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function aAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function oAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(et.P,B.P),e._closePElement()}function lAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function cAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function uAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function dAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function fAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(et.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function NMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function CM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{iq(e,t);break}case B.P:{oAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{sAt(e,t);break}case B.LI:{lAt(e);break}case B.DD:case B.DT:{cAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{uAt(e);break}case B.BR:{fAt(e);break}case B.BODY:{iAt(e,t);break}case B.HTML:{rAt(e,t);break}case B.FORM:{aAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{dAt(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:NMe(e,t)}}function RMe(e,t){e.tmplInsertionModeStack.length>0?FMe(e,t):rq(e,t)}function hAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function pAt(e,t){e._err(t,ht.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&CMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Pe.IN_TABLE_TEXT,t.type){case zi.CHARACTER:{PMe(e,t);break}case zi.WHITESPACE_CHARACTER:{IMe(e,t);break}}else xT(e,t)}function mAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_CAPTION}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_COLUMN_GROUP}function bAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.COLGROUP,B.COLGROUP),e.insertionMode=Pe.IN_COLUMN_GROUP,sq(e,t)}function yAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_TABLE_BODY}function vAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.TBODY,B.TBODY),e.insertionMode=Pe.IN_TABLE_BODY,AM(e,t)}function xAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function wAt(e,t){jMe(t)?e._appendElement(t,jt.HTML):xT(e,t),t.ackSelfClosing=!0}function kAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,jt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function l1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{vAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{Cf(e,t);break}case B.COL:{bAt(e,t);break}case B.FORM:{kAt(e,t);break}case B.TABLE:{xAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{yAt(e,t);break}case B.INPUT:{wAt(e,t);break}case B.CAPTION:{mAt(e,t);break}case B.COLGROUP:{gAt(e,t);break}default:xT(e,t)}}function _C(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:xT(e,t)}}function xT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,EM(e,t),e.fosterParentingEnabled=n}function IMe(e,t){e.pendingCharacterTokens.push(t)}function PMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function kO(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}}}function TAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):LMe(e,t)}function _At(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):$Me(e,t)}function jAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{Cf(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Pe.IN_TABLE,e.insertionMode=Pe.IN_TABLE,l1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Pe.IN_COLUMN_GROUP,e.insertionMode=Pe.IN_COLUMN_GROUP,sq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Pe.IN_TABLE_BODY,e.insertionMode=Pe.IN_TABLE_BODY,AM(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Pe.IN_ROW,e.insertionMode=Pe.IN_ROW,TM(e,t);break}default:e.tmplInsertionModeStack[0]=Pe.IN_BODY,e.insertionMode=Pe.IN_BODY,Nl(e,t)}}function NAt(e,t){t.tagID===B.TEMPLATE&&Gv(e,t)}function FMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):rq(e,t)}function RAt(e,t){t.tagID===B.HTML?Nl(e,t):_I(e,t)}function BMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Pe.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.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 _I(e,t)}function _I(e,t){e.insertionMode=Pe.IN_BODY,EM(e,t)}function IAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.FRAMESET:{e._insertElement(t,jt.HTML);break}case B.FRAME:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{Cf(e,t);break}}}function PAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Pe.AFTER_FRAMESET))}function DAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function MAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Pe.AFTER_AFTER_FRAMESET)}function LAt(e,t){t.tagID===B.HTML?Nl(e,t):NN(e,t)}function NN(e,t){e.insertionMode=Pe.IN_BODY,EM(e,t)}function $At(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function FAt(e,t){t.chars=Fs,e._insertCharacters(t)}function BAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function UMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==jt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function UAt(e,t){if(nCt(t))UMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===jt.MATHML?SMe(t):i===jt.SVG&&(iCt(t),EMe(t)),nq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function QAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){UMe(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)===jt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}et.AREA,et.BASE,et.BASEFONT,et.BGSOUND,et.BR,et.COL,et.EMBED,et.FRAME,et.HR,et.IMG,et.INPUT,et.KEYGEN,et.LINK,et.META,et.PARAM,et.SOURCE,et.TRACK,et.WBR;const zAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,VAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Cne={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function QMe(e,t){const n=eTt(e),i=tDe("type",{handlers:{root:HAt,element:qAt,text:WAt,comment:VMe,doctype:KAt,raw:XAt},unknown:YAt}),r={parser:n?new One(Cne):One.getFragmentParser(void 0,Cne),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),lk(r,Ih());const s=n?r.parser.document:r.parser.getFragment(),o=tEt(s,{file:r.options.file});return r.stitches&&yT(o,"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}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function zMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:zi.CHARACTER,chars:e.value,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function KAt(e,t){const n={type:zi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function GAt(e,t){t.stitches=!0;const n=tTt(e);if("children"in e&&"children"in n){const i=QMe({type:"root",children:e.children},t.options);n.children=i.children}VMe({type:"comment",value:{stitch:n}},t)}function VMe(e,t){const n=e.value,i={type:zi.COMMENT,data:n,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function XAt(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,HMe(t,Ih(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(zAt,"<$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 YAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))GAt(n,t);else{let i="";throw VAt.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 lk(e,t){HMe(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=Ta.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 HMe(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 ZAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,Ih(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ay.html;r===Ay.html&&n==="svg"&&(r=Ay.svg);const s=aEt({...e,children:[]},{space:r===Ay.svg?"svg":"html"}),o={type:zi.START_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:wT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function JAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&pEt.includes(n)||t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,yM(e));const i={type:zi.END_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:wT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ta.RCDATA||t.parser.tokenizer.state===Ta.RAWTEXT||t.parser.tokenizer.state===Ta.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ta.DATA)}function eTt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function wT(e){const t=Ih(e)||{line:void 0,column:void 0,offset:void 0},n=yM(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 tTt(e){return"children"in e?a1({...e,children:[]}):a1(e)}function nTt(e){return function(t,n){return QMe(t,{...e,file:n})}}const iTt="modulepreload",rTt=function(e){return"/"+e},Ane={},Ys=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=rTt(c),c in Ane)return;Ane[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":iTt,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(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var sTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,aTt=/[\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]/,oTt=/[\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]/,N4={Space_Separator:sTt,ID_Start:aTt,ID_Continue:oTt},ka={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.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==="‍"||N4.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 t9,Yl,wp,jI,ob,hf,To,aq,bE;var lTt=function(t,n){t9=String(t),Yl="start",wp=[],jI=0,ob=1,hf=0,To=void 0,aq=void 0,bE=void 0;do To=cTt(),fTt[Yl]();while(To.type!=="eof");return typeof n=="function"?n9({"":bE},"",n):bE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Bp();if(!ka.isHexDigit(n))throw Ts(Et());e+=Et()}return String.fromCodePoint(parseInt(e,16))}const fTt={start(){if(To.type==="eof")throw Gb();R4()},beforePropertyName(){switch(To.type){case"identifier":case"string":aq=To.value,Yl="afterPropertyName";return;case"punctuator":__();return;case"eof":throw Gb()}},afterPropertyName(){if(To.type==="eof")throw Gb();Yl="beforePropertyValue"},beforePropertyValue(){if(To.type==="eof")throw Gb();R4()},beforeArrayValue(){if(To.type==="eof")throw Gb();if(To.type==="punctuator"&&To.value==="]"){__();return}R4()},afterPropertyValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforePropertyName";return;case"}":__()}},afterArrayValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforeArrayValue";return;case"]":__()}},end(){}};function R4(){let e;switch(To.type){case"punctuator":switch(To.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=To.value;break}if(bE===void 0)bE=e;else{const t=wp[wp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,aq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")wp.push(e),Array.isArray(e)?Yl="beforeArrayValue":Yl="beforePropertyName";else{const t=wp[wp.length-1];t==null?Yl="end":Array.isArray(t)?Yl="afterArrayValue":Yl="afterPropertyValue"}}function __(){wp.pop();const e=wp[wp.length-1];e==null?Yl="end":Array.isArray(e)?Yl="afterArrayValue":Yl="afterPropertyValue"}function Ts(e){return NI(e===void 0?`JSON5: invalid end of input at ${ob}:${hf}`:`JSON5: invalid character '${WMe(e)}' at ${ob}:${hf}`)}function Gb(){return NI(`JSON5: invalid end of input at ${ob}:${hf}`)}function Tne(){return hf-=5,NI(`JSON5: invalid identifier character at ${ob}:${hf}`)}function hTt(e){console.warn(`JSON5: '${WMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function WMe(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 NI(e){const t=new SyntaxError(e);return t.lineNumber=ob,t.columnNumber=hf,t}var pTt=function(t,n,i){const r=[];let s="",o,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)){o=[];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&&o.indexOf(v)<0&&o.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 k=0;kv[k]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const k of y){const S=d(k,b);if(S!==void 0){let O=m(k)+":";c!==""&&(O+=" "),O+=S,w.push(O)}}let x;if(w.length===0)x="{}";else{let k;if(c==="")k=w.join(","),x="{"+k+"}";else{let S=`, +`+s;k=w.join(S),x=`{ +`+s+k+`, +`+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(!ka.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;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"&&yTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)RI(n,t+1);return}if(bS(e))for(const[n,i]of Object.entries(e)){if(bTt.has(n))throw new Error("ECharts option contains an unsafe key");RI(i,t+1)}}function vTt(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 xTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(wTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="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:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function OTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lgTt)throw new Error("ECharts option is too large");const n=STt(vTt(e));let i;try{i=KMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!bS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...bS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return bS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>bS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function ETt(){return I4??(I4=Ys(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function CTt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=GMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return ETt().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||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const ATt=p.memo(CTt);let _ne,jne=Promise.resolve(),TTt=0;function _Tt(){return _ne??(_ne=Ys(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Xn0bMahe.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))),_ne}function jTt(e){const t=jne.then(async()=>{const n=await _Tt(),i=`mermaid-diagram-${TTt+=1}`;return n.render(i,e)});return jne=t.then(()=>{},()=>{}),t}function NTt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),jTt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const RTt=p.memo(NTt),ITt="_SegmentedControl_1sl7d_1",PTt="_SegmentedControlOption_1sl7d_140",DTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:ITt,SegmentedControlOption:PTt,SegmentedControlThumb:DTt},dd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,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 k=y.offsetLeft;if(w-(x+k)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${k}px)`,b.scrollWidth>w){const S=w*.15,O=b.scrollLeft,A=y.offsetLeft,E=A+x;(AO+w-S)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);aNe({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||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(Oft,{ref:d,className:qi(r9.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":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},MTt=({children:e,...t})=>a.jsx(Tft,{className:r9.SegmentedControlOption,...t,onPointerEnter:SV,children:a.jsx("span",{className:"relative",children:e})});dd.Option=MTt;function LTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=_e("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(dd,{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:[a.jsx(dd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(dd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const $Tt=p.memo(LTt);function XMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const YMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function FTt(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 XMe(n==null?void 0:n.slice(9))}function ZMe(e){if(!e)return!1;try{const t=e.toLowerCase();return YMe.some(n=>t.includes(n))}catch{return!1}}function BTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(ZMe(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 YMe.some(s=>r.includes(s))}return!1}function UTt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=_e("conversation"),s=p.useContext(Nje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(XPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[wDe],rehypePlugins:n?[nTt,cne]:[cne],components:{pre:({node:f,children:h,...m})=>{const g=FTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx($Tt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(RTt,{source:b}):a.jsx(ATt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&qst(m);if(g)return a.jsx(Wst,{...s,path:g,children:h.children});if(m&&(ZMe(m)||BTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(BAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(JD,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Bo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Nd=p.memo(UTt);function P4(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownSource")}function JMe(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownCreator")}function QTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function zTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function VTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function HTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function kT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=_e("ui"),o=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(k=>k.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()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(VTt,{})})]}),t]})}),document.body)}function jC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function qTt(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 eLe=[".jpg",".jpeg",".png"].join(","),WTt=new Set(eLe.split(",")),tLe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),KTt=new Set(tLe.split(",")),GTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function XTt(e,t,n){return e.size>GTt?n("knowledge.errors.fileTooLarge"):t==="image"?WTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):KTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function oq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(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 YTt({region:e,onClose:t,onCreated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(""),[o,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:o.trim()||void 0,region:e};try{n(await Ibt(w))}catch(x){m(Sl(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(kT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.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)})]}),a.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")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(jC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function ZTt({item:e,onClose:t,onUpdated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Pbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Sl(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(kT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(jC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function nLe(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 JTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=_e("ui"),[s,o]=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,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),C=p.useRef(0),N=!!x;p.useEffect(()=>{var L;A&&!N&&((L=R.current)==null||L.focus())},[N,A]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),O(""),E(null),v(!1),C.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=XTt(L,s,r);if(F){g(null),c(""),d(""),O(F);return}g(L),O(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=nLe(y,r("knowledge.errors.metadataObject"))}catch(M){O(Sl(M,r("knowledge.errors.metadataFormat")));return}k(s==="web"?A?"save":"preview":"upload"),O("");try{if(s==="web")if(A){const M={sourceType:"url",metadata:A.metadata,url:A.preview.url,sourceTitle:A.preview.name,sourceMarkdown:A.preview.sourceMarkdown};await $bt(e.id,e.region,M),n()}else{const M=await Fbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Bbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof mM&&M.errorCode===cPe?i(M):O(Sl(M,r(s==="web"?A?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{k("")}},_=()=>{N||(E(null),O(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(kT,{title:r(A?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:A?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:A?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:A.preview.name,children:A.preview.name}),a.jsx("a",{href:A.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:A.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),S?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(jC,{message:S})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.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,F])=>a.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:()=>P(L),onKeyDown:M=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=H.indexOf(L),U=M.key==="Home"?H[0]:M.key==="End"?H[H.length-1]:H[(q+(M.key==="ArrowRight"?1:-1)+H.length)%H.length];P(U),requestAnimationFrame(()=>{var Z;return(Z=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:Z.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),O("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(on,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?eLe:tLe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(C.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),C.current=Math.max(0,C.current-1),C.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),C.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:oq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(on,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(jC,{message:S})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.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 e2t({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=_e("ui"),[s,o]=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=nLe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Sl(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await Ubt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Sl(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(kT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(jC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const iLe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),rLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),sLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),t2t=new Set(["pdf"]),n2t=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),i2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),r2t=new Set(["error","failed","unavailable"]);function Nne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function j_(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 s2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Nne);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>j_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[j_(s)])}}const n=Nne(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>j_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,j_(s)])}}function aLe(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 a2t(e){const t=aLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function o2t(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 iLe.has(i)?"image":rLe.has(i)?"audio":sLe.has(i)?"video":t2t.has(i)?"pdf":t||i?"file":"none"}function l2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(i2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(r2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||n2t.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:iLe.has(i)||rLe.has(i)||sLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function c2t({chunk:e}){const{t}=_e("ui"),[n,i]=p.useState(!1),r=aLe(e.attachmentUrl),s=o2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.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)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function u2t({base:e,item:t,onClose:n}){const{t:i}=_e("ui"),[r,s]=p.useState([]),[o,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),k=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const C=await Lbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(C.document.id?C.document:t),u(C.sourceMarkdown||C.document.sourceMarkdown),s(N=>E>0?[...N,...C.chunks]:C.chunks),b(C.hasMore)}catch(C){!a9(C)&&w.current===T&&y(Sl(C,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(k(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[k]);const S=a2t(o.url||t.url),O=l2t(o,i),A=o.metadata._veadk_content_format==="markdown";return a.jsx(kT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||S?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:oq(o.sizeBytes)}):null,S?a.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:O.title}),a.jsx("span",{children:S?i("knowledge.preview.openOriginalHint"):O.detail}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=s2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?A?a.jsx(Nd,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((C,N)=>a.jsx("th",{scope:"col",children:C},`${C}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((C,N)=>a.jsx("tr",{children:C.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(c2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void k(r.length),children:h?a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function d2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){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,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(!0),[j,T]=p.useState(!1),[R,C]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[H,q]=p.useState(""),[U,Z]=p.useState(!1),[z,J]=p.useState(!1),[ne,W]=p.useState(!1),[X,le]=p.useState(null),[V,Y]=p.useState(null),[K,ue]=p.useState(null),[te,Oe]=p.useState(null),[fe,pe]=p.useState(null),[Se,ve]=p.useState(!1),Le=p.useRef(0),He=p.useRef(0),Ge=p.useRef([]),De=p.useRef(!1),se=p.useRef(!1),ce=p.useRef(null),ye=p.useRef(null),Ae=p.useRef({}),Ee=p.useRef(!1),Ce=p.useRef(null),Be=p.useRef(null),he=p.useRef(null),ie=p.useRef(null),we=p.useMemo(()=>[t],[t]),Re=p.useCallback(We=>`${We.region}\0${We.id}`,[]),Ue=u.find(We=>Re(We)===b)??null,_t=!!(Ue&&H===Re(Ue));p.useEffect(()=>{r==null||r(!!Ue)},[r,Ue]),p.useEffect(()=>{w("overview"),O("")},[b]);const Pt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(vt=>[vt.name,vt.description,vt.ownerLabel,vt.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(We))):u},[u,x]),Gt=p.useMemo(()=>{const We=S.trim().toLocaleLowerCase();return We?N.filter(vt=>[vt.name,vt.id,l9(vt)].some(Ke=>Ke.toLocaleLowerCase().includes(We))):N},[S,N]);p.useEffect(()=>{Y(null)},[Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const St=p.useCallback(async(We=!1)=>{var ot;if(We&&(Ee.current||Object.keys(Ae.current).length===0))return;(ot=ce.current)==null||ot.abort();const vt=new AbortController;ce.current=vt;const Ke=Le.current+1;Le.current=Ke,Ee.current=!0,We?T(!0):E(!0),C(""),We||g([]);try{const it=await Rbt({regions:we,nextTokens:We?Ae.current:void 0,signal:vt.signal});if(Le.current!==Ke)return;d(Ct=>We?[...Ct,...it.items.filter(Ot=>!Ct.some(Bt=>Re(Bt)===Re(Ot)))]:it.items),Ae.current=it.nextTokens,h(it.nextTokens);const tt=it.failures.map(({region:Ct,error:Ot})=>`${Sh(Ct,e)}: ${Sl(Ot,l("common.loadFailed"))}`);g(Ct=>We?[...new Set([...Ct,...tt])]:tt),We||v(Ct=>it.items.some(Ot=>Re(Ot)===Ct)?Ct:"")}catch(it){if(a9(it))return;Le.current===Ke&&(We?g(tt=>[...new Set([...tt,Sl(it,l("knowledge.errors.loadMoreBases"))])]):C(Sl(it,l("knowledge.errors.loadBases"))))}finally{Le.current===Ke&&(Ee.current=!1,E(!1),T(!1))}},[Re,e,we,l]),Lt=p.useCallback(async(We,vt=!1)=>{var it;if(vt&&De.current)return;(it=ye.current)==null||it.abort();const Ke=new AbortController;ye.current=Ke;const ot=He.current+1;He.current=ot,vt||(Ge.current=[],se.current=!1,P([]),Z(!1),M("")),De.current=!0,D(!0),vt?M(""):L("");try{const tt=await Mbt(We.id,{region:We.region,offset:vt?Ge.current.length:0,signal:Ke.signal});if(He.current!==ot)return;q(Dt=>Dt===Re(We)?"":Dt);const Ct=Ge.current,Ot=vt?[...Ct,...tt.items.filter(Dt=>!Dt.id||!Ct.some(Ze=>Ze.id===Dt.id))]:tt.items,Bt=tt.hasMore&&(!vt||Ot.length>Ct.length);Ge.current=Ot,se.current=Bt,P(Ot),Z(Bt)}catch(tt){if(a9(tt))return;He.current===ot&&(tt instanceof mM&&tt.errorCode===cPe&&(q(Re(We)),le(Ot=>Ot&&Re(Ot)===Re(We)?null:Ot)),vt?M(Sl(tt,l("knowledge.errors.loadMoreData"))):L(Sl(tt,l("knowledge.errors.loadData"))))}finally{He.current===ot&&(De.current=!1,D(!1))}},[Re,l]);p.useEffect(()=>{var We;(We=ce.current)==null||We.abort(),Le.current+=1,Ee.current=!1,Ae.current={},d([]),h({}),g([]),v(""),q(""),C(""),E(!0)},[e]),p.useEffect(()=>{if(n)return St(),()=>{var We;(We=ce.current)==null||We.abort(),Le.current+=1,Ee.current=!1}},[n,i,St]),p.useEffect(()=>{var We,vt;if(!n){(We=ye.current)==null||We.abort(),He.current+=1,De.current=!1;return}if(!Ue){(vt=ye.current)==null||vt.abort(),He.current+=1,Ge.current=[],De.current=!1,se.current=!1,P([]),Z(!1),M("");return}return Lt(Ue),()=>{var Ke;(Ke=ye.current)==null||Ke.abort(),He.current+=1,De.current=!1}},[n,i,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const qe=n&&!Ue&&!x.trim()&&!A&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const We=Be.current,vt=Ce.current;if(!We||!vt||!qe)return;const Ke=new IntersectionObserver(([ot])=>{ot.isIntersecting&&St(!0)},{root:vt,rootMargin:"240px 0px",threshold:.01});return Ke.observe(We),()=>Ke.disconnect()},[qe,St]);const yt=()=>{const We=Ce.current;!We||!qe||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&St(!0)},je=!!(Ue&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const We=ie.current,vt=he.current;if(!Ue||!We||!vt||!je)return;const Ke=new IntersectionObserver(([ot])=>{ot.isIntersecting&&Lt(Ue,!0)},{root:he.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(We),()=>Ke.disconnect()},[je,Lt,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const kt=()=>{const We=he.current;if(!Ue||!We||!se.current||De.current||F)return;const{scrollHeight:vt,scrollTop:Ke,clientHeight:ot}=We;vt-Ke-ot<=240&&Lt(Ue,!0)},Tt=We=>{d(vt=>vt.map(Ke=>Re(Ke)===Re(We)?We:Ke))},fn=async()=>{if(te){ve(!0);try{await Dbt(te.id,te.region),d(We=>We.filter(vt=>Re(vt)!==Re(te))),q(We=>We===Re(te)?"":We),b===Re(te)&&v(""),Oe(null)}catch(We){C(Sl(We,l("knowledge.errors.deleteBase"))),Oe(null)}finally{ve(!1)}}},tn=async()=>{if(!(!Ue||!fe)){ve(!0);try{await Qbt(Ue.id,fe.id,Ue.region);const We=Ge.current.filter(vt=>vt.id!==fe.id);Ge.current=We,P(We),pe(null)}catch(We){L(Sl(We,l("knowledge.errors.deleteDocument"))),pe(null)}finally{ve(!1)}}};return a.jsxs("section",{className:`knowledge-library${Ue?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ue?a.jsx(dT,{className:"knowledge-library__detail",title:Ue.name,description:Ue.description||l("common.noDescription"),identitySeed:Ue.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(yH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Ue.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ue.providerKnowledgeId,children:Ue.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Ue.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Ue.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:qTt(Ue.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(fl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),_t&&Ue.canManage?a.jsx("button",{type:"button",onClick:()=>Oe(Ue),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void Lt(Ue),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(zTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Ue.canManage&&a.jsx("button",{type:"button",onClick:()=>le(Ue),children:l("knowledge.addFirstData")})]}):a.jsx(vH,{rows:Gt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>a.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>l9(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>oq(We.sizeBytes)}],searchValue:S,onSearchChange:O,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ue.canManage?{label:l(_t?"knowledge.associationInvalid":"knowledge.addData"),disabled:_t,title:_t?l("knowledge.providerMissing"):void 0,onClick:()=>le(Ue)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...Ue.canManage?[{label:l("common.edit"),onSelect:()=>ue(We)},{label:l("common.delete"),onSelect:()=>pe(We),danger:!0}]:[]],scrollRef:he,onScroll:kt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void Lt(Ue,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:ie,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Ue.canManage?a.jsxs(a.Fragment,{children:[a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Oe(Ue),children:l("common.delete")}),a.jsx(At,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:We=>k(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:Ce,"aria-live":"polite",onScroll:yt,children:[m.length>0&&!A&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void St(),children:l("common.retry")})]}),A&&u.length===0?a.jsx(fl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void St(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(QTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(zv,{children:[x.trim()?null:a.jsx(ab,{"aria-label":l("knowledge.createBase"),icon:a.jsx(HTt,{}),onClick:()=>J(!0),children:l("knowledge.createBase")}),Pt.map(We=>a.jsx(Hv,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(We.ownerLabel),title:P4(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:H===Re(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||H===Re(We),title:We.canManage?H===Re(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>le(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Re(We))}},Re(We)))]}),qe||j?a.jsx("div",{ref:Be,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):qe?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(YTt,{region:t,onClose:()=>J(!1),onCreated:We=>{d(vt=>[We,...vt]),v(Re(We)),J(!1)}}),Ue&&ne&&a.jsx(ZTt,{item:Ue,onClose:()=>W(!1),onUpdated:We=>{Tt(We),W(!1)}}),Ue&&V&&a.jsx(u2t,{base:Ue,item:V,onClose:()=>Y(null)}),X&&a.jsx(JTt,{base:X,onClose:()=>le(null),onAssociationInvalid:We=>{q(Re(X)),Ue&&Re(Ue)===Re(X)&&L(Sl(We,l("knowledge.associationInvalid"))),le(null)},onCreated:()=>{Ue&&Re(Ue)===Re(X)&&Lt(Ue),le(null)}}),Ue&&K&&a.jsx(e2t,{base:Ue,item:K,onClose:()=>ue(null),onUpdated:We=>{const vt=Ge.current.map(Ke=>Ke.id===We.id?We:Ke);Ge.current=vt,P(vt),ue(null)}}),te&&a.jsx(_d,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:te.name}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>Oe(null),onConfirm:()=>void fn()}),fe&&a.jsx(_d,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:fe.name||fe.id}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>pe(null),onConfirm:()=>void tn()})]})}const f2t="_EmptyMessage_1r5gu_1",h2t="_IconBadge_1r5gu_16",p2t="_Title_1r5gu_54",m2t="_Description_1r5gu_69",g2t="_ActionRow_1r5gu_77",OT={EmptyMessage:f2t,IconBadge:h2t,Title:p2t,Description:m2t,ActionRow:g2t},qn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:qi(OT.EmptyMessage,t),"data-fill":n,children:e}),b2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:qi(OT.IconBadge,i),"data-size":e,"data-color":t,children:n}),y2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:qi(OT.Title,t),"data-color":n,children:e}),v2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.Description,t),children:e}),x2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.ActionRow,t),children:e});qn.Icon=b2t;qn.Title=y2t;qn.Description=v2t;qn.ActionRow=x2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",Wme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Jwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const w2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Ed(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function Rne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function k2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Ah(e,t={},n=eo){return fetch(Na(`${w2t}${e}`),{...t,headers:oc(t.headers),signal:po(t.signal,n)})}async function lq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Ed(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Ed(r.detail,en("api.errorDetails")):r;return new c9(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])||en("api.missingContentType");return new c9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function lb(e,t){if(!e.ok)throw await lq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function O2t(e){return Array.isArray(e)?e.map(t=>{const n=Ed(t,en("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(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("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(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function S2t(e){if(e==null)return;const t=Ed(e,en("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"||!ED(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("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 NC(e){const t=Ed(e,en("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(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Ed(l,en("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(en("api.unknownTaskState"));const r=Rne(t.toolId,"Tool ID"),s=Rne(t.sessionId,"Session ID"),o=k2t(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}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:O2t(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:S2t(t.publication)}:{}}}async function _M(e){const t=Ed(await lb(await Ah("/capabilities",{signal:e}),en("api.loadCapability")),en("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 E2t(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 Ah(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},yr);return NC(await lb(i,en("api.startOptimization")))}const t=await Ah("/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},yr);return NC(await lb(t,en("api.startTask")))}async function C2t(e,t){return NC(await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Ed(await lb(await Ah(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("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(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Ed(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("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 M4(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},yr);return NC(await lb(t,en("api.refine")))}async function A2t(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return NC(await lb(t,en("api.stop")))}async function T2t(e){const t=await Ah(`/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 lq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Ed(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Ed(d.error,en("api.publishError"));throw new c9(typeof m.message=="string"?m.message:en("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(en("api.unknownPublishEvent"));const f=Ed(d.result,en("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"||!ED(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("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+=o.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function _2t(e){await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function j2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Ah(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},yr);if(!r.ok)throw await lq(r,en("api.download"));const o=((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=o,u.click()}finally{URL.revokeObjectURL(l)}}const oLe=p.createContext(void 0);function Xv(e){const t=p.useContext(oLe);if(t===void 0&&!e)throw new Error(Uc(47));return t}const N2t={...vje,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 R2t extends $D{constructor(n,i,r){const s=new uV;super(I2t(n,s,i,r),P2t(s),N2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===vu,s=i.reason===e1&&i.event.detail===0,o=!n&&(i.reason===R_e||i.reason==null),l=lst(i),c=this.select("activeTriggerId");if(!n&&i.reason===N_e&&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};uje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Mit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===fC&&(d="focus"),this.set("instantType",d)})}}function I2t(e,t,n,i=!1){const r={...gje(),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=bje(t,n,i),r}function P2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Qu,triggerElements:e}}function Ine({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=M2t(l,{modal:o,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),mje(d,f),fje(d);const{forceUnmount:g}=hje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,pa(I_e))}),[g,d]);const b=f||h;return a.jsxs(oLe.Provider,{value:d,children:[l&&a.jsx(cje,{handle:l,store:d}),b&&a.jsx(L2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function D2t(e){return Xv(!0)?a.jsx(Ine,{props:e}):a.jsx(mrt,{children:a.jsx(Ine,{props:e})})}function M2t(e,t){const n=lje((i,r)=>new R2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function L2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=H_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return pje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const $2t=300;function nm(e){return KA(e,"base-ui")}function F2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});const o=fit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&aw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});let c=dit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=eV(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function B2t(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 lLe(e,t){const n=oi((s,o)=>{(typeof e=="function"?e():e)||t(o||(zD?"touch":""))}),{onClick:i,onPointerDown:r}=B2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const U2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=$2t,closeDelay:h=0,id:m,...g}=t,b=Xv(!0),y=xje(c)??b;if(!y)throw new Error(Uc(74));const w=nm(m),x=y.useState("isTriggerActive",w),k=y.useState("floatingRootContext"),S=y.useState("isOpenedByTrigger",w),O=y.useState("triggerPopupId",w),A=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=dje(w,A,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),C=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=mst(k,{enabled:!o&&d&&(C!=="touch"||T!==e1),mouseOnly:!0,move:!1,handleClose:yst(),restMs:f,delay:{close:h},triggerElementRef:A,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=V_e(k,{stickIfOpen:R}),D=lLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=WD({disabled:o,native:l}),M={open(ne){return ne&&T===e1?Rst.open(ne):Sje.open(ne)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=F2t(y,A),z=Da("button",t,{state:{disabled:o,open:S},ref:[F,n,E,A],props:[I.reference,P,_,D,{[aV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":O},g,L],stateAttributesMapping:M}),J=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(lv,{ref:H,onFocus:q}),J,a.jsx(lv,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):J}),cLe=p.createContext(void 0);function Q2t(){const e=p.useContext(cLe);if(e===void 0)throw new Error(Uc(45));return e}const z2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Xv().useState("mounted")||i?a.jsx(cLe.Provider,{value:i,children:a.jsx(L_e,{ref:n,...r})}):null}),uLe=p.createContext(void 0);function V2t(){const e=p.useContext(uLe);if(!e)throw new Error(Uc(46));return e}const dLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`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 a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Pne={},Dne={},Mne="";function jM(e,t){return HA(e)?e:t}function Lne(e,t,n){return/hidden|clip/.test(e.getComputedStyle(jM(t,n)).overflowY)}function H2t(e){if(typeof document>"u")return!1;const t=Cr(e);return ea(t).innerWidth-t.documentElement.clientWidth>0}function q2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Cr(e),i=n.documentElement,r=n.body,s=jM(i,r),o=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=o,i.style.scrollbarGutter=l,c===u}function W2t(e){const t=Cr(e),n=t.documentElement,i=t.body,r=jM(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 K2t(e){var m;const t=Cr(e),n=t.documentElement,i=t.body,r=ea(n);let s=0,o=0,l=!1;const c=Cc.create();if(q1&&(((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,o=n.scrollLeft,Pne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Mne=n.style.scrollBehavior,Dne={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,k=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",O=g.overflowX==="scroll"||b.overflowX==="scroll",A=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=jM(n,i);if(l=q2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||S)&&(n.style.overflowY="scroll"),(k||O)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||A?`calc(100vw - ${T+A}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Pne),Object.assign(i.style,Dne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Mne)}function f(){d(),c.request(u)}u();const h=Di(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class G2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Qu.create());Zt(this,"timeoutUnlock",Qu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(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=Cr(t),i=n.documentElement,r=n.body,s=ea(i);if(Lne(s,i,r)){const l=new s.MutationObserver(()=>{Lne(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 o=zD||!H2t(t);this.restore=o?W2t(t):K2t(t)}}const X2t=new G2t;function fLe(e=!0,t=null){ti(()=>{if(e)return X2t.acquire(t)},[e,t])}const Y2t=20;function Z2t(e,t,n,i){const[r,s]=p.useState(!1);ti(()=>{if(!e||!t||n==null){s(!1);return}const o=Cr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-Y2t)},[e,t,n]),fLe(e&&(!t||r),i)}const J2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,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=Qit,...w}=t,x=Xv(),k=Q2t(),S=hrt(),O=x.useState("floatingRootContext"),A=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),C=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=sV(N),F=Est({anchor:o,floatingRootContext:O,positionMethod:l,mounted:A,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:k,nodeId:S,collisionAvoidance:y,adaptiveOrigin:D}),M=O.useState("domReferenceElement");ti(()=>{const z=M,J=_.current;if(z&&(_.current=z),J&&z&&z!==J){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=R===!0&&j!==vu;Z2t(E&&H,C==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},Z=Ist(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!A,inert:!E});return a.jsxs(uLe.Provider,{value:F,children:[A&&H&&a.jsx(dLe,{inert:rV(!E),cutout:T}),a.jsx(prt,{id:S,children:Z})]})}),e_t="ArrowUp",t_t="ArrowDown",n_t="ArrowLeft",i_t="ArrowRight",r_t="Home",s_t="End",hLe=new Set([e_t,t_t,n_t,i_t,r_t,s_t]),a_t=p.createContext(void 0);function o_t(e){return p.useContext(a_t)}const l_t=p.createContext(void 0);function c_t(){const[e,t]=p.useState(0),n=oi(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const u_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Xv(),d=V2t(),f=o_t()!=null,{context:h,hasClosePart:m}=c_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),k=u.useState("descriptionElementId"),S=u.useState("modal"),O=u.useState("mounted"),A=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),C=u.useState("openOnHover"),N=u.useState("closeDelay");WA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),hst(j,{enabled:C&&!R,closeDelay:N});const P=o===void 0?oje(u.context.popupRef):o,I=S!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Da("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...aje,"aria-labelledby":x,"aria-describedby":k,onKeyDown(F){f&&hLe.has(F.key)&&F.stopPropagation()}},Cje(y),c],stateAttributesMapping:Eje});return a.jsx(z_e,{context:j,openInteractionType:b,modal:I,disabled:!O||A===vu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Zs(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(l_t.Provider,{value:h,children:L})})}),d_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Da("h2",t,{ref:n,props:[{id:c},o]})}),f_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Da("p",t,{ref:n,props:[{id:c},o]})});function $ne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.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 h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.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 cq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.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"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.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 y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.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"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function v_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.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 a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.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"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function x_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function w_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Bne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function ck(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function k_t({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),o=W2e,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 a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(D2t,{open:i,onOpenChange:r,children:[a.jsxs(U2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(ck,{className:"development-token-chevron"})]}),a.jsx(z2t,{children:a.jsx(J2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(u_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(d_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(f_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function uq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.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 NM({kind:e,...t}){return e==="thinking"?a.jsx(uq,{...t}):a.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"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.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 O_t({blocks:e,active:t,status:n,render:i}){const{t:r}=_e("adk"),[s,o]=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"?K2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(ck,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{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?a.jsx(on,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.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:W2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function S_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=_e("adk"),s=snt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(O_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"thinking"})}),a.jsx(on,{children:c||r("developmentRuns.processing")})]})]})}const E_t={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 C_t(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 A_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function T_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dq(e,t){if(A_t(e))return C_t(t,e.path);if(T_t(e)){const n=E_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=dq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function __t(e,t){const n=dq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const pLe=new Map;function Yv(e,t){pLe.set(e,t)}function j_t(e){return pLe.get(e)}function N_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sdq(i,e.dataModel),resolveString:i=>__t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=j_t(r.component)??R_t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function gLe(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 RM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=_e("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(gC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Bo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Bje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Bo,{})}):null]}):null]})}function fq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function bLe(e){var n,i,r,s;const t=fq(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 yLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function vLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?bTe(t,e.uri):""}function P_t({kind:e}){return e==="image"?a.jsx(yV,{}):e==="video"?a.jsx(Qje,{}):e==="pdf"?a.jsx(Lat,{}):a.jsx(gV,{})}function IM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=fq(l.mimeType),u=vLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Hje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(P_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:bLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):yLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(aE,{className:"media-card-open"}):null]});return a.jsxs(_r.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?a.jsx(BAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Bo,{})}):null]},l.id)})}),a.jsx(uf,{children:s?a.jsx(D_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function D_t({appName:e,item:t,onClose:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>vLe(t,e),[e,t]),s=fq(t.mimeType),[o,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]),a.jsx(_r.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:a.jsxs(_r.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:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[bLe(t),t.sizeBytes?` · ${yLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(JD,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Bo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Vi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(Nd,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function M_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=_e("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(on,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(ck,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Mu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Hn(e){return typeof e=="string"?e:""}function Une(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function fd(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Mu(t)??{};return Mu(n.result)??n}function PM(e){if(typeof e=="string")try{return PM(JSON.parse(e))}catch{return e}const t=Mu(e);if(!t)return"";const n=Mu(t.result);return Hn(t.error)||Hn(t.message)||Hn(n==null?void 0:n.error)||Hn(n==null?void 0:n.message)}function L_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Mu(e.metadata),n=Hn(t==null?void 0:t.source_type).toLowerCase(),i=Hn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const xLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function $_t(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 F_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function B_t(e,t=xLe){const n=u9(e),i=Mu(n.capabilities)??{},r=fd(n.resources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Hn(l.ref),kind:c,category:L_t(l),name:Hn(l.name)||Hn(l.ref)||t.unnamedResource,description:Hn(l.description),source:Hn(l.source),version:Hn(l.version)}]}),s=fd(n.sources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=Hn(l.source),u=Hn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:F_t(c),label:$_t(c,t),status:d,count:Une(l.count),message:Hn(l.message),searchKeywords:fd(l.search_keywords).map(Hn).filter(Boolean)}]});return{collectionId:Hn(n.collection_id),capabilities:{googleAdkVersion:Hn(i.google_adk_version),agentTypes:fd(i.agent_types).map(Hn).filter(Boolean),maxOrchestrationDepth:Une(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function U_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function wLe(e,t,n=xLe){const i=u9(e),r=u9(t),s=new Map(fd(r.results).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=fd(i.agents).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Hn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Hn(d.name),h=fd(d.nodes).flatMap(A=>{const E=Mu(A);return E?[E]:[]}),m=Hn(d.root_node),g=h.find(A=>Hn(A.id)===m),b=h.filter(A=>Hn(A.id)!==m).map(A=>({id:Hn(A.id)||n.unnamedAgent,type:Hn(A.type)||"llm",description:Hn(A.description)})),v=s.get(f),y=Hn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=Qne(v==null?void 0:v.resources),k=x.length>0?x:Qne(h.flatMap(A=>fd(A.resources))),S=zne(v==null?void 0:v.python_tools),O=S.length>0?S:zne(h.flatMap(A=>fd(A.python_tools)));return{name:f,description:Hn(v==null?void 0:v.description)||Hn(g==null?void 0:g.description)||Hn(d.task),task:Hn(d.task),rootType:Hn(v==null?void 0:v.root_type)||Hn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:k.length,pythonToolCount:O.length,skills:k.filter(A=>A.kind==="skill"),knowledgeBases:k.filter(A=>A.kind==="knowledge_base"),builtinTools:k.filter(A=>A.kind==="tool"),pythonTools:O,subAgents:b,status:w,output:Hn(v==null?void 0:v.output),error:Hn(v==null?void 0:v.error)}});return{collectionId:Hn(r.collection_id)||Hn(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 Q_t(e,t){return!!PM(t)||wLe(e,t).failedCount>0}function Qne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Hn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Hn(i==null?void 0:i.name)||l[l.length-1]||r,description:Hn(i==null?void 0:i.description),version:Hn(i==null?void 0:i.version),source:Hn(i==null?void 0:i.source)}]})}function zne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i==null?void 0:i.name),s=Hn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Hn(i.description),code:s,entrypoint:Hn(i.entrypoint)||r,dependencies:fd(i.dependencies).map(Hn).filter(Boolean)}])})}function z_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(Nd,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function V_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=_e("conversation"),s=p.useMemo(()=>Kje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.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:()=>l(u),children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(z_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(At,{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 kLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const OLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function H_t(){return p.useContext(OLe)}function q_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=oi(r),[,o]=p.useState(!1),l=Td(K_t).current,c=Td(W_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=oi(()=>{d.current||(d.current=!0,o(S=>!S))}),g=oi((S,O)=>{c.set(S,O),m()}),b=oi(S=>{c.delete(S),m()}),v=oi(S=>{const O=new Map;return n.current.length=0,i&&(i.current.length=0),S.forEach(A=>{var E,j;O.set(A.element,{...A.registration.metadata??{},index:A.index}),n.current[A.index]=A.element,i&&(i.current[A.index]=A.registration.label!==void 0?A.registration.label:((j=(E=A.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??A.element.textContent)}),u.current=n.current.length,O});function y(S){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||S.length<2)return;const O=new MutationObserver(j=>{if(!Y_t(j))return;let T=null;for(const R of S)if(R.isConnected){if(T&&SLe(T,R)>0){O.disconnect(),m();return}T=R}});h.current=O;const A=new Set;for(let j=1;jO.observe(j,{childList:!0}))}const w=oi(()=>{const[S,O]=G_t(c),A=v(S);y(O),f.current=S,d.current=!1,l.forEach(E=>E(A)),s(A)});ti(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),ti(()=>{d.current&&w()}),ti(()=>()=>{var S;(S=h.current)==null||S.disconnect(),d.current=!0},[]);const x=oi(S=>(l.add(S),()=>{l.delete(S)})),k=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(OLe.Provider,{value:k,children:t})}function W_t(){return new Map}function K_t(){return new Set}function G_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>SLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function X_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Y_t(e){for(const t of e)for(let n=0;nnull},ALe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,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]=kLe({controlled:h,default:v,name:"Accordion",state:"value"}),k=oi((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(C=>C!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),S=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),O=p.useMemo(()=>({disabled:s,handleValueChange:k,hiddenUntilFound:o??!1,keepMounted:l??!1,state:S,value:w}),[s,k,o,l,S,w]),A=Da("div",t,{state:S,ref:n,props:b,stateAttributesMapping:Z_t});return a.jsx(ELe.Provider,{value:O,children:a.jsx(q_t,{elementsRef:y,children:A})})});function J_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=kLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=sje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=oi(b=>{const v=!s,y=pa(e1,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const TLe=p.createContext(void 0);function _Le(){const e=p.useContext(TLe);if(e===void 0)throw new Error(Uc(15));return e}function ejt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=H_t(),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&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return ti(()=>{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 jLe=p.createContext(void 0);function hq(){const e=p.useContext(jLe);if(e===void 0)throw new Error(Uc(9));return e}let pq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),tjt=function(e){return e.panelOpen="data-panel-open",e}({});const njt={[pq.open]:""},ijt={[pq.closed]:""},rjt={open(e){return e?{[tjt.panelOpen]:""}:null}},sjt={open(e){return e?njt:ijt}};let ajt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const mq={...sjt,index:e=>({[ajt.index]:String(e)}),...qD,value:()=>null},NLe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=ejt(),h=Jw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=CLe(),y=nm(),w=l??y,x=r||m,k=v.indexOf(w)!==-1,S=oi((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),O=J_t({open:k,onOpenChange:S,disabled:x}),A=p.useMemo(()=>({open:O.open,disabled:O.disabled,transitionStatus:O.transitionStatus}),[O.open,O.disabled,O.transitionStatus]),E=p.useMemo(()=>({...O,onOpenChange:S,state:A}),[O,A,S]),j=p.useMemo(()=>({...b,hidden:!k&&!O.mounted,index:f,disabled:x,open:k}),[O.mounted,x,f,k,b]),T=nm(),[R,C]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:k,state:j,setTriggerId:C,triggerId:N}),[T,k,j,C,N]),I=Da("div",t,{state:j,ref:h,props:u,stateAttributesMapping:mq});return a.jsx(TLe.Provider,{value:E,children:a.jsx(jLe.Provider,{value:P,children:I})})}),RLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=hq();return Da("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:mq})}),ILe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=_Le(),g=i||m,{getButtonProps:b,buttonRef:v}=WD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=hq(),k=s||void 0,S=k??y;return ti(()=>(x(E=>k??(E===null?void 0:E)),()=>{x(E=>E===k?null:E)}),[k,x]),Da("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:S,onClick:h},u,b],stateAttributesMapping:rjt})}),OO={height:void 0,width:void 0};function ojt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(OO),b=p.useRef(OO),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,k]=p.useState(!1),S=p.useRef(null),O=Jw(t,f),A=Gl(l),E=sV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),C=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=oi((F,M=!0)=>{M&&(b.current=F),g(F)}),I=oi(()=>{var F;(F=S.current)==null||F.call(S),S.current=null}),D=oi(F=>{I(),S.current=()=>{S.current=null,F()}}),_=oi(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});ti(()=>{!x||d==="starting"||k(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),ti(()=>{const F=f.current;if(!F)return;!l&&S.current&&I();const M=ljt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=z0(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(z0(F)),k(!0);return}if(M==="css-transition"){const J=cjt(F);if(P(z0(F)),!U)return J;const ne=N_(F,"transition-duration","0s");return D(ne),k(!0),J}P(z0(F));const Z=N_(F,"animation-name","none");if(!U){Z();return}const z=N_(F,"animation-duration","0s");Z(),D(z),k(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(OO,!1),c(!1);return}P(z0(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const H=z0(F);if(!(H.height>0||H.width>0)){c(!1);return}P(H),M==="css-animation"&&N_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),WA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(OO,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let H=-1;function q(){A.current||(c(!1),P(OO,!1))}return H=Cc.request(()=>{E(q,M.signal)}),()=>{Cc.cancel(H),M.abort()}},[A,s,l,T,E,P,c]),ti(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function H(q){const U=pa(__e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Di(M,"beforematch",H)},[o,u]);const L=r||n||s||l;return{height:C.height,props:{...N?{[pq.startingStyle]:""}:void 0,hidden:j,id:i},ref:O,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:C.width}}function z0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ljt(e,t){const n=ea(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Vne(n.animationDuration),r=Vne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Vne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function N_(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 cjt(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=Cc.request(n);return()=>{Cc.cancel(i),n()}}let Hne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const PLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=CLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=_Le(),k=r??d,S=s??f,O=o||void 0,A=o??h;ti(()=>(w(M=>O??(M===null?void 0:M)),()=>{w(M=>M===O?null:M)}),[O,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:C,transitionStatus:N,width:P}=ojt({externalRef:n,hiddenUntilFound:k,id:A,keepMounted:S,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=hq(),_={...I,transitionStatus:N},L=v_e(c,_),F=Da("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Hne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Hne.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mq});return C?F:null}),ujt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=djt(i,n.getBoundingClientRect()),s=fjt(i,r),o=hjt(t.getBoundingClientRect());return mjt([...s,...o])};function djt(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 fjt(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 hjt(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 pjt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function mjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),gjt(t)}function gjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.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 bjt="_Transition_1wdpp_1",yjt="_Popover_1wdpp_3",DLe={Transition:bjt,Popover:yjt},MLe=p.createContext(null),DM=()=>{const e=p.use(MLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},Dg=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=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);OV(()=>v(!1),b?500:null);const y=nb(t),w=nb(A=>{var E,j;clearTimeout(f.current),g!==A&&(A||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,A),o(A),n&&v(A))}),x=p.useCallback(A=>{w.current(A)},[w]),k=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),S=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const O=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:k,onTriggerLeave:S,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,k,S]);return a.jsx(MLe,{value:O,children:a.jsx(LRe,{open:g,onOpenChange:x,modal:!1,children:r})})},vjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=DM(),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&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx($Re,{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})},LLe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=DM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=cNe(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]),a.jsx(BRe,{forceMount:!0,ref:g,className:qi(DLe.Popover,d),style:Fv({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},xjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=DM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ujt(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(!o)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=!pjt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=cNe(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]),a.jsx(LLe,{...e})},wjt=e=>{const{open:t,showOnHover:n,setOpen:i}=DM();return iT(t,()=>{i(!1)}),a.jsx(FRe,{forceMount:!0,children:a.jsx(ek,{enterDuration:600,exitDuration:300,className:DLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(xjt,{...e},"popover-hover"):a.jsx(LLe,{...e},"popover"))})})};Dg.Trigger=vjt;Dg.Content=wjt;const kjt=["skill_hub","skill_space","knowledge_base","tool"];function $Le(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function FLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function Ojt(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 L4({label:e,resources:t}){const{t:n}=_e("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:Ojt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function Sjt({tools:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(ALe,{children:e.map((n,i)=>a.jsxs(NLe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(RLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(ILe,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx($Le,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(PLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ejt({agents:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function R_({label:e,count:t,icon:n,children:i}){const{t:r}=_e("conversation"),s=a.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,a.jsx("span",{children:t})]});return t===0?s:a.jsxs(Dg,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx(Dg.Trigger,{children:s}),a.jsx(Dg.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function Cjt({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(()=>B_t(e,i),[i,e]),s=p.useMemo(()=>kjt.map(c=>{const u=U_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?PM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(FLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(ALe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(NLe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(RLe,{className:"create-agent-card__accordion-header",children:a.jsxs(ILe,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Za,{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}),a.jsx($Le,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(PLe,{className:"create-agent-card__accordion-content",children:a.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?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Za,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.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=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Ajt({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(()=>wLe(e,t,r),[e,r,t]),o=n==="failed"?PM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.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"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(xH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(wH,{leading:a.jsx(r1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(kH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(R_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(mN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(R_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(vIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(R_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(bat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(Sjt,{tools:l.pythonTools})]}),a.jsx(R_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(vat,{"aria-hidden":"true"}),children:a.jsx(Ejt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(FLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Tjt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:$ne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:$ne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:y_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:x_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:w_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Bne},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:Bne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:h_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:cq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:p_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:m_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:g_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:b_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:v_t,detailRenderer:Cjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Fne,detailRenderer:Ajt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Fne,detailRenderer:V_t,hideHeader:!0}};function gq(e){return Tjt[e]}function _jt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function jjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Njt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function _b(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function BLe(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function Rjt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function Ijt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function ST(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Pjt(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.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 Djt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function ULe(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Mjt=p.lazy(()=>Ys(()=>Promise.resolve().then(()=>EFe),void 0)),Ljt=p.lazy(()=>Ys(()=>import("../chunks/CodeDiffEditor-DwCjEhR1.js"),[])),QLe="veadk-code-workspace-theme";function $jt(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,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Fjt(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 Bjt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(QLe)==="dark"?"dark":"light"}catch{return"light"}}function Ujt(e){return e===""?0:e.split(` +`).length}function c1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=_e("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Bjt),m=p.useMemo(()=>s?Njt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),k=p.useMemo(()=>$jt(g),[g]),S=g.find(P=>P.path===v)??null,O=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(QLe,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],H=F[F.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=P,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 A(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Fjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const H=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(H)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>A(L),"aria-expanded":!M,children:[a.jsx(Ijt,{className:M?"":"is-open"}),a.jsx(Rjt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!S||s||i({...e,files:e.files.map(I=>I.path===S.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",C=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return vi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(BLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Djt,{}):a.jsx(Pjt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(ST,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(k,0,""):a.jsx("div",{className:"code-browser-empty",children:C})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:S?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:S.path.split("/").pop()}),E(O==null?void 0:O.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(S==null?void 0:S.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:S?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:O?a.jsx(Ljt,{before:O.before,after:O.after,path:O.path,theme:f}):a.jsx(Mjt,{value:S.content,path:S.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:C})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:S?o("codeBrowser.lineCount",{count:Ujt(S.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Qjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=_e("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(BLe,{}),a.jsx("span",{children:l})]}),a.jsx(c1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const dy="••••••••",I_=5,V0=8e3,zjt=8,Vjt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,zLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,VLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,HLe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Hjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),qjt=new Set(["web_search","search","grep","rg"]),Wjt=new Set(["read_file","read","list_files","glob","ls"]),Kjt=new Set(["apply_patch","file_change","fileChange"]),Gjt=new Set(["create_goal","update_goal","get_goal"]);function yg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function hv(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function II(e){const t=yg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=yg(t[i]);r&&n.push(r)}return n}function yE(e,...t){return hv(...e.flatMap(n=>t.map(i=>n[i])))}function Xjt(e){let t=e.replace(zLe,"").replace(VLe,"").replace(HLe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${dy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${dy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,dy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${dy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${dy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${dy}`)),t}function tf(e){return Xjt(e).replace(zLe,"").replace(VLe,"").replace(HLe,"")}function PI(e,t=0,n=new WeakSet){if(t>=zjt)return"[truncated: maximum depth]";if(typeof e=="string")return tf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>PI(r,t+1,n));const i=yg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Vjt.test(r)?dy:PI(s,t+1,n)])):e}function B4(e){const t=tf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>V0*2?{text:t.slice(0,V0)+t.slice(-V0),head:[t.slice(0,V0)],tail:[t.slice(-V0)],omittedLines:0,omittedCharacters:t.length-V0*2}:n.length<=I_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,I_),tail:n.slice(-I_),omittedLines:n.length-I_*2,omittedCharacters:0}}function Yjt(e){return Gjt.has(e)?"goal":Hjt.has(e)?"command":qjt.has(e)||/search/i.test(e)?"search":Wjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Kjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Zjt(e,t){if(e.status)return e.status;const n=hv(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=yg(t),i=hv(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Jjt(e,t,n,i,r){const s=[...II(n),...II(i)];return e==="goal"?tf(yE(s,"objective","title","name")):e==="command"?tf(yE(s,"command","cmd","script","commandPreview","binary")):e==="search"?tf(yE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(tf).join(", "):tf(e==="mcp"?hv(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):hv(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function bq(e){const t=yg(e.args),n=yg(e.response),i=e.args===void 0?void 0:PI(e.args),r=e.response===void 0?void 0:PI(e.response),s=[...II(e.args),...II(e.response)],o=Yjt(e.name),l=Zjt(e,n),c=yg(n==null?void 0:n.display)??yg(t==null?void 0:t.display),u=hv(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Jjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?tf(hv(yE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&tf(yE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(tf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(Wne(i)),rawResponsePreview:r===void 0?void 0:B4(Wne(r))}}function Wne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Pd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function eNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function qLe(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function tNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function nNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function iNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function rNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Gne(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function yq(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function WLe(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function sNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function aNt(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function oNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const lNt={goal:Gne,command:eNt,read:qLe,search:tNt,"file-change":nNt,mcp:iNt,authorization:rNt,generic:Gne};function cNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function KLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function uNt({status:e}){return e==="running"||e==="queued"?a.jsx(aNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(sNt,{className:"tool-activity__status-icon"}):a.jsx(WLe,{className:"tool-activity__status-icon"})}function dNt({presentation:e,callId:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:KLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(yq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(oNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(Xne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(Xne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function Xne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=_e("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` +`))??KLe(t),n&&n.omittedCharacters>0?` ${s("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})} ${n.tail.join(` `)}`:n&&n.omittedLines>0?` ${s("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]})]})}function dNt({presentation:e}){const{t}=Te("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` +`)}`:""]})]})}function fNt({presentation:e}){const{t}=_e("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` `),n.omittedCharacters>0?` `+t("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})+` `+n.tail.join(` `):n.omittedLines>0?` ${t("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]}):null}function qLe({input:e,children:t}){const{t:n}=Te("conversation"),i=bq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=oNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":lNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(cNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(yq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(dNt,{presentation:i}),t,a.jsx(uNt,{presentation:i,callId:e.callId})]})})})]})}function fNt({items:e}){const{t}=Te("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(zLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(VLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>bq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(yq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(qLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const WLe="send_a2ui_json_to_client",hNt=28,pNt=3e3;function mNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function gNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function KLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=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=o.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&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.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 bNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.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 yNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function vNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function xNt({activity:e}){const{t}=Te("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function f9(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 GLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` -`).trimStart().split(/\n{2,}/).map(b=>b.replace(/[^\S\n]*\n[^\S\n]*/g,(v,y,w)=>{const x=w[y-1]??"",O=w[y+v.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` - -`),h=KLe(f,!t||r,s),{ref:m,onScroll:g}=hLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(cn,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(qA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function XLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:"thinking-logo is-active"})}),a.jsx(cn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function wNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=Te("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[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,k]=p.useState(null),S=new Date(e.validatedAt),E=e.validatedAt?Number.isNaN(S.getTime())?e.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>k(null),pNt);return()=>window.clearTimeout(N)},[O]);async function C(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),k(null);try{await C(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),k(null);try{await i(e),k({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),k(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 A(){y("deploy"),x(""),k(null);try{r==null||r(await C())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(_jt,{}):a.jsx(Tjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:E})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void A(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),a.jsx(o1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(o1,{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 YLe({a2aStatus:e}){const{t}=Te("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(XLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(GLe,{text:"",done:!1})}const ONt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=KLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(jd,{text:s,streaming:n})}):null});function kNt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(yNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(cn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(oO,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function SNt(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 ENt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=Te("conversation"),v=e==="create_agents"&&r&&U_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=gq(e),x=w==null?void 0:w.detailRenderer,O=(w==null?void 0:w.hideHeader)===!0,k=O||o||!!x||!!c,[S,E]=p.useState(k),C=p.useRef(!1);p.useEffect(()=>{!C.current&&k&&E(!0)},[k]);const j=()=>{C.current=!0,E(P=>!P)},T=e===WLe?g("blocks.renderUi"):e,R=SNt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(qLe,{input:{name:e,title:f9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const A=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&A&&A.length>2e3?`${A.slice(0,2e3)} -${g("blocks.truncated")}`:A;return a.jsxs(Cr.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!O?a.jsx(D_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):f9(e,n,g),done:r,open:S,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":S,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(IM,{kind:"tool"}):a.jsx(bNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(cn,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Rw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(oO,{className:`tool-chevron${S?" is-open":""}`})]}),a.jsx("div",{className:`${O?"":"think-collapse "}${S?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(vNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(xNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(v0,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(cn,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function CNt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[o,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 a.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 a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(gV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.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}`?a.jsx(Bi,{className:"spin"}):a.jsx(Iat,{}),i("blocks.preview")]}),a.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}`?a.jsx(Bi,{className:"spin"}):a.jsx(tM,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Do,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ANt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(Cr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(XJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(Cr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(XJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Rw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Rw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function TNt(e,t,n){const i=gq(e.name),r=f9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Kne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?TNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function _Nt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Kne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=gq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=bq(Kne(o)),c=!i.length||i[i.length-1].source===o.source;if(Hne(l)&&c){i.push(o);continue}r(),Hne(l)?i.push(o):n.push(o)}return r(),n}function v0({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(k_t,{blocks:n,active:r,status:t,render:x=>a.jsx(v0,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=Te("conversation"),y=_Nt(Sot(n),v),w=y.reduce((x,O,k)=>O.kind==="text"?k:x,-1);return a.jsx(a.Fragment,{children:y.map((x,O)=>{switch(x.kind){case"turn-summary":return a.jsx(w_t,{value:x.value},x.id||O);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Rw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(oO,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??O);case"progress":return a.jsx(XLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${O}:${x.label}`);case"tool-exploration":return a.jsx(fNt,{items:x.items},`exploration:${O}`);case"thinking":{const k=y.slice(O+1).some(S=>S.kind==="text"&&!!S.text.trim());return a.jsx(GLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:k,streaming:r,onStreamFrame:s},x.id??O)}case"text":{const k=x.text.replace(/^\s+/,"");return k?a.jsx(ONt,{text:k,streaming:r,onStreamFrame:s,onStreamComplete:O===w?o:void 0},x.id??O):null}case"plan":return a.jsx(kNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??O);case"attachment":return a.jsx(DM,{appName:i,items:x.files},x.id??O);case"artifact":return a.jsx(CNt,{block:x,onDownload:u,onPreview:d},x.id??O);case"delivery":return a.jsx(wNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??O);case"invocation":return a.jsx(PM,{value:x.value},x.id??O);case"tool":{if(x.name===WLe&&x.done)return null;const k=x.name==="create_agents"&&y.slice(O+1).some(S=>S.kind==="tool"&&S.name==="create_agents");return a.jsx(ENt,{name:x.itemType?H2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||k),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??O)}case"agent-transfer":return null;case"auth":return a.jsx(ANt,{block:x,onAuth:c},x.id??O);case"a2ui":return fLe(x.messages).filter(k=>k.components[k.rootId]).map(k=>a.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:a.jsx(R_t,{surface:k,onAction:l})},`${O}-${k.surfaceId}`));default:return null}})})}const jNt=()=>{};function NNt(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(en("conversation.unsupportedActivity"))}function RNt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(NNt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(v0,{blocks:n,onAction:jNt})})}function Gne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function IN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=Te("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(),k=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[S,E]=p.useState(!1),[C,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,A=(I=!1)=>{E(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||k.length!==0&&(j(Math.min(Math.max(I,0),k.length-1)),E(!0))};p.useEffect(()=>{if(!S)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[C])==null||M.focus()}),_=M=>{if(!I)return;const H=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&H||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var H;M.target instanceof Node&&!((H=g.current)!=null&&H.contains(M.target))&&A()},F=M=>{M.key==="Escape"&&A(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[C,s,S]);const P=I=>{var _;if(k.length===0)return;const D=(I+k.length)%k.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&A()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&E(!0)},onClick:()=>{!S&&k.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),S?(D=w.current[C])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),S?(_=w.current[k.length-1])==null||_.focus():N(k.length-1);else if(I.key==="Enter"&&S){I.preventDefault();const L=k[C];L&&i(L.value),A()}else I.key==="Escape"&&(I.preventDefault(),A())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():N(0)},children:a.jsx(Gne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{S?A():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Gne,{})]}),S?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===C?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),A(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),A(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Pr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Ns({error:e}){var s,o,l,c,u;const{t}=Te("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.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 a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` -`)})]}):null]})}const vq=Symbol.for("yaml.alias"),h9=Symbol.for("yaml.document"),Fg=Symbol.for("yaml.map"),ZLe=Symbol.for("yaml.pair"),Ch=Symbol.for("yaml.scalar"),lO=Symbol.for("yaml.seq"),Nd=Symbol.for("yaml.node.type"),cO=e=>!!e&&typeof e=="object"&&e[Nd]===vq,OT=e=>!!e&&typeof e=="object"&&e[Nd]===h9,kT=e=>!!e&&typeof e=="object"&&e[Nd]===Fg,ja=e=>!!e&&typeof e=="object"&&e[Nd]===ZLe,xs=e=>!!e&&typeof e=="object"&&e[Nd]===Ch,ST=e=>!!e&&typeof e=="object"&&e[Nd]===lO;function Ca(e){if(e&&typeof e=="object")switch(e[Nd]){case Fg:case lO:return!0}return!1}function _a(e){if(e&&typeof e=="object")switch(e[Nd]){case vq:case Fg:case Ch:case lO:return!0}return!1}const JLe=e=>(xs(e)||Ca(e))&&!!e.anchor,by=Symbol("break visit"),INt=Symbol("skip children"),bE=Symbol("remove node");function uO(e,t){const n=PNt(t);OT(e)?Lx(null,e.contents,n,Object.freeze([e]))===bE&&(e.contents=null):Lx(null,e,n,Object.freeze([]))}uO.BREAK=by;uO.SKIP=INt;uO.REMOVE=bE;function Lx(e,t,n,i){const r=DNt(e,t,n,i);if(_a(r)||ja(r))return MNt(e,i,r),Lx(e,r,n,i);if(typeof r!="symbol"){if(Ca(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>LNt[t]);class Xl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xl.defaultYaml,t),this.tags=Object.assign({},Xl.defaultTags,n)}clone(){const t=new Xl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xl.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,o]=i;return this.tags[s]=o,!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 o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!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 o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}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(o){return n(String(o)),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+$Nt(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&&_a(t.contents)){const s={};uO(t.contents,(o,l)=>{_a(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` -`)}}Xl.defaultYaml={explicit:!1,version:"1.2"};Xl.defaultTags={"!!":"tag:yaml.org,2002:"};function e5e(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 t5e(e){const t=new Set;return uO(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function n5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function FNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=t5e(e));const o=n5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(xs(o.node)||Ca(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function $x(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rEd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!JLe(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 xq{constructor(t){Object.defineProperty(this,Nd,{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(!OT(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ed(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?$x(s,{"":l},"",l):l}}let wq=class extends xq{constructor(t){super(vq),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=[],uO(t,{Node:(s,o)=>{(cO(o)||JLe(o))&&i.push(o)}}),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,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Ed(o,null,n),l=i.get(o)),(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=PN(r,o,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(e5e(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 PN(e,t,n){if(cO(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ca(t)){let i=0;for(const r of t.items){const s=PN(e,r,n);s>i&&(i=s)}return i}else if(ja(t)){const i=PN(e,t.key,n),r=PN(e,t.value,n);return Math.max(i,r)}return 1}const i5e=e=>!e||typeof e!="function"&&typeof e!="object";class wi extends xq{constructor(t){super(Ch),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ed(this.value,t,n)}toString(){return String(this.value)}}wi.BLOCK_FOLDED="BLOCK_FOLDED";wi.BLOCK_LITERAL="BLOCK_LITERAL";wi.PLAIN="PLAIN";wi.QUOTE_DOUBLE="QUOTE_DOUBLE";wi.QUOTE_SINGLE="QUOTE_SINGLE";const BNt="tag:yaml.org,2002:";function UNt(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 jC(e,t,n){var f,h,m;if(OT(e)&&(e=e.contents),_a(e))return e;if(ja(e)){const g=(h=(f=n.schema[Fg]).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:o,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 wq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=BNt+t.slice(2));let u=UNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new wi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Fg]:Symbol.iterator in Object(e)?o[lO]:o[Fg]}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 wi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function MI(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 o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return jC(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 gS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class r5e extends xq{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=>_a(i)||ja(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Ca(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(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(Ca(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&&xs(s)?s.value:s:Ca(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ja(n))return!1;const i=n.value;return i==null||t&&xs(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 Ca(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(Ca(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const QNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Cp(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Iy=(e,t,n)=>e.endsWith(` -`)?Cp(n,t):n.includes(` +`)}`:""]}):null}function GLe({input:e,children:t}){const{t:n}=_e("conversation"),i=bq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=lNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":cNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(uNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(yq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(fNt,{presentation:i}),t,a.jsx(dNt,{presentation:i,callId:e.callId})]})})})]})}function hNt({items:e}){const{t}=_e("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(qLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(WLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>bq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(yq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(GLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const XLe="send_a2ui_json_to_client",pNt=28,mNt=3e3;function gNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function bNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function YLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=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=o.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&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.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 yNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.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 vNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function xNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function wNt({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?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function d9(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 ZLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=_e("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` +`).trimStart().split(/\n{2,}/).map(b=>b.replace(/[^\S\n]*\n[^\S\n]*/g,(v,y,w)=>{const x=w[y-1]??"",k=w[y+v.length]??"";return!x||!k||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(k)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(k)?"":" "})).join(` + +`),h=YLe(f,!t||r,s),{ref:m,onScroll:g}=gLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(GA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function JLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:"thinking-logo is-active"})}),a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function kNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=_e("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[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(""),[k,S]=p.useState(null),O=new Date(e.validatedAt),A=e.validatedAt?Number.isNaN(O.getTime())?e.validatedAt:O.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!k)return;const N=window.setTimeout(()=>S(null),mNt);return()=>window.clearTimeout(N)},[k]);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 j(){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 T(){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 R(){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 C(){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 a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(jjt,{}):a.jsx(_jt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:A})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void C(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,k?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:k.message}):null]}),a.jsx(c1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(c1,{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({a2aStatus:e}){const{t}=_e("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(JLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(ZLe,{text:"",done:!1})}const ONt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=YLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(Nd,{text:s,streaming:n})}):null});function SNt({title:e,summary:t,items:n,done:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(vNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(on,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(ck,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function ENt(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 CNt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=_e("conversation"),v=e==="create_agents"&&r&&Q_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=gq(e),x=w==null?void 0:w.detailRenderer,k=(w==null?void 0:w.hideHeader)===!0,S=k||o||!!x||!!c,[O,A]=p.useState(S),E=p.useRef(!1);p.useEffect(()=>{!E.current&&S&&A(!0)},[S]);const j=()=>{E.current=!0,A(P=>!P)},T=e===XLe?g("blocks.renderUi"):e,R=ENt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(GLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const C=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&C&&C.length>2e3?`${C.slice(0,2e3)} +${g("blocks.truncated")}`:C;return a.jsxs(_r.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!k?a.jsx(M_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:O,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":O,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(NM,{kind:"tool"}):a.jsx(yNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(on,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(ck,{className:`tool-chevron${O?" is-open":""}`})]}),a.jsx("div",{className:`${k?"":"think-collapse "}${O?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(xNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(wNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(pv,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(on,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function ANt({block:e,onDownload:t,onPreview:n}){const{t:i}=_e("conversation"),[r,s]=p.useState(""),[o,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 a.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 a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(gV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.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}`?a.jsx(Vi,{className:"spin"}):a.jsx(Pat,{}),i("blocks.preview")]}),a.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}`?a.jsx(Vi,{className:"spin"}):a.jsx(JD,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Bo,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function TNt({block:e,onAuth:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(_r.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(JJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(_r.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(JJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Pw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Pw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function _Nt(e,t,n){const i=gq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Yne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?_Nt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function jNt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Yne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=gq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=bq(Yne(o)),c=!i.length||i[i.length-1].source===o.source;if(Kne(l)&&c){i.push(o);continue}r(),Kne(l)?i.push(o):n.push(o)}return r(),n}function pv({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(S_t,{blocks:n,active:r,status:t,render:x=>a.jsx(pv,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=_e("conversation"),y=jNt(Eot(n),v),w=y.reduce((x,k,S)=>k.kind==="text"?S:x,-1);return a.jsx(a.Fragment,{children:y.map((x,k)=>{switch(x.kind){case"turn-summary":return a.jsx(k_t,{value:x.value},x.id||k);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(ck,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??k);case"progress":return a.jsx(JLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${k}:${x.label}`);case"tool-exploration":return a.jsx(hNt,{items:x.items},`exploration:${k}`);case"thinking":{const S=y.slice(k+1).some(O=>O.kind==="text"&&!!O.text.trim());return a.jsx(ZLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:S,streaming:r,onStreamFrame:s},x.id??k)}case"text":{const S=x.text.replace(/^\s+/,"");return S?a.jsx(ONt,{text:S,streaming:r,onStreamFrame:s,onStreamComplete:k===w?o:void 0},x.id??k):null}case"plan":return a.jsx(SNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??k);case"attachment":return a.jsx(IM,{appName:i,items:x.files},x.id??k);case"artifact":return a.jsx(ANt,{block:x,onDownload:u,onPreview:d},x.id??k);case"delivery":return a.jsx(kNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??k);case"invocation":return a.jsx(RM,{value:x.value},x.id??k);case"tool":{if(x.name===XLe&&x.done)return null;const S=x.name==="create_agents"&&y.slice(k+1).some(O=>O.kind==="tool"&&O.name==="create_agents");return a.jsx(CNt,{name:x.itemType?K2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||S),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??k)}case"agent-transfer":return null;case"auth":return a.jsx(TNt,{block:x,onAuth:c},x.id??k);case"a2ui":return mLe(x.messages).filter(S=>S.components[S.rootId]).map(S=>a.jsx(_r.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(I_t,{surface:S,onAction:l})},`${k}-${S.surfaceId}`));default:return null}})})}const NNt=()=>{};function RNt(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(en("conversation.unsupportedActivity"))}function INt({activities:e}){const{t}=_e("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(RNt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(pv,{blocks:n,onAction:NNt})})}function Zne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function RN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!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),k=t.trim().toLocaleLowerCase(),S=s&&k?n.filter(I=>I.value.toLocaleLowerCase().includes(k)||I.label.toLocaleLowerCase().includes(k)):n,[O,A]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,C=(I=!1)=>{A(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||S.length!==0&&(j(Math.min(Math.max(I,0),S.length-1)),A(!0))};p.useEffect(()=>{if(!O)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const H=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&H||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var H;M.target instanceof Node&&!((H=g.current)!=null&&H.contains(M.target))&&C()},F=M=>{M.key==="Escape"&&C(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,O]);const P=I=>{var _;if(S.length===0)return;const D=(I+S.length)%S.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${O?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&C()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":O,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&A(!0)},onClick:()=>{!O&&S.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),O?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),O?(_=w.current[S.length-1])==null||_.focus():N(S.length-1);else if(I.key==="Enter"&&O){I.preventDefault();const L=S[E];L&&i(L.value),C()}else I.key==="Escape"&&(I.preventDefault(),C())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(O?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{O?C():N(0)},children:a.jsx(Zne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{O?C():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Zne,{})]}),O?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[S.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,S.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),C(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),C(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Lr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Rs({error:e}){var s,o,l,c,u;const{t}=_e("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.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 a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` +`)})]}):null]})}const vq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),Mg=Symbol.for("yaml.map"),t5e=Symbol.for("yaml.pair"),Th=Symbol.for("yaml.scalar"),uk=Symbol.for("yaml.seq"),Rd=Symbol.for("yaml.node.type"),dk=e=>!!e&&typeof e=="object"&&e[Rd]===vq,ET=e=>!!e&&typeof e=="object"&&e[Rd]===f9,CT=e=>!!e&&typeof e=="object"&&e[Rd]===Mg,Ia=e=>!!e&&typeof e=="object"&&e[Rd]===t5e,Ss=e=>!!e&&typeof e=="object"&&e[Rd]===Th,AT=e=>!!e&&typeof e=="object"&&e[Rd]===uk;function _a(e){if(e&&typeof e=="object")switch(e[Rd]){case Mg:case uk:return!0}return!1}function Ra(e){if(e&&typeof e=="object")switch(e[Rd]){case vq:case Mg:case Th:case uk:return!0}return!1}const n5e=e=>(Ss(e)||_a(e))&&!!e.anchor,fy=Symbol("break visit"),PNt=Symbol("skip children"),vE=Symbol("remove node");function fk(e,t){const n=DNt(t);ET(e)?$x(null,e.contents,n,Object.freeze([e]))===vE&&(e.contents=null):$x(null,e,n,Object.freeze([]))}fk.BREAK=fy;fk.SKIP=PNt;fk.REMOVE=vE;function $x(e,t,n,i){const r=MNt(e,t,n,i);if(Ra(r)||Ia(r))return LNt(e,i,r),$x(e,r,n,i);if(typeof r!="symbol"){if(_a(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>$Nt[t]);class Wl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wl.defaultYaml,t),this.tags=Object.assign({},Wl.defaultTags,n)}clone(){const t=new Wl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Wl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wl.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,o]=i;return this.tags[s]=o,!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 o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!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 o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}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(o){return n(String(o)),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+FNt(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&&Ra(t.contents)){const s={};fk(t.contents,(o,l)=>{Ra(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}}Wl.defaultYaml={explicit:!1,version:"1.2"};Wl.defaultTags={"!!":"tag:yaml.org,2002:"};function i5e(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 r5e(e){const t=new Set;return fk(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function s5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function BNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=r5e(e));const o=s5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(Ss(o.node)||_a(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Fx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rCd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!n5e(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 xq{constructor(t){Object.defineProperty(this,Rd,{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(!ET(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Cd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Fx(s,{"":l},"",l):l}}let wq=class extends xq{constructor(t){super(vq),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=[],fk(t,{Node:(s,o)=>{(dk(o)||n5e(o))&&i.push(o)}}),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,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Cd(o,null,n),l=i.get(o)),(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=IN(r,o,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(i5e(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 IN(e,t,n){if(dk(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(_a(t)){let i=0;for(const r of t.items){const s=IN(e,r,n);s>i&&(i=s)}return i}else if(Ia(t)){const i=IN(e,t.key,n),r=IN(e,t.value,n);return Math.max(i,r)}return 1}const a5e=e=>!e||typeof e!="function"&&typeof e!="object";class Oi extends xq{constructor(t){super(Th),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Cd(this.value,t,n)}toString(){return String(this.value)}}Oi.BLOCK_FOLDED="BLOCK_FOLDED";Oi.BLOCK_LITERAL="BLOCK_LITERAL";Oi.PLAIN="PLAIN";Oi.QUOTE_DOUBLE="QUOTE_DOUBLE";Oi.QUOTE_SINGLE="QUOTE_SINGLE";const UNt="tag:yaml.org,2002:";function QNt(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 RC(e,t,n){var f,h,m;if(ET(e)&&(e=e.contents),Ra(e))return e;if(Ia(e)){const g=(h=(f=n.schema[Mg]).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:o,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 wq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=UNt+t.slice(2));let u=QNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Oi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Mg]:Symbol.iterator in Object(e)?o[uk]:o[Mg]}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 Oi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function DI(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 o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return RC(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 yS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class o5e extends xq{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=>Ra(i)||Ia(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(yS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(_a(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(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(_a(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&&Ss(s)?s.value:s:_a(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ia(n))return!1;const i=n.value;return i==null||t&&Ss(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 _a(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(_a(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const zNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ap(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ty=(e,t,n)=>e.endsWith(` +`)?Ap(n,t):n.includes(` `)?` -`+Cp(n,t):(e.endsWith(" ")?"":" ")+n,s5e="flow",p9="block",DN="quoted";function $M(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,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===p9&&(b=Xne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===DN&&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===p9&&(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===DN){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;o&&o();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}),BM=e=>/^(%|---|\.\.\.)/m.test(e);function zNt(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,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function yE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(BM(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.lengthr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Jne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===PN&&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===h9&&(b=Jne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` +`&&m!==" "){const k=e[b+1];k&&k!==" "&&k!==` +`&&k!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===PN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const k=b>y+1?b-2:v-1;if(d[k])return e;u.push(k),d[k]=!0,f=k+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();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}),$M=e=>/^(%|---|\.\.\.)/m.test(e);function VNt(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,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function xE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||($M(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=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 k=n[h-1];if(k!==` -`&&k!==" "&&k!==" ")break}let m=n.substring(h);const g=m.indexOf(` +`;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(g9,`$&${u}`));let b=!1,v,y=-1;for(v=0;v{S=!0});const C=$M(`${w}${k}${m}`,u,p9,E);if(!S)return`>${O} -${u}${C}`}return n=n.replace(/\n+/g,`$&${u}`),`|${O} -${u}${w}${n}${m}`}function VNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` -`)||d&&/[[\]{},]/.test(s))return Fx(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` -`)?Fx(s,t):MN(e,t,n,i);if(!l&&!d&&r!==wi.PLAIN&&s.includes(` -`))return MN(e,t,n,i);if(BM(s)){if(c==="")return t.forceBlockIndent=!0,MN(e,t,n,i);if(l&&c===u)return Fx(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(o){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 Fx(s,t)}return l?f:$M(f,c,s5e,FM(t,!1))}function Oq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==wi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=wi.QUOTE_DOUBLE);const c=d=>{switch(d){case wi.BLOCK_FOLDED:case wi.BLOCK_LITERAL:return r||s?Fx(o.value,t):MN(o,t,n,i);case wi.QUOTE_DOUBLE:return yE(o.value,t);case wi.QUOTE_SINGLE:return m9(o.value,t);case wi.PLAIN:return VNt(o,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 a5e(e,t){const n=Object.assign({blockQuote:!0,commentString:QNt,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 HNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(xs(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.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 qNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(xs(e)||Ca(e))&&e.anchor;s&&e5e(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function l1(e,t,n,i){var c;if(ja(e))return e.toString(t,n,i);if(cO(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=_a(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=HNt(t.doc.schema.tags,s));const o=qNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):xs(s)?Oq(s,t,n,i):s.toString(t,n,i);return o?xs(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} -${t.indent}${l}`:l}function WNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=_a(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ca(e)||!_a(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Ca(e)||(xs(e)?e.type===wi.BLOCK_FOLDED||e.type===wi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=l1(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+=Iy(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Iy(v,n.indent,u(h))),v=`? ${v} -${l}:`):(v=`${v}:`,h&&(v+=Iy(v,n.indent,u(h))));let y,w,x;_a(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&xs(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&ST(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const k=l1(t,n,()=>O=!0,()=>b=!0);let S=" ";if(h||y||w){if(S=y?` -`:"",w){const E=u(w);S+=` -${Cp(E,n.indent)}`}k===""&&!n.inFlow?S===` -`&&x&&(S=` - -`):S+=` -${n.indent}`}else if(!m&&Ca(t)){const E=k[0],C=k.indexOf(` -`),j=C!==-1,T=n.inFlow??t.flow??t.items.length===0;if(j||!T){let R=!1;if(j&&(E==="&"||E==="!")){let A=k.indexOf(" ");E==="&"&&A!==-1&&Ae===D_||typeof e=="symbol"&&e.description===D_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new wi(Symbol(D_)),{addToJSMap:l5e}),stringify:()=>D_},KNt=(e,t)=>(Bp.identify(t)||xs(t)&&(!t.type||t.type===wi.PLAIN)&&Bp.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Bp.tag&&n.default));function l5e(e,t,n){const i=c5e(e,n);if(ST(i))for(const r of i.items)Q4(e,t,r);else if(Array.isArray(i))for(const r of i)Q4(e,t,r);else Q4(e,t,i)}function Q4(e,t,n){const i=c5e(e,n);if(!kT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function c5e(e,t){return e&&cO(t)?t.resolve(e.doc,e):t}function u5e(e,t,{key:n,value:i}){if(_a(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(KNt(e,n))l5e(e,t,i);else{const r=Ed(n,"",e);if(t instanceof Map)t.set(r,Ed(i,r,e));else if(t instanceof Set)t.add(r);else{const s=GNt(n,r,e),o=Ed(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function GNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_a(e)&&(n!=null&&n.doc)){const i=a5e(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)+'..."'),o5e(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 kq(e,t,n){const i=jC(e,void 0,n),r=jC(t,void 0,n);return new sc(i,r)}class sc{constructor(t,n=null){Object.defineProperty(this,Nd,{value:ZLe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _a(n)&&(n=n.clone(t)),_a(i)&&(i=i.clone(t)),new sc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return u5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?WNt(this,t,n,i):JSON.stringify(this)}}function d5e(e,t,n){return(t.inFlow??e.flow?YNt:XNt)(e,t,n)}function XNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,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+=Iy(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;g{O=!0});const E=MM(`${w}${S}${m}`,u,h9,A);if(!O)return`>${k} +${u}${E}`}return n=n.replace(/\n+/g,`$&${u}`),`|${k} +${u}${w}${n}${m}`}function HNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` +`)||d&&/[[\]{},]/.test(s))return Bx(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` +`)?Bx(s,t):DN(e,t,n,i);if(!l&&!d&&r!==Oi.PLAIN&&s.includes(` +`))return DN(e,t,n,i);if($M(s)){if(c==="")return t.forceBlockIndent=!0,DN(e,t,n,i);if(l&&c===u)return Bx(s,t)}const f=s.replace(/\n+/g,`$& +${c}`);if(o){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 Bx(s,t)}return l?f:MM(f,c,l5e,LM(t,!1))}function kq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Oi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=Oi.QUOTE_DOUBLE);const c=d=>{switch(d){case Oi.BLOCK_FOLDED:case Oi.BLOCK_LITERAL:return r||s?Bx(o.value,t):DN(o,t,n,i);case Oi.QUOTE_DOUBLE:return xE(o.value,t);case Oi.QUOTE_SINGLE:return p9(o.value,t);case Oi.PLAIN:return HNt(o,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 c5e(e,t){const n=Object.assign({blockQuote:!0,commentString:zNt,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 qNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(Ss(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.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 WNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Ss(e)||_a(e))&&e.anchor;s&&i5e(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function u1(e,t,n,i){var c;if(Ia(e))return e.toString(t,n,i);if(dk(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=Ra(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=qNt(t.doc.schema.tags,s));const o=WNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Ss(s)?kq(s,t,n,i):s.toString(t,n,i);return o?Ss(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} +${t.indent}${l}`:l}function KNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Ra(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(_a(e)||!Ra(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||_a(e)||(Ss(e)?e.type===Oi.BLOCK_FOLDED||e.type===Oi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=u1(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+=Ty(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ty(v,n.indent,u(h))),v=`? ${v} +${l}:`):(v=`${v}:`,h&&(v+=Ty(v,n.indent,u(h))));let y,w,x;Ra(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&Ss(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&AT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1;const S=u1(t,n,()=>k=!0,()=>b=!0);let O=" ";if(h||y||w){if(O=y?` +`:"",w){const A=u(w);O+=` +${Ap(A,n.indent)}`}S===""&&!n.inFlow?O===` +`&&x&&(O=` + +`):O+=` +${n.indent}`}else if(!m&&_a(t)){const A=S[0],E=S.indexOf(` +`),j=E!==-1,T=n.inFlow??t.flow??t.items.length===0;if(j||!T){let R=!1;if(j&&(A==="&"||A==="!")){let C=S.indexOf(" ");A==="&"&&C!==-1&&Ce===P_||typeof e=="symbol"&&e.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oi(Symbol(P_)),{addToJSMap:d5e}),stringify:()=>P_},GNt=(e,t)=>(Up.identify(t)||Ss(t)&&(!t.type||t.type===Oi.PLAIN)&&Up.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Up.tag&&n.default));function d5e(e,t,n){const i=f5e(e,n);if(AT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=f5e(e,n);if(!CT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function f5e(e,t){return e&&dk(t)?t.resolve(e.doc,e):t}function h5e(e,t,{key:n,value:i}){if(Ra(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(GNt(e,n))d5e(e,t,i);else{const r=Cd(n,"",e);if(t instanceof Map)t.set(r,Cd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=XNt(n,r,e),o=Cd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function XNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ra(e)&&(n!=null&&n.doc)){const i=c5e(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)+'..."'),u5e(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 Oq(e,t,n){const i=RC(e,void 0,n),r=RC(t,void 0,n);return new nc(i,r)}class nc{constructor(t,n=null){Object.defineProperty(this,Rd,{value:t5e}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ra(n)&&(n=n.clone(t)),Ra(i)&&(i=i.clone(t)),new nc(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?KNt(this,t,n,i):JSON.stringify(this)}}function p5e(e,t,n){return(t.inFlow??e.flow?ZNt:YNt)(e,t,n)}function YNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,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+=Ty(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+=Iy(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?` +`+Ap(u(e),c),l&&l()):f&&o&&o(),m}function ZNt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:o,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+=Ty(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}${o}${f.join(" ")}${o}${m}`}function LI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Cp(t(i),e);n.push(s.trimStart())}}function Py(e,t){const n=xs(t)?t.value:t;for(const i of e)if(ja(i)&&(i.key===t||i.key===n||xs(i.key)&&i.key.value===n))return i}class dd extends r5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Fg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=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)&&o.items.push(kq(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"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;ja(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new sc(t,t==null?void 0:t.value):i=new sc(t.key,t.value);const r=Py(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);xs(r.value)&&i5e(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=Py(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Py(this.items,t),r=i==null?void 0:i.value;return(!n&&xs(r)?r.value:r)??void 0}has(t){return!!Py(this.items,t)}set(t,n){this.add(new sc(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)u5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ja(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})),d5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const dO={collection:"map",default:!0,nodeClass:dd,tag:"tag:yaml.org,2002:map",resolve(e,t){return kT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>dd.from(e,t,n)};class x0 extends r5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(lO,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=M_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=M_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&xs(r)?r.value:r}has(t){const n=M_(t);return typeof n=="number"&&n=0?t:null}const fO={collection:"seq",default:!0,nodeClass:x0,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ST(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>x0.from(e,t,n)},UM={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),Oq(e,t,n,i)}},QM={identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wi(null),stringify:({source:e},t)=>typeof e=="string"&&QM.test.test(e)?e:t.options.nullStr},Sq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new wi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sq.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 jf({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 o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const f5e={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:jf},h5e={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():jf(e)}},p5e={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 wi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:jf},zM=e=>typeof e=="bigint"||Number.isInteger(e),Eq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function m5e(e,t,n){const{value:i}=e;return zM(i)&&i>=0?n+i.toString(t):jf(e)}const g5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Eq(e,2,8,n),stringify:e=>m5e(e,8,"0o")},b5e={identify:zM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Eq(e,0,10,n),stringify:jf},y5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Eq(e,2,16,n),stringify:e=>m5e(e,16,"0x")},ZNt=[dO,fO,UM,QM,Sq,g5e,b5e,y5e,f5e,h5e,p5e];function Yne(e){return typeof e=="bigint"||Number.isInteger(e)}const L_=({value:e})=>JSON.stringify(e),JNt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:L_},{identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:L_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:L_},{identify:Yne,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})=>Yne(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:L_}],eRt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tRt=[dO,fO].concat(JNt,eRt),Cq={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 sc(new wi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function MI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ap(t(i),e);n.push(s.trimStart())}}function _y(e,t){const n=Ss(t)?t.value:t;for(const i of e)if(Ia(i)&&(i.key===t||i.key===n||Ss(i.key)&&i.key.value===n))return i}class hd extends o5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Mg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=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)&&o.items.push(Oq(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"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;Ia(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new nc(t,t==null?void 0:t.value):i=new nc(t.key,t.value);const r=_y(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ss(r.value)&&a5e(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=_y(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=_y(this.items,t),r=i==null?void 0:i.value;return(!n&&Ss(r)?r.value:r)??void 0}has(t){return!!_y(this.items,t)}set(t,n){this.add(new nc(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(!Ia(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})),p5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const hk={collection:"map",default:!0,nodeClass:hd,tag:"tag:yaml.org,2002:map",resolve(e,t){return CT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>hd.from(e,t,n)};class mv extends o5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(uk,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=D_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=D_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Ss(r)?r.value:r}has(t){const n=D_(t);return typeof n=="number"&&n=0?t:null}const pk={collection:"seq",default:!0,nodeClass:mv,tag:"tag:yaml.org,2002:seq",resolve(e,t){return AT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>mv.from(e,t,n)},FM={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),kq(e,t,n,i)}},BM={identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oi(null),stringify:({source:e},t)=>typeof e=="string"&&BM.test.test(e)?e:t.options.nullStr},Sq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Oi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sq.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 Af({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 o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const m5e={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:Af},g5e={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():Af(e)}},b5e={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 Oi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Af},UM=e=>typeof e=="bigint"||Number.isInteger(e),Eq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function y5e(e,t,n){const{value:i}=e;return UM(i)&&i>=0?n+i.toString(t):Af(e)}const v5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Eq(e,2,8,n),stringify:e=>y5e(e,8,"0o")},x5e={identify:UM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Eq(e,0,10,n),stringify:Af},w5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Eq(e,2,16,n),stringify:e=>y5e(e,16,"0x")},JNt=[hk,pk,FM,BM,Sq,v5e,x5e,w5e,m5e,g5e,b5e];function eie(e){return typeof e=="bigint"||Number.isInteger(e)}const M_=({value:e})=>JSON.stringify(e),eRt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:M_},{identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:M_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:M_},{identify:eie,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})=>eie(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:M_}],tRt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},nRt=[hk,pk].concat(eRt,tRt),Cq={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 nc(new Oi(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]=ja(i)?i:new sc(i)}}else t("Expected a sequence for this tag");return e}function x5e(e,t,n){const{replacer:i}=n,r=new x0(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(kq(l,c,n))}return r}const Aq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:v5e,createNode:x5e};class pw extends x0{constructor(){super(),this.add=dd.prototype.add.bind(this),this.delete=dd.prototype.delete.bind(this),this.get=dd.prototype.get.bind(this),this.has=dd.prototype.has.bind(this),this.set=dd.prototype.set.bind(this),this.tag=pw.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,o;if(ja(r)?(s=Ed(r.key,"",n),o=Ed(r.value,s,n)):s=Ed(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=x5e(t,n,i),s=new this;return s.items=r.items,s}}pw.tag="tag:yaml.org,2002:omap";const Tq={collection:"seq",identify:e=>e instanceof Map,nodeClass:pw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=v5e(e,t),i=[];for(const{key:r}of n.items)xs(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new pw,n)},createNode:(e,t,n)=>pw.from(e,t,n)};function w5e({value:e,source:t},n){return t&&(e?O5e:k5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const O5e={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 wi(!0),stringify:w5e},k5e={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 wi(!1),stringify:w5e},nRt={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:jf},iRt={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():jf(e)}},rRt={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 wi(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:jf},ET=e=>typeof e=="bigint"||Number.isInteger(e);function VM(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 o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function _q(e,t,n){const{value:i}=e;if(ET(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return jf(e)}const sRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>VM(e,2,2,n),stringify:e=>_q(e,2,"0b")},aRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>VM(e,1,8,n),stringify:e=>_q(e,8,"0")},oRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>VM(e,0,10,n),stringify:jf},lRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>VM(e,2,16,n),stringify:e=>_q(e,16,"0x")};class mw extends dd{constructor(t){super(t),this.tag=mw.tag}add(t){let n;ja(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new sc(t.key,null):n=new sc(t,null),Py(this.items,n.key)||this.items.push(n)}get(t,n){const i=Py(this.items,t);return!n&&ja(i)?xs(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=Py(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new sc(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 o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(kq(o,null,i));return s}}mw.tag="tag:yaml.org,2002:set";const jq={collection:"map",identify:e=>e instanceof Set,nodeClass:mw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>mw.from(e,t,n),resolve(e,t){if(kT(e)){if(e.hasAllNullValues(!0))return Object.assign(new mw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function S5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return jf(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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const E5e={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})=>Nq(e,n),stringify:S5e},C5e={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=>Nq(e,!1),stringify:S5e},HM={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(HM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,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,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=Nq(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$/,""))??""},Zne=[dO,fO,UM,QM,O5e,k5e,sRt,aRt,oRt,lRt,nRt,iRt,rRt,Cq,Bp,Tq,Aq,jq,E5e,C5e,HM],Jne=new Map([["core",ZNt],["failsafe",[dO,fO,UM]],["json",tRt],["yaml11",Zne],["yaml-1.1",Zne]]),eie={binary:Cq,bool:Sq,float:p5e,floatExp:h5e,floatNaN:f5e,floatTime:C5e,int:b5e,intHex:y5e,intOct:g5e,intTime:E5e,map:dO,merge:Bp,null:QM,omap:Tq,pairs:Aq,seq:fO,set:jq,timestamp:HM},cRt={"tag:yaml.org,2002:binary":Cq,"tag:yaml.org,2002:merge":Bp,"tag:yaml.org,2002:omap":Tq,"tag:yaml.org,2002:pairs":Aq,"tag:yaml.org,2002:set":jq,"tag:yaml.org,2002:timestamp":HM};function z4(e,t,n){const i=Jne.get(t);if(i&&!e)return n&&!i.includes(Bp)?i.concat(Bp):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(Jne.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).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(Bp)),r.reduce((s,o)=>{const l=typeof o=="string"?eie[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(eie).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 uRt=(e,t)=>e.keyt.key?1:0;let dRt=class A5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?z4(t,"compat"):t?z4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?cRt:{},this.tags=z4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Fg,{value:dO}),Object.defineProperty(this,Ch,{value:UM}),Object.defineProperty(this,lO,{value:fO}),this.sortMapEntries=typeof o=="function"?o:o===!0?uRt:null}clone(){const t=Object.create(A5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function fRt(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=a5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Cp(u,""))}let o=!1,l=null;if(e.contents){if(_a(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Cp(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=l1(e.contents,r,()=>l=null,u);l&&(d+=Iy(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(l1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` -`)?(n.push("..."),n.push(Cp(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Cp(s(u),"")))}return n.join(` +${s.comment}`:i.comment}i=r}e.items[n]=Ia(i)?i:new nc(i)}}else t("Expected a sequence for this tag");return e}function O5e(e,t,n){const{replacer:i}=n,r=new mv(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Aq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k5e,createNode:O5e};class mw extends mv{constructor(){super(),this.add=hd.prototype.add.bind(this),this.delete=hd.prototype.delete.bind(this),this.get=hd.prototype.get.bind(this),this.has=hd.prototype.has.bind(this),this.set=hd.prototype.set.bind(this),this.tag=mw.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,o;if(Ia(r)?(s=Cd(r.key,"",n),o=Cd(r.value,s,n)):s=Cd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=O5e(t,n,i),s=new this;return s.items=r.items,s}}mw.tag="tag:yaml.org,2002:omap";const Tq={collection:"seq",identify:e=>e instanceof Map,nodeClass:mw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=k5e(e,t),i=[];for(const{key:r}of n.items)Ss(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new mw,n)},createNode:(e,t,n)=>mw.from(e,t,n)};function S5e({value:e,source:t},n){return t&&(e?E5e:C5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const E5e={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 Oi(!0),stringify:S5e},C5e={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 Oi(!1),stringify:S5e},iRt={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:Af},rRt={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():Af(e)}},sRt={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 Oi(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:Af},TT=e=>typeof e=="bigint"||Number.isInteger(e);function QM(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 o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function _q(e,t,n){const{value:i}=e;if(TT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Af(e)}const aRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>QM(e,2,2,n),stringify:e=>_q(e,2,"0b")},oRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>QM(e,1,8,n),stringify:e=>_q(e,8,"0")},lRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>QM(e,0,10,n),stringify:Af},cRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>QM(e,2,16,n),stringify:e=>_q(e,16,"0x")};class gw extends hd{constructor(t){super(t),this.tag=gw.tag}add(t){let n;Ia(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new nc(t.key,null):n=new nc(t,null),_y(this.items,n.key)||this.items.push(n)}get(t,n){const i=_y(this.items,t);return!n&&Ia(i)?Ss(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=_y(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new nc(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 o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}gw.tag="tag:yaml.org,2002:set";const jq={collection:"map",identify:e=>e instanceof Set,nodeClass:gw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>gw.from(e,t,n),resolve(e,t){if(CT(e)){if(e.hasAllNullValues(!0))return Object.assign(new gw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function A5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Af(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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const T5e={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})=>Nq(e,n),stringify:A5e},_5e={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=>Nq(e,!1),stringify:A5e},zM={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(zM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,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,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=Nq(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$/,""))??""},tie=[hk,pk,FM,BM,E5e,C5e,aRt,oRt,lRt,cRt,iRt,rRt,sRt,Cq,Up,Tq,Aq,jq,T5e,_5e,zM],nie=new Map([["core",JNt],["failsafe",[hk,pk,FM]],["json",nRt],["yaml11",tie],["yaml-1.1",tie]]),iie={binary:Cq,bool:Sq,float:b5e,floatExp:g5e,floatNaN:m5e,floatTime:_5e,int:x5e,intHex:w5e,intOct:v5e,intTime:T5e,map:hk,merge:Up,null:BM,omap:Tq,pairs:Aq,seq:pk,set:jq,timestamp:zM},uRt={"tag:yaml.org,2002:binary":Cq,"tag:yaml.org,2002:merge":Up,"tag:yaml.org,2002:omap":Tq,"tag:yaml.org,2002:pairs":Aq,"tag:yaml.org,2002:set":jq,"tag:yaml.org,2002:timestamp":zM};function Q4(e,t,n){const i=nie.get(t);if(i&&!e)return n&&!i.includes(Up)?i.concat(Up):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(nie.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).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(Up)),r.reduce((s,o)=>{const l=typeof o=="string"?iie[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(iie).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 dRt=(e,t)=>e.keyt.key?1:0;let fRt=class j5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?uRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Mg,{value:hk}),Object.defineProperty(this,Th,{value:FM}),Object.defineProperty(this,uk,{value:pk}),this.sortMapEntries=typeof o=="function"?o:o===!0?dRt:null}clone(){const t=Object.create(j5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function hRt(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=c5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ap(u,""))}let o=!1,l=null;if(e.contents){if(Ra(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ap(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=u1(e.contents,r,()=>l=null,u);l&&(d+=Ty(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(u1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +`)?(n.push("..."),n.push(Ap(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ap(s(u),"")))}return n.join(` `)+` -`}class CT{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nd,{value:h9});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:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Xl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(CT.prototype,{[Nd]:{value:h9}});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=_a(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){zv(this.contents)&&this.contents.add(t)}addIn(t,n){zv(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=t5e(this);t.anchor=!n||i.has(n)?n5e(n||"a",i):n}return new wq(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:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=FNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=jC(t,d,g);return l&&Ca(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 sc(r,s)}delete(t){return zv(this.contents)?this.contents.delete(t):!1}deleteIn(t){return gS(t)?this.contents==null?!1:(this.contents=null,!0):zv(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ca(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return gS(t)?!n&&xs(this.contents)?this.contents.value:this.contents:Ca(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ca(this.contents)?this.contents.has(t):!1}hasIn(t){return gS(t)?this.contents!==void 0:Ca(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=MI(this.schema,[t],n):zv(this.contents)&&this.contents.set(t,n)}setIn(t,n){gS(t)?this.contents=n:this.contents==null?this.contents=MI(this.schema,Array.from(t),n):zv(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 Xl({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 Xl({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 dRt(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:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ed(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?$x(o,{"":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 fRt(this,t)}}function zv(e){if(Ca(e))return!0;throw new Error("Expected a YAML collection as document contents")}class T5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class bS extends T5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class hRt extends T5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const tie=(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,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class _T{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Rd,{value:f9});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:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Wl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(_T.prototype,{[Rd]:{value:f9}});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=Ra(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){H0(this.contents)&&this.contents.add(t)}addIn(t,n){H0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=r5e(this);t.anchor=!n||i.has(n)?s5e(n||"a",i):n}return new wq(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:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=BNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=RC(t,d,g);return l&&_a(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 nc(r,s)}delete(t){return H0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return yS(t)?this.contents==null?!1:(this.contents=null,!0):H0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return _a(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return yS(t)?!n&&Ss(this.contents)?this.contents.value:this.contents:_a(this.contents)?this.contents.getIn(t,n):void 0}has(t){return _a(this.contents)?this.contents.has(t):!1}hasIn(t){return yS(t)?this.contents!==void 0:_a(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=DI(this.schema,[t],n):H0(this.contents)&&this.contents.set(t,n)}setIn(t,n){yS(t)?this.contents=n:this.contents==null?this.contents=DI(this.schema,Array.from(t),n):H0(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 Wl({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 Wl({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 fRt(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:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Cd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Fx(o,{"":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 hRt(this,t)}}function H0(e){if(_a(e))return!0;throw new Error("Expected a YAML collection as document contents")}class N5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class vS extends N5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class pRt extends N5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const rie=(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,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),o=l+o}if(/[^ ]/.test(o)){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+=`: ${o} ${u} -`}};function c1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,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,k=null;for(const C of e)switch(g&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&C.type!=="comment"&&C.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),C.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&C.source.includes(" ")&&(b=C),d=!0;break;case"comment":{d||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=C.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=C.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=C.source,u=!0,m=!0,(v||y)&&(w=C),d=!0;break;case"anchor":v&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=C,k??(k=C.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),y=C,k??(k=C.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),O&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),O=C,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=C,u=!1,d=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),u=!1,d=!1}const S=e[e.length-1],E=S?S.offset+S.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<=o||(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:E,start:k??E}}function NC(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(NC(t.key)||NC(t.value))return!0}return!1;default:return!0}}function b9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&NC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function _5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||xs(s)&&xs(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const nie="All mapping items must start at the same column";function pRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??dd,l=new o(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=c1(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",nie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||NC(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",nie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&b9(i.indent,m,r),n.atKey=!1,_5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=c1(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 gRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?dd:x0),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=AT(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 q4(e,t,n,i,r,s){const o=n.type==="block-map"?pRt(e,t,n,i,s):n.type==="block-seq"?mRt(e,t,n,i,s):gRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function bRt(e,t,n,i,r){var h;const s=i.tag,o=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===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];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: ${o}`,!0),q4(e,t,n,r,o)}const u=q4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=_a(d)?d:new wi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function yRt(e,t,n){const i=t.offset,r=vRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?wi.BLOCK_FOLDED:wi.BLOCK_LITERAL,o=t.source?xRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` +`}};function d1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,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,k=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 j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!k||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`),k&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=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 O=e[e.length-1],A=O?O.offset+O.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<=o||(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:k,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:A,start:S??A}}function IC(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(IC(t.key)||IC(t.value))return!0}return!1;default:return!0}}function g9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&IC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function R5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||Ss(s)&&Ss(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const sie="All mapping items must start at the same column";function mRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??hd,l=new o(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=d1(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",sie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||IC(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",sie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,R5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const k=d1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=k.end,k.found){y&&((b==null?void 0:b.type)==="block-map"&&!k.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 bRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?hd:mv),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=jT(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 H4(e,t,n,i,r,s){const o=n.type==="block-map"?mRt(e,t,n,i,s):n.type==="block-seq"?gRt(e,t,n,i,s):bRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function yRt(e,t,n,i,r){var h;const s=i.tag,o=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===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];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: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Ra(d)?d:new Oi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function vRt(e,t,n){const i=t.offset,r=xRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Oi.BLOCK_FOLDED:Oi.BLOCK_LITERAL,o=t.source?wRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` `.repeat(Math.max(1,o.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)o[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` `:!m&&h===` `&&(h=` @@ -683,113 +683,113 @@ ${u} `+o[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 vRt({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 o=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=wi.PLAIN,c=ORt(s,u);break;case"single-quoted-scalar":l=wi.QUOTE_SINGLE,c=kRt(s,u);break;case"double-quoted-scalar":l=wi.QUOTE_DOUBLE,c=SRt(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=AT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function ORt(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}`),j5e(e)}function kRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),j5e(e.slice(1,-1)).replace(/''/g,"'")}function j5e(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=Oi.PLAIN,c=ORt(s,u);break;case"single-quoted-scalar":l=Oi.QUOTE_SINGLE,c=SRt(s,u);break;case"double-quoted-scalar":l=Oi.QUOTE_DOUBLE,c=ERt(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=jT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function ORt(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}`),I5e(e)}function SRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),I5e(e.slice(1,-1)).replace(/''/g,"'")}function I5e(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 ERt(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 CRt(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 CRt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ARt(e,t,n,i){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function N5e(e,t,n,i){const{value:r,type:s,comment:o,range:l}=t.type==="block-scalar"?yRt(e,t,i):wRt(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[Ch]:c?u=TRt(e.schema,r,c,n,i):t.type==="scalar"?u=_Rt(e,r,t,i):u=e.schema[Ch];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=xs(f)?f:new wi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new wi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function TRt(e,t,n,i,r){var l;if(n==="!")return e[Ch];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 o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ch])}function _Rt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Ch];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Ch];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function jRt(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 NRt={composeNode:R5e,composeEmptyNode:Rq};function R5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=RRt(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=N5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=bRt(NRt,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=Rq(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&&(!xs(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),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:jRt(t,n,i),indent:-1,source:""},f=N5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function RRt({options:e},{offset:t,source:n,end:i},r){const s=new wq(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 o=t+n.length,l=AT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function IRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new CT(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=c1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?R5e(u,r,d,o):Rq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=AT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Ok(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 iie(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[Th]:c?u=_Rt(e.schema,r,c,n,i):t.type==="scalar"?u=jRt(e,r,t,i):u=e.schema[Th];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Ss(f)?f:new Oi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Oi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function _Rt(e,t,n,i,r){var l;if(n==="!")return e[Th];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 o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Th])}function jRt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Th];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Th];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function NRt(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 RRt={composeNode:D5e,composeEmptyNode:Rq};function D5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=IRt(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=P5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=yRt(RRt,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=Rq(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&&(!Ss(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),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:NRt(t,n,i),indent:-1,source:""},f=P5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function IRt({options:e},{offset:t,source:n,end:i},r){const s=new wq(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 o=t+n.length,l=jT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function PRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new _T(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=d1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?D5e(u,r,d,o):Rq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=jT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function SO(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 aie(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const o=Ok(n);s?this.warnings.push(new hRt(o,i,r)):this.errors.push(new bS(o,i,r))},this.directives=new Xl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=iie(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(Ca(s)&&!s.flow&&s.items.length>0){let o=s.items[0];ja(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} +`)+(o.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 DRt=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const o=SO(n);s?this.warnings.push(new pRt(o,i,r)):this.errors.push(new vS(o,i,r))},this.directives=new Wl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=aie(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(_a(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ia(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} ${l}`:i}else{const o=s.commentBefore;s.commentBefore=o?`${i} -${o}`:i}}if(n){for(let s=0;s{const s=Ok(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=IRt(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 bS(Ok(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 bS(Ok(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=AT(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 bS(Ok(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 CT(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 I5e="\uFEFF",P5e="",D5e="",y9="";function DRt(e){switch(e){case I5e:return"byte-order-mark";case P5e:return"doc-mode";case D5e:return"flow-error-end";case y9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${o}`:i}}if(n){for(let s=0;s{const s=SO(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=PRt(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 vS(SO(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 vS(SO(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=jT(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 vS(SO(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 _T(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 M5e="\uFEFF",L5e="",$5e="",b9="";function MRt(e){switch(e){case M5e:return"byte-order-mark";case L5e:return"doc-mode";case $5e:return"flow-error-end";case b9: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 Gd(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const rie=new Set("0123456789ABCDEFabcdef"),MRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$_=new Set(",[]{}"),LRt=new Set(` ,[]{} -\r `),W4=e=>!e||LRt.has(e);class $Rt{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===` +`: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 qd(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const oie=new Set("0123456789ABCDEFabcdef"),LRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),L_=new Set(",[]{}"),$Rt=new Set(` ,[]{} +\r `),q4=e=>!e||$Rt.has(e);class FRt{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==="...")&&Gd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Gd(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===":")&&Gd(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(W4),"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=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&qd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!qd(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===":")&&qd(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(q4),"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=>Gd(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` +`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>qd(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 o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` `)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,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const l=s;for(;o===" ";)o=this.buffer[--s];if(o===` -`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield y9,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(Gd(s)||t&&$_.has(s))break;n=i}else if(Gd(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 b9,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(qd(s)||t&&L_.has(s))break;n=i}else if(qd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` -`,s=this.buffer[i+1]):n=i),s==="#"||t&&$_.has(s))break;if(r===` -`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&$_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield y9,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(W4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Gd(i)||n&&$_.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(;!Gd(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(MRt.has(n))n=this.buffer[++t];else if(n==="%"&&rie.has(this.buffer[t+1])&&rie.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&&L_.has(s))break;if(r===` +`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&L_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,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(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(qd(i)||n&&L_.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(;!qd(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(LRt.has(n))n=this.buffer[++t];else if(n==="%"&&oie.has(this.buffer[t+1])&&oie.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 FRt{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 $I(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"&&aie(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&&sie(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 BRt{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 LI(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"&&cie(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&&lie(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 o=[];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&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),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?(o.push(this.sourceToken),t.items.push({start:o,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(Xm(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(M5e(n.key)&&!Xm(n.sep,"newline")){const l=Vv(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 o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Xm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Vv(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:o,key:null,sep:[this.sourceToken]}):Xm(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:o,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&&!Xm(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:o});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)){$I(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||Xm(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=F_(i),s=Vv(r);aie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};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)){LI(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 o=[];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&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),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?(o.push(this.sourceToken),t.items.push({start:o,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(Km(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(F5e(n.key)&&!Km(n.sep,"newline")){const l=q0(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 o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Km(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=q0(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:o,key:null,sep:[this.sourceToken]}):Km(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:o,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&&!Km(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:o});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)){LI(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||Km(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=$_(i),s=q0(r);cie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};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=F_(t),i=Vv(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=F_(t),i=Vv(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 URt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new FRt||null,prettyErrors:t}}function L5e(e,t={}){const{lineCounter:n,prettyErrors:i}=URt(t),r=new BRt(n==null?void 0:n.addNewLine),s=new PRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new bS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(tie(e,n)),o.warnings.forEach(tie(e,n))),o}function QRt(e,t,n){let i;const r=L5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>o5e(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 qM(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 OT(e)&&!i?e.toString(n):new CT(e,i,n).toString(n)}const $5e=1024;let zRt=0,md=class{constructor(t,n){this.from=t,this.to=n}};class ui{constructor(t={}){this.id=zRt++,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=Za.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}ui.closedBy=new ui({deserialize:e=>e.split(" ")});ui.openedBy=new ui({deserialize:e=>e.split(" ")});ui.group=new ui({deserialize:e=>e.split(" ")});ui.isolate=new ui({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});ui.contextHash=new ui({perNode:!0});ui.lookAhead=new ui({perNode:!0});ui.mounted=new ui({perNode:!0});class gw{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[ui.mounted.id]}}const VRt=Object.create(null);class Za{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):VRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Za(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(ui.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(ui.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Za.none=new Za("",Object.create(null),0,8);class hO{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Sr.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:Dq(Za.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Ui(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Ui(Za.none,n,i,r)))}static build(t){return KRt(t)}}Ui.empty=new Ui(Za.none,[],[],0);class Iq{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 Iq(this.buffer,this.index)}}class fb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Za.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=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 RC(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]+o.from,h;if(!(!(s&Sr.EnterBracketed&&d instanceof Ui&&(h=gw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!F5e(r,i,f,f+d.length))){if(d instanceof fb){if(s&Sr.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new lh(new HRt(o,d,t,f),null,m)}else if(s&Sr.IncludeAnonymous||!d.type.isAnonymous||Pq(d)){let m;if(!(s&Sr.IgnoreMounts)&&(m=gw.get(d))&&!m.overlay)return new jl(m.tree,f,t,o);let g=new jl(d,f,t,o);return s&Sr.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Sr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<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(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&Sr.IgnoreOverlays)&&(r=gw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Sr.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new jl(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 lie(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=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 v9(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 HRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class lh extends B5e{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 lh(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&Sr.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 lh(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 lh(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 lh(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 o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Ui(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function U5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new jl(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(RC(l,t,n,!1))}}return r?U5e(r):i}class FI{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&~Sr.EnterBracketed,t instanceof jl)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 jl?(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&Sr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Sr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Sr.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,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Sr.IncludeAnonymous||l instanceof fb||!l.type.isAnonymous||Pq(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 o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return v9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Pq(e){return e.children.some(t=>t instanceof fb||!t.type.isAnonymous||Pq(t))}function KRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=$5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Iq(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,E,C,j,T){let{id:R,start:A,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let H=s[R];E.push(H),C.push(A-k);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=A-k;if(N-A<=r&&(F=v(l.pos-S,j))){let H=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=H.length;for(;l.pos>q;)U=y(F.start,H,U);L=new fb(H,N-F.start,i),M=F.start-k}else{let H=l.pos-P;l.next();let q=[],U=[],Z=R>=o?R:-1,z=0,J=N;for(;l.pos>H;)Z>=0&&l.id==Z&&l.size>=0?(l.end<=J-r&&(g(q,U,A,z,l.end,J,Z,I,D),z=q.length,J=l.end),l.next()):T>2500?h(A,H,q,U):f(A,H,q,U,Z,T+1);if(Z>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Dq(_,q,U,0,q.length,0,N-A,ne,ne)}else L=b(_,q,U,N-A,I-N,D)}E.push(L),C.push(M)}function h(k,S,E,C){let j=[],T=0,R=-1;for(;l.pos>S;){let{id:A,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)A[I++]=j[P],A[I++]=j[P+1]-N,A[I++]=j[P+2]-N,A[I++]=I;E.push(new fb(A,j[2]-N,i)),C.push(N-k)}}function m(k,S){return(E,C,j)=>{let T=0,R=E.length-1,A,N;if(R>=0&&(A=E[R])instanceof Ui){if(!R&&A.type==k&&A.length==j)return A;(N=A.prop(ui.lookAhead))&&(T=C[R]+A.length+N)}return b(k,E,C,j,T,S)}}function g(k,S,E,C,j,T,R,A,N){let P=[],I=[];for(;k.length>C;)P.push(k.pop()),I.push(S.pop()+E-j);k.push(b(i.types[R],P,I,T-j,A-T,N)),S.push(j-E)}function b(k,S,E,C,j,T,R){if(T){let A=[ui.contextHash,T];R=R?[A].concat(R):[A]}if(j>25){let A=[ui.lookAhead,j];R=R?[A].concat(R):[A]}return new Ui(k,S,E,C,R)}function v(k,S){let E=l.fork(),C=0,j=0,T=0,R=E.end-r,A={size:0,start:0,skip:0};e:for(let N=E.pos-k;E.pos>N;){let P=E.size;if(E.id==S&&P>=0){A.size=C,A.start=j,A.skip=T,T+=4,C+=4,E.next();continue}let I=E.pos-P;if(P<0||I=o?4:0,_=E.start;for(E.next();E.pos>I;){if(E.size<0)if(E.size==-3||E.size==-4)D+=4;else break e;else E.id>=o&&(D+=4);E.next()}j=_,C+=P,T+=D}return(S<0||C==k)&&(A.size=C,A.start=j,A.skip=T),A.size>4?A:void 0}function y(k,S,E){let{id:C,start:j,end:T,size:R}=l;if(l.next(),R>=0&&C4){let N=l.pos-(R-4);for(;l.pos>N;)E=y(k,S,E)}S[--E]=A,S[--E]=T-k,S[--E]=j-k,S[--E]=C}else R==-3?u=C:R==-4&&(d=C);return E}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 Ui(c[e.topID],w.reverse(),x.reverse(),O)}const cie=new WeakMap;function LN(e,t){if(!e.isAnonymous||t instanceof fb||t.type!=e)return 1;let n=cie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Ui)){n=1;break}n+=LN(e,i)}cie.set(t,n)}return n}function Dq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;S+=E}if(x==O+1){if(S>d){let E=g[O];m(E.children,E.positions,0,E.children.length,b[O]+w);continue}f.push(g[O])}else{let E=b[x-1]+g[x-1].length-k;f.push(Dq(e,g,b,O,x,k,E,null,c))}h.push(k+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Mq{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 lh?this.setBuffer(t.context.buffer,t.index,n):t instanceof jl&&this.map.set(t.tree,n)}get(t){return t instanceof lh?this.getBuffer(t.context.buffer,t.index):t instanceof jl?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 Up{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Up(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,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.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 Up(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew md(r.from,r.to)):[new md(0,0)]:[new md(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 GRt{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 Q5e(e){return(t,n,i,r)=>new YRt(t,e,n,i,r)}class uie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function die(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class XRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const x9=new ui({perNode:!0});class YRt{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 Ui(i.type,i.children,i.positions,i.length,i.propValues.concat([[x9,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[ui.mounted.id]=new gw(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&&(o=ZRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew md(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 md(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=pie(this.ranges,n.ranges);u.length&&(die(u),this.inner.splice(n.index,0,new uie(n.parser,n.parser.startParse(this.input,mie(n.mounts,u),u),n.ranges.map(d=>new md(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 ZRt(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 fie(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Sr.IgnoreOverlays|Sr.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 Ui)n=n.children[0];else break}return!1}}let eIt=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(x9))!==null&&n!==void 0?n:i.to,this.inner=new hie(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(x9))!==null&&t!==void 0?t:n.to,this.inner=new hie(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 o=(i=s.tree)===null||i===void 0?void 0:i.prop(ui.mounted);if(o&&o.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:o})}}}return r}};function pie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new md(l,c.to))):c.to>l?n[s--]=new md(l,c.to):n.splice(s--,1))}}return i}function tIt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew md(h.from+i,h.to+i)),f=tIt(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 Up(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Up(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let w9=[],z5e=[];(()=>{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=z5e[i])t=i+1;else return!0;if(t==n)return!1}}function gie(e){return e>=127462&&e<=127487}const bie=8205;function iIt(e,t,n=!0,i=!0){return(n?V5e:rIt)(e,t,i)}function V5e(e,t,n){if(t==e.length)return t;t&&H5e(e.charCodeAt(t))&&q5e(e.charCodeAt(t-1))&&t--;let i=K4(e,t);for(t+=yie(i);t=0&&gie(K4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function rIt(e,t,n){for(;t>1;){let i=V5e(e,t-2,n);if(i=56320&&e<57344}function q5e(e){return e>=55296&&e<56320}function yie(e){return e<65536?1:2}let xr=class W5e{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]=u1(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),eh.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]=u1(this,t,n);let i=[];return this.decompose(t,n,i,0),eh.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 vE(this),s=new vE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new vE(this,t)}iterRange(t,n=this.length){return new K5e(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 G5e(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]?W5e.empty:t.length<=32?new wa(t):eh.from(wa.split(t,[]))}};class wa extends xr{constructor(t,n=sIt(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 o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new aIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new wa(vie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=$N(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new wa(l,o.length+s.length));else{let c=l.length>>1;i.push(new wa(l.slice(0,c)),new wa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof wa))return super.replace(t,n,i);[t,n]=u1(this,t,n);let r=$N(this.text,$N(i.text,vie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new wa(r,s):eh.from(wa.split(r,[]),s)}sliceString(t,n=this.length,i=` -`){[t,n]=u1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(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 wa(i,r)),i=[],r=-1);return r>-1&&n.push(new wa(i,r)),n}}class eh extends xr{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 o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=u1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new eh(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]=u1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof eh))return 0;let i=0,[r,s,o,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==o||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 wa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof eh)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof wa&&c&&(g=d[d.length-1])instanceof wa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new wa(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]:eh.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new eh(l,n)}}xr.empty=new wa([""],0);function sIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function $N(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof wa?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],o=s>>1,l=r instanceof wa?r.text.length:r.children.length;if(o==(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 wa){let c=r.text[o+(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[o+(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 wa?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 K5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new vE(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 G5e{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"&&(xr.prototype[Symbol.iterator]=function(){return this.iter()},vE.prototype[Symbol.iterator]=K5e.prototype[Symbol.iterator]=G5e.prototype[Symbol.iterator]=function(){return this});let aIt=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 u1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ro(e,t,n=!0,i=!0){return iIt(e,t,n,i)}function oIt(e){return e>=56320&&e<57344}function lIt(e){return e>=55296&&e<56320}function Nc(e,t){let n=e.charCodeAt(t);if(!lIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return oIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Lq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function th(e){return e<65536?1:2}const O9=/\r\n?|\n/;var il=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(il||(il={}));class yh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=il.Simple&&u>=t&&(i==il.TrackDel&&rt||i==il.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 yh(t)}static create(t){return new yh(t)}}class lo extends yh{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 k9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return S9(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]=o;let c=r>>1;for(;i.length0&&wg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?xr.of(m.split(i||O9)):m:xr.empty,b=g.length;if(f==h&&b==0)return;fo&&Cl(r,f-o,-1),Cl(r,h-f,b),wg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new lo(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 o!="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 wg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function S9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new IC(e),l=new IC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);Cl(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.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||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class IC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?xr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?xr.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 og{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 og(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return ht.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ht.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 ht.range(t.anchor,t.head)}static create(t,n,i,r){return new og(t,n,i,r)}}class ht{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ht.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 ht(t.ranges.map(n=>og.fromJSON(n)),t.main)}static single(t,n=t){return new ht([ht.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?ht.range(c,l):ht.range(l,c))}}return new ht(t,n)}}function Y5e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let $q=0;class mn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=$q++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new mn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:Fq),!!t.static,t.enables)}of(t){return new FN([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FN(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FN(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function Fq(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class FN{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=$q++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=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[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||E9(f,d)){let m=i(f);if(l?!xie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=UI(h,g);if(this.dependencies.every(v=>v instanceof mn?h.facet(v)===f.facet(v):v instanceof dl?h.field(v,!1)==f.field(v,!1):!0)||(l?xie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function xie(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)),o=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(U_).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],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(U_),o=r.facet(U_),l;return(l=s.find(c=>c.field==this))&&l!=o.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,U_.of({field:this,create:t})]}get extension(){return this}}const Oy={lowest:4,low:3,default:2,high:1,highest:0};function kk(e){return t=>new Z5e(t,e)}const bm={highest:kk(Oy.highest),high:kk(Oy.high),default:kk(Oy.default),low:kk(Oy.low),lowest:kk(Oy.lowest)};class Z5e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class KM{of(t){return new C9(this,t)}reconfigure(t){return KM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class C9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class BI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of uIt(t,n,o))h instanceof dl?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,Fq(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=>cIt(v,g,m))}}let f=u.map(h=>h(l));return new BI(t,o,f,l,c,s)}}function uIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof C9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof C9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof Z5e)s(o.inner,o.prec);else if(o instanceof dl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof FN)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Oy.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.`);s(u,l)}}return s(e,Oy.default),i.reduce((o,l)=>o.concat(l))}function xE(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 UI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const J5e=mn.define(),A9=mn.define({combine:e=>e.some(t=>t),static:!0}),e3e=mn.define({combine:e=>e.length?e[0]:void 0,static:!0}),t3e=mn.define(),n3e=mn.define(),i3e=mn.define(),r3e=mn.define({combine:e=>e.length?e[0]:!1});class Ih{constructor(t,n){this.type=t,this.value=n}static define(){return new dIt}}class dIt{of(t){return new Ih(this,t)}}class fIt{constructor(t){this.map=t}of(t){return new pi(this,t)}}class pi{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 pi(this.type,n)}is(t){return this.type==t}static define(t={}){return new fIt(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}}pi.reconfigure=pi.define();pi.appendConfig=pi.define();class Xa{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Y5e(i,n.newLength),s.some(l=>l.type==Xa.time)||(this.annotations=s.concat(Xa.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Xa(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(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(Xa.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Xa.time=Ih.define();Xa.userEvent=Ih.define();Xa.addToHistory=Ih.define();Xa.remote=Ih.define();function hIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Xa?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xa?e=s[0]:e=a3e(t,bw(s),!1)}return e}function mIt(e){let t=e.startState,n=t.facet(i3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=s3e(i,T9(t,s,e.changes.newLength),!0))}return i==e?e:Xa.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const gIt=[];function bw(e){return e==null?gIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const bIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let _9;try{_9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yIt(e){if(_9)return _9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||bIt.test(n)))return!0}return!1}function vIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(yIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class tr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pi.reconfigure)?(n=null,i=l.value):l.is(pi.appendConfig)&&(n=null,i=bw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=BI.resolve(i,r,this),s=new tr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(A9)?t.newSelection:t.newSelection.asSingle();new tr(n,t.newDoc,o,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:ht.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=bw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return tr.create({doc:t.doc,selection:ht.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=BI.resolve(t.extensions||[],new Map),i=t.doc instanceof xr?t.doc:xr.of((t.doc||"").split(n.staticFacet(tr.lineSeparator)||O9)),r=t.selection?t.selection instanceof ht?t.selection:ht.single(t.selection.anchor,t.selection.head):ht.single(0);return Y5e(r,i.length),n.staticFacet(A9)||(r=r.asSingle()),new tr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tr.tabSize)}get lineBreak(){return this.facet(tr.lineSeparator)||` -`}get readOnly(){return this.facet(r3e)}phrase(t,...n){for(let i of this.facet(tr.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(J5e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return vIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Ro(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});tr.lineSeparator=e3e;tr.readOnly=r3e;tr.phrases=mn.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])}});tr.languageData=J5e;tr.changeFilter=t3e;tr.transactionFilter=n3e;tr.transactionExtender=i3e;KM.reconfigure=pi.define();function Ph(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);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 hb{eq(t){return this==t}range(t,n=t){return PC.create(t,n,this)}}hb.prototype.startSide=hb.prototype.endSide=0;hb.prototype.point=!1;hb.prototype.mapMode=il.TrackDel;function Bq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class PC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new PC(t,n,i)}}function j9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uq{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 o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Uq(r,s,i,l):null,pos:o}}}class Ki{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 Ki(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,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(j9)),this.isEmpty)return n.length?Ki.of(n):this;let l=new o3e(this,null,-1).goto(0),c=0,u=[],d=new nm;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+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return DC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return DC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=wie(o,l,i),u=new Sk(o,c,s),d=new Sk(l,c,s);i.iterGaps((f,h,m)=>Oie(u,f,d,h,m,r)),i.empty&&i.length==0&&Oie(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),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=wie(s,o),c=new Sk(s,l,0).goto(i),u=new Sk(o,l,0).goto(i);for(;;){if(c.to!=u.to||!N9(c.active,u.active)||c.point&&(!u.point||!Bq(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 o=new Sk(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new nm;for(let r of t instanceof PC?[t]:n?xIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Ki.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Ki.empty;r=r.nextLayer)n=new Ki(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Ki.empty=new Ki([],[],null,-1);function xIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(j9);t=i}return e}Ki.empty.nextLayer=Ki.empty;class nm{finishChunk(t){this.chunks.push(new Uq(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 nm)).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(Ki.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Ki.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function wie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=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 o3e(o,n,i,s));return r.length==1?r[0]:new DC(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--)G4(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--)G4(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(),G4(this.heap,0)}}}function G4(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 Sk{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=DC.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){Q_(this.active,t),Q_(this.activeTo,t),Q_(this.activeRank,t),this.minActive=kie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;z_(this.active,n,i),z_(this.activeTo,n,r),z_(this.activeRank,n,s),t&&z_(t,n,this.cursor.from),this.minActive=kie(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&&Q_(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 Oie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=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,o);if(e.point||n.point?(e.point&&n.point&&Bq(e.point,n.point)&&N9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!N9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function N9(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 kie(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=Ro(e,r)}return i===!0?-1:e.length}const I9="ͼ",Sie=typeof Symbol>"u"?"__"+I9:Symbol.for(I9),P9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Eie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class pb{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.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?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=Eie[Sie]||1;return Eie[Sie]=t+1,I9+t.toString(36)}static mount(t,n,i){let r=t[P9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new wIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Cie=new Map;class wIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Cie.get(i);if(s)return t[P9]=s;this.sheet=new r.CSSStyleSheet,Cie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[P9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-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:'"'},OIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),kIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var el=0;el<10;el++)mb[48+el]=mb[96+el]=String(el);for(var el=1;el<=24;el++)mb[el+111]="F"+el;for(var el=65;el<=90;el++)mb[el]=String.fromCharCode(el+32),MC[el]=String.fromCharCode(el);for(var X4 in mb)MC.hasOwnProperty(X4)||(MC[X4]=mb[X4]);function SIt(e){var t=OIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||kIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?MC:mb)[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 Kr(){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 hn={mac:_ie||/Mac/.test(Yl.platform),windows:/Win/.test(Yl.platform),linux:/Linux|X11/.test(Yl.platform),ie:GM,ie_version:c3e?D9.documentMode||6:L9?+L9[1]:M9?+M9[1]:0,gecko:Aie,gecko_version:Aie?+(/Firefox\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,chrome:!!Y4,chrome_version:Y4?+Y4[1]:0,ios:_ie,android:/Android\b/.test(Yl.userAgent),webkit:Tie,webkit_version:Tie?+(/\bAppleWebKit\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,safari:$9,safari_version:$9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yl.userAgent)||[0,0])[1]:0,tabSize:D9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qq(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 QI=Object.create(null);function zq(e,t,n){if(e==t)return!0;e||(e=QI),t||(t=QI);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 EIt(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 jie(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 CIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new w0(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:o}=u3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new w0(t,i,r,n,t.widget||null,!0)}static line(t){return new _T(t)}static set(t,n=!1){return Ki.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Fn.none=Ki.empty;class TT extends Fn{constructor(t){let{start:n,end:i}=u3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Qq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||QI}eq(t){return this==t||t instanceof TT&&this.tagName==t.tagName&&zq(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)}}TT.prototype.point=!1;class _T extends Fn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof _T&&this.spec.class==t.spec.class&&zq(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)}}_T.prototype.mapMode=il.TrackBefore;_T.prototype.point=!0;class w0 extends Fn{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?il.TrackBefore:il.TrackAfter:il.TrackDel}get type(){return this.startSide!=this.endSide?ol.WidgetRange:this.startSide<=0?ol.WidgetBefore:ol.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof w0&&AIt(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)}}w0.prototype.point=!0;function u3e(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 AIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function yw(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 LC extends hb{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof LC&&this.tagName==t.tagName&&zq(this.attributes,t.attributes)}static create(t){return new LC(t.tagName,t.attributes||QI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Ki.of(t,n)}}LC.prototype.startSide=LC.prototype.endSide=-1;function $C(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function F9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function wE(e,t){if(!t.anchorNode)return!1;try{return F9(e,t.anchorNode)}catch{return!1}}function OE(e){return e.nodeType==3?BC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function kE(e,t,n,i){return n?Nie(e,t,n,i,-1)||Nie(e,t,n,i,1):!1}function gb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function zI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Nie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:im(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=gb(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?im(e):0}else return!1}}function im(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function FC(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 TIt(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 d3e(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 _It(e,t,n,i,r,s,o,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=TIt(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}=d3e(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+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,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 f3e(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 jIt{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?im(n):0),i,Math.min(t.focusOffset,i?im(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let yy=null;hn.safari&&hn.safari_version>=26&&(yy=!1);function h3e(e){if(e.setActive)return e.setActive();if(yy)return e.focus(yy);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(yy==null?{get preventScroll(){return yy={preventScroll:!0},!0}}:void 0),!yy){yy=!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 m3e(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=im(n)}else if(n.parentNode&&!zI(n))i=gb(n),n=n.parentNode;else return null}}function g3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function v3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(zf[b+1]==-m){let v=zf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(as[f]=as[zf[b]]=y),l=b;break}}else{if(zf.length==189)break;zf[l++]=f,zf[l++]=h,zf[l++]=c}else if((g=as[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=zf[v+2];if(y&2)break;if(b)zf[v+2]|=2;else{if(y&4)break;zf[v+2]|=4}}}}}function $It(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),as[--g]=m;c=d}else s=u,c++}}}function U9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new ch(c,b.from,m));let v=b.direction==O0!=!(m%2);Q9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?as[g]!=l:as[g]==l))break;g++}h?U9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=as[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(as[v-1]==l)break e;break}}if(h)h.push(b);else{b.toas.length;)as[as.length]=256;let i=[],r=t==O0?0:1;return Q9(e,r,r,n,0,e.length,i),i}function x3e(e){return[new ch(0,e,0)]}let w3e="";function BIt(e,t,n,i,r){var s;let o=i.head-e.from,l=ch.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Ro(e.text,o,c.forward(r,n));(dc.to)&&(d=u),w3e=e.text.slice(Math.min(o,d),Math.max(o,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)}),_3e=mn.define({combine:e=>e.some(t=>t)}),j3e=mn.define();class xw{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new xw(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 xw(ht.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const V_=pi.define({map:(e,t)=>e.map(t)}),N3e=pi.define();function Mc(e,t,n){let i=e.facet(E3e);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 wp=mn.define({combine:e=>e.length?e[0]:!0});let QIt=0;const Bx=mn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(XM.of(u=>{let d=u.plugin(l);return d?o(d):Fn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ma.define((i,r)=>new t(i,r),n)}}class Z4{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(Mc(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){Mc(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){Mc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const R3e=mn.define(),Wq=mn.define(),XM=mn.define(),I3e=mn.define(),Kq=mn.define(),jT=mn.define(),P3e=mn.define();function Iie(e,t){let n=e.state.facet(P3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Ki.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-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=UIt(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 D3e=mn.define();function Gq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(D3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const yS=mn.define();class gd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new gd(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 gd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new VI(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 zIt=[];class pa{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 zIt}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&&EIt(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=gb(this.dom),r=this.length?t>0:n>0;return new uf(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 ZM)return t;return null}static get(t){return t.cmTile}}class YM extends pa{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,o=0;for(let l of this.children){if(l.sync(t),o+=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=Pie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Pie(r);this.length=o}}function Pie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ZM extends YM{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=pa.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 o=i.children[r++];if(o instanceof Qp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-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,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class Qp extends YM{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 Qp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class d1 extends YM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new d1(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,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&HIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?hn.chrome||hn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return hn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:FC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Dy(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class k0 extends pa{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 FC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=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;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class qIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!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 Pc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(J4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=pa.get(c.dom);f&&f.setDOM(J4(c.dom))}let d=Pc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=pa.get(t.text);s&&this.cache.reused.set(s,2);let o=new Dy(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}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=M3e);let r=d1.start(t,n||((i=this.cache.find(d1))===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 o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Pc&&l.mark.eq(o))r=l,n--;else{let c=Pc.of(o,(i=this.cache.find(Pc,u=>u.mark.eq(o)))===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||!Die(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(hn.ios&&Die(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(e$,0,32)||new k0(e$.toDOM(),0,e$,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 WIt(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.fromo.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(HI,void 0,1);return i&&(i.flags=n),i||new HI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class GIt{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: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=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 qI=[k0,d1,Dy,Pc,HI,Qp,ZM];for(let e=0;e[]),this.index=qI.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],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!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(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Pc&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Pc&&(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,o=Ki.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof w0){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?f1.block:f1.inline),g=ZIt(u),b=this.cache.findWidget(m,c-l,g)||k0.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=JIt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}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=pa.get(r);if(r==this.view.contentDOM)break;s instanceof Pc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof Qp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new d1(r,M3e):i||n.push(Pc.of(new TT({tagName:r.nodeName.toLowerCase(),attributes:CIt(r)}),r)))}return{line:i,marks:n}}}function Die(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 ZIt(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 M3e={class:"cm-line"};function JIt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Qq(n,e),i&&(e.class+=" "+i)),e}function ePt(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 Pc&&t.push(i.mark)}return t}function J4(e){let t=pa.get(e);return t&&t.setDOM(e.cloneNode()),e}class f1 extends Nf{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}}f1.inline=new f1("span");f1.block=new f1("div");const e$=new class extends Nf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Mie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Fn.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 ZM(t,t.contentDOM),this.updateInner([new gd(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:!cPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?nPt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new gd(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,(hn.ie||hn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=sPt(o,this.decorations,t.changes);c.length&&(i=gd.extendWithRanges(i,c));let u=oPt(l,this.blockWrappers,t.changes);return u.length&&(i=gd.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 o=this.tile,l=new YIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&pa.get(n.text)&&l.cache.reused.set(pa.get(n.text),2),this.tile=l.run(t,n),V9(o,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=hn.chrome||hn.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)&&wE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))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)),hn.gecko&&c.empty&&!this.hasComposition&&tPt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new uf(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!kE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!kE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{hn.android&&hn.chrome&&i.contains(f.focusNode)&&lPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=$C(this.view.root);if(h)if(c.empty){if(hn.gecko){let m=iPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?m3e:g3e)(u.node,u.offset);g&&(u=new uf(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)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new uf(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new uf(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&kE(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=$C(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.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 o=im(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!pa.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];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,o,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&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof t$?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,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==os.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 Qp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,O=x?OE(x):[];if(O.length){let k=O[O.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}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"?os.RTL:os.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=OE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.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 o=OE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.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],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(Fn.replace({widget:new t$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Fn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(XM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Kq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Ki.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(j3e))try{if(u(this.view,t.range,t))return!0}catch(d){Mc(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=Gq(this.view),o={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(_It(this.view.scrollDOM,o,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(){V9(this.tile)}}function V9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)V9(i,t)}}function tPt(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 L3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=m3e(n.focusNode,n.focusOffset),r=g3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=pa.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=pa.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function nPt(e,t,n){let i=L3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=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 gd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function iPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class t$ extends Nf{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 uPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return ht.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Ro(r.text,s,!1):l=Ro(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Ro(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=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 o=e.state.sliceDoc(n.from,n.to);return n.from+R9(o,s,e.state.tabSize)}function H9(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==ol.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function fPt(e,t,n,i){let r=H9(e,t.head,t.assoc||-1),s=!i||r.type!=ol.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==os.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ht.cursor(c,n?-1:1)}return ht.cursor(n?r.to:r.from,n?-1:1)}function Lie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=BIt(r,s,o,l,n),d=w3e;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 hPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function pPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return ht.cursor(r,t.assoc);let o=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)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=q9(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:ht.cursor(i,ie.viewState.docHeight)return new nh(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ol.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==ol.Text){let f=dPt(e,r,u,o,l);return new nh(f,f==u.from?1:-1)}}if(u.type!=ol.Text)return c<(u.top+u.bottom)/2?new nh(u.from,1):new nh(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 mPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class mPt{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(o.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)==os.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return BC(t.dom,o,l).getClientRects()});return r.after?new nh(i[r.i+1],-1):new nh(i[r.i],1)}scanTile(t,n){if(!t.length)return new nh(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:BC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new nh(i[r.i+1],-1):new nh(o,1)}}const ux="￿";class gPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(tr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=ux}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 o=pa.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=pa.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:zI(r))||zI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!yPt(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,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=pa.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+(bPt(t,i.node,i.offset)?n:0))}}function bPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=F3e(t.docView.tile,n,i,0))){let c=s||o?[]:wPt(t),u=new gPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=OPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!F9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!F9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((hn.ios||hn.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(ht.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=ht.create([ht.cursor(u,m)])}else this.newSel=ht.single(d,u)}}}function F3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return F3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=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:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function B3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=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;(o===8||hn.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:xr.of(t.text.slice(s.from-l,h).split(ux))}:(m=U3e(f,t.text,u-l,d))&&(hn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==ux+ux&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:xr.of(t.text.slice(m.from,m.toB).split(ux))})}else i&&(!e.hasFocus&&r.facet(wp)||WI(i,s))&&(i=null);if(!n&&!i)return!1;if((hn.mac||hn.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=ht.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:xr.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)}:hn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:xr.of([" "])}),n)return Xq(e,n,i,o);if(i&&!WI(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=$3e(r.facet(jT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Xq(e,t,n,i=-1){if(hn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(hn.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&&vw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&vw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&vw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=xPt(e,t,n));return e.state.facet(C3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function xPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:ht.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&&L3e(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?ht.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 U3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function wPt(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 $ie(n,i)),(r!=n||s!=i)&&t.push(new $ie(r,s))),t}function OPt(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?ht.single(n+t,i+t):null}function WI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class kPt{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,hn.safari&&t.contentDOM.addEventListener("input",()=>null),hn.gecko&&FPt(t.contentDOM.ownerDocument)}handleEvent(t){!RPt(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=EPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}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&&z3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),hn.android&&hn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(hn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(Q3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||CPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&hn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&SPt(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:hn.safari&&!hn.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 SPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Fie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Mc(n.state,r)}}}function EPt(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,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(Fie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(Fie(i.value,c))}}for(let i in kf)n(i).handlers.push(kf[i]);for(let i in oc)n(i).observers.push(oc[i]);return t}const Q3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],CPt="dthko",z3e=[16,17,18,20,91,92,224,225],H_=6;function q_(e){return Math.max(0,e)*.7+8}function APt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class TPt{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=f3e(t.contentDOM),this.atoms=t.state.facet(jT).map(o=>o(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(tr.allowMultipleSelections)&&_Pt(t,n),this.dragging=NPt(t,n)&&q3e(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&&APt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Gq(this.view);t.clientX-c.left<=r+H_?n=-q_(r-t.clientX):t.clientX+c.right>=o-H_&&(n=q_(t.clientX-o)),t.clientY-c.top<=s+H_?i=-q_(s-t.clientY):t.clientY+c.bottom>=l-H_&&(i=q_(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=$3e(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 _Pt(e,t){let n=e.state.facet(O3e);return n.length?n[0](t):hn.mac?t.metaKey:t.ctrlKey}function jPt(e,t){let n=e.state.facet(k3e);return n.length?n[0](t):hn.mac?!t.altKey:!t.ctrlKey}function NPt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=$C(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function RPt(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=pa.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const kf=Object.create(null),oc=Object.create(null),V3e=hn.ie&&hn.ie_version<15||hn.ios&&hn.webkit_version<604;function IPt(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(),H3e(e,n.value)},50)}function JM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function H3e(e,t){t=JM(e.state,Hq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(W9!=null&&n.selection.ranges.every(c=>c.empty)&&W9==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((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:ht.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ht.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}oc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,hn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};oc.wheel=oc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};kf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);oc.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")};oc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};oc.touchend=(e,t)=>{e.inputState.touchActive=!1};kf.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=DPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new TPt(e,t,n,i)),i&&e.observer.ignore(()=>{h3e(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 Bie(e,t,n,i){if(i==1)return ht.cursor(t,n);if(i==2)return uPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=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?(Qie+1)%3:1}function DPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=q3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=Bie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=Bie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=MPt(r,c.pos))?u:l?r.addRange(d):ht.create([d])}}}function MPt(e,t){for(let n=0;n=t)return ht.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}kf.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,o=s+r.length;(s>=n.to||o<=n.from)&&(n=ht.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",JM(e.state,qq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};kf.dragend=e=>(e.inputState.draggedContent=null,!1);function Vie(e,t,n,i){if(n=JM(e.state,Hq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&jPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}kf.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&&Vie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Vie(e,t,i,!0),!0}return!1};kf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=V3e?null:t.clipboardData;return n?(H3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(IPt(e),!1)};function LPt(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 $Pt(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 o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:JM(e,qq,t.join(e.lineBreak)),ranges:n,linewise:i}}let W9=null;kf.copy=kf.cut=(e,t)=>{if(!wE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=$Pt(e.state);if(!n&&!r)return!1;W9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=V3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(LPt(e,n),!1)};const W3e=Ih.define();function K3e(e,t){let n=[];for(let i of e.facet(A3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:W3e.of(!0)}):null}function G3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=K3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}oc.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),G3e(e)};oc.blur=e=>{e.observer.clearSelectionRange(),G3e(e)};oc.compositionstart=oc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};oc.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,hn.chrome&&hn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};oc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};kf.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"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Xq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(hn.chrome&&hn.android&&(r=Q3e.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 o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return hn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),hn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>oc.compositionend(e,t),20),!1};const Hie=new Set;function FPt(e){Hie.has(e)||(Hie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const qie=["pre-wrap","normal","pre-line","break-spaces"];let h1=!1;function Wie(){h1=!1}class BPt{constructor(t){this.lineWrapping=t,this.doc=xr.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 qie.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)>BN&&(h1=!0),this.height=t)}replace(t,n,i){return ac.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=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,gs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,gs.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&&o(this.lineAt(0,gs.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 fu extends X3e{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 lf(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 fu||r instanceof Zo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Zo?r=new fu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ac.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 Zo extends ac{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,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Zo?i[i.length-1]=new Zo(s.length+r):i.push(null,new Zo(r-1))}if(t>0){let s=i[0];s instanceof Zo?i[0]=new Zo(t+s.length):i.unshift(new Zo(t-1),null)}return ac.of(i)}decomposeLeft(t,n){n.push(new Zo(t-1),null)}decomposeRight(t,n){n.push(null,new Zo(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 o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new Zo(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.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)>=BN&&(c=-2);let m=new fu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new Zo(s-l).updateHeight(t,l));let u=ac.of(o);return(c<0||Math.abs(u.height-this.height)>=BN||Math.abs(c-this.heightMetrics(t,n).perLine)>=BN)&&(h1=!0),KI(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 zPt extends ac{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==gs.ByPosNoHeight?gs.ByPosNoHeight:gs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){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,o);else{let u=this.lineAt(c,gs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}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 o=s.length;for(let l of i)s.push(l);if(t>0&&Kie(s,o-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?ac.of(this.break?[t,null,n]:[t,n]):(this.left=KI(this.left,t),this.right=KI(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:o}=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+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Kie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Zo&&(i=e[t+1])instanceof Zo&&e.splice(t-1,3,new Zo(n.length+1+i.length))}const VPt=5;class Yq{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 fu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new fu(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=VPt)&&this.addLineDeco(r,s,o)}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 fu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Zo(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 fu)return t;let n=new fu(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 fu)&&!this.isCovered?this.nodes.push(new fu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,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,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function KPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function GPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class i${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 BPt(i),this.stateDeco=Yie(n),this.heightMap=ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle.setDoc(n.doc),[new gd(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=Fn.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:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new W_(s,o))}}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 Zq(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(vS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Yie(this.state);let r=t.changedRanges,s=gd.extendWithRanges(r,HPt(i,this.stateDeco,t?t.changes:lo.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Wie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||h1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);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(_3e)&&(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"?os.RTL:os.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=d3e(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,o=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=f3e(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=p3e(this.scrollParent||t.win);let b=(this.printing?GPt:WPt)(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&&!KPt(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 k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();o=S>0&&r.refresh(s,S,E,C,Math.max(5,x/E),k),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),Wie();for(let S of this.viewports){let E=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(o?ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle,[new gd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new UPt(S.from,E))}h1&&(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(o?[]: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:o,visibleBottom:l}=this,c=new W_(r.lineAt(o-i*1e3,gs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,gs.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,gs.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>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=os.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(ht.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 i$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.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=[];Ki.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},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)||vS(this.heightMap.lineAt(t,gs.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)||vS(this.heightMap.lineAt(this.scaler.fromDOM(t),gs.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 vS(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}}let W_=class{constructor(t,n){this.from=t,this.to=n}};function YPt(e,t,n){let i=[],r=e,s=0;return Ki.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-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:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function G_(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 ZPt(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 Yie(e){let t=e.facet(XM).filter(i=>typeof i!="function"),n=e.facet(Kq).filter(i=>typeof i!="function");return n.length&&t.push(Ki.join(n)),t}class Zq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,gs.ByPos,t,0,0).top,d=n.lineAt(c,gs.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=o+(l.top-s)*this.scale,o=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 vS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new lf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>vS(r,t)):e._content)}const X_=mn.define({combine:e=>e.join(" ")}),K9=mn.define({combine:e=>e.indexOf(!0)>-1}),G9=pb.newName(),Y3e=pb.newName(),Z3e=pb.newName(),J3e={"&light":"."+Y3e,"&dark":"."+Z3e};function X9(e,t,n){return new pb(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 JPt=X9("."+G9,{"&":{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"}},J3e),eDt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},r$=hn.ie&&hn.ie_version<=11;class tDt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new jIt,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);(hn.ie&&hn.ie_version<=11||hn.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&&hn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(hn.chrome&&hn.chrome_version<126)&&(this.editContext=new iDt(t),t.state.facet(wp)&&(t.contentDOM.editContext=this.editContext.editContext)),r$&&(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(wp)?i.root.activeElement!=this.dom:!wE(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}(hn.ie&&hn.ie_version<=11||hn.android&&hn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&kE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=$C(t.root);if(!n)return!1;let i=hn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&nDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=wE(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&&vw(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 o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&wE(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 vPt(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=B3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!WI(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=Zie(n,t.previousSibling||t.target.previousSibling,-1),r=Zie(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(wp)!=t.state.facet(wp)&&(t.view.contentDOM.editContext=t.state.facet(wp)?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 Zie(e,t,n){for(;t;){let i=pa.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 Jie(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return kE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function nDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Jie(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?Jie(e,n):null}class iDt{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:o}=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=U3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=ht.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));WI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:xr.of(i.text.slice(d.from,d.toB).split(` -`))};if((hn.mac||hn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:xr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Xq(t,f,ht.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 o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/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=$C(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,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=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(o),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 Jt{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||NIt(t.parent)||document,this.viewState=new Gie(this,t.state||tr.create(t)),t.scrollTo&&t.scrollTo.is(V_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Bx).map(r=>new Z4(r));for(let r of this.plugins)r.update(this);this.observer=new tDt(this),this.inputState=new kPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Mie(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 Xa?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 o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(W3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=K3e(s,o),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(tr.phrases)!=this.state.facet(tr.phrases))return this.setState(s);r=VI.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(Jt.cursorScrollMargin);f=new xw(m.empty?m:ht.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(V_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=GI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(yS)!=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(X_)!=r.state.facet(X_)&&(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(z9))try{h(r)}catch(m){Mc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!B3e(this,d)&&u.force&&vw(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 Gie(this,t),this.plugins=t.facet(Bx).map(i=>new Z4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Mie(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(Bx),i=t.state.facet(Bx);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Z4(s));else{let l=this.plugins[o];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:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(p3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=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 Mc(this.state,g),ere}}),f=VI.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)&&!(hn.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),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(z9))l(n)}get themeClasses(){return G9+" "+(this.state.facet(K9)?Z3e:Y3e)+" "+this.state.facet(X_)}updateAttrs(){let t=tre(this,R3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(wp)?"true":"false",class:"cm-content",style:`${hn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),tre(this,Wq,n);let i=this.observer.ignore(()=>{let r=jie(this.contentDOM,this.contentAttrs,n),s=jie(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(Jt.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(yS);let t=this.state.facet(Jt.cspNonce);pb.mount(this.root,this.styleModules.concat(JPt).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 n$(this,t,Lie(this,t,n,i))}moveByGroup(t,n){return n$(this,t,Lie(this,t,n,i=>hPt(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 ht.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return fPt(this,t,n,i)}moveVertically(t,n,i){return n$(this,t,pPt(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=q9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),q9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[ch.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==os.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(T3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>rDt)return x3e(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||v3e(s.isolates,i=Iie(this,t))))return s.order;i||(i=Iie(this,t));let r=FIt(t.text,n,i);return this.bidiCache.push(new GI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||hn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{h3e(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,o;return V_.of(new xw(typeof t=="number"?ht.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,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return V_.of(new xw(ht.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 ma.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ma.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=pb.newName(),r=[X_.of(i),yS.of(X9(`.${i}`,t))];return n&&n.dark&&r.push(K9.of(!0)),r}static baseTheme(t){return bm.lowest(yS.of(X9("."+G9,t,J3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&pa.get(i)||pa.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=yS;Jt.inputHandler=C3e;Jt.clipboardInputFilter=Hq;Jt.clipboardOutputFilter=qq;Jt.scrollHandler=j3e;Jt.focusChangeEffect=A3e;Jt.perLineTextDirection=T3e;Jt.exceptionSink=E3e;Jt.updateListener=z9;Jt.editable=wp;Jt.mouseSelectionStyle=S3e;Jt.dragMovesSelection=k3e;Jt.clickAddsSelectionRange=O3e;Jt.decorations=XM;Jt.blockWrappers=I3e;Jt.outerDecorations=Kq;Jt.atomicRanges=jT;Jt.bidiIsolatedRanges=P3e;Jt.cursorScrollMargin=mn.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}}});Jt.scrollMargins=D3e;Jt.darkTheme=K9;Jt.cspNonce=mn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=Wq;Jt.editorAttributes=R3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=pi.define();const rDt=4096,ere={};class GI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:os.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Qq(o,n)}return n}const sDt=hn.mac?"mac":hn.windows?"win":hn.linux?"linux":"key";function aDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function lDt(e,t,n){return t4e(e4e(e.state),t,e,n)}let lg=null;const cDt=4e3;function uDt(e,t=sDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>aDt(y,t));for(let y=1;y{let O=lg={view:x,prefix:w,scope:o};return setTimeout(()=>{lg==O&&(lg=null)},cDt),!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 o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.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}=o;for(let h in d)d[h].run.push(m=>f(m,Y9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let Y9=null;function t4e(e,t,n,i){Y9=t;let r=SIt(t),s=Nc(r,0),o=th(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;lg&&lg.view==n&&lg.scope==i&&(l=lg.prefix+" ",z3e.indexOf(t.keyCode)<0&&(u=!0,lg=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+Y_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(hn.windows&&t.ctrlKey&&t.altKey)&&!(hn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=mb[t.keyCode])&&g!=r?(h(m[l+Y_(g,t,!0)])||t.shiftKey&&(b=MC[t.keyCode])!=r&&b!=g&&h(m[l+Y_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+Y_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),Y9=null,c}class Jy{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=n4e(t);return[new Jy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return dDt(t,n,i)}}function n4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==os.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function ire(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});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 dDt(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==os.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=n4e(e),u=o.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=H9(e,i,1),g=H9(e,r,-1),b=m.type==ol.Text?m:null,v=g.type==ol.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=ire(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=ire(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let k=b?x(n.from,null,b):O(m,!1),S=v?x(null,n.to,v):O(g,!0),E=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&P.from=D)break;M>I&&R(Math.max(F,I),k==null&&F<=A,Math.min(M,D),S==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(A,k==null,N,S==null,e.textDirection),{top:C,bottom:j,horizontal:T}}function O(k,S){let E=l.top+(S?k.top:k.bottom);return{top:E,bottom:E,horizontal:[]}}}function fDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class hDt{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(UN)!=t.state.facet(UN)&&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(UN);for(;n!fDt(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,hn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const UN=mn.define();function i4e(e){return[ma.define(t=>new hDt(t,e)),UN.of(e)]}const p1=mn.define({combine(e){return Ph(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function pDt(e={}){return[p1.of(e),mDt,gDt,bDt,_3e.of(!0)]}function r4e(e){return e.startState.facet(p1)!=e.state.facet(p1)}const mDt=i4e({above:!0,markers(e){let{state:t}=e,n=t.facet(p1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&hn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ht.cursor(r.head,r.assoc);for(let c of Jy.forRange(e,o,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=r4e(e);return n&&rre(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){rre(t.state,e)},class:"cm-cursorLayer"});function rre(e,t){t.style.animationDuration=e.facet(p1).cursorBlinkRate+"ms"}const gDt=i4e({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 Jy.forRange(e,"cm-selectionBackground",r))t.push(s);if(hn.ios&&!n.empty&&e.state.facet(p1).iosSelectionHandles){for(let r of Jy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ht.cursor(n.from,1)))t.push(r);for(let r of Jy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ht.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||r4e(e)},class:"cm-selectionLayer"}),bDt=bm.highest(Jt.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"}}}})),s4e=pi.define({map(e,t){return e==null?null:t.mapPos(e)}}),xS=dl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(s4e)?i.value:n,e)}}),yDt=ma.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(xS);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(xS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(xS),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(xS)!=e&&this.view.dispatch({effects:s4e.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 vDt(){return[xS,yDt]}function sre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function xDt(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 wDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=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=o}createDeco(t){let n=new nm,i=n.add.bind(n);for(let{from:r,to:s}of xDt(t,this.maxLength))sre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,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 o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;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 Z9=/x/.unicode!=null?"gu":"g",ODt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Z9),kDt={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 s$=null;function SDt(){var e;if(s$==null&&typeof document<"u"&&document.body){let t=document.body.style;s$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return s$||!1}const QN=mn.define({combine(e){let t=Ph(e,{render:null,specialChars:ODt,addSpecialChars:null});return(t.replaceTabs=!SDt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Z9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Z9)),t}});function EDt(e={}){return[QN.of(e),CDt()]}let are=null;function CDt(){return are||(are=ma.fromClass(class{constructor(e){this.view=e,this.decorations=Fn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(QN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new wDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=Nc(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=Of(o.text,l,i-o.from);return Fn.replace({widget:new jDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Fn.replace({widget:new _Dt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(QN);e.startState.facet(QN)!=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 ADt="•";function TDt(e){return e>=32?ADt:e==10?"␤":String.fromCharCode(9216+e)}class _Dt extends Nf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=TDt(this.code),i=t.state.phrase("Control character")+" "+(kDt[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 jDt extends Nf{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 NDt(){return IDt}const RDt=Fn.line({class:"cm-activeLine"}),IDt=ma.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(RDt.range(r.from)),t=r.from)}return Fn.set(n)}},{decorations:e=>e.decorations});class PDt extends Nf{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?OE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=FC(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 DDt(e){let t=ma.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Fn.set([Fn.widget({widget:new PDt(e),side:1}).range(0)]):Fn.none}get decorations(){return this.view.state.doc.length?Fn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const J9=2e3;function MDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>J9||n.off>J9||t.col<0||n.col<0){let o=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(ht.range(u.from+o,u.to+l))}}else{let o=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=R9(u.text,o,e.tabSize,!0);if(d<0)s.push(ht.cursor(u.to));else{let f=R9(u.text,l,e.tabSize);s.push(ht.range(u.from+d,u.from+f))}}}return s}function LDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function ore(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>J9?-1:r==i.length?LDt(e,t.clientX):Of(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function $Dt(e,t){let n=ore(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),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=ore(e,r);if(!l)return i;let c=MDt(e.state,n,l);return c.length?o?ht.create(c.concat(i.ranges)):ht.create(c):i}}:null}function FDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?$Dt(n,i):null)}const BDt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},UDt={style:"cursor: crosshair"};function QDt(e={}){let[t,n]=BDt[e.key||"Alt"],i=ma.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,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?UDt:null})]}const Z_="-10000px";class a4e{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(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,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 o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function zDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const a$=mn.define({combine:e=>{var t,n,i;return{position:hn.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)||zDt}}}),lre=new WeakMap,Jq=ma.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(a$);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 a4e(e,eW,(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(a$);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=Z_,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(hn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.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=Gq(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,o)=>{let l=this.manager.tooltipViews[o];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(a$).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,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Z_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=lre.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||HDt,w=this.view.textDirection==os.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 k=(O?f.top-i.top:i.bottom-f.bottom)-g;if(kx&&C.topS&&(S=O?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",cre(d,(x-e.parent.left)/r)):(d.style.top=S/s+"px",cre(d,x/r)),m){let C=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=C/r+"px"}u.overlap!==!0&&o.push({left:x,top:S,right:E,bottom:S+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=Z_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function cre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const VDt=Jt.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"}}}),HDt={x:0,y:0},eW=mn.define({enables:[Jq,VDt]}),XI=mn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class eL{static create(t){return new eL(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new a4e(t,XI,(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 qDt=eW.compute([XI],e=>{let t=e.facet(XI);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:eL.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),o4e=mn.define();class WDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,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;to.bottom||n.xo.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==os.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,o(c))},c=>Mc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Jq),n=t?t.manager.tooltips.findIndex(i=>i.create==eL.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&&!KDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!GDt(this.view,o,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 J_=4;function KDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-J_&&t.clientX<=i+J_&&t.clientY>=r-J_&&t.clientY<=s+J_}function GDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function XDt(e,t={}){let n=pi.define(),i=new WeakMap,r=dl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,il.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)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(ZDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>XI.from(o)});const s=ma.define(o=>new WDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,o4e.of(s),qDt]}}function YDt(e,t,n,i={}){var r;let s=e.state.facet(o4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function l4e(e,t){let n=e.plugin(Jq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const ZDt=pi.define(),ure=mn.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 tW(e,t){let n=e.plugin(c4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const c4e=ma.fromClass(class{constructor(e){this.input=e.state.facet(UC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(ure);this.top=new ej(e,!0,t.topContainer),this.bottom=new ej(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(ure);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new ej(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new ej(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(UC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],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:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);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=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class ej{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=dre(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=dre(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 dre(e){let t=e.nextSibling;return e.remove(),t}const UC=mn.define({enables:c4e});function JDt(e,t){let n,i=new Promise(o=>n=o),r=o=>eMt(o,t,n);e.state.field(o$,!1)?e.dispatch({effects:u4e.of(r)}):e.dispatch({effects:pi.appendConfig.of(o$.init(()=>[r]))});let s=d4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(o$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const o$=dl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(u4e)?e=[n.value].concat(e):n.is(d4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>UC.computeN([e],t=>t.field(e))}),u4e=pi.define(),d4e=pi.define();function eMt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Kr("form"),t.input){let l=Kr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Kr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Kr("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(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Kr("div",i,Kr("button",{onclick:()=>o(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 o(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 rm extends hb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}rm.prototype.elementClass="";rm.prototype.toDOM=void 0;rm.prototype.mapMode=il.TrackBefore;rm.prototype.startSide=rm.prototype.endSide=-1;rm.prototype.point=!0;const zN=mn.define(),tMt=mn.define(),nMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ki.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},EE=mn.define();function iMt(e){return[f4e(),EE.of({...nMt,...e})]}const fre=mn.define({combine:e=>e.some(t=>t)});function f4e(e){return[rMt]}const rMt=ma.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(EE).map(t=>new pre(e,t)),this.fixed=!e.state.facet(fre);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(fre)!=!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=Ki.iter(this.view.state.facet(zN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new sMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ol.Text&&o){e7(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ol.Text){e7(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.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(EE),n=e.state.facet(EE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Ki.eq(e.startState.facet(zN),e.state.facet(zN),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 o=t.indexOf(s);o<0?r.push(new pre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}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=>Jt.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==os.LTR?{left:i,right:r}:{right:i,left:r}})});function hre(e){return Array.isArray(e)?e:[e]}function e7(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class sMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Ki.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new h4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];e7(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 o=this.gutter;r.length==0&&!o.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(tMt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}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 pre{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,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=hre(n.markers(t)),n.initialSpacer&&(this.spacer=new h4e(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=hre(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!Ki.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 h4e{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":""),aMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class l$ extends rm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function c$(e,t){return e.state.facet(Ux).formatNumber(t,e.state)}const cMt=EE.compute([Ux],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(oMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new l$(c$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(lMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ux)!=t.state.facet(Ux),initialSpacer(t){return new l$(c$(t,mre(t.state.doc.lines)))},updateSpacer(t,n){let i=c$(n.view,mre(n.view.state.doc.lines));return i==t.number?t:new l$(i)},domEventHandlers:e.facet(Ux).domEventHandlers,side:"before"}));function p4e(e={}){return[Ux.of(e),f4e(),cMt]}function mre(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(uMt.range(r)))}return Ki.of(t)});function fMt(){return dMt}let hMt=0,Yf=class t7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=hMt++}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 t7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new t7(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 YI(t);return i=>i.modified.indexOf(n)>-1?i:YI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},pMt=0;class YI{constructor(t){this.name=t,this.instances=[],this.id=pMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&mMt(n,l.modified));if(i)return i;let r=[],s=new Yf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=gMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(YI.get(l,c));return s}}function mMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function gMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function ym(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=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=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=="!"){o=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 QC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return m4e.add(t)}const m4e=new ui({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 QC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let QC=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 o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function bMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function yMt(e,t,n,i=0,r=e.length){let s=new vMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class vMt{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:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=xMt(t)||QC.empty,f=bMt(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(ui.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 xMt(e){let t=e.type.prop(m4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const an=Yf.define,tj=an(),Ym=an(),gre=an(Ym),bre=an(Ym),Zm=an(),nj=an(Zm),u$=an(Zm),Kf=an(),ty=an(Kf),Vf=an(),Hf=an(),n7=an(),Ek=an(n7),ij=an(),pe={comment:tj,lineComment:an(tj),blockComment:an(tj),docComment:an(tj),name:Ym,variableName:an(Ym),typeName:gre,tagName:an(gre),propertyName:bre,attributeName:an(bre),className:an(Ym),labelName:an(Ym),namespace:an(Ym),macroName:an(Ym),literal:Zm,string:nj,docString:an(nj),character:an(nj),attributeValue:an(nj),number:u$,integer:an(u$),float:an(u$),bool:an(Zm),regexp:an(Zm),escape:an(Zm),color:an(Zm),url:an(Zm),keyword:Vf,self:an(Vf),null:an(Vf),atom:an(Vf),unit:an(Vf),modifier:an(Vf),operatorKeyword:an(Vf),controlKeyword:an(Vf),definitionKeyword:an(Vf),moduleKeyword:an(Vf),operator:Hf,derefOperator:an(Hf),arithmeticOperator:an(Hf),logicOperator:an(Hf),bitwiseOperator:an(Hf),compareOperator:an(Hf),updateOperator:an(Hf),definitionOperator:an(Hf),typeOperator:an(Hf),controlOperator:an(Hf),punctuation:n7,separator:an(n7),bracket:Ek,angleBracket:an(Ek),squareBracket:an(Ek),paren:an(Ek),brace:an(Ek),content:Kf,heading:ty,heading1:an(ty),heading2:an(ty),heading3:an(ty),heading4:an(ty),heading5:an(ty),heading6:an(ty),contentSeparator:an(Kf),list:an(Kf),quote:an(Kf),emphasis:an(Kf),strong:an(Kf),link:an(Kf),monospace:an(Kf),strikethrough:an(Kf),inserted:an(),deleted:an(),changed:an(),invalid:an(),meta:ij,documentMeta:an(ij),annotation:an(ij),processingInstruction:an(ij),definition:Yf.defineModifier("definition"),constant:Yf.defineModifier("constant"),function:Yf.defineModifier("function"),standard:Yf.defineModifier("standard"),local:Yf.defineModifier("local"),special:Yf.defineModifier("special")};for(let e in pe){let t=pe[e];t instanceof Yf&&(t.name=e)}g4e([{tag:pe.link,class:"tok-link"},{tag:pe.heading,class:"tok-heading"},{tag:pe.emphasis,class:"tok-emphasis"},{tag:pe.strong,class:"tok-strong"},{tag:pe.keyword,class:"tok-keyword"},{tag:pe.atom,class:"tok-atom"},{tag:pe.bool,class:"tok-bool"},{tag:pe.url,class:"tok-url"},{tag:pe.labelName,class:"tok-labelName"},{tag:pe.inserted,class:"tok-inserted"},{tag:pe.deleted,class:"tok-deleted"},{tag:pe.literal,class:"tok-literal"},{tag:pe.string,class:"tok-string"},{tag:pe.number,class:"tok-number"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],class:"tok-string2"},{tag:pe.variableName,class:"tok-variableName"},{tag:pe.local(pe.variableName),class:"tok-variableName tok-local"},{tag:pe.definition(pe.variableName),class:"tok-variableName tok-definition"},{tag:pe.special(pe.variableName),class:"tok-variableName2"},{tag:pe.definition(pe.propertyName),class:"tok-propertyName tok-definition"},{tag:pe.typeName,class:"tok-typeName"},{tag:pe.namespace,class:"tok-namespace"},{tag:pe.className,class:"tok-className"},{tag:pe.macroName,class:"tok-macroName"},{tag:pe.propertyName,class:"tok-propertyName"},{tag:pe.operator,class:"tok-operator"},{tag:pe.comment,class:"tok-comment"},{tag:pe.meta,class:"tok-meta"},{tag:pe.invalid,class:"tok-invalid"},{tag:pe.punctuation,class:"tok-punctuation"}]);var d$;const Og=new ui;function tL(e){return mn.define({combine:e?t=>t.concat(e):void 0})}const nW=new ui;class ku{constructor(t,n,i=[],r=""){this.data=t,this.name=r,tr.prototype.hasOwnProperty("tree")||Object.defineProperty(tr.prototype,"tree",{get(){return Yr(this)}}),this.parser=n,this.extension=[bb.of(this),tr.languageData.of((s,o,l)=>{let c=yre(s,o,l),u=c.type.prop(Og);if(!u)return[];let d=s.facet(u),f=c.type.prop(nW);if(f){let h=c.resolve(o-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 yre(t,n,i).type.prop(Og)==this.data}findRegions(t){let n=t.facet(bb);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,o)=>{if(s.prop(Og)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(ui.mounted);if(l){if(l.tree.prop(Og)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new sm(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(e){let t=e.field(ku.state,!1);return t?t.tree:Ui.empty}class wMt{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 Ck=null;class S0{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new S0(t,n,[],Ui.empty,0,i,[],null)}startParse(){return this.parser.startParse(new wMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ui.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(Up.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Ck;Ck=this;try{return t()}finally{Ck=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=vre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,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=Up.applyChanges(i,c),r=Ui.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.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=vre(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 WM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=Ck;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=o,new Ui(Za.none,[],[],o-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 Ck}}function vre(e,t,n){return Up.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class m1{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 m1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=S0.create(t.facet(bb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new m1(i)}}ku.state=dl.define({create:m1.init,update(e,t){for(let n of t.effects)if(n.is(ku.setState))return n.value;return t.startState.facet(bb)!=t.state.facet(bb)?m1.init(t.state):e.apply(t)}});let b4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(b4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const f$=typeof navigator<"u"&&(!((d$=navigator.scheduling)===null||d$===void 0)&&d$.isInputPending)?()=>navigator.scheduling.isInputPending():null,OMt=ma.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(ku.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(ku.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=b4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>f$&&f$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ku.setState.of(new m1(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=>Mc(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()}}}),bb=mn.define({combine(e){return e.length?e[0]:null},enables:e=>[ku.state,OMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class yb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class ZI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,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 ZI(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 o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const kMt=mn.define(),mO=mn.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 E0(e){let t=e.facet(mO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function zC(e,t){let n="",i=e.tabSize,r=e.facet(mO)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?SMt(e,n,t):null}class nL{constructor(t,n={}){this.state=t,this.options=n,this.unit=E0(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+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Of(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 o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const vm=new ui;function SMt(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 o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return y4e(i,e,n)}function y4e(e,t,n){for(let i=e;i;i=i.next){let r=CMt(i.node);if(r)return r(rW.create(t,n,i))}return 0}function EMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function CMt(e){let t=e.type.prop(vm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(ui.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>v4e(o,!0,1,void 0,s&&!EMt(o)?r.from:void 0)}return e.parent==null?AMt:null}function AMt(){return 0}class rW extends nL{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 rW(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(TMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return y4e(this.context.next,this.base,this.pos)}}function TMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function _Mt(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),o=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>=o)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 ww({closing:e,align:t=!0,units:n=1}){return i=>v4e(i,t,n,e)}function v4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?_Mt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const jMt=e=>e.baseIndent;function Ow({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const NMt=200;function RMt(){return tr.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+NMt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=iW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=zC(o,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 x4e=mn.define(),xm=new ui;function NT(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 PMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function JI(e,t,n){for(let i of e.facet(x4e)){let r=i(e,t,n);if(r)return r}return IMt(e,t,n)}function w4e(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 iL=pi.define({map:w4e}),RT=pi.define({map:w4e});function O4e(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 C0=dl.define({create(){return Fn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=xre(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(iL)&&!DMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(RT)&&(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(E4e),r=n.map(s=>(i?Fn.replace({widget:new QMt(i(t.state,s))}):wre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=xre(e,t.selection.main.head)),e},provide:e=>Jt.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 eP(e,t,n){var i;let r=null;return(i=e.field(C0,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function DMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function k4e(e,t){return e.field(C0,!1)?t:t.concat(pi.appendConfig.of(C4e()))}const MMt=e=>{for(let t of O4e(e)){let n=JI(e.state,t.from,t.to);if(n)return e.dispatch({effects:k4e(e.state,[iL.of(n),S4e(e,n)])}),!0}return!1},LMt=e=>{if(!e.state.field(C0,!1))return!1;let t=[];for(let n of O4e(e)){let i=eP(e.state,n.from,n.to);i&&t.push(RT.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 Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const $Mt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(C0,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(RT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},BMt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:MMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:LMt},{key:"Ctrl-Alt-[",run:$Mt},{key:"Ctrl-Alt-]",run:FMt}],UMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},E4e=mn.define({combine(e){return Ph(e,UMt)}});function C4e(e){return[C0,HMt]}function A4e(e,t){let{state:n}=e,i=n.facet(E4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=eP(e.state,l.from,l.to);c&&e.dispatch({effects:RT.of(c)}),o.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 wre=Fn.replace({widget:new class extends Nf{toDOM(e){return A4e(e,null)}}});class QMt extends Nf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return A4e(t,this.value)}}const zMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class h$ extends rm{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 VMt(e={}){let t={...zMt,...e},n=new h$(t,!0),i=new h$(t,!1),r=ma.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(bb)!=o.state.facet(bb)||o.startState.field(C0,!1)!=o.state.field(C0,!1)||Yr(o.startState)!=Yr(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new nm;for(let c of o.viewportLineBlocks){let u=eP(o.state,c.from,c.to)?i:JI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,iMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ki.empty},initialSpacer(){return new h$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=eP(o.state,l.from,l.to);if(u)return o.dispatch({effects:RT.of(u)}),!0;let d=JI(o.state,l.from,l.to);return d?(o.dispatch({effects:iL.of(d)}),!0):!1}}}),C4e()]}const HMt=Jt.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 IT{constructor(t,n){this.specs=t;let i;function r(l){let c=pb.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,o=n.scope;this.scope=o instanceof ku?l=>l.prop(Og)==o.data:o?l=>l==o:void 0,this.style=g4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new pb(i):null,this.themeType=n.themeType}static define(t,n){return new IT(t,n||{})}}const i7=mn.define(),T4e=mn.define({combine(e){return e.length?[e[0]]:null}});function VN(e){let t=e.facet(i7);return t.length?t:e.facet(T4e)}function _4e(e,t){let n=[WMt],i;return e instanceof IT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(T4e.of(e)):i?n.push(i7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(i7.of(e)),n}function Qhn(e,t,n){let i=VN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class qMt{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,VN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Yr(t.state),i=VN(t.state),r=i!=VN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(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 Fn.none;let i=new nm;for(let{from:r,to:s}of t.visibleRanges)yMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=Fn.mark({class:c})))},r,s);return i.finish()}}const WMt=bm.high(ma.fromClass(qMt,{decorations:e=>e.decorations})),KMt=IT.define([{tag:pe.meta,color:"#404740"},{tag:pe.link,textDecoration:"underline"},{tag:pe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strong,fontWeight:"bold"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.keyword,color:"#708"},{tag:[pe.atom,pe.bool,pe.url,pe.contentSeparator,pe.labelName],color:"#219"},{tag:[pe.literal,pe.inserted],color:"#164"},{tag:[pe.string,pe.deleted],color:"#a11"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],color:"#e40"},{tag:pe.definition(pe.variableName),color:"#00f"},{tag:pe.local(pe.variableName),color:"#30a"},{tag:[pe.typeName,pe.namespace],color:"#085"},{tag:pe.className,color:"#167"},{tag:[pe.special(pe.variableName),pe.macroName],color:"#256"},{tag:pe.definition(pe.propertyName),color:"#00c"},{tag:pe.comment,color:"#940"},{tag:pe.invalid,color:"#f00"}]),GMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),j4e=1e4,N4e="()[]{}",R4e=mn.define({combine(e){return Ph(e,{afterCursor:!0,brackets:N4e,maxScanDistance:j4e,renderMatch:ZMt})}}),XMt=Fn.mark({class:"cm-matchingBracket"}),YMt=Fn.mark({class:"cm-nonmatchingBracket"});function ZMt(e){let t=[],n=e.matched?XMt:YMt;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 Ore(e){let t=[],n=e.facet(R4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=uh(e,i.head,-1,n)||i.head>0&&uh(e,i.head-1,1,n)||n.afterCursor&&(uh(e,i.head,1,n)||i.heade.decorations}),eLt=[JMt,GMt];function tLt(e={}){return[R4e.of(e),eLt]}const I4e=new ui;function r7(e,t,n){let i=e.prop(t<0?ui.openedBy:ui.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 s7(e){let t=e.type.prop(I4e);return t?t(e.node):e}function uh(e,t,n,i={}){let r=i.maxScanDistance||j4e,s=i.brackets||N4e,o=Yr(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=r7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return nLt(e,t,n,c,d,u,s)}}return iLt(e,t,n,o,l.type,r,s)}function nLt(e,t,n,i,r,s,o){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=o.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 kre(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=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?o.toLowerCase():o,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 rLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||sLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||oW,mergeTokens:e.mergeTokens!==!1}}function sLt(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 Sre=new WeakMap;class sW extends ku{constructor(t){let n=tL(t.languageData),i=rLt(t),r,s=new class extends WM{createParse(o,l,c){return new oLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=uLt(n,this),r=this,this.streamParser=i,this.stateAfter=new ui({perNode:!0}),this.tokenTable=t.tokenTable?new $4e(i.tokenTable):cLt}static define(t){return new sW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Sre.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 o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Ui&&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 o=t.positions[s],l=t.children[s],c;if(on&&aW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=D4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?E0(r):4),tree:Ui.empty}}let oLt=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=S0.get(),o=r[0].from,{state:l,tree:c}=aLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(E0(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=S0.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=$_(t),i=q0(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=$_(t),i=q0(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 QRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BRt||null,prettyErrors:t}}function B5e(e,t={}){const{lineCounter:n,prettyErrors:i}=QRt(t),r=new URt(n==null?void 0:n.addNewLine),s=new DRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new vS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(rie(e,n)),o.warnings.forEach(rie(e,n))),o}function zRt(e,t,n){let i;const r=B5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>u5e(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 VM(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 ET(e)&&!i?e.toString(n):new _T(e,i,n).toString(n)}const U5e=1024;let VRt=0,gd=class{constructor(t,n){this.from=t,this.to=n}};class li{constructor(t={}){this.id=VRt++,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=Ja.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}li.closedBy=new li({deserialize:e=>e.split(" ")});li.openedBy=new li({deserialize:e=>e.split(" ")});li.group=new li({deserialize:e=>e.split(" ")});li.isolate=new li({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});li.contextHash=new li({perNode:!0});li.lookAhead=new li({perNode:!0});li.mounted=new li({perNode:!0});class bw{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[li.mounted.id]}}const HRt=Object.create(null);class Ja{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):HRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Ja(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(li.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(li.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Ja.none=new Ja("",Object.create(null),0,8);class mk{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|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:Dq(Ja.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Hi(Ja.none,n,i,r)))}static build(t){return GRt(t)}}Hi.empty=new Hi(Ja.none,[],[],0);class Iq{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 Iq(this.buffer,this.index)}}class cb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Ja.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=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 PC(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]+o.from,h;if(!(!(s&Ar.EnterBracketed&&d instanceof Hi&&(h=bw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!Q5e(r,i,f,f+d.length))){if(d instanceof cb){if(s&Ar.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new ch(new qRt(o,d,t,f),null,m)}else if(s&Ar.IncludeAnonymous||!d.type.isAnonymous||Pq(d)){let m;if(!(s&Ar.IgnoreMounts)&&(m=bw.get(d))&&!m.overlay)return new _l(m.tree,f,t,o);let g=new _l(d,f,t,o);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||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<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(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=bw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Ar.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new _l(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 die(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=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 y9(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 qRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class ch extends z5e{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 ch(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 ch(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 ch(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 ch(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 o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function V5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new _l(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(PC(l,t,n,!1))}}return r?V5e(r):i}class $I{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 _l)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 _l?(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,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Ar.IncludeAnonymous||l instanceof cb||!l.type.isAnonymous||Pq(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 o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Pq(e){return e.children.some(t=>t instanceof cb||!t.type.isAnonymous||Pq(t))}function GRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=U5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Iq(n,n.length):n,c=i.types,u=0,d=0;function f(S,O,A,E,j,T){let{id:R,start:C,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let H=s[R];A.push(H),E.push(C-S);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=C-S;if(N-C<=r&&(F=v(l.pos-O,j))){let H=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=H.length;for(;l.pos>q;)U=y(F.start,H,U);L=new cb(H,N-F.start,i),M=F.start-S}else{let H=l.pos-P;l.next();let q=[],U=[],Z=R>=o?R:-1,z=0,J=N;for(;l.pos>H;)Z>=0&&l.id==Z&&l.size>=0?(l.end<=J-r&&(g(q,U,C,z,l.end,J,Z,I,D),z=q.length,J=l.end),l.next()):T>2500?h(C,H,q,U):f(C,H,q,U,Z,T+1);if(Z>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Dq(_,q,U,0,q.length,0,N-C,ne,ne)}else L=b(_,q,U,N-C,I-N,D)}A.push(L),E.push(M)}function h(S,O,A,E){let j=[],T=0,R=-1;for(;l.pos>O;){let{id:C,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)C[I++]=j[P],C[I++]=j[P+1]-N,C[I++]=j[P+2]-N,C[I++]=I;A.push(new cb(C,j[2]-N,i)),E.push(N-S)}}function m(S,O){return(A,E,j)=>{let T=0,R=A.length-1,C,N;if(R>=0&&(C=A[R])instanceof Hi){if(!R&&C.type==S&&C.length==j)return C;(N=C.prop(li.lookAhead))&&(T=E[R]+C.length+N)}return b(S,A,E,j,T,O)}}function g(S,O,A,E,j,T,R,C,N){let P=[],I=[];for(;S.length>E;)P.push(S.pop()),I.push(O.pop()+A-j);S.push(b(i.types[R],P,I,T-j,C-T,N)),O.push(j-A)}function b(S,O,A,E,j,T,R){if(T){let C=[li.contextHash,T];R=R?[C].concat(R):[C]}if(j>25){let C=[li.lookAhead,j];R=R?[C].concat(R):[C]}return new Hi(S,O,A,E,R)}function v(S,O){let A=l.fork(),E=0,j=0,T=0,R=A.end-r,C={size:0,start:0,skip:0};e:for(let N=A.pos-S;A.pos>N;){let P=A.size;if(A.id==O&&P>=0){C.size=E,C.start=j,C.skip=T,T+=4,E+=4,A.next();continue}let I=A.pos-P;if(P<0||I=o?4:0,_=A.start;for(A.next();A.pos>I;){if(A.size<0)if(A.size==-3||A.size==-4)D+=4;else break e;else A.id>=o&&(D+=4);A.next()}j=_,E+=P,T+=D}return(O<0||E==S)&&(C.size=E,C.start=j,C.skip=T),C.size>4?C:void 0}function y(S,O,A){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)A=y(S,O,A)}O[--A]=C,O[--A]=T-S,O[--A]=j-S,O[--A]=E}else R==-3?u=E:R==-4&&(d=E);return A}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let k=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Hi(c[e.topID],w.reverse(),x.reverse(),k)}const fie=new WeakMap;function MN(e,t){if(!e.isAnonymous||t instanceof cb||t.type!=e)return 1;let n=fie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Hi)){n=1;break}n+=MN(e,i)}fie.set(t,n)}return n}function Dq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;O+=A}if(x==k+1){if(O>d){let A=g[k];m(A.children,A.positions,0,A.children.length,b[k]+w);continue}f.push(g[k])}else{let A=b[x-1]+g[x-1].length-S;f.push(Dq(e,g,b,k,x,S,A,null,c))}h.push(S+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Mq{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 ch?this.setBuffer(t.context.buffer,t.index,n):t instanceof _l&&this.map.set(t.tree,n)}get(t){return t instanceof ch?this.getBuffer(t.context.buffer,t.index):t instanceof _l?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 Qp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Qp(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,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.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 Qp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew gd(r.from,r.to)):[new gd(0,0)]:[new gd(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 XRt{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 H5e(e){return(t,n,i,r)=>new ZRt(t,e,n,i,r)}class hie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function pie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class YRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new li({perNode:!0});class ZRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Hi(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,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[li.mounted.id]=new bw(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&&(o=JRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew gd(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 gd(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=bie(this.ranges,n.ranges);u.length&&(pie(u),this.inner.splice(n.index,0,new hie(n.parser,n.parser.startParse(this.input,yie(n.mounts,u),u),n.ranges.map(d=>new gd(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 JRt(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 mie(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 Hi)n=n.children[0];else break}return!1}}let tIt=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(v9))!==null&&n!==void 0?n:i.to,this.inner=new gie(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(v9))!==null&&t!==void 0?t:n.to,this.inner=new gie(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 o=(i=s.tree)===null||i===void 0?void 0:i.prop(li.mounted);if(o&&o.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:o})}}}return r}};function bie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new gd(l,c.to))):c.to>l?n[s--]=new gd(l,c.to):n.splice(s--,1))}}return i}function nIt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew gd(h.from+i,h.to+i)),f=nIt(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 Qp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Qp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],q5e=[];(()=>{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=q5e[i])t=i+1;else return!0;if(t==n)return!1}}function vie(e){return e>=127462&&e<=127487}const xie=8205;function rIt(e,t,n=!0,i=!0){return(n?W5e:sIt)(e,t,i)}function W5e(e,t,n){if(t==e.length)return t;t&&K5e(e.charCodeAt(t))&&G5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=wie(i);t=0&&vie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function sIt(e,t,n){for(;t>1;){let i=W5e(e,t-2,n);if(i=56320&&e<57344}function G5e(e){return e>=55296&&e<56320}function wie(e){return e<65536?1:2}let Or=class X5e{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]=f1(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),th.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]=f1(this,t,n);let i=[];return this.decompose(t,n,i,0),th.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 wE(this),s=new wE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new wE(this,t)}iterRange(t,n=this.length){return new Y5e(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 Z5e(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]?X5e.empty:t.length<=32?new Sa(t):th.from(Sa.split(t,[]))}};class Sa extends Or{constructor(t,n=aIt(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 o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new oIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Sa(kie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=LN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new Sa(l,o.length+s.length));else{let c=l.length>>1;i.push(new Sa(l.slice(0,c)),new Sa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Sa))return super.replace(t,n,i);[t,n]=f1(this,t,n);let r=LN(this.text,LN(i.text,kie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Sa(r,s):th.from(Sa.split(r,[]),s)}sliceString(t,n=this.length,i=` +`){[t,n]=f1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(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 Sa(i,r)),i=[],r=-1);return r>-1&&n.push(new Sa(i,r)),n}}class th extends Or{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 o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=f1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new th(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]=f1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof th))return 0;let i=0,[r,s,o,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==o||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 Sa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof th)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof Sa&&c&&(g=d[d.length-1])instanceof Sa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new Sa(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]:th.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new th(l,n)}}Or.empty=new Sa([""],0);function aIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function LN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Sa?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],o=s>>1,l=r instanceof Sa?r.text.length:r.children.length;if(o==(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 Sa){let c=r.text[o+(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[o+(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 Sa?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 Y5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new wE(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 Z5e{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"&&(Or.prototype[Symbol.iterator]=function(){return this.iter()},wE.prototype[Symbol.iterator]=Y5e.prototype[Symbol.iterator]=Z5e.prototype[Symbol.iterator]=function(){return this});let oIt=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 f1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Lo(e,t,n=!0,i=!0){return rIt(e,t,n,i)}function lIt(e){return e>=56320&&e<57344}function cIt(e){return e>=55296&&e<56320}function Ac(e,t){let n=e.charCodeAt(t);if(!cIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return lIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Lq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function nh(e){return e<65536?1:2}const w9=/\r\n?|\n/;var al=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(al||(al={}));class xh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=al.Simple&&u>=t&&(i==al.TrackDel&&rt||i==al.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 xh(t)}static create(t){return new xh(t)}}class co extends xh{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 k9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return O9(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]=o;let c=r>>1;for(;i.length0&&vg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Or.of(m.split(i||w9)):m:Or.empty,b=g.length;if(f==h&&b==0)return;fo&&El(r,f-o,-1),El(r,h-f,b),vg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new co(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 o!="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 vg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function O9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new DC(e),l=new DC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);El(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.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||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class DC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Or.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Or.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 sg{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 sg(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return pt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return pt.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 pt.range(t.anchor,t.head)}static create(t,n,i,r){return new sg(t,n,i,r)}}class pt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:pt.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 pt(t.ranges.map(n=>sg.fromJSON(n)),t.main)}static single(t,n=t){return new pt([pt.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?pt.range(c,l):pt.range(l,c))}}return new pt(t,n)}}function e3e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let $q=0;class pn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=$q++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new pn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:Fq),!!t.static,t.enables)}of(t){return new $N([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function Fq(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class $N{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=$q++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=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[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!Oie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=BI(h,g);if(this.dependencies.every(v=>v instanceof pn?h.facet(v)===f.facet(v):v instanceof pl?h.field(v,!1)==f.field(v,!1):!0)||(l?Oie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function Oie(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)),o=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(B_).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],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(B_),o=r.facet(B_),l;return(l=s.find(c=>c.field==this))&&l!=o.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,B_.of({field:this,create:t})]}get extension(){return this}}const by={lowest:4,low:3,default:2,high:1,highest:0};function EO(e){return t=>new t3e(t,e)}const ym={highest:EO(by.highest),high:EO(by.high),default:EO(by.default),low:EO(by.low),lowest:EO(by.lowest)};class t3e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class qM{of(t){return new E9(this,t)}reconfigure(t){return qM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class FI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of dIt(t,n,o))h instanceof pl?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,Fq(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=>uIt(v,g,m))}}let f=u.map(h=>h(l));return new FI(t,o,f,l,c,s)}}function dIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof t3e)s(o.inner,o.prec);else if(o instanceof pl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof $N)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,by.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.`);s(u,l)}}return s(e,by.default),i.reduce((o,l)=>o.concat(l))}function kE(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 BI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const n3e=pn.define(),C9=pn.define({combine:e=>e.some(t=>t),static:!0}),i3e=pn.define({combine:e=>e.length?e[0]:void 0,static:!0}),r3e=pn.define(),s3e=pn.define(),a3e=pn.define(),o3e=pn.define({combine:e=>e.length?e[0]:!1});class Dh{constructor(t,n){this.type=t,this.value=n}static define(){return new fIt}}class fIt{of(t){return new Dh(this,t)}}class hIt{constructor(t){this.map=t}of(t){return new hi(this,t)}}class hi{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 hi(this.type,n)}is(t){return this.type==t}static define(t={}){return new hIt(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}}hi.reconfigure=hi.define();hi.appendConfig=hi.define();class Ya{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&e3e(i,n.newLength),s.some(l=>l.type==Ya.time)||(this.annotations=s.concat(Ya.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Ya(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(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(Ya.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Ya.time=Dh.define();Ya.userEvent=Dh.define();Ya.addToHistory=Dh.define();Ya.remote=Dh.define();function pIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Ya?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Ya?e=s[0]:e=c3e(t,yw(s),!1)}return e}function gIt(e){let t=e.startState,n=t.facet(a3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=l3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Ya.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const bIt=[];function yw(e){return e==null?bIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const yIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function vIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||yIt.test(n)))return!0}return!1}function xIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(vIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class sr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(hi.reconfigure)?(n=null,i=l.value):l.is(hi.appendConfig)&&(n=null,i=yw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=FI.resolve(i,r,this),s=new sr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new sr(n,t.newDoc,o,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:pt.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=yw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return sr.create({doc:t.doc,selection:pt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=FI.resolve(t.extensions||[],new Map),i=t.doc instanceof Or?t.doc:Or.of((t.doc||"").split(n.staticFacet(sr.lineSeparator)||w9)),r=t.selection?t.selection instanceof pt?t.selection:pt.single(t.selection.anchor,t.selection.head):pt.single(0);return e3e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new sr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(sr.tabSize)}get lineBreak(){return this.facet(sr.lineSeparator)||` +`}get readOnly(){return this.facet(o3e)}phrase(t,...n){for(let i of this.facet(sr.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(n3e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return xIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Lo(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});sr.lineSeparator=i3e;sr.readOnly=o3e;sr.phrases=pn.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])}});sr.languageData=n3e;sr.changeFilter=r3e;sr.transactionFilter=s3e;sr.transactionExtender=a3e;qM.reconfigure=hi.define();function Mh(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);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 ub{eq(t){return this==t}range(t,n=t){return MC.create(t,n,this)}}ub.prototype.startSide=ub.prototype.endSide=0;ub.prototype.point=!1;ub.prototype.mapMode=al.TrackDel;function Bq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class MC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new MC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uq{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 o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Uq(r,s,i,l):null,pos:o}}}class Yi{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 Yi(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,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Yi.of(n):this;let l=new u3e(this,null,-1).goto(0),c=0,u=[],d=new im;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+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return LC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return LC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=Sie(o,l,i),u=new CO(o,c,s),d=new CO(l,c,s);i.iterGaps((f,h,m)=>Eie(u,f,d,h,m,r)),i.empty&&i.length==0&&Eie(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),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=Sie(s,o),c=new CO(s,l,0).goto(i),u=new CO(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Bq(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 o=new CO(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new im;for(let r of t instanceof MC?[t]:n?wIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Yi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Yi.empty;r=r.nextLayer)n=new Yi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Yi.empty=new Yi([],[],null,-1);function wIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Yi.empty.nextLayer=Yi.empty;class im{finishChunk(t){this.chunks.push(new Uq(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 im)).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(Yi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Yi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Sie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=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 u3e(o,n,i,s));return r.length==1?r[0]:new LC(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--)K4(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--)K4(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(),K4(this.heap,0)}}}function K4(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 CO{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=LC.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){U_(this.active,t),U_(this.activeTo,t),U_(this.activeRank,t),this.minActive=Cie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;Q_(this.active,n,i),Q_(this.activeTo,n,r),Q_(this.activeRank,n,s),t&&Q_(t,n,this.cursor.from),this.minActive=Cie(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&&U_(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 Eie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=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,o);if(e.point||n.point?(e.point&&n.point&&Bq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(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 Cie(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=Lo(e,r)}return i===!0?-1:e.length}const R9="ͼ",Aie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Tie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class db{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.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?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=Tie[Aie]||1;return Tie[Aie]=t+1,R9+t.toString(36)}static mount(t,n,i){let r=t[I9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new kIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let _ie=new Map;class kIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=_ie.get(i);if(s)return t[I9]=s;this.sheet=new r.CSSStyleSheet,_ie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[I9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-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:'"'},OIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),SIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var il=0;il<10;il++)fb[48+il]=fb[96+il]=String(il);for(var il=1;il<=24;il++)fb[il+111]="F"+il;for(var il=65;il<=90;il++)fb[il]=String.fromCharCode(il+32),$C[il]=String.fromCharCode(il);for(var G4 in fb)$C.hasOwnProperty(G4)||($C[G4]=fb[G4]);function EIt(e){var t=OIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||SIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?$C:fb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var dn={mac:Rie||/Mac/.test(Kl.platform),windows:/Win/.test(Kl.platform),linux:/Linux|X11/.test(Kl.platform),ie:WM,ie_version:f3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:jie,gecko_version:jie?+(/Firefox\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Rie,android:/Android\b/.test(Kl.userAgent),webkit:Nie,webkit_version:Nie?+(/\bAppleWebKit\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qq(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 UI=Object.create(null);function zq(e,t,n){if(e==t)return!0;e||(e=UI),t||(t=UI);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 CIt(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 Iie(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 AIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new gv(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:o}=h3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new gv(t,i,r,n,t.widget||null,!0)}static line(t){return new RT(t)}static set(t,n=!1){return Yi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$n.none=Yi.empty;class NT extends $n{constructor(t){let{start:n,end:i}=h3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Qq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||UI}eq(t){return this==t||t instanceof NT&&this.tagName==t.tagName&&zq(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)}}NT.prototype.point=!1;class RT extends $n{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof RT&&this.spec.class==t.spec.class&&zq(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)}}RT.prototype.mapMode=al.TrackBefore;RT.prototype.point=!0;class gv extends $n{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?al.TrackBefore:al.TrackAfter:al.TrackDel}get type(){return this.startSide!=this.endSide?ul.WidgetRange:this.startSide<=0?ul.WidgetBefore:ul.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof gv&&TIt(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)}}gv.prototype.point=!0;function h3e(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 TIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function vw(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 FC extends ub{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof FC&&this.tagName==t.tagName&&zq(this.attributes,t.attributes)}static create(t){return new FC(t.tagName,t.attributes||UI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Yi.of(t,n)}}FC.prototype.startSide=FC.prototype.endSide=-1;function BC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function OE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function SE(e){return e.nodeType==3?QC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function EE(e,t,n,i){return n?Pie(e,t,n,i,-1)||Pie(e,t,n,i,1):!1}function hb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function QI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Pie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:rm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=hb(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?rm(e):0}else return!1}}function rm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function UC(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 _It(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 p3e(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 jIt(e,t,n,i,r,s,o,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=_It(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}=p3e(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+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,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 m3e(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 NIt{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?rm(n):0),i,Math.min(t.focusOffset,i?rm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let hy=null;dn.safari&&dn.safari_version>=26&&(hy=!1);function g3e(e){if(e.setActive)return e.setActive();if(hy)return e.focus(hy);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(hy==null?{get preventScroll(){return hy={preventScroll:!0},!0}}:void 0),!hy){hy=!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 y3e(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=rm(n)}else if(n.parentNode&&!QI(n))i=hb(n),n=n.parentNode;else return null}}function v3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function k3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Qf[b+1]==-m){let v=Qf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(ls[f]=ls[Qf[b]]=y),l=b;break}}else{if(Qf.length==189)break;Qf[l++]=f,Qf[l++]=h,Qf[l++]=c}else if((g=ls[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Qf[v+2];if(y&2)break;if(b)Qf[v+2]|=2;else{if(y&4)break;Qf[v+2]|=4}}}}}function FIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),ls[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new uh(c,b.from,m));let v=b.direction==bv!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?ls[g]!=l:ls[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=ls[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(ls[v-1]==l)break e;break}}if(h)h.push(b);else{b.tols.length;)ls[ls.length]=256;let i=[],r=t==bv?0:1;return U9(e,r,r,n,0,e.length,i),i}function O3e(e){return[new uh(0,e,0)]}let S3e="";function UIt(e,t,n,i,r){var s;let o=i.head-e.from,l=uh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Lo(e.text,o,c.forward(r,n));(dc.to)&&(d=u),S3e=e.text.slice(Math.min(o,d),Math.max(o,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)}),R3e=pn.define({combine:e=>e.some(t=>t)}),I3e=pn.define();class ww{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new ww(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 ww(pt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z_=hi.define({map:(e,t)=>e.map(t)}),P3e=hi.define();function Rc(e,t,n){let i=e.facet(T3e);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 kp=pn.define({combine:e=>e.length?e[0]:!0});let zIt=0;const Ux=pn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(KM.of(u=>{let d=u.plugin(l);return d?o(d):$n.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ba.define((i,r)=>new t(i,r),n)}}class Y4{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(Rc(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){Rc(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){Rc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const D3e=pn.define(),Wq=pn.define(),KM=pn.define(),M3e=pn.define(),Kq=pn.define(),IT=pn.define(),L3e=pn.define();function Mie(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 Yi.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-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=QIt(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 $3e=pn.define();function Gq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet($3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const xS=pn.define();class bd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new bd(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 bd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new zI(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 VIt=[];class ga{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 VIt}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&&CIt(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=hb(this.dom),r=this.length?t>0:n>0;return new of(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 XM)return t;return null}static get(t){return t.cmTile}}class GM extends ga{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,o=0;for(let l of this.children){if(l.sync(t),o+=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=Lie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Lie(r);this.length=o}}function Lie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class XM extends GM{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=ga.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 o=i.children[r++];if(o instanceof zp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-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,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class zp extends GM{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 zp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class h1 extends GM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new h1(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,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&qIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?dn.chrome||dn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return dn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:UC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new jy(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class yv extends ga{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 UC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=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;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class WIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!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 jc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=ga.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=jc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=ga.get(t.text);s&&this.cache.reused.set(s,2);let o=new jy(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}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=F3e);let r=h1.start(t,n||((i=this.cache.find(h1))===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 o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof jc&&l.mark.eq(o))r=l,n--;else{let c=jc.of(o,(i=this.cache.find(jc,u=>u.mark.eq(o)))===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||!$ie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(dn.ios&&$ie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new yv(J4.toDOM(),0,J4,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 KIt(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.fromo.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(VI,void 0,1);return i&&(i.flags=n),i||new VI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class XIt{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: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=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 HI=[yv,h1,jy,jc,VI,zp,XM];for(let e=0;e[]),this.index=HI.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],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!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(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof jc&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof jc&&(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,o=Yi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof gv){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?p1.block:p1.inline),g=JIt(u),b=this.cache.findWidget(m,c-l,g)||yv.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=ePt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}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=ga.get(r);if(r==this.view.contentDOM)break;s instanceof jc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof zp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new h1(r,F3e):i||n.push(jc.of(new NT({tagName:r.nodeName.toLowerCase(),attributes:AIt(r)}),r)))}return{line:i,marks:n}}}function $ie(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 JIt(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 F3e={class:"cm-line"};function ePt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Qq(n,e),i&&(e.class+=" "+i)),e}function tPt(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 jc&&t.push(i.mark)}return t}function Z4(e){let t=ga.get(e);return t&&t.setDOM(e.cloneNode()),e}class p1 extends Tf{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}}p1.inline=new p1("span");p1.block=new p1("div");const J4=new class extends Tf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Fie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$n.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 XM(t,t.contentDOM),this.updateInner([new bd(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:!uPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?iPt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new bd(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,(dn.ie||dn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=aPt(o,this.decorations,t.changes);c.length&&(i=bd.extendWithRanges(i,c));let u=lPt(l,this.blockWrappers,t.changes);return u.length&&(i=bd.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 o=this.tile,l=new ZIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ga.get(n.text)&&l.cache.reused.set(ga.get(n.text),2),this.tile=l.run(t,n),z9(o,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=dn.chrome||dn.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)&&OE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))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)),dn.gecko&&c.empty&&!this.hasComposition&&nPt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new of(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!EE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!EE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{dn.android&&dn.chrome&&i.contains(f.focusNode)&&cPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=BC(this.view.root);if(h)if(c.empty){if(dn.gecko){let m=rPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?y3e:v3e)(u.node,u.offset);g&&(u=new of(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)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new of(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new of(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&EE(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=BC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.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 o=rm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ga.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];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,o,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&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?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,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==cs.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 zp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,k=x?SE(x):[];if(k.length){let S=k[k.length-1],O=c?S.right-y.left:y.right-S.left;O>l&&(l=O,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"?cs.RTL:cs.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=SE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.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 o=SE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.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],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push($n.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return $n.set(t)}updateDeco(){let t=1,n=this.view.state.facet(KM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Kq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Yi.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(I3e))try{if(u(this.view,t.range,t))return!0}catch(d){Rc(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=Gq(this.view),o={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(jIt(this.view.scrollDOM,o,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(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function nPt(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 B3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=y3e(n.focusNode,n.focusOffset),r=v3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ga.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=ga.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function iPt(e,t,n){let i=B3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=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 bd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function rPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends Tf{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 dPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return pt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Lo(r.text,s,!1):l=Lo(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Lo(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=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 o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(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==ul.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function hPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ul.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==cs.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return pt.cursor(c,n?-1:1)}return pt.cursor(n?r.to:r.from,n?-1:1)}function Bie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=UIt(r,s,o,l,n),d=S3e;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 pPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function mPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return pt.cursor(r,t.assoc);let o=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)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(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:pt.cursor(i,ie.viewState.docHeight)return new ih(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ul.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==ul.Text){let f=fPt(e,r,u,o,l);return new ih(f,f==u.from?1:-1)}}if(u.type!=ul.Text)return c<(u.top+u.bottom)/2?new ih(u.from,1):new ih(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 gPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class gPt{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(o.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 k=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)==cs.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return QC(t.dom,o,l).getClientRects()});return r.after?new ih(i[r.i+1],-1):new ih(i[r.i],1)}scanTile(t,n){if(!t.length)return new ih(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:QC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new ih(i[r.i+1],-1):new ih(o,1)}}const dx="￿";class bPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(sr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=dx}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 o=ga.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=ga.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:QI(r))||QI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!vPt(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,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=ga.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+(yPt(t,i.node,i.offset)?n:0))}}function yPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=Q3e(t.docView.tile,n,i,0))){let c=s||o?[]:kPt(t),u=new bPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=OPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((dn.ios||dn.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(pt.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=pt.create([pt.cursor(u,m)])}else this.newSel=pt.single(d,u)}}}function Q3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return Q3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=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:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function z3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=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;(o===8||dn.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:Or.of(t.text.slice(s.from-l,h).split(dx))}:(m=V3e(f,t.text,u-l,d))&&(dn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==dx+dx&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Or.of(t.text.slice(m.from,m.toB).split(dx))})}else i&&(!e.hasFocus&&r.facet(kp)||qI(i,s))&&(i=null);if(!n&&!i)return!1;if((dn.mac||dn.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=pt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Or.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)}:dn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=pt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Or.of([" "])}),n)return Xq(e,n,i,o);if(i&&!qI(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=U3e(r.facet(IT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Xq(e,t,n,i=-1){if(dn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(dn.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&&xw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&xw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&xw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=wPt(e,t,n));return e.state.facet(_3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function wPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:pt.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&&B3e(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?pt.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 V3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function kPt(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 Uie(n,i)),(r!=n||s!=i)&&t.push(new Uie(r,s))),t}function OPt(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?pt.single(n+t,i+t):null}function qI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class SPt{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,dn.safari&&t.contentDOM.addEventListener("input",()=>null),dn.gecko&&BPt(t.contentDOM.ownerDocument)}handleEvent(t){!IPt(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=CPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}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&&q3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),dn.android&&dn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(dn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(H3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||APt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&dn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&EPt(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:dn.safari&&!dn.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 EPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Qie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Rc(n.state,r)}}}function CPt(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,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(Qie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(Qie(i.value,c))}}for(let i in xf)n(i).handlers.push(xf[i]);for(let i in rc)n(i).observers.push(rc[i]);return t}const H3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],APt="dthko",q3e=[16,17,18,20,91,92,224,225],V_=6;function H_(e){return Math.max(0,e)*.7+8}function TPt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class _Pt{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=m3e(t.contentDOM),this.atoms=t.state.facet(IT).map(o=>o(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(sr.allowMultipleSelections)&&jPt(t,n),this.dragging=RPt(t,n)&&G3e(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&&TPt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Gq(this.view);t.clientX-c.left<=r+V_?n=-H_(r-t.clientX):t.clientX+c.right>=o-V_&&(n=H_(t.clientX-o)),t.clientY-c.top<=s+V_?i=-H_(s-t.clientY):t.clientY+c.bottom>=l-V_&&(i=H_(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=U3e(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 jPt(e,t){let n=e.state.facet(E3e);return n.length?n[0](t):dn.mac?t.metaKey:t.ctrlKey}function NPt(e,t){let n=e.state.facet(C3e);return n.length?n[0](t):dn.mac?!t.altKey:!t.ctrlKey}function RPt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=BC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function IPt(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=ga.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const xf=Object.create(null),rc=Object.create(null),W3e=dn.ie&&dn.ie_version<15||dn.ios&&dn.webkit_version<604;function PPt(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(),K3e(e,n.value)},50)}function YM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function K3e(e,t){t=YM(e.state,Hq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==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((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:pt.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:pt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,dn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};rc.wheel=rc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};xf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);rc.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")};rc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};rc.touchend=(e,t)=>{e.inputState.touchActive=!1};xf.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(A3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=MPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new _Pt(e,t,n,i)),i&&e.observer.ignore(()=>{g3e(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 zie(e,t,n,i){if(i==1)return pt.cursor(t,n);if(i==2)return dPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=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?(Hie+1)%3:1}function MPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=G3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=zie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=zie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=LPt(r,c.pos))?u:l?r.addRange(d):pt.create([d])}}}function LPt(e,t){for(let n=0;n=t)return pt.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}xf.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,o=s+r.length;(s>=n.to||o<=n.from)&&(n=pt.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",YM(e.state,qq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};xf.dragend=e=>(e.inputState.draggedContent=null,!1);function Wie(e,t,n,i){if(n=YM(e.state,Hq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&NPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}xf.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&&Wie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Wie(e,t,i,!0),!0}return!1};xf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=W3e?null:t.clipboardData;return n?(K3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(PPt(e),!1)};function $Pt(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 FPt(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 o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:YM(e,qq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;xf.copy=xf.cut=(e,t)=>{if(!OE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=FPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=W3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):($Pt(e,n),!1)};const X3e=Dh.define();function Y3e(e,t){let n=[];for(let i of e.facet(j3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:X3e.of(!0)}):null}function Z3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Y3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}rc.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),Z3e(e)};rc.blur=e=>{e.observer.clearSelectionRange(),Z3e(e)};rc.compositionstart=rc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};rc.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,dn.chrome&&dn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};rc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};xf.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"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Xq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(dn.chrome&&dn.android&&(r=H3e.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 o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return dn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),dn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>rc.compositionend(e,t),20),!1};const Kie=new Set;function BPt(e){Kie.has(e)||(Kie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Gie=["pre-wrap","normal","pre-line","break-spaces"];let m1=!1;function Xie(){m1=!1}class UPt{constructor(t){this.lineWrapping=t,this.doc=Or.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)>FN&&(m1=!0),this.height=t)}replace(t,n,i){return ic.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=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,xs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,xs.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&&o(this.lineAt(0,xs.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 mu extends J3e{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 sf(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 mu||r instanceof tl&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof tl?r=new mu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ic.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 tl extends ic{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,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof tl?i[i.length-1]=new tl(s.length+r):i.push(null,new tl(r-1))}if(t>0){let s=i[0];s instanceof tl?i[0]=new tl(t+s.length):i.unshift(new tl(t-1),null)}return ic.of(i)}decomposeLeft(t,n){n.push(new tl(t-1),null)}decomposeRight(t,n){n.push(null,new tl(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 o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new tl(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.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)>=FN&&(c=-2);let m=new mu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new tl(s-l).updateHeight(t,l));let u=ic.of(o);return(c<0||Math.abs(u.height-this.height)>=FN||Math.abs(c-this.heightMetrics(t,n).perLine)>=FN)&&(m1=!0),WI(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 VPt extends ic{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==xs.ByPosNoHeight?xs.ByPosNoHeight:xs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){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,o);else{let u=this.lineAt(c,xs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}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 o=s.length;for(let l of i)s.push(l);if(t>0&&Yie(s,o-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?ic.of(this.break?[t,null,n]:[t,n]):(this.left=WI(this.left,t),this.right=WI(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:o}=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+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(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 tl&&(i=e[t+1])instanceof tl&&e.splice(t-1,3,new tl(n.length+1+i.length))}const HPt=5;class Yq{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 mu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new mu(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=HPt)&&this.addLineDeco(r,s,o)}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 mu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new tl(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 mu)return t;let n=new mu(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 mu)&&!this.isCovered?this.nodes.push(new mu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,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,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function GPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function XPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${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 UPt(i),this.stateDeco=ere(n),this.heightMap=ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle.setDoc(n.doc),[new bd(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=$n.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:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new q_(s,o))}}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?Jie:new Zq(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(wS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=ere(this.state);let r=t.changedRanges,s=bd.extendWithRanges(r,qPt(i,this.stateDeco,t?t.changes:co.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Xie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||m1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);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(R3e)&&(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"?cs.RTL:cs.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||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:O}=p3e(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=S,this.scaleY=O,u|=16,o=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=m3e(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=b3e(this.scrollParent||t.win);let b=(this.printing?XPt:KPt)(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&&!GPt(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)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:A,textHeight:E}=t.docView.measureTextSize();o=O>0&&r.refresh(s,O,A,E,Math.max(5,x/A),S),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),Xie();for(let O of this.viewports){let A=O.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(O);this.heightMap=(o?ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle,[new bd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new QPt(O.from,A))}m1&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]: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:o,visibleBottom:l}=this,c=new q_(r.lineAt(o-i*1e3,xs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,xs.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,xs.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>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=cs.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(pt.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 n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let O of t)O.from>=d.from&&O.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=[];Yi.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},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)||wS(this.heightMap.lineAt(t,xs.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)||wS(this.heightMap.lineAt(this.scaler.fromDOM(t),xs.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 wS(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}}let q_=class{constructor(t,n){this.from=t,this.to=n}};function ZPt(e,t,n){let i=[],r=e,s=0;return Yi.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-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:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function K_(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 JPt(e,t){for(let n of e)if(t(n))return n}const Jie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ere(e){let t=e.facet(KM).filter(i=>typeof i!="function"),n=e.facet(Kq).filter(i=>typeof i!="function");return n.length&&t.push(Yi.join(n)),t}class Zq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,xs.ByPos,t,0,0).top,d=n.lineAt(c,xs.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=o+(l.top-s)*this.scale,o=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 wS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new sf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>wS(r,t)):e._content)}const G_=pn.define({combine:e=>e.join(" ")}),W9=pn.define({combine:e=>e.indexOf(!0)>-1}),K9=db.newName(),e4e=db.newName(),t4e=db.newName(),n4e={"&light":"."+e4e,"&dark":"."+t4e};function G9(e,t,n){return new db(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 eDt=G9("."+K9,{"&":{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"}},n4e),tDt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=dn.ie&&dn.ie_version<=11;class nDt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new NIt,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);(dn.ie&&dn.ie_version<=11||dn.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&&dn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(dn.chrome&&dn.chrome_version<126)&&(this.editContext=new rDt(t),t.state.facet(kp)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(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(kp)?i.root.activeElement!=this.dom:!OE(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}(dn.ie&&dn.ie_version<=11||dn.android&&dn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&EE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=BC(t.root);if(!n)return!1;let i=dn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&iDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=OE(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&&xw(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 o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&OE(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 xPt(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=z3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!qI(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=tre(n,t.previousSibling||t.target.previousSibling,-1),r=tre(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(kp)!=t.state.facet(kp)&&(t.view.contentDOM.editContext=t.state.facet(kp)?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 tre(e,t,n){for(;t;){let i=ga.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 nre(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return EE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function iDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return nre(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?nre(e,n):null}class rDt{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:o}=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=V3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=pt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));qI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Or.of(i.text.slice(d.from,d.toB).split(` +`))};if((dn.mac||dn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Or.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Xq(t,f,pt.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 o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/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=BC(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,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=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(o),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 Jt{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||RIt(t.parent)||document,this.viewState=new Zie(this,t.state||sr.create(t)),t.scrollTo&&t.scrollTo.is(z_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ux).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new nDt(this),this.inputState=new SPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fie(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 Ya?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 o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(X3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=Y3e(s,o),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(sr.phrases)!=this.state.facet(sr.phrases))return this.setState(s);r=zI.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(Jt.cursorScrollMargin);f=new ww(m.empty?m:pt.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(z_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=KI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(xS)!=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(G_)!=r.state.facet(G_)&&(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(Q9))try{h(r)}catch(m){Rc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!z3e(this,d)&&u.force&&xw(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 Zie(this,t),this.plugins=t.facet(Ux).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Fie(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(Ux),i=t.state.facet(Ux);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];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:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(b3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=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 Rc(this.state,g),ire}}),f=zI.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)&&!(dn.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),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?t4e:e4e)+" "+this.state.facet(G_)}updateAttrs(){let t=rre(this,D3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(kp)?"true":"false",class:"cm-content",style:`${dn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),rre(this,Wq,n);let i=this.observer.ignore(()=>{let r=Iie(this.contentDOM,this.contentAttrs,n),s=Iie(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(Jt.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(xS);let t=this.state.facet(Jt.cspNonce);db.mount(this.root,this.styleModules.concat(eDt).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 t$(this,t,Bie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Bie(this,t,n,i=>pPt(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 pt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return hPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,mPt(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=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[uh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==cs.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>sDt)return O3e(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||k3e(s.isolates,i=Mie(this,t))))return s.order;i||(i=Mie(this,t));let r=BIt(t.text,n,i);return this.bidiCache.push(new KI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||dn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{g3e(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,o;return z_.of(new ww(typeof t=="number"?pt.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,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return z_.of(new ww(pt.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 ba.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ba.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=db.newName(),r=[G_.of(i),xS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return ym.lowest(xS.of(G9("."+K9,t,n4e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&ga.get(i)||ga.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=xS;Jt.inputHandler=_3e;Jt.clipboardInputFilter=Hq;Jt.clipboardOutputFilter=qq;Jt.scrollHandler=I3e;Jt.focusChangeEffect=j3e;Jt.perLineTextDirection=N3e;Jt.exceptionSink=T3e;Jt.updateListener=Q9;Jt.editable=kp;Jt.mouseSelectionStyle=A3e;Jt.dragMovesSelection=C3e;Jt.clickAddsSelectionRange=E3e;Jt.decorations=KM;Jt.blockWrappers=M3e;Jt.outerDecorations=Kq;Jt.atomicRanges=IT;Jt.bidiIsolatedRanges=L3e;Jt.cursorScrollMargin=pn.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}}});Jt.scrollMargins=$3e;Jt.darkTheme=W9;Jt.cspNonce=pn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=Wq;Jt.editorAttributes=D3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=hi.define();const sDt=4096,ire={};class KI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:cs.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Qq(o,n)}return n}const aDt=dn.mac?"mac":dn.windows?"win":dn.linux?"linux":"key";function oDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function cDt(e,t,n){return r4e(i4e(e.state),t,e,n)}let ag=null;const uDt=4e3;function dDt(e,t=aDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>oDt(y,t));for(let y=1;y{let k=ag={view:x,prefix:w,scope:o};return setTimeout(()=>{ag==k&&(ag=null)},uDt),!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 o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.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}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function r4e(e,t,n,i){X9=t;let r=EIt(t),s=Ac(r,0),o=nh(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;ag&&ag.view==n&&ag.scope==i&&(l=ag.prefix+" ",q3e.indexOf(t.keyCode)<0&&(u=!0,ag=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+X_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(dn.windows&&t.ctrlKey&&t.altKey)&&!(dn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=fb[t.keyCode])&&g!=r?(h(m[l+X_(g,t,!0)])||t.shiftKey&&(b=$C[t.keyCode])!=r&&b!=g&&h(m[l+X_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+X_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Ky{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=s4e(t);return[new Ky(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return fDt(t,n,i)}}function s4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==cs.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function are(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});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 fDt(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==cs.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=s4e(e),u=o.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=V9(e,i,1),g=V9(e,r,-1),b=m.type==ul.Text?m:null,v=g.type==ul.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=are(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=are(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):k(m,!1),O=v?x(null,n.to,v):k(g,!0),A=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2C&&P.from=D)break;M>I&&R(Math.max(F,I),S==null&&F<=C,Math.min(M,D),O==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(C,S==null,N,O==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function k(S,O){let A=l.top+(O?S.top:S.bottom);return{top:A,bottom:A,horizontal:[]}}}function hDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class pDt{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(BN)!=t.state.facet(BN)&&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(BN);for(;n!hDt(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,dn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const BN=pn.define();function a4e(e){return[ba.define(t=>new pDt(t,e)),BN.of(e)]}const g1=pn.define({combine(e){return Mh(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function mDt(e={}){return[g1.of(e),gDt,bDt,yDt,R3e.of(!0)]}function o4e(e){return e.startState.facet(g1)!=e.state.facet(g1)}const gDt=a4e({above:!0,markers(e){let{state:t}=e,n=t.facet(g1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&dn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:pt.cursor(r.head,r.assoc);for(let c of Ky.forRange(e,o,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=o4e(e);return n&&ore(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ore(t.state,e)},class:"cm-cursorLayer"});function ore(e,t){t.style.animationDuration=e.facet(g1).cursorBlinkRate+"ms"}const bDt=a4e({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 Ky.forRange(e,"cm-selectionBackground",r))t.push(s);if(dn.ios&&!n.empty&&e.state.facet(g1).iosSelectionHandles){for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-start",pt.cursor(n.from,1)))t.push(r);for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-end",pt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||o4e(e)},class:"cm-selectionLayer"}),yDt=ym.highest(Jt.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"}}}})),l4e=hi.define({map(e,t){return e==null?null:t.mapPos(e)}}),kS=pl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(l4e)?i.value:n,e)}}),vDt=ba.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(kS);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(kS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(kS),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(kS)!=e&&this.view.dispatch({effects:l4e.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 xDt(){return[kS,vDt]}function lre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function wDt(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 kDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=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=o}createDeco(t){let n=new im,i=n.add.bind(n);for(let{from:r,to:s}of wDt(t,this.maxLength))lre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,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 o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;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 Y9=/x/.unicode!=null?"gu":"g",ODt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),SDt={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 r$=null;function EDt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const UN=pn.define({combine(e){let t=Mh(e,{render:null,specialChars:ODt,addSpecialChars:null});return(t.replaceTabs=!EDt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function CDt(e={}){return[UN.of(e),ADt()]}let cre=null;function ADt(){return cre||(cre=ba.fromClass(class{constructor(e){this.view=e,this.decorations=$n.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(UN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new kDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=Ac(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=vf(o.text,l,i-o.from);return $n.replace({widget:new NDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=$n.replace({widget:new jDt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(UN);e.startState.facet(UN)!=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 TDt="•";function _Dt(e){return e>=32?TDt:e==10?"␤":String.fromCharCode(9216+e)}class jDt extends Tf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=_Dt(this.code),i=t.state.phrase("Control character")+" "+(SDt[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 NDt extends Tf{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 RDt(){return PDt}const IDt=$n.line({class:"cm-activeLine"}),PDt=ba.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(IDt.range(r.from)),t=r.from)}return $n.set(n)}},{decorations:e=>e.decorations});class DDt extends Tf{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?SE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=UC(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 MDt(e){let t=ba.fromClass(class{constructor(n){this.view=n,this.placeholder=e?$n.set([$n.widget({widget:new DDt(e),side:1}).range(0)]):$n.none}get decorations(){return this.view.state.doc.length?$n.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function LDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=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(pt.range(u.from+o,u.to+l))}}else{let o=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=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(pt.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(pt.range(u.from+d,u.from+f))}}}return s}function $Dt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function ure(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>Z9?-1:r==i.length?$Dt(e,t.clientX):vf(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function FDt(e,t){let n=ure(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),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=ure(e,r);if(!l)return i;let c=LDt(e.state,n,l);return c.length?o?pt.create(c.concat(i.ranges)):pt.create(c):i}}:null}function BDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?FDt(n,i):null)}const UDt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},QDt={style:"cursor: crosshair"};function zDt(e={}){let[t,n]=UDt[e.key||"Alt"],i=ba.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,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?QDt:null})]}const Y_="-10000px";class c4e{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(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,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 o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function VDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=pn.define({combine:e=>{var t,n,i;return{position:dn.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)||VDt}}}),dre=new WeakMap,Jq=ba.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(s$);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 c4e(e,eW,(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(s$);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=Y_,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(dn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.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=Gq(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,o)=>{let l=this.manager.tooltipViews[o];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(s$).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,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Y_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=dre.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||qDt,w=this.view.textDirection==cs.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),k=this.above[l];!c.strictSide&&(k?f.top-v-g-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let S=(k?f.top-i.top:i.bottom-f.bottom)-g;if(Sx&&E.topO&&(O=k?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(O-e.parent.top)/s+"px",fre(d,(x-e.parent.left)/r)):(d.style.top=O/s+"px",fre(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&&o.push({left:x,top:O,right:A,bottom:O+v}),d.classList.toggle("cm-tooltip-above",k),d.classList.toggle("cm-tooltip-below",!k),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=Y_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function fre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const HDt=Jt.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"}}}),qDt={x:0,y:0},eW=pn.define({enables:[Jq,HDt]}),GI=pn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class ZM{static create(t){return new ZM(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new c4e(t,GI,(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 WDt=eW.compute([GI],e=>{let t=e.facet(GI);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:ZM.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),u4e=pn.define();class KDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,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;to.bottom||n.xo.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==cs.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,o(c))},c=>Rc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Jq),n=t?t.manager.tooltips.findIndex(i=>i.create==ZM.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&&!GDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!XDt(this.view,o,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 Z_=4;function GDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Z_&&t.clientX<=i+Z_&&t.clientY>=r-Z_&&t.clientY<=s+Z_}function XDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function YDt(e,t={}){let n=hi.define(),i=new WeakMap,r=pl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,al.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)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(JDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>GI.from(o)});const s=ba.define(o=>new KDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,u4e.of(s),WDt]}}function ZDt(e,t,n,i={}){var r;let s=e.state.facet(u4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function d4e(e,t){let n=e.plugin(Jq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const JDt=hi.define(),hre=pn.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 tW(e,t){let n=e.plugin(f4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const f4e=ba.fromClass(class{constructor(e){this.input=e.state.facet(zC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(hre);this.top=new J_(e,!0,t.topContainer),this.bottom=new J_(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(hre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new J_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new J_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(zC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],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:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);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=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class J_{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=pre(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=pre(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 pre(e){let t=e.nextSibling;return e.remove(),t}const zC=pn.define({enables:f4e});function eMt(e,t){let n,i=new Promise(o=>n=o),r=o=>tMt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:h4e.of(r)}):e.dispatch({effects:hi.appendConfig.of(a$.init(()=>[r]))});let s=p4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=pl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(h4e)?e=[n.value].concat(e):n.is(p4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>zC.computeN([e],t=>t.field(e))}),h4e=hi.define(),p4e=hi.define();function tMt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Yr("form"),t.input){let l=Yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Yr("div",i,Yr("button",{onclick:()=>o(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 o(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 sm extends ub{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sm.prototype.elementClass="";sm.prototype.toDOM=void 0;sm.prototype.mapMode=al.TrackBefore;sm.prototype.startSide=sm.prototype.endSide=-1;sm.prototype.point=!0;const QN=pn.define(),nMt=pn.define(),iMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Yi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},AE=pn.define();function rMt(e){return[m4e(),AE.of({...iMt,...e})]}const mre=pn.define({combine:e=>e.some(t=>t)});function m4e(e){return[sMt]}const sMt=ba.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(AE).map(t=>new bre(e,t)),this.fixed=!e.state.facet(mre);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(mre)!=!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=Yi.iter(this.view.state.facet(QN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new aMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ul.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ul.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.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(AE),n=e.state.facet(AE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Yi.eq(e.startState.facet(QN),e.state.facet(QN),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 o=t.indexOf(s);o<0?r.push(new bre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}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=>Jt.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==cs.LTR?{left:i,right:r}:{right:i,left:r}})});function gre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class aMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Yi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new g4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(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 o=this.gutter;r.length==0&&!o.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(nMt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}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 bre{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,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=gre(n.markers(t)),n.initialSpacer&&(this.spacer=new g4e(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=gre(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!Yi.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 g4e{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":""),oMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends sm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet(Qx).formatNumber(t,e.state)}const uMt=AE.compute([Qx],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(lMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(cMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Qx)!=t.state.facet(Qx),initialSpacer(t){return new o$(l$(t,yre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,yre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet(Qx).domEventHandlers,side:"before"}));function b4e(e={}){return[Qx.of(e),m4e(),uMt]}function yre(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(dMt.range(r)))}return Yi.of(t)});function hMt(){return fMt}let pMt=0,Xf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=pMt++}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 e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(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 XI(t);return i=>i.modified.indexOf(n)>-1?i:XI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},mMt=0;class XI{constructor(t){this.name=t,this.instances=[],this.id=mMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&gMt(n,l.modified));if(i)return i;let r=[],s=new Xf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=bMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(XI.get(l,c));return s}}function gMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function bMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function vm(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=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=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=="!"){o=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 VC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return y4e.add(t)}const y4e=new li({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 VC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let VC=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 o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function yMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function vMt(e,t,n,i=0,r=e.length){let s=new xMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class xMt{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:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=wMt(t)||VC.empty,f=yMt(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(li.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 wMt(e){let t=e.type.prop(y4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const sn=Xf.define,ej=sn(),Gm=sn(),vre=sn(Gm),xre=sn(Gm),Xm=sn(),tj=sn(Xm),c$=sn(Xm),Wf=sn(),Xb=sn(Wf),zf=sn(),Vf=sn(),t7=sn(),AO=sn(t7),nj=sn(),me={comment:ej,lineComment:sn(ej),blockComment:sn(ej),docComment:sn(ej),name:Gm,variableName:sn(Gm),typeName:vre,tagName:sn(vre),propertyName:xre,attributeName:sn(xre),className:sn(Gm),labelName:sn(Gm),namespace:sn(Gm),macroName:sn(Gm),literal:Xm,string:tj,docString:sn(tj),character:sn(tj),attributeValue:sn(tj),number:c$,integer:sn(c$),float:sn(c$),bool:sn(Xm),regexp:sn(Xm),escape:sn(Xm),color:sn(Xm),url:sn(Xm),keyword:zf,self:sn(zf),null:sn(zf),atom:sn(zf),unit:sn(zf),modifier:sn(zf),operatorKeyword:sn(zf),controlKeyword:sn(zf),definitionKeyword:sn(zf),moduleKeyword:sn(zf),operator:Vf,derefOperator:sn(Vf),arithmeticOperator:sn(Vf),logicOperator:sn(Vf),bitwiseOperator:sn(Vf),compareOperator:sn(Vf),updateOperator:sn(Vf),definitionOperator:sn(Vf),typeOperator:sn(Vf),controlOperator:sn(Vf),punctuation:t7,separator:sn(t7),bracket:AO,angleBracket:sn(AO),squareBracket:sn(AO),paren:sn(AO),brace:sn(AO),content:Wf,heading:Xb,heading1:sn(Xb),heading2:sn(Xb),heading3:sn(Xb),heading4:sn(Xb),heading5:sn(Xb),heading6:sn(Xb),contentSeparator:sn(Wf),list:sn(Wf),quote:sn(Wf),emphasis:sn(Wf),strong:sn(Wf),link:sn(Wf),monospace:sn(Wf),strikethrough:sn(Wf),inserted:sn(),deleted:sn(),changed:sn(),invalid:sn(),meta:nj,documentMeta:sn(nj),annotation:sn(nj),processingInstruction:sn(nj),definition:Xf.defineModifier("definition"),constant:Xf.defineModifier("constant"),function:Xf.defineModifier("function"),standard:Xf.defineModifier("standard"),local:Xf.defineModifier("local"),special:Xf.defineModifier("special")};for(let e in me){let t=me[e];t instanceof Xf&&(t.name=e)}v4e([{tag:me.link,class:"tok-link"},{tag:me.heading,class:"tok-heading"},{tag:me.emphasis,class:"tok-emphasis"},{tag:me.strong,class:"tok-strong"},{tag:me.keyword,class:"tok-keyword"},{tag:me.atom,class:"tok-atom"},{tag:me.bool,class:"tok-bool"},{tag:me.url,class:"tok-url"},{tag:me.labelName,class:"tok-labelName"},{tag:me.inserted,class:"tok-inserted"},{tag:me.deleted,class:"tok-deleted"},{tag:me.literal,class:"tok-literal"},{tag:me.string,class:"tok-string"},{tag:me.number,class:"tok-number"},{tag:[me.regexp,me.escape,me.special(me.string)],class:"tok-string2"},{tag:me.variableName,class:"tok-variableName"},{tag:me.local(me.variableName),class:"tok-variableName tok-local"},{tag:me.definition(me.variableName),class:"tok-variableName tok-definition"},{tag:me.special(me.variableName),class:"tok-variableName2"},{tag:me.definition(me.propertyName),class:"tok-propertyName tok-definition"},{tag:me.typeName,class:"tok-typeName"},{tag:me.namespace,class:"tok-namespace"},{tag:me.className,class:"tok-className"},{tag:me.macroName,class:"tok-macroName"},{tag:me.propertyName,class:"tok-propertyName"},{tag:me.operator,class:"tok-operator"},{tag:me.comment,class:"tok-comment"},{tag:me.meta,class:"tok-meta"},{tag:me.invalid,class:"tok-invalid"},{tag:me.punctuation,class:"tok-punctuation"}]);var u$;const xg=new li;function JM(e){return pn.define({combine:e?t=>t.concat(e):void 0})}const nW=new li;class Au{constructor(t,n,i=[],r=""){this.data=t,this.name=r,sr.prototype.hasOwnProperty("tree")||Object.defineProperty(sr.prototype,"tree",{get(){return es(this)}}),this.parser=n,this.extension=[pb.of(this),sr.languageData.of((s,o,l)=>{let c=wre(s,o,l),u=c.type.prop(xg);if(!u)return[];let d=s.facet(u),f=c.type.prop(nW);if(f){let h=c.resolve(o-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 wre(t,n,i).type.prop(xg)==this.data}findRegions(t){let n=t.facet(pb);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,o)=>{if(s.prop(xg)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(li.mounted);if(l){if(l.tree.prop(xg)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new am(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function es(e){let t=e.field(Au.state,!1);return t?t.tree:Hi.empty}class kMt{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 TO=null;class vv{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new vv(t,n,[],Hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new kMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Qp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=TO;TO=this;try{return t()}finally{TO=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=kre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,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=Qp.applyChanges(i,c),r=Hi.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.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=kre(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 HM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=TO;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=o,new Hi(Ja.none,[],[],o-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 TO}}function kre(e,t,n){return Qp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class b1{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 b1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=vv.create(t.facet(pb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new b1(i)}}Au.state=pl.define({create:b1.init,update(e,t){for(let n of t.effects)if(n.is(Au.setState))return n.value;return t.startState.facet(pb)!=t.state.facet(pb)?b1.init(t.state):e.apply(t)}});let x4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(x4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,OMt=ba.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(Au.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(Au.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=x4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Au.setState.of(new b1(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=>Rc(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()}}}),pb=pn.define({combine(e){return e.length?e[0]:null},enables:e=>[Au.state,OMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class mb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class YI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,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 YI(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 o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const SMt=pn.define(),bk=pn.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 xv(e){let t=e.facet(bk);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function HC(e,t){let n="",i=e.tabSize,r=e.facet(bk)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?EMt(e,n,t):null}class eL{constructor(t,n={}){this.state=t,this.options=n,this.unit=xv(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+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return vf(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 o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const xm=new li;function EMt(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 o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return w4e(i,e,n)}function w4e(e,t,n){for(let i=e;i;i=i.next){let r=AMt(i.node);if(r)return r(rW.create(t,n,i))}return 0}function CMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function AMt(e){let t=e.type.prop(xm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(li.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>k4e(o,!0,1,void 0,s&&!CMt(o)?r.from:void 0)}return e.parent==null?TMt:null}function TMt(){return 0}class rW extends eL{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 rW(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(_Mt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return w4e(this.context.next,this.base,this.pos)}}function _Mt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function jMt(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),o=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>=o)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 kw({closing:e,align:t=!0,units:n=1}){return i=>k4e(i,t,n,e)}function k4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?jMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const NMt=e=>e.baseIndent;function Ow({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const RMt=200;function IMt(){return sr.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+RMt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=iW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=HC(o,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 O4e=pn.define(),wm=new li;function PT(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 DMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function ZI(e,t,n){for(let i of e.facet(O4e)){let r=i(e,t,n);if(r)return r}return PMt(e,t,n)}function S4e(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 tL=hi.define({map:S4e}),DT=hi.define({map:S4e});function E4e(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 wv=pl.define({create(){return $n.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=Ore(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(tL)&&!MMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(DT)&&(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(T4e),r=n.map(s=>(i?$n.replace({widget:new zMt(i(t.state,s))}):Sre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=Ore(e,t.selection.main.head)),e},provide:e=>Jt.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 JI(e,t,n){var i;let r=null;return(i=e.field(wv,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function MMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function C4e(e,t){return e.field(wv,!1)?t:t.concat(hi.appendConfig.of(_4e()))}const LMt=e=>{for(let t of E4e(e)){let n=ZI(e.state,t.from,t.to);if(n)return e.dispatch({effects:C4e(e.state,[tL.of(n),A4e(e,n)])}),!0}return!1},$Mt=e=>{if(!e.state.field(wv,!1))return!1;let t=[];for(let n of E4e(e)){let i=JI(e.state,n.from,n.to);i&&t.push(DT.of(i),A4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function A4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const FMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(wv,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(DT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},UMt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:LMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:$Mt},{key:"Ctrl-Alt-[",run:FMt},{key:"Ctrl-Alt-]",run:BMt}],QMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},T4e=pn.define({combine(e){return Mh(e,QMt)}});function _4e(e){return[wv,qMt]}function j4e(e,t){let{state:n}=e,i=n.facet(T4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=JI(e.state,l.from,l.to);c&&e.dispatch({effects:DT.of(c)}),o.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 Sre=$n.replace({widget:new class extends Tf{toDOM(e){return j4e(e,null)}}});class zMt extends Tf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return j4e(t,this.value)}}const VMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends sm{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 HMt(e={}){let t={...VMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ba.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(pb)!=o.state.facet(pb)||o.startState.field(wv,!1)!=o.state.field(wv,!1)||es(o.startState)!=es(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new im;for(let c of o.viewportLineBlocks){let u=JI(o.state,c.from,c.to)?i:ZI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,rMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Yi.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=JI(o.state,l.from,l.to);if(u)return o.dispatch({effects:DT.of(u)}),!0;let d=ZI(o.state,l.from,l.to);return d?(o.dispatch({effects:tL.of(d)}),!0):!1}}}),_4e()]}const qMt=Jt.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 MT{constructor(t,n){this.specs=t;let i;function r(l){let c=db.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,o=n.scope;this.scope=o instanceof Au?l=>l.prop(xg)==o.data:o?l=>l==o:void 0,this.style=v4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new db(i):null,this.themeType=n.themeType}static define(t,n){return new MT(t,n||{})}}const n7=pn.define(),N4e=pn.define({combine(e){return e.length?[e[0]]:null}});function zN(e){let t=e.facet(n7);return t.length?t:e.facet(N4e)}function R4e(e,t){let n=[KMt],i;return e instanceof MT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(N4e.of(e)):i?n.push(n7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function qhn(e,t,n){let i=zN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class WMt{constructor(t){this.markCache=Object.create(null),this.tree=es(t.state),this.decorations=this.buildDeco(t,zN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=es(t.state),i=zN(t.state),r=i!=zN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(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 $n.none;let i=new im;for(let{from:r,to:s}of t.visibleRanges)vMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=$n.mark({class:c})))},r,s);return i.finish()}}const KMt=ym.high(ba.fromClass(WMt,{decorations:e=>e.decorations})),GMt=MT.define([{tag:me.meta,color:"#404740"},{tag:me.link,textDecoration:"underline"},{tag:me.heading,textDecoration:"underline",fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strong,fontWeight:"bold"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.keyword,color:"#708"},{tag:[me.atom,me.bool,me.url,me.contentSeparator,me.labelName],color:"#219"},{tag:[me.literal,me.inserted],color:"#164"},{tag:[me.string,me.deleted],color:"#a11"},{tag:[me.regexp,me.escape,me.special(me.string)],color:"#e40"},{tag:me.definition(me.variableName),color:"#00f"},{tag:me.local(me.variableName),color:"#30a"},{tag:[me.typeName,me.namespace],color:"#085"},{tag:me.className,color:"#167"},{tag:[me.special(me.variableName),me.macroName],color:"#256"},{tag:me.definition(me.propertyName),color:"#00c"},{tag:me.comment,color:"#940"},{tag:me.invalid,color:"#f00"}]),XMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),I4e=1e4,P4e="()[]{}",D4e=pn.define({combine(e){return Mh(e,{afterCursor:!0,brackets:P4e,maxScanDistance:I4e,renderMatch:JMt})}}),YMt=$n.mark({class:"cm-matchingBracket"}),ZMt=$n.mark({class:"cm-nonmatchingBracket"});function JMt(e){let t=[],n=e.matched?YMt:ZMt;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 Ere(e){let t=[],n=e.facet(D4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=dh(e,i.head,-1,n)||i.head>0&&dh(e,i.head-1,1,n)||n.afterCursor&&(dh(e,i.head,1,n)||i.heade.decorations}),tLt=[eLt,XMt];function nLt(e={}){return[D4e.of(e),tLt]}const M4e=new li;function i7(e,t,n){let i=e.prop(t<0?li.openedBy:li.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 r7(e){let t=e.type.prop(M4e);return t?t(e.node):e}function dh(e,t,n,i={}){let r=i.maxScanDistance||I4e,s=i.brackets||P4e,o=es(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return iLt(e,t,n,c,d,u,s)}}return rLt(e,t,n,o,l.type,r,s)}function iLt(e,t,n,i,r,s,o){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=o.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 Cre(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=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?o.toLowerCase():o,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 sLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||aLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||oW,mergeTokens:e.mergeTokens!==!1}}function aLt(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 Are=new WeakMap;class sW extends Au{constructor(t){let n=JM(t.languageData),i=sLt(t),r,s=new class extends HM{createParse(o,l,c){return new lLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=dLt(n,this),r=this,this.streamParser=i,this.stateAfter=new li({perNode:!0}),this.tokenTable=t.tokenTable?new U4e(i.tokenTable):uLt}static define(t){return new sW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Are.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 o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&aW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=$4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?xv(r):4),tree:Hi.empty}}let lLt=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=vv.get(),o=r[0].from,{state:l,tree:c}=oLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(xv(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=vv.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 o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+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 o=this.ranges[++this.rangeIndex].from;n+=o-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 o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+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,o=new P4e(n,t?t.state.tabSize:4,t?E0(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=M4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const oW=Object.create(null),VC=[Za.none],lLt=new hO(VC),Ere=[],Cre=Object.create(null),L4e=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"]])L4e[e]=F4e(oW,t);class $4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),L4e)}resolve(t){return t?this.table[t]||(this.table[t]=F4e(this.extra,t)):0}}const cLt=new $4e(oW);function p$(e,t){Ere.indexOf(e)>-1||(Ere.push(e),console.warn(t))}function F4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||pe[u];d?typeof d=="function"?c.length?c=c.map(d):p$(u,`Modifier ${u} used at start of tag`):c.length?p$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:p$(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=Cre[r];if(s)return s.id;let o=Cre[r]=Za.define({id:VC.length,name:i,props:[ym({[i]:n})]});return VC.push(o),o.id}function uLt(e,t){let n=Za.define({id:VC.length,name:"Document",props:[Og.add(()=>e),vm.add(()=>i=>t.getIndent(i))],top:!0});return VC.push(n),n}os.RTL,os.LTR;var Are={};class tP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,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 tP(t,[],n,i,i,0,[],0,r?new Tre(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,o=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[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+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:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.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 tP(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 dLt(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,o;sc&1&&l==o)||r.push(n[s],o)}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 o=this.findForcedReduction();if(o==null)return!1;n=o}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,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&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(o,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 Tre{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class dLt{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 nP{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 nP(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 nP(this.stack,this.pos,this.index)}}function wS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-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 HN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _re=new HN;class fLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_re,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 o=this.ranges[++r];s+=o.from-i.to,i=o}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=_re,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 kw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;B4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}kw.prototype.contextual=kw.prototype.fallback=kw.prototype.extend=!1;class iP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?wS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(B4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}iP.prototype.contextual=kw.prototype.fallback=kw.prototype.extend=!1;class Ia{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function B4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||hLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=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{o=e[g+2],t.advance();continue e}}break}}function jre(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function hLt(e,t,n,i){let r=jre(n,i,t);return r<0||jre(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 pLt=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?Nre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Nre(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=o,null;if(s instanceof Ui){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class mLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new HN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=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 HN,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 HN,{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 o=0;o=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 pLt(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[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)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 o=r&&yLt(r);if(o)return iu&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw iu&&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 o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return iu&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";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(ui.contextHash)||0)==d))return t.useNode(f,h),iu&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ui)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Ui&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),iu&&console.log(o+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 Rre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),iu&&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()&&(iu&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)iu&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))iu&&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),iu&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Rre(l,i)):(!r||r.scoree;class rL{constructor(t){this.start=t.start,this.shift=t.shift||g$,this.reduce=t.reduce||g$,this.reuse=t.reuse||g$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class am extends WM{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 hO(n.map((l,c)=>Za.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=$5e;let o=wS(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 kw(o,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 gLt(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 o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>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=mp(this.data,s+2);else break;r=n(mp(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=mp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(am.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 o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Ire(o),o})),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 o=n.indexOf(s);o>=0&&(i[o]=!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 vLt=316,xLt=317,Pre=1,wLt=2,OLt=3,kLt=4,SLt=318,ELt=320,CLt=321,ALt=5,TLt=6,_Lt=0,a7=[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],U4e=125,jLt=59,o7=47,NLt=42,RLt=43,ILt=45,PLt=60,DLt=44,MLt=63,LLt=46,$Lt=91,FLt=new rL({start:!1,shift(e,t){return t==ALt||t==TLt||t==ELt?e:t==CLt},strict:!1}),BLt=new Ia((e,t)=>{let{next:n}=e;(n==U4e||n==-1||t.context)&&e.acceptToken(SLt)},{contextual:!0,fallback:!0}),ULt=new Ia((e,t)=>{let{next:n}=e,i;a7.indexOf(n)>-1||n==o7&&((i=e.peek(1))==o7||i==NLt)||n!=U4e&&n!=jLt&&n!=-1&&!t.context&&e.acceptToken(vLt)},{contextual:!0}),QLt=new Ia((e,t)=>{e.next==$Lt&&!t.context&&e.acceptToken(xLt)},{contextual:!0}),zLt=new Ia((e,t)=>{let{next:n}=e;if(n==RLt||n==ILt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Pre);e.acceptToken(i?Pre:wLt)}}else n==MLt&&e.peek(1)==LLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(OLt))},{contextual:!0});function b$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const VLt=new Ia((e,t)=>{if(e.next!=PLt||!t.dialectEnabled(_Lt)||(e.advance(),e.next==o7))return;let n=0;for(;a7.indexOf(e.next)>-1;)e.advance(),n++;if(b$(e.next,!0)){for(e.advance(),n++;b$(e.next,!1);)e.advance(),n++;for(;a7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==DLt)return;for(let i=0;;i++){if(i==7){if(!b$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(kLt,-n)}),HLt=ym({"get set async static":pe.modifier,"for while do if else switch try catch finally return throw break continue default case defer":pe.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":pe.operatorKeyword,"let var const using function class extends":pe.definitionKeyword,"import export from":pe.moduleKeyword,"with debugger new":pe.keyword,TemplateString:pe.special(pe.string),super:pe.atom,BooleanLiteral:pe.bool,this:pe.self,null:pe.null,Star:pe.modifier,VariableName:pe.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":pe.function(pe.variableName),VariableDefinition:pe.definition(pe.variableName),Label:pe.labelName,PropertyName:pe.propertyName,PrivatePropertyName:pe.special(pe.propertyName),"CallExpression/MemberExpression/PropertyName":pe.function(pe.propertyName),"FunctionDeclaration/VariableDefinition":pe.function(pe.definition(pe.variableName)),"ClassDeclaration/VariableDefinition":pe.definition(pe.className),"NewExpression/VariableName":pe.className,PropertyDefinition:pe.definition(pe.propertyName),PrivatePropertyDefinition:pe.definition(pe.special(pe.propertyName)),UpdateOp:pe.updateOperator,"LineComment Hashbang":pe.lineComment,BlockComment:pe.blockComment,Number:pe.number,String:pe.string,Escape:pe.escape,ArithOp:pe.arithmeticOperator,LogicOp:pe.logicOperator,BitOp:pe.bitwiseOperator,CompareOp:pe.compareOperator,RegExp:pe.regexp,Equals:pe.definitionOperator,Arrow:pe.function(pe.punctuation),": Spread":pe.punctuation,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace,"InterpolationStart InterpolationEnd":pe.special(pe.brace),".":pe.derefOperator,", ;":pe.separator,"@":pe.meta,TypeName:pe.typeName,TypeDefinition:pe.definition(pe.typeName),"type enum interface implements namespace module declare":pe.definitionKeyword,"abstract global Privacy readonly override":pe.modifier,"is keyof unique infer asserts":pe.operatorKeyword,JSXAttributeValue:pe.attributeValue,JSXText:pe.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":pe.angleBracket,"JSXIdentifier JSXNameSpacedName":pe.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":pe.attributeName,"JSXBuiltin/JSXIdentifier":pe.standard(pe.tagName)}),qLt={__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},WLt={__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},KLt={__proto__:null,"<":193},GLt=am.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:FLt,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:[HLt],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:[ULt,QLt,zLt,VLt,2,3,4,5,6,7,8,9,10,11,12,13,14,BLt,new iP("$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 iP("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=>qLt[e]||-1},{term:343,get:e=>WLt[e]||-1},{term:95,get:e=>KLt[e]||-1}],tokenPrec:15201});class lW{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=Yr(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(z4e(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 Dre(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 XLt(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+$/]:XLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function Q4e(e,t){return n=>{for(let i=Yr(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 Mre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function e0(e){return e.selection.main.from}function z4e(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 uW=Ih.define();function YLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=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+o,insert:c},range:ht.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Lre=new WeakMap;function ZLt(e){if(!Array.isArray(e))return e;let t=Lre.get(e);return t||Lre.set(e,t=cW(e)),t}const rP=pi.define(),HC=pi.define();class JLt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Lq(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||E==1&&v||O==0&&E!=0)&&(n[f]==k||i[f]==k&&(h=!0)?o[f++]=w:o.length&&(y=!1)),O=E,w+=th(k)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,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),o,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 o of n){let l=o+(this.astral?th(Nc(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class e5t{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:t5t,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=>$re(t(i),n(i)),optionClass:(t,n)=>i=>$re(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function $re(e,t){return e?t?e+" "+t:e:t}function t5t(e,t,n,i,r,s){let o=e.textDirection==os.RTL,l=o,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?o?"left-narrow":"right-narrow":l?"left":"right")}}const dW=pi.define();function n5t(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 o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.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 y$(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 i5t{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:o}=r.open,l=t.state.facet(jo);this.optionContent=n5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=y$(s.length,o,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:dW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(jo).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:HC.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:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=y$(s.length,o,t.state.facet(jo).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=y$(n.options.length,n.selected,this.view.state.facet(jo).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 o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Mc(this.view.state,l,"completion info")):(this.addInfoPane(o,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&&s5t(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 o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.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+"-"+o,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 i5t(n,e,t)}function s5t(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 Fre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function a5t(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)}},o=t.facet(jo);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 Mre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new e5t(h):new JLt(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 Mre(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):Fre(d.completion)>Fre(c)&&(l[l.length-1]=d),c=d.completion}return l}class Qx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Qx(this.options,Bre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=a5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(jo).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:f5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Qx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Qx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class sP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new sP(u5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(jo),s=(i.override||n.languageDataAt("autocomplete",e0(n)).map(ZLt)).map(c=>(this.active.find(d=>d.source==c)||new bd(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 o=this.open,l=t.effects.some(c=>c.is(fW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!o5t(s,this.active)||l?o=Qx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new bd(c.source,0):c));for(let c of t.effects)c.is(dW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new sP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?l5t:c5t}}function o5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const u5t=[];function V4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(uW);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 bd{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=V4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new bd(r.source,0)),i&4&&r.state==0&&(r=new bd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(rP))r=new bd(r.source,1,s.value);else if(s.is(HC))r=new bd(r.source,0);else if(s.is(fW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(e0(t.state))}}class Sw extends bd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}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),o=t.changes.mapPos(this.to,1),l=e0(t.state);if(l>o||!r||n&2&&(e0(t.startState)==this.from||ln.map(t))}}),Rc=dl.define({create(){return sP.start()},update(e,t){return e.update(t)},provide:e=>[eW.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function hW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Rc).active.find(r=>r.source==t.source);return i instanceof Sw?(typeof n=="string"?e.dispatch({...YLt(e.state,n,i.from,i.to),annotations:uW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const f5t=r5t(Rc,hW);function rj(e,t="option"){return n=>{let i=n.state.field(Rc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:dW.of(l)}),!0}}const h5t=e=>{let t=e.state.field(Rc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Rc,!1)?(e.dispatch({effects:rP.of(!0)}),!0):!1,p5t=e=>{let t=e.state.field(Rc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:HC.of(null)}),!0)};class m5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const g5t=50,b5t=1e3,y5t=ma.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(Rc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Rc),n=e.state.facet(jo);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Rc)==t)return;let i=e.transactions.some(s=>{let o=V4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sg5t&&Date.now()-o.time>b5t){for(let l of o.context.abortListeners)try{l()}catch(c){Mc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(rP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.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(Rc);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(jo).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=e0(t),i=new lW(t,n,e.explicit,this.view),r=new m5t(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:HC.of(null)}),Mc(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(jo).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(jo),i=this.view.state.field(Rc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new bd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:fW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Rc,!1);if(t&&t.tooltip&&this.view.state.facet(jo).closeOnBlur){let n=t.open&&l4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:HC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:rP.of(!1)}),20),this.composing=0}}}),v5t=typeof navigator=="object"&&/Win/.test(navigator.platform),x5t=bm.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Rc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(v5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&hW(t,i),!1}})),H4e=Jt.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 w5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class pW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,il.TrackDel),i=t.mapPos(this.to,1,il.TrackDel);return n==null||i==null?null:new pW(this.field,n,i)}}class mW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew pW(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 o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){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 w5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.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(o)}return new mW(i,r)}}let O5t=Fn.widget({widget:new class extends Nf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),k5t=Fn.mark({class:"cm-snippetField"});class gO{constructor(t,n){this.ranges=t,this.active=n,this.deco=Fn.set(t.map(i=>(i.from==i.to?O5t:k5t).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 gO(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 PT=pi.define({map(e,t){return e&&e.map(t)}}),S5t=pi.define(),qC=dl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(PT))return n.value;if(n.is(S5t)&&e)return new gO(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=>Jt.decorations.from(e,t=>t?t.deco:Fn.none)});function gW(e,t){return ht.create(e.filter(n=>n.field==t).map(n=>ht.range(n.from,n.to)))}function E5t(e){let t=mW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:xr.of(o)},scrollIntoView:!0,annotations:i?[uW.of(i),Xa.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=gW(l,0)),l.some(d=>d.field>0)){let d=new gO(l,0),f=u.effects=[PT.of(d)];n.state.field(qC,!1)===void 0&&f.push(pi.appendConfig.of([qC,j5t,N5t,H4e]))}n.dispatch(n.state.update(u))}}function q4e(e){return({state:t,dispatch:n})=>{let i=t.field(qC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:gW(i.ranges,r),effects:PT.of(s?null:new gO(i.ranges,r)),scrollIntoView:!0})),!0}}const C5t=({state:e,dispatch:t})=>e.field(qC,!1)?(t(e.update({effects:PT.of(null)})),!0):!1,A5t=q4e(1),T5t=q4e(-1),_5t=[{key:"Tab",run:A5t,shift:T5t},{key:"Escape",run:C5t}],Ure=mn.define({combine(e){return e.length?e[0]:_5t}}),j5t=bm.highest(pO.compute([Ure],e=>e.facet(Ure)));function Ys(e,t){return{...t,apply:E5t(e)}}const N5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(qC,!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:gW(n.ranges,r.field),effects:PT.of(n.ranges.some(s=>s.field>r.field)?new gO(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),WC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},My=pi.define({map(e,t){let n=t.mapPos(e,-1,il.TrackAfter);return n??void 0}}),bW=new class extends hb{};bW.startSide=1;bW.endSide=-1;const W4e=dl.define({create(){return Ki.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(My)&&(e=e.update({add:[bW.range(n.value,n.value+1)]}));return e}});function R5t(){return[P5t,W4e]}const x$="()[]{}<>«»»«[]{}";function K4e(e){for(let t=0;t{if((I5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&th(Nc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=L5t(e.state,i);return s?(e.dispatch(s),!0):!1}),D5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=G4e(e,e.selection.main.head).brackets||WC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=$5t(e.doc,o.head);for(let c of i)if(c==l&&sL(e.doc,o.head)==K4e(Nc(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ht.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},M5t=[{key:"Backspace",run:D5t}];function L5t(e,t){let n=G4e(e,e.selection.main.head),i=n.brackets||WC.brackets;for(let r of i){let s=K4e(Nc(r,0));if(t==r)return s==r?U5t(e,r,i.indexOf(r+r+r)>-1,n):F5t(e,r,s,n.before||WC.before);if(t==s&&X4e(e,e.selection.main.from))return B5t(e,r,s)}return null}function X4e(e,t){let n=!1;return e.field(W4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function sL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,th(Nc(n,0)))}function $5t(e,t){let n=e.sliceString(t-2,t);return th(Nc(n,0))==n.length?n:n.slice(1)}function F5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:My.of(o.to+t.length),range:ht.range(o.anchor+t.length,o.head+t.length)};let l=sL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:My.of(o.head+t.length),range:ht.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function B5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&sL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:ht.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function U5t(e,t,n,i){let r=i.stringPrefixes||WC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:My.of(l.to+t.length),range:ht.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=sL(e.doc,c),d;if(u==t){if(Qre(e,c))return{changes:{insert:t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)};if(X4e(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:ht.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=zre(e,c-2*t.length,r))>-1&&Qre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&zre(e,c,r)>-1&&!Q5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Qre(e,t){let n=Yr(e).resolveInner(t+1);return n.parent&&n.from==t}function Q5t(e,t,n,i){let r=Yr(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){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 zre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.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))!=Qs.Word)return s}return-1}function z5t(e={}){return[x5t,Rc,jo.of(e),y5t,V5t,H4e]}const Y4e=[{key:"Ctrl-Space",run:v$},{mac:"Alt-`",run:v$},{mac:"Alt-i",run:v$},{key:"Escape",run:p5t},{key:"ArrowDown",run:rj(!0)},{key:"ArrowUp",run:rj(!1)},{key:"PageDown",run:rj(!0,"page")},{key:"PageUp",run:rj(!1,"page")},{key:"Enter",run:h5t}],V5t=bm.highest(pO.computeN([jo],e=>e.facet(jo).defaultKeymap?[Y4e]:[])),Z4e=[Ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ys(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+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 o=this.ranges[++this.rangeIndex].from;n+=o-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 o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+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,o=new L4e(n,t?t.state.tabSize:4,t?xv(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=F4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const oW=Object.create(null),qC=[Ja.none],cLt=new mk(qC),Tre=[],_re=Object.create(null),B4e=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"]])B4e[e]=Q4e(oW,t);class U4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),B4e)}resolve(t){return t?this.table[t]||(this.table[t]=Q4e(this.extra,t)):0}}const uLt=new U4e(oW);function h$(e,t){Tre.indexOf(e)>-1||(Tre.push(e),console.warn(t))}function Q4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||me[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(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=_re[r];if(s)return s.id;let o=_re[r]=Ja.define({id:qC.length,name:i,props:[vm({[i]:n})]});return qC.push(o),o.id}function dLt(e,t){let n=Ja.define({id:qC.length,name:"Document",props:[xg.add(()=>e),xm.add(()=>i=>t.getIndent(i))],top:!0});return qC.push(n),n}cs.RTL,cs.LTR;var jre={};class eP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,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 eP(t,[],n,i,i,0,[],0,r?new Nre(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,o=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[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+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:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.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 eP(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 fLt(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,o;sc&1&&l==o)||r.push(n[s],o)}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 o=this.findForcedReduction();if(o==null)return!1;n=o}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,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&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(o,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 Nre{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class fLt{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 tP{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 tP(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 tP(this.stack,this.pos,this.index)}}function OS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-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 VN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Rre=new VN;class hLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Rre,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 o=this.ranges[++r];s+=o.from-i.to,i=o}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=Rre,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 Sw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;z4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Sw.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class nP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?OS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(z4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}nP.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class Ma{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function z4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||pLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=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{o=e[g+2],t.advance();continue e}}break}}function Ire(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function pLt(e,t,n,i){let r=Ire(n,i,t);return r<0||Ire(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 mLt=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?Pre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Pre(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=o,null;if(s instanceof Hi){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class gLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new VN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=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 VN,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 VN,{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 o=0;o=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 mLt(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[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)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 o=r&&vLt(r);if(o)return au&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw au&&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 o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return au&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";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(li.contextHash)||0)==d))return t.useNode(f,h),au&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Hi)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Hi&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),au&&console.log(o+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 Dre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),au&&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()&&(au&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)au&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))au&&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),au&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Dre(l,i)):(!r||r.scoree;class nL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class om extends HM{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 mk(n.map((l,c)=>Ja.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=U5e;let o=OS(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 Sw(o,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 bLt(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 o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>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=yp(this.data,s+2);else break;r=n(yp(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=yp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(om.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 o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Mre(o),o})),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 o=n.indexOf(s);o>=0&&(i[o]=!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 xLt=316,wLt=317,Lre=1,kLt=2,OLt=3,SLt=4,ELt=318,CLt=320,ALt=321,TLt=5,_Lt=6,jLt=0,s7=[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],V4e=125,NLt=59,a7=47,RLt=42,ILt=43,PLt=45,DLt=60,MLt=44,LLt=63,$Lt=46,FLt=91,BLt=new nL({start:!1,shift(e,t){return t==TLt||t==_Lt||t==CLt?e:t==ALt},strict:!1}),ULt=new Ma((e,t)=>{let{next:n}=e;(n==V4e||n==-1||t.context)&&e.acceptToken(ELt)},{contextual:!0,fallback:!0}),QLt=new Ma((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==RLt)||n!=V4e&&n!=NLt&&n!=-1&&!t.context&&e.acceptToken(xLt)},{contextual:!0}),zLt=new Ma((e,t)=>{e.next==FLt&&!t.context&&e.acceptToken(wLt)},{contextual:!0}),VLt=new Ma((e,t)=>{let{next:n}=e;if(n==ILt||n==PLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Lre);e.acceptToken(i?Lre:kLt)}}else n==LLt&&e.peek(1)==$Lt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(OLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const HLt=new Ma((e,t)=>{if(e.next!=DLt||!t.dialectEnabled(jLt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==MLt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(SLt,-n)}),qLt=vm({"get set async static":me.modifier,"for while do if else switch try catch finally return throw break continue default case defer":me.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":me.operatorKeyword,"let var const using function class extends":me.definitionKeyword,"import export from":me.moduleKeyword,"with debugger new":me.keyword,TemplateString:me.special(me.string),super:me.atom,BooleanLiteral:me.bool,this:me.self,null:me.null,Star:me.modifier,VariableName:me.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":me.function(me.variableName),VariableDefinition:me.definition(me.variableName),Label:me.labelName,PropertyName:me.propertyName,PrivatePropertyName:me.special(me.propertyName),"CallExpression/MemberExpression/PropertyName":me.function(me.propertyName),"FunctionDeclaration/VariableDefinition":me.function(me.definition(me.variableName)),"ClassDeclaration/VariableDefinition":me.definition(me.className),"NewExpression/VariableName":me.className,PropertyDefinition:me.definition(me.propertyName),PrivatePropertyDefinition:me.definition(me.special(me.propertyName)),UpdateOp:me.updateOperator,"LineComment Hashbang":me.lineComment,BlockComment:me.blockComment,Number:me.number,String:me.string,Escape:me.escape,ArithOp:me.arithmeticOperator,LogicOp:me.logicOperator,BitOp:me.bitwiseOperator,CompareOp:me.compareOperator,RegExp:me.regexp,Equals:me.definitionOperator,Arrow:me.function(me.punctuation),": Spread":me.punctuation,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace,"InterpolationStart InterpolationEnd":me.special(me.brace),".":me.derefOperator,", ;":me.separator,"@":me.meta,TypeName:me.typeName,TypeDefinition:me.definition(me.typeName),"type enum interface implements namespace module declare":me.definitionKeyword,"abstract global Privacy readonly override":me.modifier,"is keyof unique infer asserts":me.operatorKeyword,JSXAttributeValue:me.attributeValue,JSXText:me.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":me.angleBracket,"JSXIdentifier JSXNameSpacedName":me.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":me.attributeName,"JSXBuiltin/JSXIdentifier":me.standard(me.tagName)}),WLt={__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},KLt={__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},GLt={__proto__:null,"<":193},XLt=om.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:BLt,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:[qLt],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:[QLt,zLt,VLt,HLt,2,3,4,5,6,7,8,9,10,11,12,13,14,ULt,new nP("$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 nP("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=>WLt[e]||-1},{term:343,get:e=>KLt[e]||-1},{term:95,get:e=>GLt[e]||-1}],tokenPrec:15201});class lW{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=es(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(q4e(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 $re(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 YLt(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+$/]:YLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function H4e(e,t){return n=>{for(let i=es(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 Fre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Gy(e){return e.selection.main.from}function q4e(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 uW=Dh.define();function ZLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=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+o,insert:c},range:pt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Bre=new WeakMap;function JLt(e){if(!Array.isArray(e))return e;let t=Bre.get(e);return t||Bre.set(e,t=cW(e)),t}const iP=hi.define(),WC=hi.define();class e5t{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:(O=Lq(S))!=O.toLowerCase()?1:O!=O.toUpperCase()?2:0;(!w||A==1&&v||k==0&&A!=0)&&(n[f]==S||i[f]==S&&(h=!0)?o[f++]=w:o.length&&(y=!1)),k=A,w+=nh(S)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,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),o,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 o of n){let l=o+(this.astral?nh(Ac(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class t5t{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:n5t,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=>Ure(t(i),n(i)),optionClass:(t,n)=>i=>Ure(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Ure(e,t){return e?t?e+" "+t:e:t}function n5t(e,t,n,i,r,s){let o=e.textDirection==cs.RTL,l=o,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?o?"left-narrow":"right-narrow":l?"left":"right")}}const dW=hi.define();function i5t(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 o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.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 b$(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 r5t{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:o}=r.open,l=t.state.facet(Do);this.optionContent=i5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,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:dW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Do).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:WC.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:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(Do).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=b$(n.options.length,n.selected,this.view.state.facet(Do).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 o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Rc(this.view.state,l,"completion info")):(this.addInfoPane(o,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&&a5t(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 o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.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+"-"+o,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 r5t(n,e,t)}function a5t(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 Qre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function o5t(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)}},o=t.facet(Do);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 Fre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new t5t(h):new e5t(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 Fre(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):Qre(d.completion)>Qre(c)&&(l[l.length-1]=d),c=d.completion}return l}class zx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new zx(this.options,zre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=o5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Do).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:h5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new zx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new zx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new rP(d5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Do),s=(i.override||n.languageDataAt("autocomplete",Gy(n)).map(JLt)).map(c=>(this.active.find(d=>d.source==c)||new yd(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 o=this.open,l=t.effects.some(c=>c.is(fW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!l5t(s,this.active)||l?o=zx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new yd(c.source,0):c));for(let c of t.effects)c.is(dW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new rP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?c5t:u5t}}function l5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const d5t=[];function W4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(uW);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 yd{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=W4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new yd(r.source,0)),i&4&&r.state==0&&(r=new yd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(iP))r=new yd(r.source,1,s.value);else if(s.is(WC))r=new yd(r.source,0);else if(s.is(fW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Gy(t.state))}}class Ew extends yd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}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),o=t.changes.mapPos(this.to,1),l=Gy(t.state);if(l>o||!r||n&2&&(Gy(t.startState)==this.from||ln.map(t))}}),Tc=pl.define({create(){return rP.start()},update(e,t){return e.update(t)},provide:e=>[eW.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function hW(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 Ew?(typeof n=="string"?e.dispatch({...ZLt(e.state,n,i.from,i.to),annotations:uW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const h5t=s5t(Tc,hW);function ij(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:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:dW.of(l)}),!0}}const p5t=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:iP.of(!0)}),!0):!1,m5t=e=>{let t=e.state.field(Tc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:WC.of(null)}),!0)};class g5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const b5t=50,y5t=1e3,v5t=ba.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(Do);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Tc)==t)return;let i=e.transactions.some(s=>{let o=W4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sb5t&&Date.now()-o.time>y5t){for(let l of o.context.abortListeners)try{l()}catch(c){Rc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(iP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.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(Do).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Gy(t),i=new lW(t,n,e.explicit,this.view),r=new g5t(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:WC.of(null)}),Rc(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(Do).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Do),i=this.view.state.field(Tc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new yd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:fW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Tc,!1);if(t&&t.tooltip&&this.view.state.facet(Do).closeOnBlur){let n=t.open&&d4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:WC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:iP.of(!1)}),20),this.composing=0}}}),x5t=typeof navigator=="object"&&/Win/.test(navigator.platform),w5t=ym.highest(Jt.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&&!(x5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&hW(t,i),!1}})),K4e=Jt.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 k5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class pW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,al.TrackDel),i=t.mapPos(this.to,1,al.TrackDel);return n==null||i==null?null:new pW(this.field,n,i)}}class mW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew pW(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 o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){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 k5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.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(o)}return new mW(i,r)}}let O5t=$n.widget({widget:new class extends Tf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),S5t=$n.mark({class:"cm-snippetField"});class yk{constructor(t,n){this.ranges=t,this.active=n,this.deco=$n.set(t.map(i=>(i.from==i.to?O5t:S5t).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 yk(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 LT=hi.define({map(e,t){return e&&e.map(t)}}),E5t=hi.define(),KC=pl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(LT))return n.value;if(n.is(E5t)&&e)return new yk(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=>Jt.decorations.from(e,t=>t?t.deco:$n.none)});function gW(e,t){return pt.create(e.filter(n=>n.field==t).map(n=>pt.range(n.from,n.to)))}function C5t(e){let t=mW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Or.of(o)},scrollIntoView:!0,annotations:i?[uW.of(i),Ya.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=gW(l,0)),l.some(d=>d.field>0)){let d=new yk(l,0),f=u.effects=[LT.of(d)];n.state.field(KC,!1)===void 0&&f.push(hi.appendConfig.of([KC,N5t,R5t,K4e]))}n.dispatch(n.state.update(u))}}function G4e(e){return({state:t,dispatch:n})=>{let i=t.field(KC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:gW(i.ranges,r),effects:LT.of(s?null:new yk(i.ranges,r)),scrollIntoView:!0})),!0}}const A5t=({state:e,dispatch:t})=>e.field(KC,!1)?(t(e.update({effects:LT.of(null)})),!0):!1,T5t=G4e(1),_5t=G4e(-1),j5t=[{key:"Tab",run:T5t,shift:_5t},{key:"Escape",run:A5t}],Vre=pn.define({combine(e){return e.length?e[0]:j5t}}),N5t=ym.highest(gk.compute([Vre],e=>e.facet(Vre)));function Xs(e,t){return{...t,apply:C5t(e)}}const R5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(KC,!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:gW(n.ranges,r.field),effects:LT.of(n.ranges.some(s=>s.field>r.field)?new yk(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),GC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ny=hi.define({map(e,t){let n=t.mapPos(e,-1,al.TrackAfter);return n??void 0}}),bW=new class extends ub{};bW.startSide=1;bW.endSide=-1;const X4e=pl.define({create(){return Yi.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(Ny)&&(e=e.update({add:[bW.range(n.value,n.value+1)]}));return e}});function I5t(){return[D5t,X4e]}const v$="()[]{}<>«»»«[]{}";function Y4e(e){for(let t=0;t{if((P5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&nh(Ac(i,0))==1||t!=r.from||n!=r.to)return!1;let s=$5t(e.state,i);return s?(e.dispatch(s),!0):!1}),M5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Z4e(e,e.selection.main.head).brackets||GC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=F5t(e.doc,o.head);for(let c of i)if(c==l&&iL(e.doc,o.head)==Y4e(Ac(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:pt.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},L5t=[{key:"Backspace",run:M5t}];function $5t(e,t){let n=Z4e(e,e.selection.main.head),i=n.brackets||GC.brackets;for(let r of i){let s=Y4e(Ac(r,0));if(t==r)return s==r?Q5t(e,r,i.indexOf(r+r+r)>-1,n):B5t(e,r,s,n.before||GC.before);if(t==s&&J4e(e,e.selection.main.from))return U5t(e,r,s)}return null}function J4e(e,t){let n=!1;return e.field(X4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function iL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,nh(Ac(n,0)))}function F5t(e,t){let n=e.sliceString(t-2,t);return nh(Ac(n,0))==n.length?n:n.slice(1)}function B5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Ny.of(o.to+t.length),range:pt.range(o.anchor+t.length,o.head+t.length)};let l=iL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Ny.of(o.head+t.length),range:pt.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function U5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&iL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:pt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Q5t(e,t,n,i){let r=i.stringPrefixes||GC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ny.of(l.to+t.length),range:pt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=iL(e.doc,c),d;if(u==t){if(Hre(e,c))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(J4e(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:pt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=qre(e,c-2*t.length,r))>-1&&Hre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&qre(e,c,r)>-1&&!z5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Hre(e,t){let n=es(e).resolveInner(t+1);return n.parent&&n.from==t}function z5t(e,t,n,i){let r=es(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){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 qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.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))!=Qs.Word)return s}return-1}function V5t(e={}){return[w5t,Tc,Do.of(e),v5t,H5t,K4e]}const e$e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:m5t},{key:"ArrowDown",run:ij(!0)},{key:"ArrowUp",run:ij(!1)},{key:"PageDown",run:ij(!0,"page")},{key:"PageUp",run:ij(!1,"page")},{key:"Enter",run:p5t}],H5t=ym.highest(gk.computeN([Do],e=>e.facet(Do).defaultKeymap?[e$e]:[])),t$e=[Xs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Xs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Xs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Xs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Xs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Xs(`try { \${} } catch (\${error}) { \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ys("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Ys(`if (\${}) { +}`,{label:"try",detail:"/ catch block",type:"keyword"}),Xs("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Xs(`if (\${}) { \${} } else { \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),Ys(`class \${name} { +}`,{label:"if",detail:"/ else block",type:"keyword"}),Xs(`class \${name} { constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Ys('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ys('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],H5t=Z4e.concat([Ys("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ys("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ys("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Vre=new Mq,J4e=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ak(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const q5t=["FunctionDeclaration"],W5t={FunctionDeclaration:Ak("function"),ClassDeclaration:Ak("class"),ClassExpression:()=>!0,EnumDeclaration:Ak("constant"),TypeAliasDeclaration:Ak("type"),NamespaceDeclaration:Ak("namespace"),VariableDefinition(e,t){e.matchContext(q5t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function e$e(e,t){let n=Vre.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=W5t[o.name];if(l&&l(o,s)||J4e.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of e$e(e,o.node))i.push(l);return!1}}),Vre.set(t,i),i}const Hre=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,t$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function K5t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(t$e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Hre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)J4e.has(r.name)&&(i=i.concat(e$e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Hre}}const vh=sm.define({name:"javascript",parser:GLt.configure({props:[vm.add({IfStatement:Ow({except:/^\s*({|else\b)/}),TryStatement:Ow({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jMt,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:ww({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ow({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}}),xm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":NT,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:"$"}}),n$e={test:e=>/^JSX/.test(e.name),facet:tL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},i$e=vh.configure({dialect:"ts"},"typescript"),r$e=vh.configure({dialect:"jsx",props:[nW.add(e=>e.isTop?[n$e]:void 0)]}),s$e=vh.configure({dialect:"jsx ts",props:[nW.add(e=>e.isTop?[n$e]:void 0)]},"typescript");let a$e=e=>({label:e,type:"keyword"});const o$e="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(a$e),G5t=o$e.concat(["declare","implements","private","protected","public"].map(a$e));function l7(e={}){let t=e.jsx?e.typescript?s$e:r$e:e.typescript?i$e:vh,n=e.typescript?H5t.concat(G5t):Z4e.concat(o$e);return new yb(t,[vh.data.of({autocomplete:Q4e(t$e,cW(n))}),vh.data.of({autocomplete:K5t}),e.jsx?Z5t:[]])}function X5t(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 qre(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 Y5t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Z5t=Jt.inputHandler.of((e,t,n,i,r)=>{if((Y5t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!vh.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u;let{head:d}=c,f=Yr(o).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.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=qre(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:ht.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=X5t(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(h=qre(o.doc,m,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),J5t=ym({String:pe.string,Number:pe.number,"True False":pe.bool,PropertyName:pe.propertyName,Null:pe.null,", :":pe.separator,"[ ]":pe.squareBracket,"{ }":pe.brace}),e3t=am.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:[J5t],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}),t3t=sm.define({name:"json",parser:e3t.configure({props:[vm.add({Object:Ow({except:/^\s*\}/}),Array:Ow({except:/^\s*\]/})}),xm.add({"Object Array":NT})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function n3t(){return new yb(t3t)}class aP{static create(t,n,i,r,s){let o=r+(r<<8)+t+(n<<4)|0;return new aP(t,n,i,o,s,[],[])}constructor(t,n,i,r,s,o,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ui.contextHash,r]]}addChild(t,n){t.prop(ui.contextHash)!=this.hash&&(t=new Ui(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 Ui(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,o)=>new Ui(Za.none,r,s,o,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 i3t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class r3t{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 CE(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?xW:vW)(n,t,!1);return i>0&&(e.type!=qt.BulletList||yW(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const l$e={[qt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(ur(qt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(Pd(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]:Wre,[qt.BulletList]:Wre,[qt.Document](){return!0}};function Pd(e){return e==32||e==9||e==10||e==13}function CE(e,t=0){for(;tn&&Pd(e.charCodeAt(t-1));)t--;return t}function c$e(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(b$e.SetextHeading)>-1||i<3?-1:1}function d$e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function vW(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||Pd(e.text.charCodeAt(e.pos+1)))&&(!n||d$e(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 f$e(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function h$e(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,m$e=/\?>/,u7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,y$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(ur(qt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(ur(qt.ProcessingInstruction,n,n+1+o[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(ur(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),o=GC.test(r),l=GC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new hu(t==95?O$e:k$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(ur(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(ur(qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new hu(ky,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new hu(oP,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 hu&&(r.type==ky||r.type==oP)){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),o=e.parts[i]=u3t(e,s,r.type==ky?qt.Link:qt.Image,r.from,n+1);if(r.type==ky)for(let l=0;lt?ur(qt.URL,t+n,s+n):s==e.length?null:!1}}function E$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!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 hu(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 hu&&(n.type==ky||n.type==oP))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 hu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%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,o);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 hu&&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 hu?n:null}skipSpace(t){return CE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new w$e(t,n)}}wW.linkStart=ky;wW.imageStart=oP;function f7(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(ui.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=A$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Ui(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")&&(d3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=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 o-s}}function A$e(e,t){let n=e;for(let i=1;isj[e]),Object.keys(sj).map(e=>b$e[e]),Object.keys(sj),o3t,l$e,Object.keys(O$).map(e=>O$[e]),Object.keys(O$),[]);function m3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function g3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Q5e((r,s)=>{let o=r.type.id;if(t&&(o==qt.CodeBlock||o==qt.FencedCode)){let l="";if(o==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:o==qt.FencedCode}}else if(n&&(o==qt.HTMLBlock||o==qt.HTMLTag||o==qt.CommentBlock))return{parser:n,overlay:m3t(r.node,r.from,r.to)};return null})}}const b3t={resolve:"Strikethrough",mark:"StrikethroughMark"},y3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":pe.strikethrough}},{name:"StrikethroughMark",style:pe.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),o=/\s|^$/.test(r),l=GC.test(i),c=GC.test(r);return e.addDelimiter(b3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function AE(e,t,n=0,i,r=0){let s=0,o=!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++,o=!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 Yre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Zre{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)&&T$e.test(r=n.text.slice(n.pos))){let s=[];AE(t,i.content,0,s,i.start)==AE(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=[];AE(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 v3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":pe.heading}},"TableRow",{name:"TableCell",style:pe.content},{name:"TableDelimiter",style:pe.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return Yre(t.content,0)?new Zre:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Zre)||!Yre(t.text,t.basePos))return!1;let i=e.peekLine();return T$e.test(i)&&AE(e,t.text,t.basePos)==AE(e,i,t.basePos)},before:"SetextHeading"}]};class x3t{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 w3t={defineNodes:[{name:"Task",block:!0,style:pe.list},{name:"TaskMarker",style:pe.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new x3t:null},after:"SetextHeading"}]},Jre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ese=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,O3t=/[\w-]+\.[\w-]+($|[/:])/,tse=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,nse=/\/[a-zA-Z\d@.]+/gy;function ise(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==")"&&ise(e,t,i,")")>ise(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 rse(e,t){tse.lastIndex=t;let n=tse.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 S3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;Jre.lastIndex=i;let r=Jre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=k3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=rse(e.text,i):(s=rse(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(nse.lastIndex=s,r=nse.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)}}]},E3t=[v3t,w3t,y3t,S3t];function _$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let lse=null,cse=null,use=0;function p7(e,t){let n=e.pos+t;if(use==n&&cse==e)return lse;let i=e.peek(t),r="";for(;Z3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return cse=e,use=n,lse=r?r.toLowerCase():i==J3t||i==e4t?void 0:null}const L$e=60,lP=62,kW=47,J3t=63,e4t=33,t4t=45;function dse(e,t){this.name=e,this.parent=t}const n4t=[OW,I$e,j$e,N$e,R$e],i4t=new rL({start:null,shift(e,t,n,i){return n4t.indexOf(t)>-1?new dse(p7(i,1)||"",e):e},reduce(e,t){return t==P$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==OW||r==q3t?new dse(p7(i,1)||"",e):e},strict:!1}),r4t=new Ia((e,t)=>{if(e.next!=L$e){e.next<0&&t.context&&e.acceptToken(k$);return}e.advance();let n=e.next==kW;n&&e.advance();let i=p7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?B3t:F3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(M3t);if(r&&Y3t[r])return e.acceptToken(k$,-2);if(t.dialectEnabled(K3t))return e.acceptToken(L3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken($3t)}else{if(i=="script")return e.acceptToken(j$e);if(i=="style")return e.acceptToken(N$e);if(i=="textarea")return e.acceptToken(R$e);if(X3t.hasOwnProperty(i))return e.acceptToken(I$e);r&&ose[r]&&ose[r][i]?e.acceptToken(k$,-1):e.acceptToken(OW)}},{contextual:!0}),s4t=new Ia(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(ase);break}if(e.next==t4t)t++;else if(e.next==lP&&t>=2){n>=3&&e.acceptToken(ase,-2);break}else t=0;e.advance()}});function a4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const o4t=new Ia((e,t)=>{if(e.next==kW&&e.peek(1)==lP){let n=t.dialectEnabled(G3t)||a4t(t.context);e.acceptToken(n?D3t:sse,2)}else e.next==lP&&e.acceptToken(sse,1)});function SW(e,t,n){let i=2+e.length;return new Ia(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==L$e||s==1&&r.next==kW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const l4t=SW("script",_3t,j3t),c4t=SW("style",N3t,R3t),u4t=SW("textarea",I3t,P3t),d4t=ym({"Text RawText IncompleteTag IncompleteCloseTag":pe.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":pe.angleBracket,TagName:pe.tagName,"MismatchedCloseTag/TagName":[pe.tagName,pe.invalid],AttributeName:pe.attributeName,"AttributeValue UnquotedAttributeValue":pe.attributeValue,Is:pe.definitionOperator,"EntityReference CharacterReference":pe.character,Comment:pe.blockComment,ProcessingInst:pe.processingInstruction,DoctypeDecl:pe.documentMeta}),f4t=am.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:i4t,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:[d4t],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==z3t)return S$(l,c,n);if(u==V3t)return S$(l,c,i);if(u==H3t)return S$(l,c,r);if(u==P$e&&s.length){let d=l.node,f=d.firstChild,h=f&&fse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=$$e(f,c))))){let b=d.lastChild,v=b.type.id==W3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==D$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=fse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==h7){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==M$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const h4t=145,hse=1,p4t=146,m4t=147,B$e=2,g4t=148,b4t=3,y4t=4,U$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],v4t=58,x4t=40,Q$e=95,w4t=91,qN=45,O4t=46,k4t=35,S4t=37,E4t=38,C4t=92,A4t=10,T4t=42;function XC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EW(e){return e>=48&&e<=57}function pse(e){return EW(e)||e>=97&&e<=102||e>=65&&e<=70}const z$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(XC(c)||c==qN||c==Q$e||s&&EW(c))!s&&(c!=qN||l>0)&&(s=!0),o===l&&c==qN&&o++,i.advance();else if(c==C4t&&i.peek(1)!=A4t){if(i.advance(),pse(i.next)){do i.advance();while(pse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(B$e)?t:c==x4t?n:e);break}}},_4t=new Ia(z$e(p4t,B$e,m4t),{contextual:!0}),j4t=new Ia(z$e(g4t,b4t,y4t),{contextual:!0}),N4t=new Ia(e=>{if(U$e.includes(e.peek(-1))){let{next:t}=e;(XC(t)||t==Q$e||t==k4t||t==O4t||t==T4t||t==w4t||t==v4t&&XC(e.peek(1))||t==qN||t==E4t)&&e.acceptToken(h4t)}}),R4t=new Ia(e=>{if(!U$e.includes(e.peek(-1))){let{next:t}=e;if(t==S4t&&(e.advance(),e.acceptToken(hse)),XC(t)){do e.advance();while(XC(e.next)||EW(e.next));e.acceptToken(hse)}}}),I4t=ym({"AtKeyword import charset namespace keyframes media supports font-feature-values":pe.definitionKeyword,"from to selector scope MatchFlag":pe.keyword,NamespaceName:pe.namespace,KeyframeName:pe.labelName,KeyframeRangeName:pe.operatorKeyword,TagName:pe.tagName,ClassName:pe.className,PseudoClassName:pe.constant(pe.className),IdName:pe.labelName,"FeatureName PropertyName":pe.propertyName,AttributeName:pe.attributeName,NumberLiteral:pe.number,KeywordQuery:pe.keyword,UnaryQueryOp:pe.operatorKeyword,"CallTag ValueName FontName":pe.atom,VariableName:pe.variableName,Callee:pe.operatorKeyword,Unit:pe.unit,"UniversalSelector NestingSelector":pe.definitionOperator,"MatchOp CompareOp":pe.compareOperator,"ChildOp SiblingOp, LogicOp":pe.logicOperator,BinOp:pe.arithmeticOperator,Important:pe.modifier,Comment:pe.blockComment,ColorLiteral:pe.color,"ParenthesizedContent StringLiteral":pe.string,":":pe.punctuation,"PseudoOp #":pe.derefOperator,"; , |":pe.separator,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace}),P4t={__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},D4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},M4t={__proto__:null,selector:118,style:124,layer:202},L4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},$4t={__proto__:null,to:243},F4t=am.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:[N4t,R4t,_4t,j4t,1,2,3,4,new iP("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=>P4t[e]||-1},{term:148,get:e=>D4t[e]||-1},{term:4,get:e=>M4t[e]||-1},{term:28,get:e=>L4t[e]||-1},{term:146,get:e=>$4t[e]||-1}],tokenPrec:2405});let E$=null;function C$(){if(!E$&&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)));E$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return E$||[]}const mse=["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})),gse=["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}))),B4t=["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})),U4t=["@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})),Zh=/^(\w[\w-]*|-\w[\w-]*|)$/,Q4t=/^-(-[\w-]*)?$/;function z4t(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 bse=new Mq,V4t=["Declaration"];function H4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function V$e(e,t,n){if(t.to-t.from>4096){let i=bse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Sr.IncludeAnonymous);if(o.firstChild())do for(let l of V$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return bse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(V4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const q4t=e=>t=>{let{state:n,pos:i}=t,r=Yr(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:C$(),validFor:Zh};if(r.name=="ValueName")return{from:r.from,options:gse,validFor:Zh};if(r.name=="PseudoClassName")return{from:r.from,options:mse,validFor:Zh};if(e(r)||(t.explicit||s)&&z4t(r,n.doc))return{from:e(r)||s?r.from:i,options:V$e(n.doc,H4t(r),e),validFor:Q4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:C$(),validFor:Zh};return{from:r.from,options:B4t,validFor:Zh}}if(r.name=="AtKeyword")return{from:r.from,options:U4t,validFor:Zh};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:mse,validFor:Zh}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:gse,validFor:Zh}:o.name=="Block"||o.name=="Styles"?{from:i,options:C$(),validFor:Zh}:null},W4t=q4t(e=>e.name=="VariableName"),cP=sm.define({name:"css",parser:F4t.configure({props:[vm.add({Declaration:Ow()}),xm.add({"Block KeyframeList":NT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function K4t(){return new yb(cP,cP.data.of({autocomplete:W4t}))}const _k=["_blank","_self","_top","_parent"],A$=["ascii","utf-8","utf-16","latin1","latin1"],T$=["get","post","put","delete"],_$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ru=["true","false"],Pn={},G4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:_k,hreflang:null}},abbr:Pn,address:Pn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Pn,aside:Pn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Pn,base:{attrs:{href:null,target:_k}},bdi:Pn,bdo:Pn,blockquote:{attrs:{cite:null}},body:Pn,br:Pn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:_$,formmethod:T$,formnovalidate:["novalidate"],formtarget:_k,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Pn,center:Pn,cite:Pn,code:Pn,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:Pn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Pn,div:Pn,dl:Pn,dt:Pn,em:Pn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Pn,figure:Pn,footer:Pn,form:{attrs:{action:null,name:null,"accept-charset":A$,autocomplete:["on","off"],enctype:_$,method:T$,novalidate:["novalidate"],target:_k}},h1:Pn,h2:Pn,h3:Pn,h4:Pn,h5:Pn,h6:Pn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Pn,hgroup:Pn,hr:Pn,html:{attrs:{manifest:null}},i:Pn,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:_$,formmethod:T$,formnovalidate:["novalidate"],formtarget:_k,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:Pn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Pn,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:Pn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:A$,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:Pn,noscript:Pn,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:Pn,param:{attrs:{name:null,value:null}},pre:Pn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Pn,rt:Pn,ruby:Pn,samp:Pn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:A$}},section:Pn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Pn,source:{attrs:{src:null,type:null,media:null}},span:Pn,strong:Pn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Pn,summary:Pn,sup:Pn,table:Pn,tbody:Pn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Pn,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:Pn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Pn,time:{attrs:{datetime:null}},title:Pn,tr:Pn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Pn,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:Pn},H$e={accesskey:null,class:null,contenteditable:ru,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:ru,autocorrect:ru,autocapitalize:ru,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":ru,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ru,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ru,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ru,"aria-hidden":ru,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ru,"aria-multiselectable":ru,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ru,"aria-relevant":null,"aria-required":ru,"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},q$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of q$e)H$e[e]=null;class YC{constructor(t,n){this.tags={...G4t,...t},this.globalAttrs={...H$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}YC.default=new YC;function b1(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 y1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function W$e(e,t,n){let i=n.tags[b1(e,y1(t))];return(i==null?void 0:i.children)||n.allTags}function CW(e,t){let n=[];for(let i=y1(t);i&&!i.type.isTop;i=y1(i.parent)){let r=b1(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 K$e=/^[:\-\.\w\u00b7-\uffff]*$/;function yse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=y1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:W$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(CW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function vse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:CW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:K$e}}function X4t(e,t,n,i){let r=[],s=0;for(let o of W$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of CW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Y4t(e,t,n,i,r){let s=y1(n),o=s?t.tags[b1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.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:K$e}}function Z4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=y1(n),h=f?t.tags[b1(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 G$e(e,t){let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromG$e(i,r)}const t$t=vh.parser.configure({top:"SingleExpression"}),X$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:i$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:r$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:s$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:t$t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:cP.parser}],Y$e=[{name:"style",parser:cP.parser.configure({top:"Styles"})}].concat(q$e.map(e=>({name:e,parser:vh.parser}))),Z$e=sm.define({name:"html",parser:f4t.configure({props:[vm.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:"-_"}}),WN=Z$e.configure({wrap:F$e(X$e,Y$e)});function n$t(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=F$e((e.nestedLanguages||[]).concat(X$e),(e.nestedAttributes||[]).concat(Y$e)));let i=n?Z$e.configure({wrap:n,dialect:t}):t?WN.configure({dialect:t}):WN;return new yb(i,[WN.data.of({autocomplete:e$t(e)}),e.autoCloseTags!==!1?i$t:[],l7().support,K4t().support])}const xse=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),i$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!WN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Yr(o).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=b1(o.doc,v.parent,m))&&!xse.has(b)){let y=m+(o.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=b1(o.doc,v,m))&&!xse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:ht.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),J$e=tL({commentTokens:{block:{open:""}}}),e6e=new ui,t6e=p3t.configure({props:[xm.add(e=>!e.is("Block")||e.is("Document")||m7(e)!=null||r$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),e6e.add(m7),vm.add({Document:()=>null}),Og.add({Document:J$e})]});function m7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function r$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function s$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=m7(i.type))!=null&&r<=t)break;n=i}return n.to}const a$t=x4e.of((e,t,n)=>{for(let i=Yr(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function AW(e){return new ku(J$e,e,[],"markdown")}const o$t=AW(t6e),l$t=t6e.configure([E3t,A3t,C3t,T3t,{props:[xm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uP=AW(l$t);function c$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=ZI.matchLanguageName(e,n,!0),i instanceof ZI)return i.support?i.support.language.parser:S0.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let j$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,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(+i6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function n6e(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],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new j$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new j$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new j$(s.parent,c,c+d,o[1],u,f,s))}}return i}function i6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function N$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=i6e(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 o=s.nextSibling;if(!o)break;s=o}}function TW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(mO)!=" ")return e;let i=Of(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const u$t=(e={})=>({state:t,dispatch:n})=>{let i=Yr(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!uP.isActiveAt(t,l.from,-1)&&!uP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=n6e(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,k="";x&&x.item?(O=u.from+x.from,k=x.marker(r,1)):O=u.from+(x?x.to:0);let S=[{from:O,to:c,insert:k}];return f.node.name=="OrderedList"&&N$(f.item,r,S,-2),x&&x.node.name=="OrderedList"&&N$(x.item,r,S),{range:ht.cursor(O+k.length),changes:S}}else{let x=Ose(d,t,u);return{range:ht.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"&&N$(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=TW(b,t),f$t(f.node,t.doc)&&(b=Ose(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:ht.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},d$t=u$t();function wse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function f$t(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),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=Yr(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&uP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=n6e(h$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:ht.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-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),!uP.isActiveAt(t.state,i.from,1)))return!1;let s=Yr(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||v$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const x6t=new Ia((e,t)=>{let n;if(e.next<0)e.acceptToken(S$t);else if(t.context.flags&KN)I$(e.next)&&e.acceptToken(k$t,1);else if(((n=e.peek(-1))<0||I$(n))&&t.canShift(kse)){let i=0;for(;e.next==_W||e.next==oL;)e.advance(),i++;(e.next==A0||e.next==ZC||e.next==jW)&&e.acceptToken(kse,-i)}else I$(e.next)&&e.acceptToken(O$t,1)},{contextual:!0}),w6t=new Ia((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==A0||i==ZC){let r=0,s=0;for(;;){if(e.next==_W)r++;else if(e.next==oL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=A0&&e.next!=ZC&&e.next!=jW&&(r[e,t|d6e])),S6t=new rL({start:O6t,reduce(e,t,n,i){return e.flags&KN&&v6t.has(t)||(t==U$t||t==l6e)&&e.flags&d6e?e.parent:e},shift(e,t,n,i){return t==s6e?new GN(e,k6t(i.read(i.pos,n.pos)),0):t==a6e?e.parent:t==A$t||t==N$t||t==P$t||t==o6e?new GN(e,0,KN):Ase.has(t)?new GN(e,0,Ase.get(t)|e.flags&KN):e},hash(e){return e.hash}}),E6t=new Ia(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==_W||n==oL)){n!=f6t&&n!=h6t&&n!=A0&&n!=ZC&&n!=jW&&e.acceptToken(w$t);return}}}),C6t=new Ia((e,t)=>{let{flags:n}=t.context,i=n&ap?u6e:c6e,r=(n&op)>0,s=!(n&lp),o=(n&cp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==g7)if(e.peek(1)==g7)e.advance(2);else{if(e.pos==l){e.acceptToken(o6e,1);return}break}else if(s&&e.next==Cse){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),A6t(e,c)),e.acceptToken(C$t);return}break}else if(e.next==Cse&&!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(Sse,r?3:1);return}break}else if(e.next==A0){if(r)e.advance();else if(e.pos==l){e.acceptToken(Sse);return}break}else e.advance();e.pos>l&&e.acceptToken(E$t)});function A6t(e,t){if(t==p6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==m6t)for(let n=0;n<2&&P$(e.next);n++)e.advance();else if(t==b6t)for(let n=0;n<4&&P$(e.next);n++)e.advance();else if(t==y6t)for(let n=0;n<8&&P$(e.next);n++)e.advance();else if(t==g6t&&e.next==g7){for(e.advance();e.next>=0&&e.next!=Ese&&e.next!=c6e&&e.next!=u6e&&e.next!=A0;)e.advance();e.next==Ese&&e.advance()}}const T6t=ym({'async "*" "**" FormatConversion FormatSpec':pe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":pe.controlKeyword,"in not and or is del":pe.operatorKeyword,"from def class global nonlocal lambda":pe.definitionKeyword,import:pe.moduleKeyword,"with as print":pe.keyword,Boolean:pe.bool,None:pe.null,VariableName:pe.variableName,"CallExpression/VariableName":pe.function(pe.variableName),"FunctionDefinition/VariableName":pe.function(pe.definition(pe.variableName)),"ClassDefinition/VariableName":pe.definition(pe.className),PropertyName:pe.propertyName,"CallExpression/MemberExpression/PropertyName":pe.function(pe.propertyName),Comment:pe.lineComment,Number:pe.number,String:pe.string,FormatString:pe.special(pe.string),Escape:pe.escape,UpdateOp:pe.updateOperator,"ArithOp!":pe.arithmeticOperator,BitOp:pe.bitwiseOperator,CompareOp:pe.compareOperator,AssignOp:pe.definitionOperator,Ellipsis:pe.punctuation,At:pe.meta,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace,".":pe.derefOperator,", ;":pe.separator}),_6t={__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},j6t=am.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:[E6t,w6t,x6t,C6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>_6t[e]||-1}],tokenPrec:7668}),Tse=new Mq,f6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function oj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const N6t={FunctionDefinition:oj("function"),ClassDefinition:oj("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 o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,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:oj("variable"),AsPattern:oj("variable"),__proto__:null};function h6e(e,t){let n=Tse.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(o.name){let l=N6t[o.name];if(l&&l(o,s,r)||!r&&f6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of h6e(e,o.node))i.push(l);return!1}}),Tse.set(t,i),i}const _se=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,p6e=["String","FormatString","Comment","PropertyName"];function R6t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(p6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_se.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)f6e.has(r.name)&&(i=i.concat(h6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:_se}}const I6t=["__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"}))),P6t=[Ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Ys(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=sP.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new Hi(this.parser.nodeSet.types[t],y1,y1,(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(d7(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?w$e(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=d7(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(Kt.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?mr(this.parser.getNodeType(t),n,i,r):new S$e(t,n)}get buffer(){return new O$e(this.parser.nodeSet)}}function w$e(e,t,n,i,r){let s=e[t].to,o=[],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=w$e(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),o.push(h),l.push(f-c)}return u(n.to+i,!1),new Hi(n.type,o,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class rL extends HM{constructor(t,n,i,r,s,o,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,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 u3t(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=u7(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(jO(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,O,A)=>y(O,A,S.value));let x=h.length,k=y?["Block","BlockContext"]:v?x>=Kt.ATXHeading1&&x<=Kt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(Ja.define({id:x,name:b,props:k&&[[li.group,k]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof Xf?m[b]=w:Object.assign(m,w))}i=new mk(h),m&&(i=i.extend(vm(m)))}if(jO(n.props)&&(i=i.extend(...n.props)),jO(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=o[m]=void 0),g>-1&&(c[g]=void 0)}if(jO(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,o[m]=h.leaf;else{let g=h.before?sj(l,h.before):h.after?sj(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),o.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(jO(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?sj(u,h.before):h.after?sj(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 rL(i,s,o,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 wW(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function jO(e){return e!=null&&e.length>0}function u7(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=u7(e[0]);if(e.length==1)return t;let n=u7(e.slice(1));if(!n||!t)return t||n;let i=(o,l)=>(o||y1).concat(l||y1),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?(o,l,c,u)=>r(s(o,l,c,u),l,c,u):r:s}}function sj(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let k$e=[Ja.none];for(let e=1,t;t=Kt[e];e++)k$e[e]=Ja.define({id:e,name:t,props:e>=Kt.Escape?[]:[[li.group,e in d$e?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const y1=[];class O$e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return Hi.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let XC=class{constructor(t,n,i,r=y1){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 O$e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class S$e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return y1}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 mr(e,t,n,i){return new XC(e,t,n,i)}const E$e={resolve:"Emphasis",mark:"EmphasisMark"},C$e={resolve:"Emphasis",mark:"EmphasisMark"},yy={},aP={};class gu{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const Jre="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let YC=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{YC=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const w$={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(mr(Kt.Autolink,n,n+1+r[0].length,[mr(Kt.LinkMark,n,n+1),mr(Kt.URL,n+1,n+r[0].length),mr(Kt.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(mr(Kt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(mr(Kt.ProcessingInstruction,n,n+1+o[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(mr(Kt.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),o=YC.test(r),l=YC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new gu(t==95?E$e:C$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(mr(Kt.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(mr(Kt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new gu(yy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new gu(aP,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 gu&&(r.type==yy||r.type==aP)){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),o=e.parts[i]=d3t(e,s,r.type==yy?Kt.Link:Kt.Image,r.from,n+1);if(r.type==yy)for(let l=0;lt?mr(Kt.URL,t+n,s+n):s==e.length?null:!1}}function T$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!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 gu(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 gu&&(n.type==yy||n.type==aP))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 gu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%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,o);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 gu&&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 gu?n:null}skipSpace(t){return TE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?mr(this.parser.getNodeType(t),n,i,r):new S$e(t,n)}}wW.linkStart=yy;wW.imageStart=aP;function d7(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(li.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=j$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Hi(t.parser.nodeSet.types[Kt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(f3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=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 o-s}}function j$e(e,t){let n=e;for(let i=1;irj[e]),Object.keys(rj).map(e=>x$e[e]),Object.keys(rj),l3t,d$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function g3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function b3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:H5e((r,s)=>{let o=r.type.id;if(t&&(o==Kt.CodeBlock||o==Kt.FencedCode)){let l="";if(o==Kt.FencedCode){let u=r.node.getChild(Kt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Kt.CodeText,bracketed:o==Kt.FencedCode}}else if(n&&(o==Kt.HTMLBlock||o==Kt.HTMLTag||o==Kt.CommentBlock))return{parser:n,overlay:g3t(r.node,r.from,r.to)};return null})}}const y3t={resolve:"Strikethrough",mark:"StrikethroughMark"},v3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":me.strikethrough}},{name:"StrikethroughMark",style:me.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),o=/\s|^$/.test(r),l=YC.test(i),c=YC.test(r);return e.addDelimiter(y3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function _E(e,t,n=0,i,r=0){let s=0,o=!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++,o=!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 ese(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class tse{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)&&N$e.test(r=n.text.slice(n.pos))){let s=[];_E(t,i.content,0,s,i.start)==_E(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=[];_E(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 x3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":me.heading}},"TableRow",{name:"TableCell",style:me.content},{name:"TableDelimiter",style:me.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return ese(t.content,0)?new tse:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof tse)||!ese(t.text,t.basePos))return!1;let i=e.peekLine();return N$e.test(i)&&_E(e,t.text,t.basePos)==_E(e,i,t.basePos)},before:"SetextHeading"}]};class w3t{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 k3t={defineNodes:[{name:"Task",block:!0,style:me.list},{name:"TaskMarker",style:me.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new w3t:null},after:"SetextHeading"}]},nse=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ise=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,O3t=/[\w-]+\.[\w-]+($|[/:])/,rse=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,sse=/\/[a-zA-Z\d@.]+/gy;function ase(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==")"&&ase(e,t,i,")")>ase(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 ose(e,t){rse.lastIndex=t;let n=rse.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 E3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;nse.lastIndex=i;let r=nse.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=S3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ose(e.text,i):(s=ose(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(sse.lastIndex=s,r=sse.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)}}]},C3t=[x3t,k3t,v3t,E3t];function R$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let dse=null,fse=null,hse=0;function h7(e,t){let n=e.pos+t;if(hse==n&&fse==e)return dse;let i=e.peek(t),r="";for(;J3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return fse=e,hse=n,dse=r?r.toLowerCase():i==e4t||i==t4t?void 0:null}const B$e=60,oP=62,OW=47,e4t=63,t4t=33,n4t=45;function pse(e,t){this.name=e,this.parent=t}const i4t=[kW,M$e,I$e,P$e,D$e],r4t=new nL({start:null,shift(e,t,n,i){return i4t.indexOf(t)>-1?new pse(h7(i,1)||"",e):e},reduce(e,t){return t==L$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==kW||r==W3t?new pse(h7(i,1)||"",e):e},strict:!1}),s4t=new Ma((e,t)=>{if(e.next!=B$e){e.next<0&&t.context&&e.acceptToken(k$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?U3t:B3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(L3t);if(r&&Z3t[r])return e.acceptToken(k$,-2);if(t.dialectEnabled(G3t))return e.acceptToken($3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(F3t)}else{if(i=="script")return e.acceptToken(I$e);if(i=="style")return e.acceptToken(P$e);if(i=="textarea")return e.acceptToken(D$e);if(Y3t.hasOwnProperty(i))return e.acceptToken(M$e);r&&use[r]&&use[r][i]?e.acceptToken(k$,-1):e.acceptToken(kW)}},{contextual:!0}),a4t=new Ma(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(cse);break}if(e.next==n4t)t++;else if(e.next==oP&&t>=2){n>=3&&e.acceptToken(cse,-2);break}else t=0;e.advance()}});function o4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const l4t=new Ma((e,t)=>{if(e.next==OW&&e.peek(1)==oP){let n=t.dialectEnabled(X3t)||o4t(t.context);e.acceptToken(n?M3t:lse,2)}else e.next==oP&&e.acceptToken(lse,1)});function SW(e,t,n){let i=2+e.length;return new Ma(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==B$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const c4t=SW("script",j3t,N3t),u4t=SW("style",R3t,I3t),d4t=SW("textarea",P3t,D3t),f4t=vm({"Text RawText IncompleteTag IncompleteCloseTag":me.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":me.angleBracket,TagName:me.tagName,"MismatchedCloseTag/TagName":[me.tagName,me.invalid],AttributeName:me.attributeName,"AttributeValue UnquotedAttributeValue":me.attributeValue,Is:me.definitionOperator,"EntityReference CharacterReference":me.character,Comment:me.blockComment,ProcessingInst:me.processingInstruction,DoctypeDecl:me.documentMeta}),h4t=om.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:r4t,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:[f4t],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==V3t)return O$(l,c,n);if(u==H3t)return O$(l,c,i);if(u==q3t)return O$(l,c,r);if(u==L$e&&s.length){let d=l.node,f=d.firstChild,h=f&&mse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=U$e(f,c))))){let b=d.lastChild,v=b.type.id==K3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==$$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=mse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){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==F$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const p4t=145,gse=1,m4t=146,g4t=147,z$e=2,b4t=148,y4t=3,v4t=4,V$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],x4t=58,w4t=40,H$e=95,k4t=91,HN=45,O4t=46,S4t=35,E4t=37,C4t=38,A4t=92,T4t=10,_4t=42;function ZC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EW(e){return e>=48&&e<=57}function bse(e){return EW(e)||e>=97&&e<=102||e>=65&&e<=70}const q$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(ZC(c)||c==HN||c==H$e||s&&EW(c))!s&&(c!=HN||l>0)&&(s=!0),o===l&&c==HN&&o++,i.advance();else if(c==A4t&&i.peek(1)!=T4t){if(i.advance(),bse(i.next)){do i.advance();while(bse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(z$e)?t:c==w4t?n:e);break}}},j4t=new Ma(q$e(m4t,z$e,g4t),{contextual:!0}),N4t=new Ma(q$e(b4t,y4t,v4t),{contextual:!0}),R4t=new Ma(e=>{if(V$e.includes(e.peek(-1))){let{next:t}=e;(ZC(t)||t==H$e||t==S4t||t==O4t||t==_4t||t==k4t||t==x4t&&ZC(e.peek(1))||t==HN||t==C4t)&&e.acceptToken(p4t)}}),I4t=new Ma(e=>{if(!V$e.includes(e.peek(-1))){let{next:t}=e;if(t==E4t&&(e.advance(),e.acceptToken(gse)),ZC(t)){do e.advance();while(ZC(e.next)||EW(e.next));e.acceptToken(gse)}}}),P4t=vm({"AtKeyword import charset namespace keyframes media supports font-feature-values":me.definitionKeyword,"from to selector scope MatchFlag":me.keyword,NamespaceName:me.namespace,KeyframeName:me.labelName,KeyframeRangeName:me.operatorKeyword,TagName:me.tagName,ClassName:me.className,PseudoClassName:me.constant(me.className),IdName:me.labelName,"FeatureName PropertyName":me.propertyName,AttributeName:me.attributeName,NumberLiteral:me.number,KeywordQuery:me.keyword,UnaryQueryOp:me.operatorKeyword,"CallTag ValueName FontName":me.atom,VariableName:me.variableName,Callee:me.operatorKeyword,Unit:me.unit,"UniversalSelector NestingSelector":me.definitionOperator,"MatchOp CompareOp":me.compareOperator,"ChildOp SiblingOp, LogicOp":me.logicOperator,BinOp:me.arithmeticOperator,Important:me.modifier,Comment:me.blockComment,ColorLiteral:me.color,"ParenthesizedContent StringLiteral":me.string,":":me.punctuation,"PseudoOp #":me.derefOperator,"; , |":me.separator,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace}),D4t={__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},M4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},L4t={__proto__:null,selector:118,style:124,layer:202},$4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},F4t={__proto__:null,to:243},B4t=om.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:[R4t,I4t,j4t,N4t,1,2,3,4,new nP("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=>D4t[e]||-1},{term:148,get:e=>M4t[e]||-1},{term:4,get:e=>L4t[e]||-1},{term:28,get:e=>$4t[e]||-1},{term:146,get:e=>F4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&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)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const yse=["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})),vse=["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}))),U4t=["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})),Q4t=["@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})),tp=/^(\w[\w-]*|-\w[\w-]*|)$/,z4t=/^-(-[\w-]*)?$/;function V4t(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 xse=new Mq,H4t=["Declaration"];function q4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function W$e(e,t,n){if(t.to-t.from>4096){let i=xse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Ar.IncludeAnonymous);if(o.firstChild())do for(let l of W$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return xse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(H4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const W4t=e=>t=>{let{state:n,pos:i}=t,r=es(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:E$(),validFor:tp};if(r.name=="ValueName")return{from:r.from,options:vse,validFor:tp};if(r.name=="PseudoClassName")return{from:r.from,options:yse,validFor:tp};if(e(r)||(t.explicit||s)&&V4t(r,n.doc))return{from:e(r)||s?r.from:i,options:W$e(n.doc,q4t(r),e),validFor:z4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:tp};return{from:r.from,options:U4t,validFor:tp}}if(r.name=="AtKeyword")return{from:r.from,options:Q4t,validFor:tp};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:yse,validFor:tp}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:vse,validFor:tp}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:tp}:null},K4t=W4t(e=>e.name=="VariableName"),lP=am.define({name:"css",parser:B4t.configure({props:[xm.add({Declaration:Ow()}),wm.add({"Block KeyframeList":PT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function G4t(){return new mb(lP,lP.data.of({autocomplete:K4t}))}const NO=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ou=["true","false"],In={},X4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:NO,hreflang:null}},abbr:In,address:In,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:In,aside:In,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:In,base:{attrs:{href:null,target:NO}},bdi:In,bdo:In,blockquote:{attrs:{cite:null}},body:In,br:In,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:In,center:In,cite:In,code:In,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:In,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:In,div:In,dl:In,dt:In,em:In,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:In,figure:In,footer:In,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:NO}},h1:In,h2:In,h3:In,h4:In,h5:In,h6:In,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:In,hgroup:In,hr:In,html:{attrs:{manifest:null}},i:In,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:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,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:In,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:In,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:In,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,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:In,noscript:In,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:In,param:{attrs:{name:null,value:null}},pre:In,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:In,rt:In,ruby:In,samp:In,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:In,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:In,source:{attrs:{src:null,type:null,media:null}},span:In,strong:In,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:In,summary:In,sup:In,table:In,tbody:In,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:In,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:In,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:In,time:{attrs:{datetime:null}},title:In,tr:In,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:In,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:In},K$e={accesskey:null,class:null,contenteditable:ou,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:ou,autocorrect:ou,autocapitalize:ou,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":ou,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ou,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ou,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ou,"aria-hidden":ou,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ou,"aria-multiselectable":ou,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ou,"aria-relevant":null,"aria-required":ou,"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},G$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of G$e)K$e[e]=null;class JC{constructor(t,n){this.tags={...X4t,...t},this.globalAttrs={...K$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}JC.default=new JC;function v1(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 x1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function X$e(e,t,n){let i=n.tags[v1(e,x1(t))];return(i==null?void 0:i.children)||n.allTags}function CW(e,t){let n=[];for(let i=x1(t);i&&!i.type.isTop;i=x1(i.parent)){let r=v1(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 Y$e=/^[:\-\.\w\u00b7-\uffff]*$/;function wse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=x1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:X$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(CW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function kse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:CW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Y$e}}function Y4t(e,t,n,i){let r=[],s=0;for(let o of X$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of CW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Z4t(e,t,n,i,r){let s=x1(n),o=s?t.tags[v1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.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:Y$e}}function J4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=x1(n),h=f?t.tags[v1(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 Z$e(e,t){let{state:n,pos:i}=t,r=es(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromZ$e(i,r)}const n$t=wh.parser.configure({top:"SingleExpression"}),J$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:a$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:o$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:l$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:n$t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:wh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:lP.parser}],e6e=[{name:"style",parser:lP.parser.configure({top:"Styles"})}].concat(G$e.map(e=>({name:e,parser:wh.parser}))),t6e=am.define({name:"html",parser:h4t.configure({props:[xm.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:"-_"}}),qN=t6e.configure({wrap:Q$e(J$e,e6e)});function i$t(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=Q$e((e.nestedLanguages||[]).concat(J$e),(e.nestedAttributes||[]).concat(e6e)));let i=n?t6e.configure({wrap:n,dialect:t}):t?qN.configure({dialect:t}):qN;return new mb(i,[qN.data.of({autocomplete:t$t(e)}),e.autoCloseTags!==!1?r$t:[],o7().support,G4t().support])}const Ose=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),r$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!qN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=es(o).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=v1(o.doc,v.parent,m))&&!Ose.has(b)){let y=m+(o.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=v1(o.doc,v,m))&&!Ose.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:pt.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),n6e=JM({commentTokens:{block:{open:""}}}),i6e=new li,r6e=m3t.configure({props:[wm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||s$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),i6e.add(p7),xm.add({Document:()=>null}),xg.add({Document:n6e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function s$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function a$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const o$t=O4e.of((e,t,n)=>{for(let i=es(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function AW(e){return new Au(n6e,e,[],"markdown")}const l$t=AW(r6e),c$t=r6e.configure([C3t,T3t,A3t,_3t,{props:[wm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),cP=AW(c$t);function u$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=YI.matchLanguageName(e,n,!0),i instanceof YI)return i.support?i.support.language.parser:vv.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,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(+a6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function s6e(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],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function a6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=a6e(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 o=s.nextSibling;if(!o)break;s=o}}function TW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(bk)!=" ")return e;let i=vf(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const d$t=(e={})=>({state:t,dispatch:n})=>{let i=es(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!cP.isActiveAt(t,l.from,-1)&&!cP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=s6e(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,k,S="";x&&x.item?(k=u.from+x.from,S=x.marker(r,1)):k=u.from+(x?x.to:0);let O=[{from:k,to:c,insert:S}];return f.node.name=="OrderedList"&&j$(f.item,r,O,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,O),{range:pt.cursor(k+S.length),changes:O}}else{let x=Ese(d,t,u);return{range:pt.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"&&j$(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=TW(b,t),h$t(f.node,t.doc)&&(b=Ese(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:pt.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},f$t=d$t();function Sse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function h$t(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),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=es(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&cP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=s6e(p$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:pt.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-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),!cP.isActiveAt(t.state,i.from,1)))return!1;let s=es(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||x$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const w6t=new Ma((e,t)=>{let n;if(e.next<0)e.acceptToken(E$t);else if(t.context.flags&WN)R$(e.next)&&e.acceptToken(S$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Cse)){let i=0;for(;e.next==_W||e.next==sL;)e.advance(),i++;(e.next==kv||e.next==eA||e.next==jW)&&e.acceptToken(Cse,-i)}else R$(e.next)&&e.acceptToken(O$t,1)},{contextual:!0}),k6t=new Ma((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==kv||i==eA){let r=0,s=0;for(;;){if(e.next==_W)r++;else if(e.next==sL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=kv&&e.next!=eA&&e.next!=jW&&(r[e,t|p6e])),E6t=new nL({start:O6t,reduce(e,t,n,i){return e.flags&WN&&x6t.has(t)||(t==Q$t||t==d6e)&&e.flags&p6e?e.parent:e},shift(e,t,n,i){return t==l6e?new KN(e,S6t(i.read(i.pos,n.pos)),0):t==c6e?e.parent:t==T$t||t==R$t||t==D$t||t==u6e?new KN(e,0,WN):jse.has(t)?new KN(e,0,jse.get(t)|e.flags&WN):e},hash(e){return e.hash}}),C6t=new Ma(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==_W||n==sL)){n!=h6t&&n!=p6t&&n!=kv&&n!=eA&&n!=jW&&e.acceptToken(k$t);return}}}),A6t=new Ma((e,t)=>{let{flags:n}=t.context,i=n&cp?h6e:f6e,r=(n&up)>0,s=!(n&dp),o=(n&fp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(u6e,1);return}break}else if(s&&e.next==_se){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),T6t(e,c)),e.acceptToken(A$t);return}break}else if(e.next==_se&&!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(Ase,r?3:1);return}break}else if(e.next==kv){if(r)e.advance();else if(e.pos==l){e.acceptToken(Ase);return}break}else e.advance();e.pos>l&&e.acceptToken(C$t)});function T6t(e,t){if(t==m6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==g6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==y6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==v6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==b6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Tse&&e.next!=f6e&&e.next!=h6e&&e.next!=kv;)e.advance();e.next==Tse&&e.advance()}}const _6t=vm({'async "*" "**" FormatConversion FormatSpec':me.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":me.controlKeyword,"in not and or is del":me.operatorKeyword,"from def class global nonlocal lambda":me.definitionKeyword,import:me.moduleKeyword,"with as print":me.keyword,Boolean:me.bool,None:me.null,VariableName:me.variableName,"CallExpression/VariableName":me.function(me.variableName),"FunctionDefinition/VariableName":me.function(me.definition(me.variableName)),"ClassDefinition/VariableName":me.definition(me.className),PropertyName:me.propertyName,"CallExpression/MemberExpression/PropertyName":me.function(me.propertyName),Comment:me.lineComment,Number:me.number,String:me.string,FormatString:me.special(me.string),Escape:me.escape,UpdateOp:me.updateOperator,"ArithOp!":me.arithmeticOperator,BitOp:me.bitwiseOperator,CompareOp:me.compareOperator,AssignOp:me.definitionOperator,Ellipsis:me.punctuation,At:me.meta,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace,".":me.derefOperator,", ;":me.separator}),j6t={__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},N6t=om.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:[C6t,k6t,w6t,A6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>j6t[e]||-1}],tokenPrec:7668}),Nse=new Mq,m6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const R6t={FunctionDefinition:aj("function"),ClassDefinition:aj("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 o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,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:aj("variable"),AsPattern:aj("variable"),__proto__:null};function g6e(e,t){let n=Nse.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Ar.IncludeAnonymous).iterate(o=>{if(o.name){let l=R6t[o.name];if(l&&l(o,s,r)||!r&&m6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of g6e(e,o.node))i.push(l);return!1}}),Nse.set(t,i),i}const Rse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,b6e=["String","FormatString","Comment","PropertyName"];function I6t(e){let t=es(e.state).resolveInner(e.pos,-1);if(b6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Rse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)m6e.has(r.name)&&(i=i.concat(g6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Rse}}const P6t=["__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"}))),D6t=[Xs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Xs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Xs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Xs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Xs(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],D6t=Q4e(p6e,cW(I6t.concat(P6t)));function D$(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 M$(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 L$=sm.define({name:"python",parser:j6t.configure({props:[vm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&D$(e)||e.node;return(t=M$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=D$(e);return(t=M$(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":ww({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":ww({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":ww({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=D$(e);return(t=n&&M$(e,n))!==null&&t!==void 0?t:e.continue()}}),xm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":NT,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 M6t(){return new yb(L$,[L$.data.of({autocomplete:R6t}),L$.data.of({autocomplete:D6t})])}const dx=63,jse=64,L6t=1,$6t=2,m6e=3,F6t=4,g6e=5,B6t=6,U6t=7,b6e=65,Q6t=66,z6t=8,V6t=9,H6t=10,q6t=11,W6t=12,y6e=13,K6t=19,G6t=20,X6t=29,Y6t=33,Z6t=34,J6t=47,eFt=0,NW=1,b7=2,JC=3,y7=4;class Sy{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}}Sy.top=new Sy(null,-1,eFt);function TE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(om(r)||r==-1)return n}}function v7(e){return e==32||e==9}function om(e){return e==10||e==13}function v6e(e){return v7(e)||om(e)}function Ly(e){return e<0||v6e(e)}const tFt=new rL({start:Sy.top,reduce(e,t){return e.type==JC&&(t==G6t||t==Z6t)?e.parent:e},shift(e,t,n,i){if(t==m6e)return new Sy(e,TE(i,i.pos),NW);if(t==b6e||t==g6e)return new Sy(e,TE(i,i.pos),b7);if(t==dx)return e.parent;if(t==K6t||t==Y6t)return new Sy(e,0,JC);if(t==y6e&&e.type==y7)return e.parent;if(t==J6t){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Sy(e,e.depth+ +r[0],y7)}return e},hash(e){return e.hash}});function v1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ly(e.peek(n+3))}const nFt=new Ia((e,t)=>{if(e.next==-1&&t.canShift(jse))return e.acceptToken(jse);let n=e.peek(-1);if((om(n)||n<0)&&t.context.type!=JC){if(v1(e,45))if(t.canShift(dx))e.acceptToken(dx);else return e.acceptToken(L6t,3);if(v1(e,46))if(t.canShift(dx))e.acceptToken(dx);else return e.acceptToken($6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==JC){e.next==63&&(e.advance(),Ly(e.next)&&e.acceptToken(U6t));return}if(e.next==45)e.advance(),Ly(e.next)&&e.acceptToken(t.context.type==NW&&t.context.depth==TE(e,e.pos-1)?F6t:m6e);else if(e.next==63)e.advance(),Ly(e.next)&&e.acceptToken(t.context.type==b7&&t.context.depth==TE(e,e.pos-1)?B6t:g6e);else{let n=e.pos;for(;;)if(v7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)x6e(e);else if(e.next==38)x7(e);else if(e.next==42){x7(e);break}else if(e.next==39||e.next==34){if(RW(e,!0))break;return}else if(e.next==91||e.next==123){if(!sFt(e))return;break}else{w6e(e,!0,!1,0);break}for(;v7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(X6t))return;let i=e.peek(1);Ly(i)&&e.acceptTokenTo(t.context.type==b7&&t.context.depth==TE(e,n)?Q6t:b6e,n)}}},{contextual:!0});function rFt(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 Nse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Rse(e,t){return e.next==37?(e.advance(),Nse(e.next)&&e.advance(),Nse(e.next)&&e.advance(),!0):rFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function x6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Rse(e,!0)){e.next==62&&e.advance();break}}else for(;Rse(e,!1););}function x7(e){for(e.advance();!Ly(e.next)&&dP(e.next)!="f";)e.advance()}function RW(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(om(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function sFt(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(!RW(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||om(e.next))return!1;e.advance()}}const aFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function dP(e){return e<33?"u":e>125?"s":aFt[e-33]}function $$(e,t){let n=dP(e);return n!="u"&&!(t&&n=="f")}function w6e(e,t,n,i){if(dP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&$$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;v6e(s);){if(om(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?$$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:$$(s,n)))||!n&&l<=i||l==0&&!n&&(v1(e,45,o)||v1(e,46,o)))break;if(t&&dP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const oFt=new Ia((e,t)=>{if(e.next==33)x6e(e),e.acceptToken(W6t);else if(e.next==38||e.next==42){let n=e.next==38?H6t:q6t;x7(e),e.acceptToken(n)}else e.next==39||e.next==34?(RW(e,!1),e.acceptToken(V6t)):w6e(e,!1,t.context.type==JC,t.context.depth)&&e.acceptToken(z6t)}),lFt=new Ia((e,t)=>{let n=t.context.type==y7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(v1(e,45,r)||v1(e,46,r))||!om(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:tFt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[cFt],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:[nFt,iFt,oFt,lFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),dFt=sm.define({name:"yaml",parser:uFt.configure({props:[vm.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:ww({closing:"}"}),FlowSequence:ww({closing:"]"})}),xm.add({"FlowMapping FlowSequence":NT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function fFt(){return new yb(dFt)}function hFt(e){O6e(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]=[],o=e[r],l=0;l2&&o.token&&typeof o.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 o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=PW(e.state,n.from);return i.line?_Ft(e):i.block?NFt(e):!1};function IW(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 _Ft=IW(PFt,0),jFt=IW(A6e,0),NFt=IW((e,t)=>A6e(e,t,IFt(t)),0);function PW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const jk=50;function RFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-jk,i),o=e.sliceDoc(r,r+jk),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.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*jk?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+jk),f=e.sliceDoc(r-jk,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 IFt(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 A6e(e,t,n=t.selection.ranges){let i=n.map(s=>PW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>RFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>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 o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const O7=Ih.define(),DFt=Ih.define(),MFt=mn.define(),T6e=mn.define({combine(e){return Ph(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)})}}),_6e=dl.define({create(){return dh.empty},update(e,t){let n=t.state.facet(T6e),i=t.annotation(O7);if(i){let c=Lc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=fP(d,d.length,n.minDepth,c):d=R6e(d,t.startState.selection),new dh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(DFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Xa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Lc.fromTransaction(t),o=t.annotation(Xa.time),l=t.annotation(Xa.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,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 dh(e.done.map(Lc.fromJSON),e.undone.map(Lc.fromJSON))}});function LFt(e={}){return[_6e,T6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?j6e:t.inputType=="historyRedo"?k7:null;return i?(t.preventDefault(),i(n)):!1}})]}function lL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(_6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const j6e=lL(0,!1),k7=lL(1,!1),$Ft=lL(0,!0),FFt=lL(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&&lo.fromJSON(t.changes),[],t.mapped&&yh.fromJSON(t.mapped),t.startSelection&&ht.fromJSON(t.startSelection),t.selectionsAfter.map(ht.fromJSON))}static fromTransaction(t,n){let i=yd;for(let r of t.startState.facet(MFt)){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,yd)}static selection(t){return new Lc(void 0,yd,void 0,void 0,t)}}function fP(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 BFt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function UFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function N6e(e,t){return e.length?t.length?e.concat(t):e:t}const yd=[],QFt=200;function R6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-QFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),fP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Lc.selection([t])]}function zFt(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 F$(e,t){if(!e.length)return e;let n=e.length,i=yd;for(;n;){let r=VFt(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)]:yd}function VFt(e,t,n){let i=N6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):yd,n);if(!e.changes)return Lc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Lc(r,pi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const HFt=/^(input\.type|delete)($|\.)/;class dh{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 dh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||HFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):cL(n,t))}function Il(e){return e.textDirectionAt(e.state.selection.main.head)==os.LTR}const P6e=e=>I6e(e,!Il(e)),D6e=e=>I6e(e,Il(e));function M6e(e,t){return If(e,n=>n.empty?e.moveByGroup(n,t):cL(n,t))}const WFt=e=>M6e(e,!Il(e)),KFt=e=>M6e(e,Il(e));function GFt(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 uL(e,t,n){let i=Yr(e).resolveInner(t.head),r=n?ui.closedBy:ui.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;GFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?uh(e,i.from,1):uh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,ht.cursor(l,n?-1:1)}const XFt=e=>If(e,t=>uL(e.state,t,!Il(e))),YFt=e=>If(e,t=>uL(e.state,t,Il(e)));function L6e(e,t){return If(e,n=>{if(!n.empty)return cL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const $6e=e=>L6e(e,!1),F6e=e=>L6e(e,!0);function B6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):cL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomU6e(e,!1),S7=e=>U6e(e,!0);function Ib(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=ht.cursor(i.from+s))}return r}const ZFt=e=>If(e,t=>Ib(e,t,!0)),JFt=e=>If(e,t=>Ib(e,t,!1)),e8t=e=>If(e,t=>Ib(e,t,!Il(e))),t8t=e=>If(e,t=>Ib(e,t,Il(e))),n8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).from,1)),i8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).to,-1));function r8t(e,t,n){let i=!1,r=bO(e.selection,s=>{let o=uh(e,s.head,-1)||uh(e,s.head,1)||s.head>0&&uh(e,s.head-1,1)||s.headr8t(e,t);function Dd(e,t,n){let i=bO(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=ht.range(r.head,r.anchor));let s=n(r);return ht.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Rf(e.state,i)),!0)}function Q6e(e,t){return Dd(e,t,n=>e.moveByChar(n,t))}const z6e=e=>Q6e(e,!Il(e)),V6e=e=>Q6e(e,Il(e));function H6e(e,t){return Dd(e,t,n=>e.moveByGroup(n,t))}const a8t=e=>H6e(e,!Il(e)),o8t=e=>H6e(e,Il(e)),l8t=e=>{let t=!Il(e);return Dd(e,t,n=>uL(e.state,n,t))},c8t=e=>{let t=Il(e);return Dd(e,t,n=>uL(e.state,n,t))};function q6e(e,t){return Dd(e,t,n=>e.moveVertically(n,t))}const W6e=e=>q6e(e,!1),K6e=e=>q6e(e,!0);function G6e(e,t){return Dd(e,t,n=>e.moveVertically(n,t,B6e(e).height))}const Pse=e=>G6e(e,!1),Dse=e=>G6e(e,!0),u8t=e=>Dd(e,!0,t=>Ib(e,t,!0)),d8t=e=>Dd(e,!1,t=>Ib(e,t,!1)),f8t=e=>{let t=!Il(e);return Dd(e,t,n=>Ib(e,n,t))},h8t=e=>{let t=Il(e);return Dd(e,t,n=>Ib(e,n,t))},p8t=e=>Dd(e,!1,t=>ht.cursor(e.lineBlockAt(t.head).from)),m8t=e=>Dd(e,!0,t=>ht.cursor(e.lineBlockAt(t.head).to)),Mse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:0})),!0),Lse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.doc.length})),!0),$se=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:0})),!0),Fse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),g8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),b8t=({state:e,dispatch:t})=>{let n=dL(e).map(({from:i,to:r})=>ht.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:ht.create(n),userEvent:"select"})),!0},y8t=({state:e,dispatch:t})=>{let n=bO(e.selection,i=>{let r=Yr(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return ht.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Rf(e,n)),!0)};function X6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.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(Rf(n,ht.create(r,r.length-1))),!0)}const v8t=e=>X6e(e,!1),x8t=e=>X6e(e,!0),w8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=ht.create([n.main]):n.main.empty||(i=ht.create([ht.cursor(n.main.head)])),i?(t(Rf(e,i)),!0):!1};function DT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=lj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=lj(e,o,!1),l=lj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:ht.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const Y6e=(e,t,n)=>DT(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rY6e(e,!1,!0),Z6e=e=>Y6e(e,!0,!1),J6e=(e,t)=>DT(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=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=Ro(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=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),eFe=e=>J6e(e,!1),O8t=e=>J6e(e,!0),k8t=e=>DT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headDT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),E8t=e=>DT(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:xr.of(["",""])},range:ht.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},A8t=({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),o=r==s.from?r-1:Ro(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Ro(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:ht.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dL(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 o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function tFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of dL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(ht.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(ht.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:ht.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const T8t=({state:e,dispatch:t})=>tFe(e,t,!1),_8t=({state:e,dispatch:t})=>tFe(e,t,!0);function nFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of dL(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 j8t=({state:e,dispatch:t})=>nFe(e,t,!1),N8t=({state:e,dispatch:t})=>nFe(e,t,!0),R8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.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 I8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Yr(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(ui.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 Bse=iFe(!1),P8t=iFe(!0);function iFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&I8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new nL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=iW(u,s);for(d==null&&(d=Of(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:ht.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const D8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new nL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=DW(e,(s,o,l)=>{let c=iW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=zC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(DW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(mO)})}),{userEvent:"input.indent"})),!0),sFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(DW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Of(r,e.tabSize),o=0,l=zC(e,Math.max(0,s-E0(e)));for(;o(e.setTabFocusMode(),!0),L8t=[{key:"Ctrl-b",run:P6e,shift:z6e,preventDefault:!0},{key:"Ctrl-f",run:D6e,shift:V6e},{key:"Ctrl-p",run:$6e,shift:W6e},{key:"Ctrl-n",run:F6e,shift:K6e},{key:"Ctrl-a",run:n8t,shift:p8t},{key:"Ctrl-e",run:i8t,shift:m8t},{key:"Ctrl-d",run:Z6e},{key:"Ctrl-h",run:E7},{key:"Ctrl-k",run:k8t},{key:"Ctrl-Alt-h",run:eFe},{key:"Ctrl-o",run:C8t},{key:"Ctrl-t",run:A8t},{key:"Ctrl-v",run:S7}],$8t=[{key:"ArrowLeft",run:P6e,shift:z6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:WFt,shift:a8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e8t,shift:f8t,preventDefault:!0},{key:"ArrowRight",run:D6e,shift:V6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:KFt,shift:o8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:t8t,shift:h8t,preventDefault:!0},{key:"ArrowUp",run:$6e,shift:W6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mse,shift:$se},{mac:"Ctrl-ArrowUp",run:Ise,shift:Pse},{key:"ArrowDown",run:F6e,shift:K6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Lse,shift:Fse},{mac:"Ctrl-ArrowDown",run:S7,shift:Dse},{key:"PageUp",run:Ise,shift:Pse},{key:"PageDown",run:S7,shift:Dse},{key:"Home",run:JFt,shift:d8t,preventDefault:!0},{key:"Mod-Home",run:Mse,shift:$se},{key:"End",run:ZFt,shift:u8t,preventDefault:!0},{key:"Mod-End",run:Lse,shift:Fse},{key:"Enter",run:Bse,shift:Bse},{key:"Mod-a",run:g8t},{key:"Backspace",run:E7,shift:E7,preventDefault:!0},{key:"Delete",run:Z6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:eFe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:O8t,preventDefault:!0},{mac:"Mod-Backspace",run:S8t,preventDefault:!0},{mac:"Mod-Delete",run:E8t,preventDefault:!0}].concat(L8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),F8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:XFt,shift:l8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:YFt,shift:c8t},{key:"Alt-ArrowUp",run:T8t},{key:"Shift-Alt-ArrowUp",run:j8t},{key:"Alt-ArrowDown",run:_8t},{key:"Shift-Alt-ArrowDown",run:N8t},{key:"Mod-Alt-ArrowUp",run:v8t},{key:"Mod-Alt-ArrowDown",run:x8t},{key:"Escape",run:w8t},{key:"Mod-Enter",run:P8t},{key:"Alt-l",mac:"Ctrl-l",run:b8t},{key:"Mod-i",run:y8t,preventDefault:!0},{key:"Mod-[",run:sFe},{key:"Mod-]",run:rFe},{key:"Mod-Alt-\\",run:D8t},{key:"Shift-Mod-k",run:R8t},{key:"Shift-Mod-\\",run:s8t},{key:"Mod-/",run:TFt},{key:"Alt-A",run:jFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:M8t}].concat($8t),B8t={key:"Tab",run:rFe,shift:sFe},Use=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class x1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,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(Use(l)):Use,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 Nc(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=Lq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=th(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,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=hP(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 Ew(n,t.sliceString(n,i));return B$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=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=hP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ew.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(oFe.prototype[Symbol.iterator]=lFe.prototype[Symbol.iterator]=function(){return this});function U8t(e){try{return new RegExp(e,MW),!0}catch{return!1}}function hP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const Q8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=JDt(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 o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,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=ht.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},z8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V8t=mn.define({combine(e){return Ph(e,z8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function H8t(e){return[X8t,G8t]}const q8t=Fn.mark({class:"cm-selectionMatch"}),W8t=Fn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Qse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function K8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const G8t=ma.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(V8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return Fn.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return Fn.none;let c=n.wordAt(r.head);if(!c)return Fn.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return Fn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Qse(o,n,r.from,r.to)&&K8t(o,n,r.from,r.to)))return Fn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Fn.none}let l=[];for(let c of e.visibleRanges){let u=new x1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Qse(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(W8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(q8t.range(d,f)),l.length>t.maxMatches))return Fn.none}}return Fn.set(l)}},{decorations:e=>e.decorations}),X8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Y8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=ht.create(n.ranges.map(r=>e.wordAt(r.head)||ht.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function Z8t(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 o=!1,l=new x1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new x1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&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 J8t=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Y8t({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=Z8t(e,i);return r?(t(e.update({selection:e.selection.addRange(ht.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},yO=mn.define({combine(e){return Ph(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new hBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class cFe{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||U8t(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 sBt(this):new nBt(this)}getCursor(t,n=0,i){let r=t.doc?t:tr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?hx(this,r,n,i):fx(this,r,n,i)}}class uFe{constructor(t){this.spec=t}}function eBt(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function fx(e,t,n,i){let r;return e.wholeWord&&(r=tBt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=eBt(e.test,t,r)),new x1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function tBt(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=fx(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 iBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function hx(e,t,n,i){let r;return e.wholeWord&&(r=rBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=iBt(e.test,t,r)),new oFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function pP(e,t){return e.slice(Ro(e,t,!1),t)}function mP(e,t){return e.slice(t,Ro(e,t))}function rBt(e){return(t,n,i)=>!i[0].length||(e(pP(i.input,i.index))!=Qs.Word||e(mP(i.input,i.index))!=Qs.Word)&&(e(mP(i.input,i.index+i[0].length))!=Qs.Word||e(pP(i.input,i.index+i[0].length))!=Qs.Word)}class sBt extends uFe{nextMatch(t,n,i){let r=hx(this.spec,t,i,t.doc.length).next();return r.done&&(r=hx(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),o=hx(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.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=hx(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 eA=pi.define(),LW=pi.define(),Bg=dl.define({create(e){return new U$(C7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(eA)?e=new U$(n.value.create(),e.panel):n.is(LW)&&(e=new U$(e.query,n.value?$W:null));return e},provide:e=>UC.from(e,t=>t.panel)});class U${constructor(t,n){this.query=t,this.panel=n}}const aBt=Fn.mark({class:"cm-searchMatch"}),oBt=Fn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lBt=ma.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Bg))}update(e){let t=e.state.field(Bg);(t!=e.startState.field(Bg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Fn.none;let{view:n}=this,i=new nm;for(let r=0,s=n.visibleRanges,o=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?oBt:aBt)})}return i.finish()}},{decorations:e=>e.decorations});function MT(e){return t=>{let n=t.state.field(Bg,!1);return n&&n.query.spec.valid?e(t,n):hFe(t)}}const gP=MT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=ht.single(i.from,i.to),s=e.state.facet(yO);return e.dispatch({selection:r,effects:[FW(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),fFe(e),!0}),bP=MT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=ht.single(r.from,r.to),o=e.state.facet(yO);return e.dispatch({selection:s,effects:[FW(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),fFe(e),!0}),cBt=MT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ht.create(n.map(i=>ht.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),uBt=({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=[],o=0;for(let l=new x1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(ht.range(l.value.from,l.value.to))}return t(e.update({selection:ht.create(s,o),userEvent:"select.search.matches"})),!0},zse=MT((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 o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=ht.single(o.from,o.to).map(f),d.push(FW(e,o)),d.push(n.facet(yO).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),dBt=MT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function $W(e){return e.state.facet(yO).createPanel(e)}function C7(e,t){var n,i,r,s,o;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(yO);return new cFe({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:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function dFe(e){let t=tW(e,$W);return t&&t.dom.querySelector("[main-field]")}function fFe(e){let t=dFe(e);t&&t==e.root.activeElement&&t.select()}const hFe=e=>{let t=e.state.field(Bg,!1);if(t&&t.panel){let n=dFe(e);if(n&&n!=e.root.activeElement){let i=C7(e.state,t.query.spec);i.valid&&e.dispatch({effects:eA.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[LW.of(!0),t?eA.of(C7(e.state,t.query.spec)):pi.appendConfig.of(mBt)]});return!0},pFe=e=>{let t=e.state.field(Bg,!1);if(!t||!t.panel)return!1;let n=tW(e,$W);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:LW.of(!1)}),!0},fBt=[{key:"Mod-f",run:hFe,scope:"editor search-panel"},{key:"F3",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:pFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:uBt},{key:"Mod-Alt-g",run:Q8t},{key:"Mod-d",run:J8t,preventDefault:!0}];class hBt{constructor(t){this.view=t;let n=this.query=t.state.field(Bg).query.spec;this.commit=this.commit.bind(this),this.searchField=Kr("input",{value:n.search,placeholder:su(t,"Find"),"aria-label":su(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kr("input",{value:n.replace,placeholder:su(t,"Replace"),"aria-label":su(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Kr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Kr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Kr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Kr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>gP(t),[su(t,"next")]),i("prev",()=>bP(t),[su(t,"previous")]),i("select",()=>cBt(t),[su(t,"all")]),Kr("label",null,[this.caseField,su(t,"match case")]),Kr("label",null,[this.reField,su(t,"regexp")]),Kr("label",null,[this.wordField,su(t,"by word")]),...t.state.readOnly?[]:[Kr("br"),this.replaceField,i("replace",()=>zse(t),[su(t,"replace")]),i("replaceAll",()=>dBt(t),[su(t,"replace all")])],Kr("button",{name:"close",onclick:()=>pFe(t),"aria-label":su(t,"close"),type:"button"},["×"])])}commit(){let t=new cFe({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:eA.of(t)}))}keydown(t){lDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?bP:gP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),zse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(eA)&&!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(yO).top}}function su(e,t){return e.state.phrase(t)}const cj=30,uj=/[\s\.,:;?!]/;function FW(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-cj),o=Math.min(r,n+cj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-cj;c--)if(!uj.test(l[c-1])&&uj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const pBt=Jt.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"}}),mBt=[Bg,bm.low(lBt),pBt];class Vse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Ey{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(tA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new nm,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=TBt(l);if(y)o.add(b,b,Fn.widget({widget:new SBt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,k)=>k.markClass?O+" "+k.markClass:O,"");o.add(b,v,Fn.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&&o.diagnostics.indexOf(t)<0))if(!i)i=new Vse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Vse(i.from,s,i.diagnostic)}}),i}function gBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(tA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(mFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function bBt(e,t){return e.field(Su,!1)?t:t.concat(pi.appendConfig.of(_Bt))}const mFe=pi.define(),BW=pi.define(),gFe=pi.define(),Su=dl.define({create(){return new Ey(Fn.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=vb(n,e.selected.diagnostic,s)||vb(n,null,s)}!n.size&&r&&t.state.facet(tA).autoPanel&&(r=null),e=new Ey(n,r,i)}for(let n of t.effects)if(n.is(mFe)){let i=t.state.facet(tA).autoPanel?n.value.length?nA.open:null:e.panel;e=Ey.init(n.value,i,t.state)}else n.is(BW)?e=new Ey(e.diagnostics,n.value?nA.open:null,e.selected):n.is(gFe)&&(e=new Ey(e.diagnostics,e.panel,n.value));return e},provide:e=>[UC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),yBt=Fn.mark({class:"cm-lintRange cm-lintRange-active"});function vBt(e,t,n){let{diagnostics:i}=e.state.field(Su),r,s=-1,o=-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)&&(tyFe(e,n,!1)))}const wBt=e=>{let t=e.state.field(Su,!1);(!t||!t.panel)&&e.dispatch({effects:bBt(e.state,[BW.of(!0)])});let n=tW(e,nA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Hse=e=>{let t=e.state.field(Su,!1);return!t||!t.panel?!1:(e.dispatch({effects:BW.of(!1)}),!0)},OBt=e=>{let t=e.state.field(Su,!1);if(!t)return!1;let n=e.state.selection.main,i=vb(t.diagnostics,null,n.to+1);return!i&&(i=vb(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}),YDt(e,i.from,1,{tooltip:vFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},kBt=[{key:"Mod-Shift-m",run:wBt,preventDefault:!0},{key:"F8",run:OBt}],tA=mn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ph(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qse,tooltipFilter:qse,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 qse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function bFe(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 yFe(e,t,n){var i;let r=n?bFe(t.actions):[];return Kr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=vb(e.state.field(Su).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Kr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Kr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Kr("div",{class:"cm-diagnosticSource"},t.source))}class SBt extends Nf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Kr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Wse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=yFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class nA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Hse(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],o=bFe(s.actions);for(let l=0;l{for(let s=0;sHse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Su).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.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(Su),i=vb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gFe.of(i)})}static open(t){return new nA(t)}}function EBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function dj(e){return EBt(``,'width="6" height="3"')}const CBt=Jt.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:dj("#f11")},".cm-lintRange-warning":{backgroundImage:dj("orange")},".cm-lintRange-info":{backgroundImage:dj("#999")},".cm-lintRange-hint":{backgroundImage:dj("#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 ABt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function TBt(e){let t="hint",n=1;for(let i of e){let r=ABt(i.severity);r>n&&(n=r,t=i.severity)}return t}const vFe=XDt(vBt,{hideOn:gBt}),_Bt=[Su,Jt.decorations.compute([Su],e=>{let{selected:t,panel:n}=e.field(Su);return!t||!n||t.from==t.to?Fn.none:Fn.set([yBt.range(t.from,t.to)])}),vFe,CBt];var Kse=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(M5t)),t.defaultKeymap!==!1&&(s=s.concat(F8t)),t.searchKeymap!==!1&&(s=s.concat(fBt)),t.historyKeymap!==!1&&(s=s.concat(qFt)),t.foldKeymap!==!1&&(s=s.concat(BMt)),t.completionKeymap!==!1&&(s=s.concat(Y4e)),t.lintKeymap!==!1&&(s=s.concat(kBt));var o=[];return t.lineNumbers!==!1&&o.push(p4e()),t.highlightActiveLineGutter!==!1&&o.push(fMt()),t.highlightSpecialChars!==!1&&o.push(EDt()),t.history!==!1&&o.push(LFt()),t.foldGutter!==!1&&o.push(VMt()),t.drawSelection!==!1&&o.push(pDt()),t.dropCursor!==!1&&o.push(vDt()),t.allowMultipleSelections!==!1&&o.push(tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(RMt()),t.syntaxHighlighting!==!1&&o.push(_4e(KMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(tLt()),t.closeBrackets!==!1&&o.push(R5t()),t.autocompletion!==!1&&o.push(z5t()),t.rectangularSelection!==!1&&o.push(FDt()),r!==!1&&o.push(QDt()),t.highlightActiveLine!==!1&&o.push(NDt()),t.highlightSelectionMatches!==!1&&o.push(H8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(mO.of(" ".repeat(t.tabSize))),o.concat([pO.of(s.flat())]).filter(Boolean)};const jBt="#e5c07b",Gse="#e06c75",NBt="#56b6c2",RBt="#ffffff",XN="#abb2bf",A7="#7d8799",IBt="#61afef",PBt="#98c379",Xse="#d19a66",DBt="#c678dd",MBt="#21252b",Yse="#2c313a",Zse="#282c34",Q$="#353a42",LBt="#3E4451",Jse="#528bff",$Bt=Jt.theme({"&":{color:XN,backgroundColor:Zse},".cm-content":{caretColor:Jse},".cm-cursor, .cm-dropCursor":{borderLeftColor:Jse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:LBt},".cm-panels":{backgroundColor:MBt,color:XN},".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:Zse,color:A7,border:"none"},".cm-activeLineGutter":{backgroundColor:Yse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Q$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Q$,borderBottomColor:Q$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Yse,color:XN}}},{dark:!0}),FBt=IT.define([{tag:pe.keyword,color:DBt},{tag:[pe.name,pe.deleted,pe.character,pe.propertyName,pe.macroName],color:Gse},{tag:[pe.function(pe.variableName),pe.labelName],color:IBt},{tag:[pe.color,pe.constant(pe.name),pe.standard(pe.name)],color:Xse},{tag:[pe.definition(pe.name),pe.separator],color:XN},{tag:[pe.typeName,pe.className,pe.number,pe.changed,pe.annotation,pe.modifier,pe.self,pe.namespace],color:jBt},{tag:[pe.operator,pe.operatorKeyword,pe.url,pe.escape,pe.regexp,pe.link,pe.special(pe.string)],color:NBt},{tag:[pe.meta,pe.comment],color:A7},{tag:pe.strong,fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.link,color:A7,textDecoration:"underline"},{tag:pe.heading,fontWeight:"bold",color:Gse},{tag:[pe.atom,pe.bool,pe.special(pe.variableName)],color:Xse},{tag:[pe.processingInstruction,pe.string,pe.inserted],color:PBt},{tag:pe.invalid,color:RBt}]),BBt=[$Bt,_4e(FBt)];var UBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),QBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=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(pO.of([B8t])),g&&(typeof g=="boolean"?b.unshift(Kse()):b.unshift(Kse(g))),h&&b.unshift(DDt(h)),d){case"light":b.push(UBt);break;case"dark":b.push(BBt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(tr.readOnly.of(!0)),[...b]},zBt=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 VBt{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 eae{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 z$=null,HBt=()=>typeof window>"u"?new eae:(z$||(z$=new eae),z$),qBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),tae=null,V$=null;function WBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===tae||(tae=o,V$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),V$}var nae=Ih.define(),KBt=200,GBt=[];function XBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?GBt: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,k=O===void 0?null:O,S=e.maxWidth,E=S===void 0?null:S,C=e.placeholder,j=C===void 0?"":C,T=e.editable,R=T===void 0?!0:T,A=e.readOnly,N=A===void 0?!1:A,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),H=M[0],q=M[1],U=p.useState(),Z=U[0],z=U[1],J=p.useState(),ne=J[0],W=J[1],X=p.useState(()=>({current:null}))[0],V=p.useState(()=>({current:null}))[0],ae=WBt(m,b,y,x,k,E),Y=Jt.updateListener.of(ue=>{if(ue.docChanged&&typeof i=="function"&&!ue.transactions.some(me=>me.annotation(nae))){X.current?X.current.reset():(X.current=new VBt(()=>{if(V.current){var me=V.current;V.current=null,me()}X.current=null},KBt),HBt().add(X.current));var fe=ue.state.doc,se=fe.toString();i(se,ue)}r&&r(zBt(ue))}),K=QBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),te=[Y,...ae?[ae]:[],qBt,...K];return o&&typeof o=="function"&&te.push(Jt.updateListener.of(o)),te=te.concat(c),p.useLayoutEffect(()=>{if(H&&!ne){var ue={doc:t,selection:n,extensions:te},fe=F?tr.fromJSON(F.json,ue,F.fields):tr.create(ue);if(W(fe),!Z){var se=new Jt({state:fe,parent:H,root:L});z(se),s&&s(se,fe)}}return()=>{Z&&(W(void 0),z(void 0))}},[H,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{Z&&(Z.destroy(),z(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Z]),p.useEffect(()=>{u&&Z&&Z.focus()},[u,Z]),p.useEffect(()=>{Z&&Z.dispatch({effects:pi.reconfigure.of(te)})},[f,c,m,b,y,x,k,E,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var ue=Z?Z.state.doc.toString():"";if(Z&&t!==ue){var fe=X.current&&!X.current.isDone,se=()=>{Z&&t!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:t||""},annotations:[nae.of(!0)]})};fe?V.current=se:se()}}},[t,Z]),{state:ne,setState:W,view:Z,setView:z,container:H,setContainer:q}}var YBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],xFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,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,k=e.basicSetup,S=e.placeholder,E=e.indentWithTab,C=e.editable,j=e.readOnly,T=e.root,R=e.initialState,A=AFt(e,YBt),N=p.useRef(null),P=XBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:k,placeholder:S,indentWithTab:E,editable:C,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(H=>{N.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 a.jsx("div",w7({ref:F,className:""+M+(n?" "+n:"")},A))});xFe.displayName="CodeMirror";function wFe(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")?[sW.define(CFt)]:i==="py"||i==="pyi"?[M6t()]:["ts","tsx","mts","cts"].includes(i??"")?[l7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[l7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[n3t()]:i==="yaml"||i==="yml"?[fFt()]:["md","markdown"].includes(i??"")?[g$t()]:[]}function LT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...wFe(t),...s===1?[]:[p4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(xFe,{value:e,height:o,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 OFe=Object.freeze(Object.defineProperty({__proto__:null,default:LT,languageFor:wFe},Symbol.toStringTag,{value:"Module"}));function ZBt(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((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=L5e(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),Xs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Xs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Xs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Xs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],M6t=H4e(b6e,cW(P6t.concat(D6t)));function P$(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 D$(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 M$=am.define({name:"python",parser:N6t.configure({props:[xm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(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":kw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":kw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":kw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),wm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":PT,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 L6t(){return new mb(M$,[M$.data.of({autocomplete:I6t}),M$.data.of({autocomplete:M6t})])}const fx=63,Ise=64,$6t=1,F6t=2,y6e=3,B6t=4,v6e=5,U6t=6,Q6t=7,x6e=65,z6t=66,V6t=8,H6t=9,q6t=10,W6t=11,K6t=12,w6e=13,G6t=19,X6t=20,Y6t=29,Z6t=33,J6t=34,eFt=47,tFt=0,NW=1,g7=2,tA=3,b7=4;class vy{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}}vy.top=new vy(null,-1,tFt);function jE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(lm(r)||r==-1)return n}}function y7(e){return e==32||e==9}function lm(e){return e==10||e==13}function k6e(e){return y7(e)||lm(e)}function Ry(e){return e<0||k6e(e)}const nFt=new nL({start:vy.top,reduce(e,t){return e.type==tA&&(t==X6t||t==J6t)?e.parent:e},shift(e,t,n,i){if(t==y6e)return new vy(e,jE(i,i.pos),NW);if(t==x6e||t==v6e)return new vy(e,jE(i,i.pos),g7);if(t==fx)return e.parent;if(t==G6t||t==Z6t)return new vy(e,0,tA);if(t==w6e&&e.type==b7)return e.parent;if(t==eFt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new vy(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function w1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ry(e.peek(n+3))}const iFt=new Ma((e,t)=>{if(e.next==-1&&t.canShift(Ise))return e.acceptToken(Ise);let n=e.peek(-1);if((lm(n)||n<0)&&t.context.type!=tA){if(w1(e,45))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken($6t,3);if(w1(e,46))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken(F6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==tA){e.next==63&&(e.advance(),Ry(e.next)&&e.acceptToken(Q6t));return}if(e.next==45)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==NW&&t.context.depth==jE(e,e.pos-1)?B6t:y6e);else if(e.next==63)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==jE(e,e.pos-1)?U6t:v6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)O6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(RW(e,!0))break;return}else if(e.next==91||e.next==123){if(!aFt(e))return;break}else{S6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Y6t))return;let i=e.peek(1);Ry(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==jE(e,n)?z6t:x6e,n)}}},{contextual:!0});function sFt(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 Pse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Dse(e,t){return e.next==37?(e.advance(),Pse(e.next)&&e.advance(),Pse(e.next)&&e.advance(),!0):sFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function O6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Dse(e,!0)){e.next==62&&e.advance();break}}else for(;Dse(e,!1););}function v7(e){for(e.advance();!Ry(e.next)&&uP(e.next)!="f";)e.advance()}function RW(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(lm(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function aFt(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(!RW(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||lm(e.next))return!1;e.advance()}}const oFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function uP(e){return e<33?"u":e>125?"s":oFt[e-33]}function L$(e,t){let n=uP(e);return n!="u"&&!(t&&n=="f")}function S6e(e,t,n,i){if(uP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;k6e(s);){if(lm(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(w1(e,45,o)||w1(e,46,o)))break;if(t&&uP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const lFt=new Ma((e,t)=>{if(e.next==33)O6e(e),e.acceptToken(K6t);else if(e.next==38||e.next==42){let n=e.next==38?q6t:W6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(RW(e,!1),e.acceptToken(H6t)):S6e(e,!1,t.context.type==tA,t.context.depth)&&e.acceptToken(V6t)}),cFt=new Ma((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(w1(e,45,r)||w1(e,46,r))||!lm(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:nFt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[uFt],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:[iFt,rFt,lFt,cFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),fFt=am.define({name:"yaml",parser:dFt.configure({props:[xm.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:kw({closing:"}"}),FlowSequence:kw({closing:"]"})}),wm.add({"FlowMapping FlowSequence":PT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function hFt(){return new mb(fFt)}function pFt(e){E6e(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]=[],o=e[r],l=0;l2&&o.token&&typeof o.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 o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=PW(e.state,n.from);return i.line?jFt(e):i.block?RFt(e):!1};function IW(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 jFt=IW(DFt,0),NFt=IW(j6e,0),RFt=IW((e,t)=>j6e(e,t,PFt(t)),0);function PW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const RO=50;function IFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-RO,i),o=e.sliceDoc(r,r+RO),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.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*RO?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+RO),f=e.sliceDoc(r-RO,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 PFt(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 j6e(e,t,n=t.selection.ranges){let i=n.map(s=>PW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>IFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>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 o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Dh.define(),MFt=Dh.define(),LFt=pn.define(),N6e=pn.define({combine(e){return Mh(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)})}}),R6e=pl.define({create(){return fh.empty},update(e,t){let n=t.state.facet(N6e),i=t.annotation(w7);if(i){let c=Ic.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=dP(d,d.length,n.minDepth,c):d=D6e(d,t.startState.selection),new fh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(MFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Ya.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Ic.fromTransaction(t),o=t.annotation(Ya.time),l=t.annotation(Ya.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,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 fh(e.done.map(Ic.fromJSON),e.undone.map(Ic.fromJSON))}});function $Ft(e={}){return[R6e,N6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?I6e:t.inputType=="historyRedo"?k7:null;return i?(t.preventDefault(),i(n)):!1}})]}function aL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(R6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const I6e=aL(0,!1),k7=aL(1,!1),FFt=aL(0,!0),BFt=aL(1,!0);class Ic{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 Ic(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 Ic(t.changes&&co.fromJSON(t.changes),[],t.mapped&&xh.fromJSON(t.mapped),t.startSelection&&pt.fromJSON(t.startSelection),t.selectionsAfter.map(pt.fromJSON))}static fromTransaction(t,n){let i=vd;for(let r of t.startState.facet(LFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Ic(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,vd)}static selection(t){return new Ic(void 0,vd,void 0,void 0,t)}}function dP(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 UFt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function QFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function P6e(e,t){return e.length?t.length?e.concat(t):e:t}const vd=[],zFt=200;function D6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-zFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),dP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Ic.selection([t])]}function VFt(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 $$(e,t){if(!e.length)return e;let n=e.length,i=vd;for(;n;){let r=HFt(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?[Ic.selection(i)]:vd}function HFt(e,t,n){let i=P6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):vd,n);if(!e.changes)return Ic.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Ic(r,hi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const qFt=/^(input\.type|delete)($|\.)/;class fh{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 fh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||qFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):oL(n,t))}function Rl(e){return e.textDirectionAt(e.state.selection.main.head)==cs.LTR}const L6e=e=>M6e(e,!Rl(e)),$6e=e=>M6e(e,Rl(e));function F6e(e,t){return jf(e,n=>n.empty?e.moveByGroup(n,t):oL(n,t))}const KFt=e=>F6e(e,!Rl(e)),GFt=e=>F6e(e,Rl(e));function XFt(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 lL(e,t,n){let i=es(e).resolveInner(t.head),r=n?li.closedBy:li.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;XFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?dh(e,i.from,1):dh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,pt.cursor(l,n?-1:1)}const YFt=e=>jf(e,t=>lL(e.state,t,!Rl(e))),ZFt=e=>jf(e,t=>lL(e.state,t,Rl(e)));function B6e(e,t){return jf(e,n=>{if(!n.empty)return oL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const U6e=e=>B6e(e,!1),Q6e=e=>B6e(e,!0);function z6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):oL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomV6e(e,!1),O7=e=>V6e(e,!0);function jb(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=pt.cursor(i.from+s))}return r}const JFt=e=>jf(e,t=>jb(e,t,!0)),e8t=e=>jf(e,t=>jb(e,t,!1)),t8t=e=>jf(e,t=>jb(e,t,!Rl(e))),n8t=e=>jf(e,t=>jb(e,t,Rl(e))),i8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).from,1)),r8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).to,-1));function s8t(e,t,n){let i=!1,r=vk(e.selection,s=>{let o=dh(e,s.head,-1)||dh(e,s.head,1)||s.head>0&&dh(e,s.head-1,1)||s.heads8t(e,t);function Md(e,t,n){let i=vk(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=pt.range(r.head,r.anchor));let s=n(r);return pt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(_f(e.state,i)),!0)}function H6e(e,t){return Md(e,t,n=>e.moveByChar(n,t))}const q6e=e=>H6e(e,!Rl(e)),W6e=e=>H6e(e,Rl(e));function K6e(e,t){return Md(e,t,n=>e.moveByGroup(n,t))}const o8t=e=>K6e(e,!Rl(e)),l8t=e=>K6e(e,Rl(e)),c8t=e=>{let t=!Rl(e);return Md(e,t,n=>lL(e.state,n,t))},u8t=e=>{let t=Rl(e);return Md(e,t,n=>lL(e.state,n,t))};function G6e(e,t){return Md(e,t,n=>e.moveVertically(n,t))}const X6e=e=>G6e(e,!1),Y6e=e=>G6e(e,!0);function Z6e(e,t){return Md(e,t,n=>e.moveVertically(n,t,z6e(e).height))}const Lse=e=>Z6e(e,!1),$se=e=>Z6e(e,!0),d8t=e=>Md(e,!0,t=>jb(e,t,!0)),f8t=e=>Md(e,!1,t=>jb(e,t,!1)),h8t=e=>{let t=!Rl(e);return Md(e,t,n=>jb(e,n,t))},p8t=e=>{let t=Rl(e);return Md(e,t,n=>jb(e,n,t))},m8t=e=>Md(e,!1,t=>pt.cursor(e.lineBlockAt(t.head).from)),g8t=e=>Md(e,!0,t=>pt.cursor(e.lineBlockAt(t.head).to)),Fse=({state:e,dispatch:t})=>(t(_f(e,{anchor:0})),!0),Bse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.doc.length})),!0),Use=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:0})),!0),Qse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),b8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),y8t=({state:e,dispatch:t})=>{let n=cL(e).map(({from:i,to:r})=>pt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:pt.create(n),userEvent:"select"})),!0},v8t=({state:e,dispatch:t})=>{let n=vk(e.selection,i=>{let r=es(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return pt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(_f(e,n)),!0)};function J6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.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(_f(n,pt.create(r,r.length-1))),!0)}const x8t=e=>J6e(e,!1),w8t=e=>J6e(e,!0),k8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=pt.create([n.main]):n.main.empty||(i=pt.create([pt.cursor(n.main.head)])),i?(t(_f(e,i)),!0):!1};function $T(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=oj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=oj(e,o,!1),l=oj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:pt.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const eFe=(e,t,n)=>$T(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&reFe(e,!1,!0),tFe=e=>eFe(e,!0,!1),nFe=(e,t)=>$T(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=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=Lo(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=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),iFe=e=>nFe(e,!1),O8t=e=>nFe(e,!0),S8t=e=>$T(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head$T(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),C8t=e=>$T(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:Or.of(["",""])},range:pt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},T8t=({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),o=r==s.from?r-1:Lo(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Lo(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:pt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cL(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 o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function rFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of cL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(pt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(pt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:pt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _8t=({state:e,dispatch:t})=>rFe(e,t,!1),j8t=({state:e,dispatch:t})=>rFe(e,t,!0);function sFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of cL(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 N8t=({state:e,dispatch:t})=>sFe(e,t,!1),R8t=({state:e,dispatch:t})=>sFe(e,t,!0),I8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(cL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.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 P8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=es(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(li.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 zse=aFe(!1),D8t=aFe(!0);function aFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&P8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new eL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=iW(u,s);for(d==null&&(d=vf(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:pt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const M8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new eL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=DW(e,(s,o,l)=>{let c=iW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=HC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(DW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(bk)})}),{userEvent:"input.indent"})),!0),lFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(DW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=vf(r,e.tabSize),o=0,l=HC(e,Math.max(0,s-xv(e)));for(;o(e.setTabFocusMode(),!0),$8t=[{key:"Ctrl-b",run:L6e,shift:q6e,preventDefault:!0},{key:"Ctrl-f",run:$6e,shift:W6e},{key:"Ctrl-p",run:U6e,shift:X6e},{key:"Ctrl-n",run:Q6e,shift:Y6e},{key:"Ctrl-a",run:i8t,shift:m8t},{key:"Ctrl-e",run:r8t,shift:g8t},{key:"Ctrl-d",run:tFe},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:S8t},{key:"Ctrl-Alt-h",run:iFe},{key:"Ctrl-o",run:A8t},{key:"Ctrl-t",run:T8t},{key:"Ctrl-v",run:O7}],F8t=[{key:"ArrowLeft",run:L6e,shift:q6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:KFt,shift:o8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t8t,shift:h8t,preventDefault:!0},{key:"ArrowRight",run:$6e,shift:W6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:GFt,shift:l8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:n8t,shift:p8t,preventDefault:!0},{key:"ArrowUp",run:U6e,shift:X6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Fse,shift:Use},{mac:"Ctrl-ArrowUp",run:Mse,shift:Lse},{key:"ArrowDown",run:Q6e,shift:Y6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Bse,shift:Qse},{mac:"Ctrl-ArrowDown",run:O7,shift:$se},{key:"PageUp",run:Mse,shift:Lse},{key:"PageDown",run:O7,shift:$se},{key:"Home",run:e8t,shift:f8t,preventDefault:!0},{key:"Mod-Home",run:Fse,shift:Use},{key:"End",run:JFt,shift:d8t,preventDefault:!0},{key:"Mod-End",run:Bse,shift:Qse},{key:"Enter",run:zse,shift:zse},{key:"Mod-a",run:b8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:tFe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:iFe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:O8t,preventDefault:!0},{mac:"Mod-Backspace",run:E8t,preventDefault:!0},{mac:"Mod-Delete",run:C8t,preventDefault:!0}].concat($8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),B8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:YFt,shift:c8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ZFt,shift:u8t},{key:"Alt-ArrowUp",run:_8t},{key:"Shift-Alt-ArrowUp",run:N8t},{key:"Alt-ArrowDown",run:j8t},{key:"Shift-Alt-ArrowDown",run:R8t},{key:"Mod-Alt-ArrowUp",run:x8t},{key:"Mod-Alt-ArrowDown",run:w8t},{key:"Escape",run:k8t},{key:"Mod-Enter",run:D8t},{key:"Alt-l",mac:"Ctrl-l",run:y8t},{key:"Mod-i",run:v8t,preventDefault:!0},{key:"Mod-[",run:lFe},{key:"Mod-]",run:oFe},{key:"Mod-Alt-\\",run:M8t},{key:"Shift-Mod-k",run:I8t},{key:"Shift-Mod-\\",run:a8t},{key:"Mod-/",run:_Ft},{key:"Alt-A",run:NFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:L8t}].concat(F8t),U8t={key:"Tab",run:oFe,shift:lFe},Vse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class k1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,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(Vse(l)):Vse,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 Ac(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=Lq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=nh(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,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=fP(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 Cw(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=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=fP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Cw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(uFe.prototype[Symbol.iterator]=dFe.prototype[Symbol.iterator]=function(){return this});function Q8t(e){try{return new RegExp(e,MW),!0}catch{return!1}}function fP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const z8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=eMt(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 o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,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=pt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},V8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},H8t=pn.define({combine(e){return Mh(e,V8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function q8t(e){return[Y8t,X8t]}const W8t=$n.mark({class:"cm-selectionMatch"}),K8t=$n.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Hse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function G8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const X8t=ba.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(H8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return $n.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return $n.none;let c=n.wordAt(r.head);if(!c)return $n.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return $n.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Hse(o,n,r.from,r.to)&&G8t(o,n,r.from,r.to)))return $n.none}else if(s=n.sliceDoc(r.from,r.to),!s)return $n.none}let l=[];for(let c of e.visibleRanges){let u=new k1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Hse(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(K8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(W8t.range(d,f)),l.length>t.maxMatches))return $n.none}}return $n.set(l)}},{decorations:e=>e.decorations}),Y8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Z8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=pt.create(n.ranges.map(r=>e.wordAt(r.head)||pt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function J8t(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 o=!1,l=new k1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new k1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&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 eBt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Z8t({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=J8t(e,i);return r?(t(e.update({selection:e.selection.addRange(pt.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},xk=pn.define({combine(e){return Mh(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new pBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class fFe{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||Q8t(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 aBt(this):new iBt(this)}getCursor(t,n=0,i){let r=t.doc?t:sr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?px(this,r,n,i):hx(this,r,n,i)}}class hFe{constructor(t){this.spec=t}}function tBt(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function hx(e,t,n,i){let r;return e.wholeWord&&(r=nBt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=tBt(e.test,t,r)),new k1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function nBt(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=hx(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 rBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function px(e,t,n,i){let r;return e.wholeWord&&(r=sBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=rBt(e.test,t,r)),new uFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function hP(e,t){return e.slice(Lo(e,t,!1),t)}function pP(e,t){return e.slice(t,Lo(e,t))}function sBt(e){return(t,n,i)=>!i[0].length||(e(hP(i.input,i.index))!=Qs.Word||e(pP(i.input,i.index))!=Qs.Word)&&(e(pP(i.input,i.index+i[0].length))!=Qs.Word||e(hP(i.input,i.index+i[0].length))!=Qs.Word)}class aBt extends hFe{nextMatch(t,n,i){let r=px(this.spec,t,i,t.doc.length).next();return r.done&&(r=px(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),o=px(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.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=px(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 nA=hi.define(),LW=hi.define(),Lg=pl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(nA)?e=new B$(n.value.create(),e.panel):n.is(LW)&&(e=new B$(e.query,n.value?$W:null));return e},provide:e=>zC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const oBt=$n.mark({class:"cm-searchMatch"}),lBt=$n.mark({class:"cm-searchMatch cm-searchMatch-selected"}),cBt=ba.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Lg))}update(e){let t=e.state.field(Lg);(t!=e.startState.field(Lg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return $n.none;let{view:n}=this,i=new im;for(let r=0,s=n.visibleRanges,o=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?lBt:oBt)})}return i.finish()}},{decorations:e=>e.decorations});function FT(e){return t=>{let n=t.state.field(Lg,!1);return n&&n.query.spec.valid?e(t,n):gFe(t)}}const mP=FT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=pt.single(i.from,i.to),s=e.state.facet(xk);return e.dispatch({selection:r,effects:[FW(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),mFe(e),!0}),gP=FT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=pt.single(r.from,r.to),o=e.state.facet(xk);return e.dispatch({selection:s,effects:[FW(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),mFe(e),!0}),uBt=FT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:pt.create(n.map(i=>pt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dBt=({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=[],o=0;for(let l=new k1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(pt.range(l.value.from,l.value.to))}return t(e.update({selection:pt.create(s,o),userEvent:"select.search.matches"})),!0},qse=FT((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 o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=pt.single(o.from,o.to).map(f),d.push(FW(e,o)),d.push(n.facet(xk).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),fBt=FT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function $W(e){return e.state.facet(xk).createPanel(e)}function E7(e,t){var n,i,r,s,o;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(xk);return new fFe({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:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function pFe(e){let t=tW(e,$W);return t&&t.dom.querySelector("[main-field]")}function mFe(e){let t=pFe(e);t&&t==e.root.activeElement&&t.select()}const gFe=e=>{let t=e.state.field(Lg,!1);if(t&&t.panel){let n=pFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:nA.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[LW.of(!0),t?nA.of(E7(e.state,t.query.spec)):hi.appendConfig.of(gBt)]});return!0},bFe=e=>{let t=e.state.field(Lg,!1);if(!t||!t.panel)return!1;let n=tW(e,$W);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:LW.of(!1)}),!0},hBt=[{key:"Mod-f",run:gFe,scope:"editor search-panel"},{key:"F3",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:bFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dBt},{key:"Mod-Alt-g",run:z8t},{key:"Mod-d",run:eBt,preventDefault:!0}];class pBt{constructor(t){this.view=t;let n=this.query=t.state.field(Lg).query.spec;this.commit=this.commit.bind(this),this.searchField=Yr("input",{value:n.search,placeholder:lu(t,"Find"),"aria-label":lu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Yr("input",{value:n.replace,placeholder:lu(t,"Replace"),"aria-label":lu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>mP(t),[lu(t,"next")]),i("prev",()=>gP(t),[lu(t,"previous")]),i("select",()=>uBt(t),[lu(t,"all")]),Yr("label",null,[this.caseField,lu(t,"match case")]),Yr("label",null,[this.reField,lu(t,"regexp")]),Yr("label",null,[this.wordField,lu(t,"by word")]),...t.state.readOnly?[]:[Yr("br"),this.replaceField,i("replace",()=>qse(t),[lu(t,"replace")]),i("replaceAll",()=>fBt(t),[lu(t,"replace all")])],Yr("button",{name:"close",onclick:()=>bFe(t),"aria-label":lu(t,"close"),type:"button"},["×"])])}commit(){let t=new fFe({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:nA.of(t)}))}keydown(t){cDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?gP:mP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(nA)&&!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(xk).top}}function lu(e,t){return e.state.phrase(t)}const lj=30,cj=/[\s\.,:;?!]/;function FW(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-lj),o=Math.min(r,n+lj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-lj;c--)if(!cj.test(l[c-1])&&cj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const mBt=Jt.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"}}),gBt=[Lg,ym.low(cBt),mBt];class Wse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class xy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(iA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new im,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,k)=>Math.min(x,k.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 k=b;;){if(k>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>k)break;k=d+u.value.length,d+=u.value.length,u.next()}}let w=_Bt(l);if(y)o.add(b,b,$n.widget({widget:new EBt(w),diagnostics:l.slice()}));else{let x=l.reduce((k,S)=>S.markClass?k+" "+S.markClass:k,"");o.add(b,v,$n.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(k=>k.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new Wse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Wse(i.from,s,i.diagnostic)}}),i}function bBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(iA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(yFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function yBt(e,t){return e.field(Tu,!1)?t:t.concat(hi.appendConfig.of(jBt))}const yFe=hi.define(),BW=hi.define(),vFe=hi.define(),Tu=pl.define({create(){return new xy($n.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=gb(n,e.selected.diagnostic,s)||gb(n,null,s)}!n.size&&r&&t.state.facet(iA).autoPanel&&(r=null),e=new xy(n,r,i)}for(let n of t.effects)if(n.is(yFe)){let i=t.state.facet(iA).autoPanel?n.value.length?rA.open:null:e.panel;e=xy.init(n.value,i,t.state)}else n.is(BW)?e=new xy(e.diagnostics,n.value?rA.open:null,e.selected):n.is(vFe)&&(e=new xy(e.diagnostics,e.panel,n.value));return e},provide:e=>[zC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),vBt=$n.mark({class:"cm-lintRange cm-lintRange-active"});function xBt(e,t,n){let{diagnostics:i}=e.state.field(Tu),r,s=-1,o=-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)&&(twFe(e,n,!1)))}const kBt=e=>{let t=e.state.field(Tu,!1);(!t||!t.panel)&&e.dispatch({effects:yBt(e.state,[BW.of(!0)])});let n=tW(e,rA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Kse=e=>{let t=e.state.field(Tu,!1);return!t||!t.panel?!1:(e.dispatch({effects:BW.of(!1)}),!0)},OBt=e=>{let t=e.state.field(Tu,!1);if(!t)return!1;let n=e.state.selection.main,i=gb(t.diagnostics,null,n.to+1);return!i&&(i=gb(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}),ZDt(e,i.from,1,{tooltip:kFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},SBt=[{key:"Mod-Shift-m",run:kBt,preventDefault:!0},{key:"F8",run:OBt}],iA=pn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Mh(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 xFe(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 wFe(e,t,n){var i;let r=n?xFe(t.actions):[];return Yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=gb(e.state.field(Tu).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Yr("div",{class:"cm-diagnosticSource"},t.source))}class EBt extends Tf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Xse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Kse(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],o=xFe(s.actions);for(let l=0;l{for(let s=0;sKse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tu).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.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(Tu),i=gb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:vFe.of(i)})}static open(t){return new rA(t)}}function CBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function uj(e){return CBt(``,'width="6" height="3"')}const ABt=Jt.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:uj("#f11")},".cm-lintRange-warning":{backgroundImage:uj("orange")},".cm-lintRange-info":{backgroundImage:uj("#999")},".cm-lintRange-hint":{backgroundImage:uj("#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 TBt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function _Bt(e){let t="hint",n=1;for(let i of e){let r=TBt(i.severity);r>n&&(n=r,t=i.severity)}return t}const kFe=YDt(xBt,{hideOn:bBt}),jBt=[Tu,Jt.decorations.compute([Tu],e=>{let{selected:t,panel:n}=e.field(Tu);return!t||!n||t.from==t.to?$n.none:$n.set([vBt.range(t.from,t.to)])}),kFe,ABt];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(L5t)),t.defaultKeymap!==!1&&(s=s.concat(B8t)),t.searchKeymap!==!1&&(s=s.concat(hBt)),t.historyKeymap!==!1&&(s=s.concat(WFt)),t.foldKeymap!==!1&&(s=s.concat(UMt)),t.completionKeymap!==!1&&(s=s.concat(e$e)),t.lintKeymap!==!1&&(s=s.concat(SBt));var o=[];return t.lineNumbers!==!1&&o.push(b4e()),t.highlightActiveLineGutter!==!1&&o.push(hMt()),t.highlightSpecialChars!==!1&&o.push(CDt()),t.history!==!1&&o.push($Ft()),t.foldGutter!==!1&&o.push(HMt()),t.drawSelection!==!1&&o.push(mDt()),t.dropCursor!==!1&&o.push(xDt()),t.allowMultipleSelections!==!1&&o.push(sr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(IMt()),t.syntaxHighlighting!==!1&&o.push(R4e(GMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(nLt()),t.closeBrackets!==!1&&o.push(I5t()),t.autocompletion!==!1&&o.push(V5t()),t.rectangularSelection!==!1&&o.push(BDt()),r!==!1&&o.push(zDt()),t.highlightActiveLine!==!1&&o.push(RDt()),t.highlightSelectionMatches!==!1&&o.push(q8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(bk.of(" ".repeat(t.tabSize))),o.concat([gk.of(s.flat())]).filter(Boolean)};const NBt="#e5c07b",Zse="#e06c75",RBt="#56b6c2",IBt="#ffffff",GN="#abb2bf",C7="#7d8799",PBt="#61afef",DBt="#98c379",Jse="#d19a66",MBt="#c678dd",LBt="#21252b",eae="#2c313a",tae="#282c34",U$="#353a42",$Bt="#3E4451",nae="#528bff",FBt=Jt.theme({"&":{color:GN,backgroundColor:tae},".cm-content":{caretColor:nae},".cm-cursor, .cm-dropCursor":{borderLeftColor:nae},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:$Bt},".cm-panels":{backgroundColor:LBt,color:GN},".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:tae,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:eae},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:eae,color:GN}}},{dark:!0}),BBt=MT.define([{tag:me.keyword,color:MBt},{tag:[me.name,me.deleted,me.character,me.propertyName,me.macroName],color:Zse},{tag:[me.function(me.variableName),me.labelName],color:PBt},{tag:[me.color,me.constant(me.name),me.standard(me.name)],color:Jse},{tag:[me.definition(me.name),me.separator],color:GN},{tag:[me.typeName,me.className,me.number,me.changed,me.annotation,me.modifier,me.self,me.namespace],color:NBt},{tag:[me.operator,me.operatorKeyword,me.url,me.escape,me.regexp,me.link,me.special(me.string)],color:RBt},{tag:[me.meta,me.comment],color:C7},{tag:me.strong,fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.link,color:C7,textDecoration:"underline"},{tag:me.heading,fontWeight:"bold",color:Zse},{tag:[me.atom,me.bool,me.special(me.variableName)],color:Jse},{tag:[me.processingInstruction,me.string,me.inserted],color:DBt},{tag:me.invalid,color:IBt}]),UBt=[FBt,R4e(BBt)];var QBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),zBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=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(gk.of([U8t])),g&&(typeof g=="boolean"?b.unshift(Yse()):b.unshift(Yse(g))),h&&b.unshift(MDt(h)),d){case"light":b.push(QBt);break;case"dark":b.push(UBt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(sr.readOnly.of(!0)),[...b]},VBt=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 HBt{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 iae{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 Q$=null,qBt=()=>typeof window>"u"?new iae:(Q$||(Q$=new iae),Q$),WBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),rae=null,z$=null;function KBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===rae||(rae=o,z$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var sae=Dh.define(),GBt=200,XBt=[];function YBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?XBt: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,k=e.minWidth,S=k===void 0?null:k,O=e.maxWidth,A=O===void 0?null:O,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,C=e.readOnly,N=C===void 0?!1:C,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),H=M[0],q=M[1],U=p.useState(),Z=U[0],z=U[1],J=p.useState(),ne=J[0],W=J[1],X=p.useState(()=>({current:null}))[0],le=p.useState(()=>({current:null}))[0],V=KBt(m,b,y,x,S,A),Y=Jt.updateListener.of(te=>{if(te.docChanged&&typeof i=="function"&&!te.transactions.some(pe=>pe.annotation(sae))){X.current?X.current.reset():(X.current=new HBt(()=>{if(le.current){var pe=le.current;le.current=null,pe()}X.current=null},GBt),qBt().add(X.current));var Oe=te.state.doc,fe=Oe.toString();i(fe,te)}r&&r(VBt(te))}),K=zBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ue=[Y,...V?[V]:[],WBt,...K];return o&&typeof o=="function"&&ue.push(Jt.updateListener.of(o)),ue=ue.concat(c),p.useLayoutEffect(()=>{if(H&&!ne){var te={doc:t,selection:n,extensions:ue},Oe=F?sr.fromJSON(F.json,te,F.fields):sr.create(te);if(W(Oe),!Z){var fe=new Jt({state:Oe,parent:H,root:L});z(fe),s&&s(fe,Oe)}}return()=>{Z&&(W(void 0),z(void 0))}},[H,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{Z&&(Z.destroy(),z(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Z]),p.useEffect(()=>{u&&Z&&Z.focus()},[u,Z]),p.useEffect(()=>{Z&&Z.dispatch({effects:hi.reconfigure.of(ue)})},[f,c,m,b,y,x,S,A,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var te=Z?Z.state.doc.toString():"";if(Z&&t!==te){var Oe=X.current&&!X.current.isDone,fe=()=>{Z&&t!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:t||""},annotations:[sae.of(!0)]})};Oe?le.current=fe:fe()}}},[t,Z]),{state:ne,setState:W,view:Z,setView:z,container:H,setContainer:q}}var ZBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],OFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,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,k=e.maxWidth,S=e.basicSetup,O=e.placeholder,A=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,C=TFt(e,ZBt),N=p.useRef(null),P=YBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:k,basicSetup:S,placeholder:O,indentWithTab:A,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(H=>{N.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 a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},C))});OFe.displayName="CodeMirror";function SFe(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")?[sW.define(AFt)]:i==="py"||i==="pyi"?[L6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[i3t()]:i==="yaml"||i==="yml"?[hFt()]:["md","markdown"].includes(i??"")?[b$t()]:[]}function BT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...SFe(t),...s===1?[]:[b4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(OFe,{value:e,height:o,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 EFe=Object.freeze(Object.defineProperty({__proto__:null,default:BT,languageFor:SFe},Symbol.toStringTag,{value:"Module"}));function JBt(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((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=B5e(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(([o,l])=>({key:o,value:typeof l=="string"?l:qM(l).trim()}))}}function JBt(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.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 e9t(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function t9t(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,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 kFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.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:[a.jsx(e9t,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(JBt,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(kFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function n9t(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 fL({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>t9t(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,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(()=>ZBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(kFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>n9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(jd,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(LT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const i9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:fL},Symbol.toStringTag,{value:"Module"})),r9t=1200,s9t=3,SFe=2,a9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,iae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function rae(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 o9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function H$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>a9t.test(n))}function sae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:VM(l).trim()}))}}function e9t(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.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 t9t(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function n9t(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,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 CFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.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:[a.jsx(t9t,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(e9t,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(CFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function i9t(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 uL({files:e}){var m;const{t,i18n:n}=_e("skills"),i=p.useMemo(()=>n9t(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,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(()=>JBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(CFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>i9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(Nd,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(BT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const r9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:uL},Symbol.toStringTag,{value:"Module"})),s9t=1200,a9t=3,AFe=2,o9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,aae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function oae(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 l9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>o9t.test(n))}function lae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` `))||e.error||en("generation.validation.fallback");return[en("generation.validation.repairInstruction"),en("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function l9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:SFe})}return o9t(e.task)}function aae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function c9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("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 en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function u9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function oae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function q$(e){return`${e.region||""}:${e.id}`}function d9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function f9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Se,oe,$e,Ue;const{t:u}=Te("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,k]=p.useState([]),[S,E]=p.useState(""),[C,j]=p.useState(!1),[T,R]=p.useState(""),[A,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,H]=p.useState(n?q$(n):""),[q,U]=p.useState(Date.now()),Z=p.useRef([]);p.useEffect(()=>{const be=new AbortController;return NM(be.signal).then(ke=>{f(ke),x([rae(0,ke)])}).catch(ke=>{be.signal.aborted||m(Pr(ke,en("generation.errors.loadCapability")))}),()=>be.abort()},[]),p.useEffect(()=>{Z.current=O},[O]),p.useEffect(()=>{const be=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(be)},[]),p.useEffect(()=>{const be=ke=>{Z.current.some(Ae=>{var He;return((He=Ae.task)==null?void 0:He.state)==="running"||Ae.repairing})&&ke.preventDefault()};return window.addEventListener("beforeunload",be),()=>{var ke;window.removeEventListener("beforeunload",be);for(const Ae of Z.current)(ke=Ae.task)!=null&&ke.jobId&&T2t(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(He=>{var Qe;return((Qe=He.task)==null?void 0:Qe.state)==="running"||He.repairing}))return;let be=!1,ke;const Ae=async()=>{const He=Z.current,Qe=await Promise.all(He.map(async jt=>{var Pt;if(((Pt=jt.task)==null?void 0:Pt.state)!=="running")return jt;try{const Kt=await E2t(jt.task.jobId);if(H$(Kt)&&(jt.repairAttempts||0)tt.map(mt=>mt.id===jt.id?{...mt,task:Kt,repairing:!0,repairMode:"auto",repairAttempts:xt,repairError:void 0}:mt));try{const tt=await L4({jobId:Kt.jobId,intent:sae(Kt),expectedRevision:Kt.revision});return{...jt,task:tt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:xt,repairError:void 0,error:void 0,pollError:void 0}}catch(tt){return{...jt,task:Kt,repairing:!1,repairMode:void 0,repairAttempts:xt,repairError:Pr(tt,en("generation.errors.autoRepair")),pollError:void 0}}}let Ct=jt.artifact;return Kt.state==="ready"&&(Ct=await M4(Kt.jobId,Kt.revision)),{...jt,task:Kt,artifact:Ct,repairing:!1,repairMode:Kt.state==="running"?jt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Kt){return{...jt,pollError:Pr(Kt,en("generation.errors.pollCandidate"))}}}));be||(k(Qe),ke=window.setTimeout(()=>void Ae(),r9t))};return Ae(),()=>{be=!0,ke!==void 0&&window.clearTimeout(ke)}},[O.some(be=>{var ke;return((ke=be.task)==null?void 0:ke.state)==="running"||be.repairing})]);const z=O.find(be=>be.id===S)||O[0],J=e==="create"&&!n,ne=i.find(be=>q$(be)===M)??null,W=n??ne,X=i.map(be=>({value:q$(be),label:`${Dc(be)||u("generation.unnamedSpace")} · ${Oh(be.region||"cn-beijing",t)}`})),V=u9t(v),ae=!!(d!=null&&d.enabled&&g.trim()&&!V&&w.length>0&&w.every(be=>be.model.trim()&&!oae(be.model.trim()))),Y=(be,ke)=>{x(Ae=>Ae.map(He=>He.id===be?{...He,...ke}:He))},K=async be=>{const ke={...be,model:be.model.trim()},Ae=be.style==="custom"?be.customStyle.trim():be.style;try{const He=await S2t({operation:e,intent:g.trim(),model:ke.model,style:Ae,name:v.trim()||void 0,source:o});return{id:be.id,config:ke,task:He}}catch(He){return{id:be.id,config:ke,error:Pr(He,en("generation.errors.createCandidate"))}}},te=async()=>{if(!ae)return;j(!0),I(null);const be=w.map(Ae=>({id:Ae.id,config:Ae}));k(be),E(w[0].id);const ke=await Promise.all(w.map(K));k(ke)},ue=async be=>{k(Ae=>Ae.map(He=>He.id===be.id?{...He,error:void 0}:He));const ke=await K(be.config);k(Ae=>Ae.map(He=>He.id===be.id?ke:He))},fe=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const be=await L4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,task:be,artifact:void 0}:Ae)),R("")}catch(be){I(Pr(be,en("generation.errors.refine")))}finally{N("")}}},se=async()=>{if(!(!(z!=null&&z.task)||!H$(z.task))){N("refine"),I(null),k(be=>be.map(ke=>ke.id===z.id?{...ke,repairing:!0,repairMode:"manual",repairError:void 0}:ke));try{const be=await L4({jobId:z.task.jobId,intent:sae(z.task),expectedRevision:z.task.revision});k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,task:be,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(be){k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Pr(be,en("generation.errors.repairAgain"))}:Ae))}finally{N("")}}},me=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const be=z.artifact||await M4(z.task.jobId,z.task.revision),ke=(o==null?void 0:o.region)||W.region||"";if(!AD(ke))throw new Error(en("generation.errors.unsupportedRegion"));await A2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:be.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:ke,onProgress:Ae=>_(Ae.message)}),F(z.id),c()}catch(be){I(Pr(be,en("generation.errors.upload")))}finally{N(""),_("")}}},Ee=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const be=z.artifact||await M4(z.task.jobId,z.task.revision);await _2t(z.task.jobId,z.task.revision,be.sha256)}catch(be){I(Pr(be,en("generation.errors.download")))}finally{N("")}}},xe=async()=>{O.some(be=>{var ke;return((ke=be.task)==null?void 0:ke.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(be=>{var ke;return((ke=be.task)==null?void 0:ke.state)==="running"?[C2t({jobId:be.task.jobId,expectedRevision:be.task.revision})]:[]})),l())},Ne=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),We=be=>{var ke;return((ke=d==null?void 0:d.models.find(Ae=>Ae.id===be))==null?void 0:ke.label)||be},Xe=be=>be.config.style==="custom"?be.config.customStyle.trim()||u("generation.styles.customFallback"):u(iae[be.config.style]),Re=[...Object.entries(iae).map(([be,ke])=>({value:be,label:u(ke)})),{value:"custom",label:u("generation.styles.custom")}],re=be=>be.error||be.repairError?u("generation.stages.failed"):l9t(be),ce=be=>!be.error&&!be.repairError&&(be.repairing||!be.task||be.task.state==="running"),ve=O.some(be=>{var ke;return((ke=be.task)==null?void 0:ke.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void xe(),"aria-label":u("generation.back"),children:a.jsx(d9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Ne}),a.jsx("p",{children:Dc(n)||u("generation.home")})]}),O.length>0?a.jsx("span",{className:"skill-generation__ttl",children:c9t(z==null?void 0:z.task,q)}):null]}),C?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(be=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===be.id,className:(z==null?void 0:z.id)===be.id?"is-active":"",onClick:()=>E(be.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Xe(be)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:We(be.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(be)?a.jsx(aae,{}):null,re(be)]})]})]},be.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Xe(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:We(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(z)?a.jsx(aae,{}):null,ce(z)?a.jsx(cn,{children:re(z)}):re(z)]})]})]})}),z.task?a.jsx(RNt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Ns,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void ue(z),children:u("generation.retryCandidate")})]}):null,(Se=z.task)!=null&&Se.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(be=>a.jsx("p",{children:be},be)),H$(z.task)?a.jsx("button",{type:"button",disabled:!!A,onClick:()=>void se(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((oe=z.task)==null?void 0:oe.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void Ee(),disabled:!!A,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(fL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:(($e=z.task)==null?void 0:$e.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ue=z.task)==null?void 0:Ue.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[J?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(IN,{label:u("generation.uploadToSpace"),value:M,options:X,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:be=>R(be.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!A,onClick:()=>void fe(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!L||!W,onClick:()=>void me(),children:A==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":J?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Ns,{error:P})}):null]}):null,!ve&&O.every(be=>be.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:be=>b(be.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:be=>y(be.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!V,"aria-describedby":"skill-name-help"}),V?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:V}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((be,ke)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:ke+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(He=>He.id!==be.id)),children:u("generation.remove")}):null]}),a.jsx(IN,{label:u("generation.model"),required:!0,value:be.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Y(be.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:oae(be.model.trim())}),a.jsx(IN,{label:u("generation.style"),required:!0,value:be.style,options:Re,onChange:Ae=>Y(be.id,{style:Ae})}),be.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:be.customStyle,onChange:Ae=>Y(be.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},be.id)),d&&w.lengthx(be=>[...be,rae(be.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!ae,onClick:()=>void te(),children:u("generation.generate")})})]})]})}async function EFe(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:ul(uc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await iT(s,n);return s.json()}function h9t(e){return EFe(e,{},Q("skills.listVersionsFailed"),ho)}function p9t(e){return EFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),hr)}function CFe(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 m9t(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 AFe=p.createContext(void 0);function Pb(e){const t=p.useContext(AFe);if(!e&&t===void 0)throw new Error(Hc(27));return t}const iv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Pb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Ra("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:Oje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),hL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Pb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=GD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,fa(T_e,b.nativeEvent))}return Ra("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),$T=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=tm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Ra("p",t,{ref:n,props:[{id:u},l]})}),TFe=p.createContext(void 0);function g9t(){const e=p.useContext(TFe);if(e===void 0)throw new Error(Hc(26));return e}const b9t={...hV,...KD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},rv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Pb(),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"),k=u.useState("transitionStatus"),S=u.useState("role"),E=h.useState("floatingId");g9t(),VA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const C=l===void 0?rje(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),A=Ra("div",t,{state:{open:w,nested:v,transitionStatus:k,nestedDialogOpen:j},props:[m,{id:E,"aria-labelledby":O,"aria-describedby":d,role:S,...ije,hidden:!b,onKeyDown(N){uLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:b9t});return a.jsx(B_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:C,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:A})}),sv=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Pb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(TFe.Provider,{value:i,children:a.jsxs(P_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(lLe,{ref:s.context.internalBackdropRef,inert:rV(!c)}),t.children]})}):null});function y9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=Q_e(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=uo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return cLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Jn(()=>(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]),dje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const v9t={...gje,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 x9t extends BD{constructor(n,i,r){const s=new uV,o=w9t(n,s,i,r);super(o,O9t(s),v9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};oje(r,n,i.trigger),this.update(r)})}}function w9t(e,t,n,i=!1){const r={...hje(),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=pje(t,n,i),r}function O9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function k9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,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=Pb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=sje((T,R)=>new x9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",o);const k=O.useState("open"),S=O.useState("mounted"),E=O.useState("payload");fje(O,k),cje(O);const{forceUnmount:C}=uje(k,O);p.useImperativeHandle(u,()=>({unmount:C,close:()=>O.setOpen(!1,fa(j_e))}),[C,O]);const j=k||S;return a.jsxs(AFe.Provider,{value:O,children:[d&&a.jsx(aje,{handle:d,store:O}),j&&a.jsx(y9t,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:E}):n]})}function av(e){return k9t("dialog",e)}const vO=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=tm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Ra("h2",t,{ref:n,props:[{id:u},l]})}),_Fe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Pb(!0),g=bje(d)??h;if(!g)throw new Error(Hc(79));const b=tm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=lje(b,x,g,{payload:u}),{getButtonProps:S,buttonRef:E}=GD({disabled:o,native:l}),C=U_e(v),j=sLe(()=>g.select("open"),A=>{g.set("openMethod",A)}),T={disabled:o,open:y},R=g.useState("triggerProps",k);return Ra("button",t,{state:T,ref:[E,n,O,x],props:[C.reference,R,j,{[aV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,S],stateAttributesMapping:wje})});async function jFe(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:ul(uc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,ho)});if(!r.ok)throw await iT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const S9t=e=>jFe(e,!1),E9t=e=>jFe(e,!0),C9t=["safety","usability","completeness","reliability","maintainability"];function NFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function A9t(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 UW({score:e}){const{t}=Te("reviews");return a.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 RFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=Te("reviews"),[s,o]=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 S=new AbortController;let E,C=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(C||S.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){C=!0,P&&c(!0),d(null);try{const D=await(N?E9t:S9t)({id:y,region:w,signal:S.signal});if(S.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=NFe(D),j&&document.visibilityState!=="hidden"&&(E=setTimeout(()=>void T(!1),5e3))}catch(D){S.signal.aborted||(j=!1,d(Pr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{C=!1,S.signal.aborted||c(!1)}}},R=()=>{clearTimeout(E),j&&document.visibilityState!=="hidden"&&T(!1)},A=f.retry&&b.current!==f.revision;return A&&(b.current=f.revision),T(A,!0),document.addEventListener("visibilitychange",R),()=>{S.abort(),clearTimeout(E),document.removeEventListener("visibilitychange",R)}},[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 S=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(S),()=>URL.revokeObjectURL(S)},[O]);const k=S=>h(E=>({revision:E.revision+1,retry:S}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(cn,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(UW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.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")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Ns,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?a.jsxs(a.Fragment,{children:[O.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:O.riskFlags.map((S,E)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${S.severity}`)})," · ",S.reason]},`${E}:${S.reason}`))})]}):null,O.coverage&&!O.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),a.jsxs("ul",{children:[O.coverage.omittedFiles.map(S=>a.jsx("li",{children:i("score.omittedFile",S)},`omitted:${S.path}`)),O.coverage.truncatedFiles.map(S=>a.jsx("li",{children:i("score.truncatedFile",S)},`truncated:${S.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:C9t.map(S=>{const E=O.dimensions[S];return a.jsxs("div",{className:S==="safety"&&E.score!==null&&E.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${S}`)}),a.jsx("strong",{children:E.score===null?i("score.insufficient"):i("score.points",{score:E.score})})]}),a.jsx("dd",{children:E.reason})]},S)})}),O.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:O.suggestions.map((S,E)=>a.jsx("li",{children:S},`${E}:${S}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:O.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:O.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function T9t({application:e}){const{t}=Te("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(UW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(RFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function FT({status:e}){const{t}=Te("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function QW({person:e,fallback:t,compact:n=!1}){const{t:i}=Te("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function zW({application:e}){const{t,i18n:n}=Te("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(FT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(QW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function VW({applications:e}){const{t,i18n:n}=Te("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(zW,{application:i}),a.jsx(T9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function _9t({name:e,applications:t,onClose:n}){const{t:i}=Te("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(av,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"review-backdrop"}),a.jsxs(rv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(vO,{children:i("detail.history")}),a.jsx($T,{children:e})]}),a.jsx(hL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(wT,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(VW,{applications:t})})]})]})})}function j9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=Te("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([]),[k,S]=p.useState(!1),[E,C]=p.useState(null),[j,T]=p.useState(0),[R,A]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const H=u==null?void 0:u.items.find(X=>X.version===f),q=p.useMemo(()=>CFe(i),[i]),U=q.get(`${e.skillId}:${f}`),Z=i.filter(X=>X.sourceSkillId===e.skillId&&X.version===f&&X.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&H&&["running","ready"].includes(H.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var ae;F.current=!0;const X=document.activeElement instanceof HTMLElement?document.activeElement:null;(ae=_.current)==null||ae.focus();const V=Y=>{var fe;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const K=Array.from(((fe=I.current)==null?void 0:fe.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),te=K[0],ue=K[K.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",V),()=>{F.current=!1,document.removeEventListener("keydown",V),X!=null&&X.isConnected&&X.focus()}},[]),p.useEffect(()=>{const X=new AbortController;return g(!0),v(null),h9t({spaceId:t.id,skillId:e.skillId,region:n,signal:X.signal}).then(V=>{X.signal.aborted||(d(V),h(ae=>{var Y;return V.items.some(K=>K.version===ae)?ae:((Y=V.items[0])==null?void 0:Y.version)||""}))}).catch(V=>{X.signal.aborted||v(Pr(V,l("skillCenter.versions.loadFailed")))}).finally(()=>{X.signal.aborted||g(!1)}),()=>X.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!H)return;let X=!0;return S(!0),C(null),O([]),OIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(V=>{X&&O(V)}).catch(V=>{X&&C(Pr(V,l("skillCenter.versions.filesFailed")))}).finally(()=>{X&&S(!1)}),()=>{X=!1}},[t.id,e.skillId,n,f,!!H,R,l]);async function J(X){if(!L.current){L.current=!0,P("upload"),w(null);try{const V=await p9t({spaceId:t.id,skillId:e.skillId,region:n,file:X});if(!F.current)return;h(V.version),T(ae=>ae+1),s()}catch(V){F.current&&w(Pr(V,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(X){F.current&&w(Pr(X,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(X){if(!X)return"—";const V=new Date(X);return Number.isNaN(V.getTime())?X:V.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:X=>{X.target===X.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(X=>X+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var X;return(X=D.current)==null?void 0:X.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:X=>{var ae;const V=(ae=X.target.files)==null?void 0:ae[0];X.target.value="",V&&J(V)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Ns,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(X=>X+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(X=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===X.version?" is-active":""}`,"aria-pressed":f===X.version,onClick:()=>h(X.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:X.sourceVersion||X.version}),X.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:X.createdAt,children:W(X.createdAt)}),q.get(`${e.skillId}:${X.version}`)?a.jsx(FT,{status:q.get(`${e.skillId}:${X.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},X.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:H?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:H.sourceVersion||H.version}),a.jsx("p",{title:H.description,children:H.description}),H.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:H.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),H.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:H.error}):null,["running","ready"].includes(H.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:H.status})}),U?a.jsx(zW,{application:U}):null,Z.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(VW,{applications:Z})]}):null,a.jsx("div",{className:"skill-versions__files",children:k?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):E?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:E}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(X=>X+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(fL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function N9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=Te("ui"),[s,o]=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),Rpt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Pr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(X0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.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?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:l})}):null]})}function HW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Te("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function R9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,o]=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 Npt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Pr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(HW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(IN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.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 I9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,o]=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 $pt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Pr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(HW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.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 P9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[o,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 S=>{const E=w.current+1;if(w.current=E,l(S),u(null),b(null),f(!!S),!!S)try{const C=await Upt(S);w.current===E&&u({name:C.name,fileCount:C.files.length})}catch(C){w.current===E&&b(Pr(C,r("management.archiveValidationFailed")))}finally{w.current===E&&f(!1)}},k=async()=>{if(!(!o||!c)){m(!0),b(null);try{await Bpt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(S){b(Pr(S,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(HW,{title:r("management.uploadTitle",{name:Dc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var E;return void O(((E=S.target.files)==null?void 0:E[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var E;S.preventDefault(),y(!1),O(((E=S.dataTransfer.files)==null?void 0:E[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function D9t(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 BT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=D9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const M9t=12,lae=12;function yP({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return a.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?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const L9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function IFe(e,t){const n=(e||"").trim().toLowerCase();return L9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function $9t(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 F9t(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 cae(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 uu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function B9t(e,t){const n=new Map(e.map(i=>[uu(i),i]));for(const i of t)n.set(uu(i),i);return[...n.values()].sort((i,r)=>cae(r.updatedAt)-cae(i.updatedAt))}function U9t(e){const t=e.replace(/\r\n/g,` +`)}function c9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:AFe})}return l9t(e.task)}function cae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function u9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("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 en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function d9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function uae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function f9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function h9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Ae,Ee,Ce,Be;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([]),[k,S]=p.useState([]),[O,A]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,H]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),Z=p.useRef([]);p.useEffect(()=>{const he=new AbortController;return _M(he.signal).then(ie=>{f(ie),x([oae(0,ie)])}).catch(ie=>{he.signal.aborted||m(Lr(ie,en("generation.errors.loadCapability")))}),()=>he.abort()},[]),p.useEffect(()=>{Z.current=k},[k]),p.useEffect(()=>{const he=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(he)},[]),p.useEffect(()=>{const he=ie=>{Z.current.some(we=>{var Re;return((Re=we.task)==null?void 0:Re.state)==="running"||we.repairing})&&ie.preventDefault()};return window.addEventListener("beforeunload",he),()=>{var ie;window.removeEventListener("beforeunload",he);for(const we of Z.current)(ie=we.task)!=null&&ie.jobId&&_2t(we.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!k.some(Re=>{var Ue;return((Ue=Re.task)==null?void 0:Ue.state)==="running"||Re.repairing}))return;let he=!1,ie;const we=async()=>{const Re=Z.current,Ue=await Promise.all(Re.map(async _t=>{var Pt;if(((Pt=_t.task)==null?void 0:Pt.state)!=="running")return _t;try{const Gt=await C2t(_t.task.jobId);if(V$(Gt)&&(_t.repairAttempts||0)qe.map(yt=>yt.id===_t.id?{...yt,task:Gt,repairing:!0,repairMode:"auto",repairAttempts:Lt,repairError:void 0}:yt));try{const qe=await M4({jobId:Gt.jobId,intent:lae(Gt),expectedRevision:Gt.revision});return{..._t,task:qe,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Lt,repairError:void 0,error:void 0,pollError:void 0}}catch(qe){return{..._t,task:Gt,repairing:!1,repairMode:void 0,repairAttempts:Lt,repairError:Lr(qe,en("generation.errors.autoRepair")),pollError:void 0}}}let St=_t.artifact;return Gt.state==="ready"&&(St=await D4(Gt.jobId,Gt.revision)),{..._t,task:Gt,artifact:St,repairing:!1,repairMode:Gt.state==="running"?_t.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Gt){return{..._t,pollError:Lr(Gt,en("generation.errors.pollCandidate"))}}}));he||(S(Ue),ie=window.setTimeout(()=>void we(),s9t))};return we(),()=>{he=!0,ie!==void 0&&window.clearTimeout(ie)}},[k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"||he.repairing})]);const z=k.find(he=>he.id===O)||k[0],J=e==="create"&&!n,ne=i.find(he=>H$(he)===M)??null,W=n??ne,X=i.map(he=>({value:H$(he),label:`${Nc(he)||u("generation.unnamedSpace")} · ${Sh(he.region||"cn-beijing",t)}`})),le=d9t(v),V=!!(d!=null&&d.enabled&&g.trim()&&!le&&w.length>0&&w.every(he=>he.model.trim()&&!uae(he.model.trim()))),Y=(he,ie)=>{x(we=>we.map(Re=>Re.id===he?{...Re,...ie}:Re))},K=async he=>{const ie={...he,model:he.model.trim()},we=he.style==="custom"?he.customStyle.trim():he.style;try{const Re=await E2t({operation:e,intent:g.trim(),model:ie.model,style:we,name:v.trim()||void 0,source:o});return{id:he.id,config:ie,task:Re}}catch(Re){return{id:he.id,config:ie,error:Lr(Re,en("generation.errors.createCandidate"))}}},ue=async()=>{if(!V)return;j(!0),I(null);const he=w.map(we=>({id:we.id,config:we}));S(he),A(w[0].id);const ie=await Promise.all(w.map(K));S(ie)},te=async he=>{S(we=>we.map(Re=>Re.id===he.id?{...Re,error:void 0}:Re));const ie=await K(he.config);S(we=>we.map(Re=>Re.id===he.id?ie:Re))},Oe=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const he=await M4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});S(ie=>ie.map(we=>we.id===z.id?{...we,task:he,artifact:void 0}:we)),R("")}catch(he){I(Lr(he,en("generation.errors.refine")))}finally{N("")}}},fe=async()=>{if(!(!(z!=null&&z.task)||!V$(z.task))){N("refine"),I(null),S(he=>he.map(ie=>ie.id===z.id?{...ie,repairing:!0,repairMode:"manual",repairError:void 0}:ie));try{const he=await M4({jobId:z.task.jobId,intent:lae(z.task),expectedRevision:z.task.revision});S(ie=>ie.map(we=>we.id===z.id?{...we,task:he,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:we))}catch(he){S(ie=>ie.map(we=>we.id===z.id?{...we,repairing:!1,repairMode:void 0,repairError:Lr(he,en("generation.errors.repairAgain"))}:we))}finally{N("")}}},pe=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const he=z.artifact||await D4(z.task.jobId,z.task.revision),ie=(o==null?void 0:o.region)||W.region||"";if(!ED(ie))throw new Error(en("generation.errors.unsupportedRegion"));await T2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:he.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:ie,onProgress:we=>_(we.message)}),F(z.id),c()}catch(he){I(Lr(he,en("generation.errors.upload")))}finally{N(""),_("")}}},Se=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const he=z.artifact||await D4(z.task.jobId,z.task.revision);await j2t(z.task.jobId,z.task.revision,he.sha256)}catch(he){I(Lr(he,en("generation.errors.download")))}finally{N("")}}},ve=async()=>{k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(k.flatMap(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"?[A2t({jobId:he.task.jobId,expectedRevision:he.task.revision})]:[]})),l())},Le=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),He=he=>{var ie;return((ie=d==null?void 0:d.models.find(we=>we.id===he))==null?void 0:ie.label)||he},Ge=he=>he.config.style==="custom"?he.config.customStyle.trim()||u("generation.styles.customFallback"):u(aae[he.config.style]),De=[...Object.entries(aae).map(([he,ie])=>({value:he,label:u(ie)})),{value:"custom",label:u("generation.styles.custom")}],se=he=>he.error||he.repairError?u("generation.stages.failed"):c9t(he),ce=he=>!he.error&&!he.repairError&&(he.repairing||!he.task||he.task.state==="running"),ye=k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void ve(),"aria-label":u("generation.back"),children:a.jsx(f9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Le}),a.jsx("p",{children:Nc(n)||u("generation.home")})]}),k.length>0?a.jsx("span",{className:"skill-generation__ttl",children:u9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:k.map(he=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===he.id,className:(z==null?void 0:z.id)===he.id?"is-active":"",onClick:()=>A(he.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ge(he)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:He(he.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(he)?a.jsx(cae,{}):null,se(he)]})]})]},he.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ge(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:He(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(z)?a.jsx(cae,{}):null,ce(z)?a.jsx(on,{children:se(z)}):se(z)]})]})]})}),z.task?a.jsx(INt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Rs,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void te(z),children:u("generation.retryCandidate")})]}):null,(Ae=z.task)!=null&&Ae.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(he=>a.jsx("p",{children:he},he)),V$(z.task)?a.jsx("button",{type:"button",disabled:!!C,onClick:()=>void fe(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Ee=z.task)==null?void 0:Ee.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void Se(),disabled:!!C,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(uL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((Ce=z.task)==null?void 0:Ce.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Be=z.task)==null?void 0:Be.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[J?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(RN,{label:u("generation.uploadToSpace"),value:M,options:X,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:he=>R(he.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!C,onClick:()=>void Oe(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!C||!!L||!W,onClick:()=>void pe(),children:C==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":J?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Rs,{error:P})}):null]}):null,!ye&&k.every(he=>he.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:he=>b(he.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:he=>y(he.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!le,"aria-describedby":"skill-name-help"}),le?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:le}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((he,ie)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:ie+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(we=>we.filter(Re=>Re.id!==he.id)),children:u("generation.remove")}):null]}),a.jsx(RN,{label:u("generation.model"),required:!0,value:he.model,options:(d==null?void 0:d.models.map(we=>({value:we.id,label:we.label})))||[],onChange:we=>Y(he.id,{model:we}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:uae(he.model.trim())}),a.jsx(RN,{label:u("generation.style"),required:!0,value:he.style,options:De,onChange:we=>Y(he.id,{style:we})}),he.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:he.customStyle,onChange:we=>Y(he.id,{customStyle:we.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},he.id)),d&&w.lengthx(he=>[...he,oae(he.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!V,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}async function TFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await aT(s,n);return s.json()}function p9t(e){return TFe(e,{},Q("skills.listVersionsFailed"),eo)}function m9t(e){return TFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),yr)}function _Fe(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 g9t(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 jFe=p.createContext(void 0);function Nb(e){const t=p.useContext(jFe);if(!e&&t===void 0)throw new Error(Uc(27));return t}const Zv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Nb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Da("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:Eje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),dL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Nb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=WD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,pa(N_e,b.nativeEvent))}return Da("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),UT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Da("p",t,{ref:n,props:[{id:u},l]})}),NFe=p.createContext(void 0);function b9t(){const e=p.useContext(NFe);if(e===void 0)throw new Error(Uc(26));return e}const y9t={...hV,...qD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Jv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Nb(),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"),k=u.useState("titleElementId"),S=u.useState("transitionStatus"),O=u.useState("role"),A=h.useState("floatingId");b9t(),WA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?oje(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),C=Da("div",t,{state:{open:w,nested:v,transitionStatus:S,nestedDialogOpen:j},props:[m,{id:A,"aria-labelledby":k,"aria-describedby":d,role:O,...aje,hidden:!b,onKeyDown(N){hLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:y9t});return a.jsx(z_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:C})}),e0=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Nb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(NFe.Provider,{value:i,children:a.jsxs(L_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(dLe,{ref:s.context.internalBackdropRef,inert:rV(!c)}),t.children]})}):null});function v9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=H_e(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=fo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return fLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),ti(()=>(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]),pje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const x9t={...vje,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 w9t extends $D{constructor(n,i,r){const s=new uV,o=k9t(n,s,i,r);super(o,O9t(s),x9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};uje(r,n,i.trigger),this.update(r)})}}function k9t(e,t,n,i=!1){const r={...gje(),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=bje(t,n,i),r}function O9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function S9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,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=Nb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},k=lje((T,R)=>new w9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);k.useControlledProp("openProp",i),k.useControlledProp("triggerIdProp",f),k.useSyncedValues(x),k.useContextCallback("onOpenChange",s),k.useContextCallback("onOpenChangeComplete",o);const S=k.useState("open"),O=k.useState("mounted"),A=k.useState("payload");mje(k,S),fje(k);const{forceUnmount:E}=hje(S,k);p.useImperativeHandle(u,()=>({unmount:E,close:()=>k.setOpen(!1,pa(I_e))}),[E,k]);const j=S||O;return a.jsxs(jFe.Provider,{value:k,children:[d&&a.jsx(cje,{handle:d,store:k}),j&&a.jsx(v9t,{store:k,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:A}):n]})}function t0(e){return S9t("dialog",e)}const wk=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Da("h2",t,{ref:n,props:[{id:u},l]})}),RFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Nb(!0),g=xje(d)??h;if(!g)throw new Error(Uc(79));const b=nm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:k,isMountedByThisTrigger:S}=dje(b,x,g,{payload:u}),{getButtonProps:O,buttonRef:A}=WD({disabled:o,native:l}),E=V_e(v),j=lLe(()=>g.select("open"),C=>{g.set("openMethod",C)}),T={disabled:o,open:y},R=g.useState("triggerProps",S);return Da("button",t,{state:T,ref:[A,n,k,x],props:[E.reference,R,j,{[aV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,O],stateAttributesMapping:Sje})});async function IFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Na(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:hl(oc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,eo)});if(!r.ok)throw await aT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const E9t=e=>IFe(e,!1),C9t=e=>IFe(e,!0),A9t=["safety","usability","completeness","reliability","maintainability"];function PFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function T9t(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 UW({score:e}){const{t}=_e("reviews");return a.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 DFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=_e("reviews"),[s,o]=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 O=new AbortController;let A,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||O.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?C9t:E9t)({id:y,region:w,signal:O.signal});if(O.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=PFe(D),j&&document.visibilityState!=="hidden"&&(A=setTimeout(()=>void T(!1),5e3))}catch(D){O.signal.aborted||(j=!1,d(Lr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,O.signal.aborted||c(!1)}}},R=()=>{clearTimeout(A),j&&document.visibilityState!=="hidden"&&T(!1)},C=f.retry&&b.current!==f.revision;return C&&(b.current=f.revision),T(C,!0),document.addEventListener("visibilitychange",R),()=>{O.abort(),clearTimeout(A),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const k=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!k){g("");return}const O=URL.createObjectURL(new Blob([JSON.stringify(k,null,2)],{type:"application/json"}));return g(O),()=>URL.revokeObjectURL(O)},[k]);const S=O=>h(A=>({revision:A.revision+1,retry:O}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(on,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(UW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.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")?a.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]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Rs,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,k?a.jsxs(a.Fragment,{children:[k.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:k.riskFlags.map((O,A)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${O.severity}`)})," · ",O.reason]},`${A}:${O.reason}`))})]}):null,k.coverage&&!k.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:k.coverage.includedFiles,total:k.coverage.totalFiles})}),a.jsxs("ul",{children:[k.coverage.omittedFiles.map(O=>a.jsx("li",{children:i("score.omittedFile",O)},`omitted:${O.path}`)),k.coverage.truncatedFiles.map(O=>a.jsx("li",{children:i("score.truncatedFile",O)},`truncated:${O.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:A9t.map(O=>{const A=k.dimensions[O];return a.jsxs("div",{className:O==="safety"&&A.score!==null&&A.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${O}`)}),a.jsx("strong",{children:A.score===null?i("score.insufficient"):i("score.points",{score:A.score})})]}),a.jsx("dd",{children:A.reason})]},O)})}),k.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:k.suggestions.map((O,A)=>a.jsx("li",{children:O},`${A}:${O}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:k.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:k.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:k.scoredAt,children:new Date(k.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function _9t({application:e}){const{t}=_e("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(UW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(DFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function QT({status:e}){const{t}=_e("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function QW({person:e,fallback:t,compact:n=!1}){const{t:i}=_e("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function zW({application:e}){const{t,i18n:n}=_e("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(QT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(QW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function VW({applications:e}){const{t,i18n:n}=_e("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(zW,{application:i}),a.jsx(_9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function j9t({name:e,applications:t,onClose:n}){const{t:i}=_e("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(t0,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"review-backdrop"}),a.jsxs(Jv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:i("detail.history")}),a.jsx(UT,{children:e})]}),a.jsx(dL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(ST,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(VW,{applications:t})})]})]})})}function N9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){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,k]=p.useState([]),[S,O]=p.useState(!1),[A,E]=p.useState(null),[j,T]=p.useState(0),[R,C]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const H=u==null?void 0:u.items.find(X=>X.version===f),q=p.useMemo(()=>_Fe(i),[i]),U=q.get(`${e.skillId}:${f}`),Z=i.filter(X=>X.sourceSkillId===e.skillId&&X.version===f&&X.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&H&&["running","ready"].includes(H.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var V;F.current=!0;const X=document.activeElement instanceof HTMLElement?document.activeElement:null;(V=_.current)==null||V.focus();const le=Y=>{var Oe;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const K=Array.from(((Oe=I.current)==null?void 0:Oe.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ue=K[0],te=K[K.length-1];Y.shiftKey&&document.activeElement===ue&&(Y.preventDefault(),te==null||te.focus()),!Y.shiftKey&&document.activeElement===te&&(Y.preventDefault(),ue==null||ue.focus())};return document.addEventListener("keydown",le),()=>{F.current=!1,document.removeEventListener("keydown",le),X!=null&&X.isConnected&&X.focus()}},[]),p.useEffect(()=>{const X=new AbortController;return g(!0),v(null),p9t({spaceId:t.id,skillId:e.skillId,region:n,signal:X.signal}).then(le=>{X.signal.aborted||(d(le),h(V=>{var Y;return le.items.some(K=>K.version===V)?V:((Y=le.items[0])==null?void 0:Y.version)||""}))}).catch(le=>{X.signal.aborted||v(Lr(le,l("skillCenter.versions.loadFailed")))}).finally(()=>{X.signal.aborted||g(!1)}),()=>X.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!H)return;let X=!0;return O(!0),E(null),k([]),EIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(le=>{X&&k(le)}).catch(le=>{X&&E(Lr(le,l("skillCenter.versions.filesFailed")))}).finally(()=>{X&&O(!1)}),()=>{X=!1}},[t.id,e.skillId,n,f,!!H,R,l]);async function J(X){if(!L.current){L.current=!0,P("upload"),w(null);try{const le=await m9t({spaceId:t.id,skillId:e.skillId,region:n,file:X});if(!F.current)return;h(le.version),T(V=>V+1),s()}catch(le){F.current&&w(Lr(le,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(X){F.current&&w(Lr(X,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(X){if(!X)return"—";const le=new Date(X);return Number.isNaN(le.getTime())?X:le.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:X=>{X.target===X.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(X=>X+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var X;return(X=D.current)==null?void 0:X.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:X=>{var V;const le=(V=X.target.files)==null?void 0:V[0];X.target.value="",le&&J(le)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Rs,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(X=>X+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(X=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===X.version?" is-active":""}`,"aria-pressed":f===X.version,onClick:()=>h(X.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:X.sourceVersion||X.version}),X.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:X.createdAt,children:W(X.createdAt)}),q.get(`${e.skillId}:${X.version}`)?a.jsx(QT,{status:q.get(`${e.skillId}:${X.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},X.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:H?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:H.sourceVersion||H.version}),a.jsx("p",{title:H.description,children:H.description}),H.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:H.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),H.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:H.error}):null,["running","ready"].includes(H.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:H.status})}),U?a.jsx(zW,{application:U}):null,Z.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(VW,{applications:Z})]}):null,a.jsx("div",{className:"skill-versions__files",children:S?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):A?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:A}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>C(X=>X+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(uL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function R9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=_e("ui"),[s,o]=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),Ipt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Lr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(Hv,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.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?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:l})}):null]})}function HW({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 o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function I9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=_e("skills"),[s,o]=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 Rpt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Lr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(HW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(RN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.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 P9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=_e("skills"),[s,o]=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 Fpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Lr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(HW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.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 D9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=_e("skills"),[o,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),k=async O=>{const A=w.current+1;if(w.current=A,l(O),u(null),b(null),f(!!O),!!O)try{const E=await Qpt(O);w.current===A&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===A&&b(Lr(E,r("management.archiveValidationFailed")))}finally{w.current===A&&f(!1)}},S=async()=>{if(!(!o||!c)){m(!0),b(null);try{await Upt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(O){b(Lr(O,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(HW,{title:r("management.uploadTitle",{name:Nc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:O=>{var A;return void k(((A=O.target.files)==null?void 0:A[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var O;return(O=x.current)==null?void 0:O.click()},onDragEnter:O=>{O.preventDefault(),y(!0)},onDragOver:O=>{O.preventDefault(),O.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:O=>{O.currentTarget.contains(O.relatedTarget)||y(!1)},onDrop:O=>{var A;O.preventDefault(),y(!1),k(((A=O.dataTransfer.files)==null?void 0:A[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void S(),children:r(h?"management.uploading":"management.upload")})]})]})}function M9t(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 zT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=M9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const L9t=12,dae=12;function bP({disabled:e,placement:t="top",children:n}){const{t:i}=_e("ui"),r=p.useId();return a.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?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const $9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function MFe(e,t){const n=(e||"").trim().toLowerCase();return $9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function F9t(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 B9t(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 fae(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 hu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function U9t(e,t){const n=new Map(e.map(i=>[hu(i),i]));for(const i of t)n.set(hu(i),i);return[...n.values()].sort((i,r)=>fae(r.updatedAt)-fae(i.updatedAt))}function Q9t(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 PFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function Q9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function z9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function uae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.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 V9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function H9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(uae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(uae,{direction:"right"})})]})]})}function q9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function W$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Title,{children:t}),n?a.jsx(Wn.Description,{children:n}):null,i?a.jsx(Ns,{error:i}):null,r?a.jsx(Wn.ActionRow,{children:a.jsx(_t,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function dae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:Oh(s,t)}),a.jsx(Ns,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function W9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=Te("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]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:PFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(yP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(Q9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:IFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Dc(t),children:t.isShared?b("skillCenter.sharedSpace"):Dc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:Oh(n,i)})]})]}),a.jsx(ob,{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}),a.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?a.jsx(cl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Ns,{error:f})}):a.jsx(VW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(V9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Ns,{error:l})}):s.length>0?a.jsx(fL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:U9t(w.content)}:w)}):a.jsx(q9t,{children:b("skillCenter.noSkillContent")})})]})})}function K9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Dc(e),children:Dc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(yP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function G9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var zt;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>CFe(v),[v]),[x,O]=p.useState(null),[k,S]=p.useState(null),[E,C]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,A]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,H]=p.useState([]),[q,U]=p.useState(1),[Z,z]=p.useState(0),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[V,ae]=p.useState(!1),[Y,K]=p.useState(""),[te,ue]=p.useState("overview"),[fe,se]=p.useState(null),[me,Ee]=p.useState(null),[xe,Ne]=p.useState(null),[We,Xe]=p.useState([]),[Re,re]=p.useState(!1),[ce,ve]=p.useState(null),[Se,oe]=p.useState(null),[$e,Ue]=p.useState(!1),[be,ke]=p.useState(null),[Ae,He]=p.useState(null),[Qe,jt]=p.useState(null),[Pt,Kt]=p.useState(0),[Ct,xt]=p.useState(0),[tt,mt]=p.useState(""),[_e,Ot]=p.useState(""),[Nt,Yt]=p.useState(null),[xn,Ke]=p.useState(r),St=p.useRef(0),qe=p.useRef(0),nt=p.useRef(!1),et=p.useRef(null),ft=p.useRef(null),Et=p.useRef(null),At=p.useDeferredValue(I),It=p.useDeferredValue(Y),Gt=xn&&(_||xn.selectPublishSpace)?xn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((zt=xn.source)==null?void 0:zt.name)||u("skillCenter.skill")}):"",Ye=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Dc(_),wt=!(_!=null&&_.isShared)||_.canWrite===!0,vt=Gt||Ye||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(vt))},[n,o,vt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const tn=p.useMemo(()=>{const ze=At.trim().toLocaleLowerCase(),bt=h.filter(Ht=>!Ht.isShared);return ze?bt.filter(Ht=>`${Dc(Ht)} ${Ht.name} ${Ht.description||""} ${Ht.projectName||""}`.toLocaleLowerCase().includes(ze)):bt},[At,h]),Qt=p.useMemo(()=>{const ze=It.trim().toLocaleLowerCase();return ze?M.filter(bt=>`${bt.skillName} ${bt.skillDescription||""}`.toLocaleLowerCase().includes(ze)):M},[It,M]),un=(_==null?void 0:_.region)||Zi(e);p.useEffect(()=>{if(!n||!_)return;const ze=()=>xt(Ht=>Ht+1),bt=()=>{document.visibilityState==="visible"&&ze()};return window.addEventListener("focus",ze),document.addEventListener("visibilitychange",bt),()=>{window.removeEventListener("focus",ze),document.removeEventListener("visibilitychange",bt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const ze=_?`${un}:${_.id}`:"";if(j.current!==ze&&(j.current=ze,y([]),O(null),Ee(null)),S(null),C(!1),!n||!_||_.isShared)return;const bt=new AbortController;return C(!0),Lpt({spaceId:_.id,region:un,signal:bt.signal}).then(Ht=>{bt.signal.aborted||y(Ht.items)}).catch(Ht=>{bt.signal.aborted||S(Pr(Ht,u("skillCenter.reviewStatusFailed")))}).finally(()=>{bt.signal.aborted||C(!1)}),()=>bt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,un,Ct,n,i,u]);const De=p.useMemo(()=>f.flatMap(ze=>{var Ht;const bt=(Ht=R[ze])==null?void 0:Ht.error;return bt?[{region:ze,error:bt}]:[]}),[R,f]),on=f.some(ze=>{const bt=R[ze];return!!(bt&&!bt.done&&!bt.error)}),On=De.length===f.length;p.useEffect(()=>{const ze=new AbortController;return NM(ze.signal).then(oe).catch(()=>oe({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>ze.abort()},[u]);const Sn=p.useCallback(async(ze,bt)=>{var Dr;if(nt.current||ze.length===0)return;nt.current=!0,P(!0),bt&&((Dr=et.current)==null||Dr.abort(),m([]),A(Object.fromEntries(ze.map(({region:ti})=>[ti,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Ht=new AbortController;et.current=Ht;const _n=++qe.current,jr=await Promise.allSettled(ze.map(async({region:ti,page:Si})=>({region:ti,page:Si,result:await jpt({region:ti,page:Si,pageSize:M9t,signal:Ht.signal})})));if(qe.current!==_n)return;const Hs=jr.map((ti,Si)=>{const Zr=ze[Si];return ti.status==="rejected"?{request:Zr,error:Pr(ti.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Zr,error:null,items:(ti.value.result.items||[]).map(Jr=>({...Jr,region:Jr.region||ti.value.region})),totalCount:ti.value.result.totalCount||0,scannedCount:ti.value.result.scannedCount??ti.value.result.items.length}}),qs=Hs.flatMap(ti=>ti.items);A(ti=>{const Si={...ti};return Hs.forEach(({request:Zr,error:Jr,scannedCount:ga,totalCount:go})=>{const us=Si[Zr.region]||{nextPage:Zr.page,loadedCount:0,done:!1,error:null};if(Jr){Si[Zr.region]={...us,error:Jr};return}const ge=us.loadedCount+ga;Si[Zr.region]={nextPage:Zr.page+1,loadedCount:ge,done:ga===0||ge>=go,error:null}}),Si}),m(ti=>B9t(bt?[]:ti,qs)),L(ti=>ti&&(qs.find(Si=>uu(Si)===uu(ti))||ti)),nt.current=!1,P(!1)},[]),zi=p.useCallback(()=>{if(nt.current)return;const ze=f.flatMap(bt=>{const Ht=R[bt];return Ht&&!Ht.done&&!Ht.error?[{region:bt,page:Ht.nextPage}]:[]});Sn(ze,!1)},[Sn,R,f]);p.useEffect(()=>{ei(),L(null),H([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(ze=>({region:ze,page:1})),!0),()=>{var ze;qe.current+=1,(ze=et.current)==null||ze.abort(),nt.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const ze=Et.current,bt=ft.current;if(!ze||!bt||!on||N)return;const Ht=new IntersectionObserver(([_n])=>{_n.isIntersecting&&zi()},{root:bt,rootMargin:"240px 0px",threshold:.01});return Ht.observe(ze),()=>Ht.disconnect()},[on,zi,N]);const dn=()=>{const ze=ft.current;!ze||!on||N||ze.scrollHeight-ze.scrollTop-ze.clientHeight<=240&&zi()};p.useEffect(()=>{if(!_){H([]),z(0),ae(!1);return}let ze=!0;return ne(!0),X(null),EIe(_.id,{region:un,page:q,pageSize:lae,project:_.projectName}).then(bt=>{ze&&(H(bt.items||[]),z(bt.totalCount||0),ae(bt.degraded===!0))}).catch(bt=>{ze&&(H([]),z(0),ae(!1),X(Pr(bt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{ze&&ne(!1)}),()=>{ze=!1}},[un,_,q,Ct,u]);const lr=ze=>{ei(),L(ze),ue("overview"),U(1),K("")},Mn=()=>{ei(),L(null),H([]),z(0),ae(!1),ue("overview"),U(1),K(""),Yt(null)},ei=()=>{St.current+=1,se(null),Ne(null),Xe([]),ve(null),re(!1)},Bn=async ze=>{if(!_)return;const bt=jy(ze),Ht=St.current+1;St.current=Ht,se(ze),Ne(null),ve(null),re(!0);try{const[_n,jr]=await Promise.all([Vpt(_.id,bt,ze.version,un,_.projectName,ze.skillName,_.name),OIe({spaceId:_.id,skillId:bt,version:ze.version,region:un,skillSpaceName:_.name,skillName:ze.skillName})]);St.current===Ht&&(Ne(_n),Xe(jr))}catch(_n){St.current===Ht&&ve(Pr(_n,u("skillCenter.errors.loadSkillDetails")))}finally{St.current===Ht&&re(!1)}},ki=ze=>{if(_)return{kind:"skill-center",skillId:jy(ze),version:ze.version,region:un,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:ze.skillName,description:ze.skillDescription}},zn=ze=>{const bt=ki(ze);!bt||!(Se!=null&&Se.enabled)||(ei(),Ke({operation:"optimize",source:bt}))},Rn=async ze=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:ze.skillName})))){mt(ze.skillId),Yt(null);try{await Qpt({spaceId:_.id,skillId:ze.skillId,region:un}),xt(bt=>bt+1),Kt(bt=>bt+1)}catch(bt){Yt(Pr(bt,u("skillCenter.errors.deleteSkill")))}finally{mt("")}}},di=async ze=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Dc(ze)})))return;const bt=uu(ze);Ot(bt),Yt(null);try{await Fpt({spaceId:ze.id,region:ze.region||Zi(e)}),_&&uu(_)===bt&&Mn(),Kt(Ht=>Ht+1)}catch(Ht){Yt(Pr(Ht,u("skillCenter.errors.deleteSpace")))}finally{Ot("")}},rt=async(ze,bt=ze.version,Ht=!1)=>{var Hs,qs,Dr,ti;if(!_||T.current)return;const _n=_,jr=`${_n.region}:${_n.id}:${ze.skillId}:${bt}`;T.current=!0,b(jr),Yt(null);try{const Si=await Ipt({spaceId:_n.id,skillId:ze.skillId,version:bt,region:_n.region||un});((Hs=F.current)==null?void 0:Hs.id)===_n.id&&((qs=F.current)==null?void 0:qs.region)===_n.region&&y(Zr=>[...Zr.filter(Jr=>Jr.id!==Si.id),Si])}catch(Si){if(Ht)throw Pr(Si,u("skillCenter.reviewFailed"));((Dr=F.current)==null?void 0:Dr.id)===_n.id&&((ti=F.current)==null?void 0:ti.region)===_n.region&&Yt(Pr(Si,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return xn&&(_||xn.selectPublishSpace)?a.jsx(f9t,{operation:xn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(ze=>!ze.isShared),spacesLoading:N,initialIntent:xn.initialIntent,source:xn.source,onBack:()=>Ke(null),onPublished:()=>{xt(ze=>ze+1),Kt(ze=>ze+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(lT,{className:"skillcenter-detail",title:Ye||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:Mn,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(ze=>ze+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(yH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:Z})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?F9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(ze=>ze+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ye||_.name}),children:[a.jsx(YIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:Z}),actions:a.jsxs(a.Fragment,{children:[a.jsx(Jp,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:ze=>K(ze.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:J||E,onClick:()=>xt(ze=>ze+1),children:u("common.refresh")})]})}),V?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,J&&M.length===0?a.jsx(cl,{}):W&&M.length===0?a.jsx(W$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>xt(ze=>ze+1)}}):Qt.length===0?a.jsx(W$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&wt?{label:u("skillCenter.localUpload"),onClick:()=>jt(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Qt.map(ze=>{const bt=w.get(`${ze.skillId}:${ze.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Bn(ze),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:ze.skillName,children:ze.skillName}),ze.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:ze.sourceVersion||ze.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:PFe(ze.skillDescription,u)}),_.isShared&&ze.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:ze.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${$9t(ze.skillStatus)}`,children:IFe(ze.skillStatus,u)}),bt?a.jsx(FT,{status:bt.status}):null,bt!=null&&bt.reviewer||bt!=null&&bt.reviewedBy?a.jsx(QW,{compact:!0,person:bt.reviewer,fallback:bt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Bn(ze),children:u("common.view")}),!ze.lookupByName&&ze.skillId?a.jsx("button",{type:"button",onClick:()=>Ee(ze),children:u("skillCenter.versions.title")}):null,!_.isShared&&!ze.lookupByName&&ze.skillId?a.jsx("button",{type:"button",disabled:E||k!==null||g!==null||bt!==void 0&&bt.status!=="returned",onClick:()=>void rt(ze),children:g===`${_.region}:${_.id}:${ze.skillId}:${ze.version}`?u("skillCenter.reviewSubmitting"):u(bt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[bt.status]:"skillCenter.requestPublication")}):null,v.some(Ht=>Ht.sourceSkillId===ze.skillId)?a.jsx("button",{type:"button",onClick:()=>O(ze),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Se!=null&&Se.enabled),children:a.jsx("button",{type:"button",disabled:!(Se!=null&&Se.enabled),onClick:()=>zn(ze),children:u("skillCenter.optimize")})}),!ze.lookupByName&&wt?a.jsx("button",{type:"button",className:"is-danger",disabled:tt===ze.skillId,onClick:()=>void Rn(ze),children:tt===ze.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${jy(ze)}:${ze.version}`)})})]})}),!Y.trim()&&!J&&!W&&Z>0?a.jsx(H9t,{page:q,total:Z,pageSize:lae,onPage:U}):null]})]})}],activeSectionKey:te,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:ze=>ue(ze),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ke(_),children:u("skillCenter.editSpace")}),a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:_e===uu(_),onClick:()=>void di(_),children:_e===uu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),wt?a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>jt(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Se!=null&&Se.enabled),children:a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Se!=null&&Se.enabled),onClick:()=>Ke({operation:"create"}),children:[a.jsx(Ije,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(Jp,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:ze=>D(ze.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,a.jsxs(em,{className:"skillcenter-list-results",ref:ft,"aria-label":u("skillCenter.spaceList"),onScroll:dn,children:[De.length>0&&!On?a.jsx(dae,{errors:De,cloudProvider:e,onRetry:()=>Kt(ze=>ze+1)}):null,a.jsxs(K0,{children:[a.jsx(N9t,{region:t,active:n,revision:Pt+i,onOpen:lr},`${e}:${t}`),I.trim()?null:a.jsx(cb,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(z9t,{}),onClick:()=>Ue(!0),children:u("skillCenter.newSpace")}),tn.map(ze=>{const bt=uu(ze);return a.jsx(X0,{className:"skillcenter-space-card",title:Dc(ze),description:ze.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:ze.skillCount??0})},{label:u("skillCenter.updatedAt"),value:BT(ze.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>He(ze)},detailAction:{label:u("common.viewDetails"),onClick:()=>lr(ze)}},bt)})]}),N&&h.length===0?a.jsx(cl,{}):On&&h.length===0?a.jsx(dae,{errors:De,cloudProvider:e,fullPage:!0,onRetry:()=>Kt(ze=>ze+1)}):tn.length===0&&I.trim()?a.jsx(W$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!On&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Et,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):on?a.jsx("span",{children:u("skillCenter.scrollForMore")}):De.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),me&&_?a.jsx(j9t,{skill:me,space:_,region:un,reviews:v.filter(ze=>ze.sourceSkillId===me.skillId),onClose:()=>Ee(null),onChanged:()=>xt(ze=>ze+1),onSubmitReview:!_.isShared&&!E&&!k?ze=>rt(me,ze,!0):void 0},`${un}:${_.id}:${me.skillId}`):null,x?a.jsx(_9t,{name:x.skillName,applications:v.filter(ze=>ze.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,fe&&_&&a.jsx(W9t,{skill:fe,space:_,region:un,cloudProvider:e,detail:xe,files:We,loading:Re,error:ce,reviews:v.filter(ze=>ze.sourceSkillId===fe.skillId),reviewsLoading:E,reviewsError:k,canOptimize:!_.isShared&&(Se==null?void 0:Se.enabled)===!0,onOptimize:()=>zn(fe),onDownload:()=>void zpt({spaceId:_.id,skillId:jy(fe),version:fe.version,region:un,fallbackName:fe.skillName,skillSpaceName:_.name,skillName:fe.skillName}).catch(ze=>ve(Pr(ze,u("skillCenter.errors.downloadSkill")))),onClose:ei}),$e?a.jsx(R9t,{region:t,regionOptions:ju(e),onClose:()=>Ue(!1),onCreated:ze=>{Ue(!1),Kt(bt=>bt+1),L({...ze,region:ze.region||t})}}):null,be?a.jsx(I9t,{space:be,region:be.region||Zi(e),onClose:()=>ke(null),onUpdated:ze=>{const bt={...ze,region:ze.region||be.region||Zi(e)};ke(null),L(Ht=>Ht&&uu(Ht)===uu(bt)?bt:Ht),m(Ht=>Ht.map(_n=>uu(_n)===uu(bt)?bt:_n)),Kt(Ht=>Ht+1)}}):null,Ae?a.jsx(K9t,{space:Ae,canUseSandbox:(Se==null?void 0:Se.enabled)===!0,onClose:()=>He(null),onUpload:()=>{jt(Ae),He(null)},onSandbox:()=>{const ze=Ae;He(null),lr(ze),Ke({operation:"create"})}}):null,Qe?a.jsx(P9t,{space:Qe,region:Qe.region||Zi(e),onClose:()=>jt(null),onUploaded:()=>{jt(null),xt(ze=>ze+1),Kt(ze=>ze+1)}}):null]})}function X9t(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 Y9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>X9t(f),[f]),g=f("library.tabs.skills"),b=AD(t)?t:Zi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[k,S]=p.useState(!1),[E,C]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[A,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=lbt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,H=p.useMemo(()=>ju(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(W=>W===ne?g:W),O.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{C(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(X=>X.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await bbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{C(W=>{if(W.has(ne))return W;const X=new Set(W);return X.add(ne),X}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},Z=a.jsx(ob,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(lb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),J=n==="skills"?w!==g:n==="knowledge"&&k;return a.jsxs(Sh,{className:`library-view${J?" is-detail":""}`,"aria-label":f("library.title"),children:[J?null:a.jsx(W0,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[E.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(G9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:Z,toolbarFilters:z("library-skills-region-filter")})}):null,E.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(u2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:S,toolbarLeading:Z,toolbarFilters:z("library-knowledge-region-filter")})}):null,E.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(pbt,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?So(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:ybt,onDelete:vbt,onDownload:xbt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:Z,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const DFe="veadk_agentkit_connections",Z9t=3e3,fae=6e4;function af(){try{const e=localStorage.getItem(DFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function pL(e){try{localStorage.setItem(DFe,JSON.stringify(e))}catch{}}function bf(e,t){return`agentkit:${e}:${t}`}function MFe(e){try{return new URL(e).host}catch{return e}}function xO(e){KAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)WAe(bf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function LFe(e,t,n,i,r,s,o,l){const c=af(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,pL(c),xO(c),f}async function J9t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of $A(n))try{const g=await Kw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await O2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof Q1)throw vP(e),g;if(g instanceof Oa&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw vP(e),u||new Oa(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=LFe(e,t,c,l,f,i,s,o);return bf(h.id,l[0])}function e7t(e){return new Promise(t=>window.setTimeout(t,e))}async function YN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await J9t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Oa)||!o.retryable||l>=fae)throw o;const c=Math.min(Z9t,fae-l);await e7t(c)}}async function $Fe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await FA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||MFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...af().filter(c=>c.base!==r),o];return pL(l),xO(l),o}function t7t(e){const t=af().filter(n=>n.id!==e);return pL(t),xO(t),t}function vP(e){const t=af().filter(n=>n.runtimeId!==e);return pL(t),xO(t),t}function FFe(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 o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:bf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:MFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const hae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:$Fe,addRuntimeConnection:LFe,buildAgentEntries:FFe,connectRuntime:YN,loadConnections:af,registerConnections:xO,remoteAppId:bf,removeConnection:t7t,removeRuntimeConnection:vP},Symbol.toStringTag,{value:"Module"}));function n7t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,o]=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 $Fe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(bf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Bi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const i7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,r7t={"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"},s7t={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",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function mL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?r7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(N8().toLowerCase()==="zh-cn"||!i7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?s7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function eo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function gL(){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}})}ZN.prototype=gL.prototype={constructor:ZN,on:function(e,t){var n=this._,i=o7t(e+"",n),r,s=-1,o=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)),mae.hasOwnProperty(t)?{space:mae[t],local:e}:e}function c7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===T7&&t.documentElement.namespaceURI===T7?t.createElement(e):t.createElementNS(n,e)}}function u7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BFe(e){var t=bL(e);return(t.local?u7t:c7t)(t)}function d7t(){}function qW(e){return e==null?d7t:function(){return this.querySelector(e)}}function f7t(e){typeof e!="function"&&(e=qW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(k=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function L7t(e){e||(e=$7t);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 F7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function B7t(){return Array.from(this)}function U7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Z7t:typeof t=="function"?eUt:J7t)(e,t,n??"")):w1(this.node(),e)}function w1(e,t){return e.style.getPropertyValue(t)||HFe(e).getComputedStyle(e,null).getPropertyValue(t)}function nUt(e){return function(){delete this[e]}}function iUt(e,t){return function(){this[e]=t}}function rUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function sUt(e,t){return arguments.length>1?this.each((t==null?nUt:typeof t=="function"?rUt:iUt)(e,t)):this.node()[e]}function qFe(e){return e.trim().split(/^|\s+/)}function WW(e){return e.classList||new WFe(e)}function WFe(e){this._node=e,this._names=qFe(e.getAttribute("class")||"")}WFe.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 KFe(e,t){for(var n=WW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function IUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function _7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,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:o,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}})}_7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function zUt(e){return!e.ctrlKey&&!e.button}function VUt(){return this.parentNode}function HUt(e,t){return t??{x:e.x,y:e.y}}function qUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function e8e(){var e=zUt,t=VUt,n=HUt,i=qUt,r={},s=gL("start","drag","end"),o=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,QUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,k){if(!(d||!e.call(this,O,k))){var S=x(this,t.call(this,O,k),O,k,"mouse");S&&(xu(O.view).on("mousemove.drag",g,iA).on("mouseup.drag",b,iA),ZFe(O.view),K$(O),u=!1,l=O.clientX,c=O.clientY,S("start",O))}}function g(O){if(Cw(O),!u){var k=O.clientX-l,S=O.clientY-c;u=k*k+S*S>f}r.mouse("drag",O)}function b(O){xu(O.view).on("mousemove.drag mouseup.drag",null),JFe(O.view,u),Cw(O),r.mouse("end",O)}function v(O,k){if(e.call(this,O,k)){var S=O.changedTouches,E=t.call(this,O,k),C=S.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hj(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=KUt.exec(e))?new $c(t[1],t[2],t[3],1):(t=GUt.exec(e))?new $c(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XUt.exec(e))?hj(t[1],t[2],t[3],t[4]):(t=YUt.exec(e))?hj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZUt.exec(e))?Oae(t[1],t[2]/100,t[3]/100,1):(t=JUt.exec(e))?Oae(t[1],t[2]/100,t[3]/100,t[4]):gae.hasOwnProperty(e)?vae(gae[e]):e==="transparent"?new $c(NaN,NaN,NaN,0):null}function vae(e){return new $c(e>>16&255,e>>8&255,e&255,1)}function hj(e,t,n,i){return i<=0&&(e=t=n=NaN),new $c(e,t,n,i)}function nQt(e){return e instanceof QT||(e=T0(e)),e?(e=e.rgb(),new $c(e.r,e.g,e.b,e.opacity)):new $c}function j7(e,t,n,i){return arguments.length===1?nQt(e):new $c(e,t,n,i??1)}function $c(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}KW($c,j7,t8e(QT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new $c(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rA:Math.pow(rA,e),new $c(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $c(t0(this.r),t0(this.g),t0(this.b),OP(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:xae,formatHex:xae,formatHex8:iQt,formatRgb:wae,toString:wae}));function xae(){return`#${$y(this.r)}${$y(this.g)}${$y(this.b)}`}function iQt(){return`#${$y(this.r)}${$y(this.g)}${$y(this.b)}${$y((isNaN(this.opacity)?1:this.opacity)*255)}`}function wae(){const e=OP(this.opacity);return`${e===1?"rgb(":"rgba("}${t0(this.r)}, ${t0(this.g)}, ${t0(this.b)}${e===1?")":`, ${e})`}`}function OP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function t0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $y(e){return e=t0(e),(e<16?"0":"")+e.toString(16)}function Oae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cf(e,t,n,i)}function n8e(e){if(e instanceof cf)return new cf(e.h,e.s,e.l,e.opacity);if(e instanceof QT||(e=T0(e)),!e)return new cf;if(e instanceof cf)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),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new cf(o,l,c,e.opacity)}function rQt(e,t,n,i){return arguments.length===1?n8e(e):new cf(e,t,n,i??1)}function cf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}KW(cf,rQt,t8e(QT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rA:Math.pow(rA,e),new cf(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 $c(G$(e>=240?e-240:e+120,r,i),G$(e,r,i),G$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new cf(kae(this.h),pj(this.s),pj(this.l),OP(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=OP(this.opacity);return`${e===1?"hsl(":"hsla("}${kae(this.h)}, ${pj(this.s)*100}%, ${pj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kae(e){return e=(e||0)%360,e<0?e+360:e}function pj(e){return Math.max(0,Math.min(1,e||0))}function G$(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 yL=e=>()=>e;function i8e(e,t){return function(n){return e+n*t}}function sQt(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 Whn(e,t){var n=t-e;return n?i8e(e,n>180||n<-180?n-360*Math.round(n/360):n):yL(isNaN(e)?t:e)}function aQt(e){return(e=+e)==1?r8e:function(t,n){return n-t?sQt(t,n,e):yL(isNaN(t)?n:t)}}function r8e(e,t){var n=t-e;return n?i8e(e,n):yL(isNaN(e)?t:e)}const kP=function e(t){var n=aQt(t);function i(r,s){var o=n((r=j7(r)).r,(s=j7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=r8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function oQt(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[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Zf(i,r)})),n=X$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Zf(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:Zf(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:Zf(u,f)},{i:b-2,x:Zf(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),o(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;--O1}function Cae(){_0=(EP=aA.now())+vL,O1=OS=0;try{OQt()}finally{O1=0,SQt(),_0=0}}function kQt(){var e=aA.now(),t=e-EP;t>l8e&&(vL-=t,EP=e)}function SQt(){for(var e,t=SP,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:SP=n);kS=e,I7(i)}function I7(e){if(!O1){OS&&(OS=clearTimeout(OS));var t=e-_0;t>24?(e<1/0&&(OS=setTimeout(Cae,e-aA.now()-vL)),Nk&&(Nk=clearInterval(Nk))):(Nk||(EP=aA.now(),Nk=setInterval(kQt,l8e)),O1=1,c8e(Cae))}}function Aae(e,t,n){var i=new CP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var EQt=gL("start","end","cancel","interrupt"),CQt=[],d8e=0,Tae=1,P7=2,eR=3,_ae=4,D7=5,tR=6;function xL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;AQt(e,n,{name:t,index:i,group:r,on:EQt,tween:CQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:d8e})}function XW(e,t){var n=Pf(e,t);if(n.state>d8e)throw new Error("too late; already scheduled");return n}function Dh(e,t){var n=Pf(e,t);if(n.state>eR)throw new Error("too late; already running");return n}function Pf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function AQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=u8e(s,0,n.time);function s(u){n.state=Tae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Tae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===eR)return Aae(o);m.state===_ae?(m.state=tR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dP7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function izt(e,t,n){var i,r,s=nzt(t)?XW:Dh;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function rzt(e,t){var n=this._id;return arguments.length<2?Pf(this.node(),n).on.on(e):this.each(izt(n,e,t))}function szt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function azt(){return this.on("end.remove",szt(this._id))}function ozt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function Rzt(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 Ap(e,t,n){this.k=e,this.x=t,this.y=n}Ap.prototype={constructor:Ap,scale:function(e){return e===1?this:new Ap(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ap(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 wL=new Ap(1,0,0);m8e.prototype=Ap.prototype;function m8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wL;return e.__zoom}function Y$(e){e.stopImmediatePropagation()}function Rk(e){e.preventDefault(),e.stopImmediatePropagation()}function Izt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Pzt(){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 jae(){return this.__zoom||wL}function Dzt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lzt(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],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function g8e(){var e=Izt,t=Pzt,n=Lzt,i=Dzt,r=Mzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=JN,u=gL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",jae).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",jae),P!==L?k(P,I,D,_):L.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?O(L):typeof D=="function"?D.apply(this,arguments):D,H=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,H),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,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),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,H=_==null?O(F):typeof _=="function"?_.apply(this,arguments):_;return n(wL.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),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Ap(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Ap(P.k,_,L)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,I,D,_){P.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=S(L,F).event(_),H=t.apply(L,F),q=D==null?O(H):typeof D=="function"?D.apply(L,F):D,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Z=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,J=c(Z.invert(q).concat(U/Z.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=J(ne),X=U/W[2];ne=new Ap(X,q[0]-W[0]*X,q[1]-W[1]*X)}M.zoom(null,ne)}})}function S(P,I,D){return!D&&P.__zooming||new E(P,I)}function E(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}E.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="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(P){var I=xu(this.that).datum();u.call(P,this.that,new Rzt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function C(P,...I){if(!e.apply(this,arguments))return;var D=S(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=nf(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],nR(this),D.start()}Rk(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=S(this,I,!0).event(P),L=xu(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=nf(P,D),M=P.clientX,H=P.clientY;ZFe(P.view),Y$(P),_.mouse=[F,this.__zoom.invert(F)],nR(this),_.start();function q(Z){if(Rk(Z),!_.moved){var z=Z.clientX-M,J=Z.clientY-H;_.moved=z*z+J*J>b}_.event(Z).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=nf(Z,D),_.mouse[1]),_.extent,o))}function U(Z){L.on("mousemove.zoom mouseup.zoom",null),JFe(Z.view,_.moved),Rk(Z),_.event(Z).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=nf(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);Rk(P),l>0?xu(this).transition().duration(l).call(k,M,_,P):xu(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=S(this,I,P.changedTouches.length===_).event(P),F,M,H,q;for(Y$(P),M=0;M<_;++M)H=D[M],q=nf(H,this),q=[q,this.__zoom.invert(q),H.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),nR(this),L.start())}}function A(P,...I){if(this.__zooming){var D=S(this,I).event(P),_=P.changedTouches,L=_.length,F,M,H,q;for(Rk(P),F=0;F`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.`},oA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],b8e=["Enter"," ","Escape"],y8e={"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 k1;(function(e){e.Strict="strict",e.Loose="loose"})(k1||(k1={}));var n0;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(n0||(n0={}));var lA;(function(e){e.Partial="partial",e.Full="full"})(lA||(lA={}));const v8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var cg;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(cg||(cg={}));var cA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(cA||(cA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const Nae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function x8e(e){return e===null?null:e?"valid":"invalid"}const w8e=e=>"id"in e&&"source"in e&&"target"in e,$zt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zT=(e,t=[0,0])=>{const{width:n,height:i}=wm(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Fzt=(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 o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):ZW(r)?r:t.nodeLookup.get(r.id));const l=o?AP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return OL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return kL(n)},VT=(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=OL(n,AP(r)),i=!0)}),i?kL(n):{x:0,y:0,width:0,height:0}},JW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...wO(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(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=uA(l,E1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},Bzt=(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 Uzt(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 Qzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Uzt(e,o),c=VT(l),u=tK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function O8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",Sf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&N0(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=N0(f)?j0(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",Sf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function zzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=Bzt(o,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:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const S1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),j0=(e={x:0,y:0},t,n)=>({x:S1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:S1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function k8e(e,t,n){const{width:i,height:r}=wm(n),{x:s,y:o}=n.internals.positionAbsolute;return j0(e,[[s,o],[s+i,o+r]],t)}const Rae=(e,t,n)=>en?-S1(Math.abs(e-n),1,t)/t:0,eK=(e,t,n=15,i=40)=>{const r=Rae(e.x,i,t.width-i)*n,s=Rae(e.y,i,t.height-i)*n;return[r,s]},OL=(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)}),M7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),kL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),E1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:zT(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}},AP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:zT(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)}},S8e=(e,t)=>kL(OL(M7(e),M7(t))),uA=(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)},Iae=e=>df(e.width)&&df(e.height)&&df(e.x)&&df(e.y),df=e=>!isNaN(e)&&isFinite(e),E8e=(e,t)=>(n,i)=>{},HT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wO=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?HT(l,o):l},C1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Hv(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 Vzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Hv(e,n),r=Hv(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Hv(e.top??e.y??0,n),r=Hv(e.bottom??e.y??0,n),s=Hv(e.left??e.x??0,t),o=Hv(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Hzt(e,t,n,i,r,s){const{x:o,y:l}=C1(e,[t,n,i]),{x:c,y:u}=C1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const tK=(e,t,n,i,r,s)=>{const o=Vzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=S1(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=Hzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},dA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function N0(e){return e!=null&&e!=="parent"}function wm(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 nK(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 C8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Pae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function qzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Wzt(e){return{...y8e,...e||{}}}function jE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=ff(e),l=wO({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?HT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const iK=e=>({width:e.offsetWidth,height:e.offsetHeight}),A8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Kzt=["INPUT","SELECT","TEXTAREA"];function T8e(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:Kzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _8e=e=>"clientX"in e,ff=(e,t)=>{var s,o;const n=_8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Dae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...iK(o)}})};function j8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.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 bj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Mae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-bj(t-i,s),n];case vn.Right:return[t+bj(i-t,s),n];case vn.Top:return[t,n-bj(n-r,s)];case vn.Bottom:return[t,n+bj(r-n,s)]}}function N8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Mae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Mae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=j8e({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 R8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Yzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Zzt=(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)),Jzt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Sf.error006()),t;const i=n.getEdgeId||Yzt;let r;return w8e(e)?r={...e}:r={...e,id:i(e)},Zzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function I8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=R8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Lae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},eVt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tVt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Lae[t],c=Lae[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=eVt({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]=R8e({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)*o,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)*o);const C=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?C:j:g=h==="x"?j:C}else{const C=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:C:g=l.y===m?C:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);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 P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,x,O]}function nVt(e,t,n,i){const r=Math.min($ae(e,t)/2,$ae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function L7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function rVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=L7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const P8e=1e3,sVt=10,rK={nodeOrigin:[0,0],nodeExtent:oA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aVt={...rK,checkEquality:!0};function sK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function oVt(e,t,n){const i=sK(rK,n);for(const r of e.values())if(r.parentId)oK(r,e,t,i);else{const s=zT(r,i.nodeOrigin),o=N0(r.extent)?r.extent:i.nodeExtent,l=j0(s,o,wm(r));r.internals.positionAbsolute=l}}function lVt(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 aK(e){return e==="manual"}function $7(e,t,n,i={}){var d,f;const r=sK(aVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!aK(r.zIndexMode)?P8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=zT(h,r.nodeOrigin),b=N0(h.extent)?h.extent:r.nodeExtent,v=j0(g,b,wm(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:lVt(h,m),z:D8e(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&&oK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function cVt(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 oK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=sK(rK,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}cVt(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*sVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!aK(c)?P8e:0,{x:h,y:m,z:g}=uVt(e,d,o,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 D8e(e,t,n){const i=df(e.zIndex)?e.zIndex:0;return aK(n)?i:i+(e.selected?t:0)}function uVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=wm(e),u=zT(e,n),d=N0(e.extent)?j0(u,e.extent,c):u;let f=j0({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=k8e(f,c,t));const h=D8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function lK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??E1(c),d=S8e(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=wm(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(k=>k.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=lK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function fVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Qae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function M8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Qae("source",c,d,e,r,o),Qae("target",c,u,e,s,l),t.set(i.id,i)}}function L8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L8e(n,t):!1}function zae(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 hVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!L8e(o,e))&&(o.draggable||t&&typeof o.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 Z$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.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 pVt({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},o=HT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function mVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=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:k,nodeId:S,nodeClickDistance:E=0}){h=xu(O);function C({x:A,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:H,updateNodePositions:q}=t();s={x:A,y:N};let U=!1;const Z=l.size>1,z=Z&&I?M7(VT(l)):null,J=Z&&_?pVt({dragItems:l,snapGrid:D,x:A,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let X={x:A-W.distance.x,y:N-W.distance.y};_&&(X=J?{x:Math.round(X.x+J.x),y:Math.round(X.y+J.y)}:HT(X,D));let V=null;if(Z&&I&&!W.extent&&z){const{positionAbsolute:K}=W.internals,te=K.x-z.x+I[0][0],ue=K.x+W.measured.width-z.x2+I[1][0],fe=K.y-z.y+I[0][1],se=K.y+W.measured.height-z.y2+I[1][1];V=[[te,fe],[ue,se]]}const{position:ae,positionAbsolute:Y}=O8e({nodeId:ne,nextPosition:X,nodeLookup:P,nodeExtent:V||I,nodeOrigin:L,onError:H});U=U||W.position.x!==ae.x||W.position.y!==ae.y,W.position=ae,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!S&&M))){const[ne,W]=Z$({nodeId:S,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),S||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:A,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=eK(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/A[2],s.y=(s.y??0)-_/A[2],await N({x:D,y:_})&&C(s)),o=requestAnimationFrame(j)}function T(A){var Z;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:q}=t();f=!0,(!F||!k)&&!P&&S&&((Z=N.get(S))!=null&&Z.selected||q()),k&&F&&S&&(e==null||e(S));const U=jE(A.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=hVt(N,I,U,S),l.size>0&&(n||M||!S&&H)){const[z,J]=Z$({nodeId:S,dragItems:l,nodeLookup:N});n==null||n(A.sourceEvent,l,z,J),M==null||M(A.sourceEvent,z,J),S||H==null||H(A.sourceEvent,J)}}const R=e8e().clickDistance(E).on("start",A=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,P===0&&T(A),s=jE(A.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=ff(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=jE(A.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!L.has(S))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=ff(A.sourceEvent,d),H=M.x-u.x,q=M.y-u.y;Math.sqrt(H*H+q*q)>_&&T(A)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=ff(A.sourceEvent,d),C(F))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!S&&D){const[_,L]=Z$({nodeId:S,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(A.sourceEvent,l,_,L),I==null||I(A.sourceEvent,_,L),S||D==null||D(A.sourceEvent,L)}}}).filter(A=>{const N=A.target;return!A.button&&(!w||!zae(N,`.${w}`,O))&&(!x||zae(N,x,O))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function gVt(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())uA(r,E1(s))>0&&i.push(s);return i}const bVt=250;function yVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=gVt(e,n,t+bVt);for(const u of o){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}=R0(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 $8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.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,...R0(o,c,c.position,!0)}:c}function F8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const B8e=()=>!0;function xVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=B8e,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:k,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:C}){const j=A8e(e.target);let T=0,R;const{x:A,y:N}=ff(e),P=F8e(s,C),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=$8e(r,P,i,c,t);if(!_)return;let L=ff(e,I),F=!1,M=null,H=!1,q=null;function U(){if(!d||!I)return;const[ae,Y]=eK(L,I,S);h({x:ae,y:Y}),T=requestAnimationFrame(U)}const Z={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:R0(z,Z,vn.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:z,to:L,toHandle:null,toPosition:Nae[Z.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}E===0&&W();function X(ae){if(!D){const{x:se,y:me}=ff(ae),Ee=se-A,xe=me-N;if(!(Ee*Ee+xe*xe>E*E))return;W()}if(!k()||!Z){V(ae);return}const Y=O();L=ff(ae,I),R=yVt(wO(L,Y,!1,[1,1]),n,c,Z),F||(U(),F=!0);const K=U8e(ae,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=K.handleDomNode,M=K.connection,H=vVt(!!R,K.isValid);const te=c.get(r),ue=te?R0(te,Z,vn.Left,!0):ne.from,fe={...ne,from:ue,isValid:H,to:K.toHandle&&H?C1({x:K.toHandle.x,y:K.toHandle.y},Y):L,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:Nae[Z.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null,pointer:L};x(fe),ne=fe}function V(ae){if(!("touches"in ae&&ae.touches.length>0)){if(D){(R||q)&&M&&H&&(b==null||b(M));const{inProgress:Y,...K}=ne,te={...K,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ae,te),s&&(w==null||w(ae,te))}m(),cancelAnimationFrame(T),F=!1,H=!1,M=null,q=null,j.removeEventListener("mousemove",X),j.removeEventListener("mouseup",V),j.removeEventListener("touchmove",X),j.removeEventListener("touchend",V)}}j.addEventListener("mousemove",X),j.addEventListener("mouseup",V),j.addEventListener("touchmove",X),j.addEventListener("touchend",V)}function U8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=B8e,nodeLookup:d}){const f=s==="target",h=t?o.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}=ff(e),b=o.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=F8e(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!x||!w)return y;const E={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=E;const j=k&&S&&(n===k1.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=j&&u(E),y.toHandle=$8e(x,w,O,d,n,!0)}return y}const F7={onPointerDown:xVt,isValid:U8e};function wVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=xu(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(),k=x.sourceEvent.ctrlKey&&dA()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,E=O[2]*Math.pow(2,S*k);t.scaleTo(E)};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 k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const E=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),C={x:O[0]-S[0]*E,y:O[1]-S[1]*E},j=[[0,0],[c,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:O[2]},j,l)},w=g8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:nf}}const SL=e=>({x:e.x,y:e.y,zoom:e.k}),J$=({x:e,y:t,zoom:n})=>wL.translate(e,t).scale(n),zx=(e,t)=>e.target.closest(`.${t}`),Q8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),OVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,e6=(e,t=0,n=OVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},z8e=e=>{const t=e.ctrlKey&&dA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function kVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(zx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=nf(d),y=z8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===n0.Vertical?0:d.deltaX*h,g=r===n0.Horizontal?0:d.deltaY*h;!dA()&&d.shiftKey&&r!==n0.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=SL(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 SVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=zx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function EVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=SL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.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 CVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&Q8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,SL(s.transform)))}}function AVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Q8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=SL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function TVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,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"&&(zx(f,`${u}-flow__node`)||zx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||zx(f,l)&&g||zx(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 _Vt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,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=g8e().scaleExtent([t,n]).translateExtent(i),h=xu(e).call(f);w({x:r.x,y:r.y,zoom:S1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(z8e);async function b(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).transform(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:H,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Z,onTransformChange:z,connectionInProgress:J,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const X=I&&!U&&!P;f.clickDistance(W?1/0:!df(ne)||ne<0?0:ne);const V=X?kVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):SVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",V,{passive:!1});const ae=EVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",ae);const Y=CVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const K=AVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",K);const te=TVt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:H,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:A,noWheelClassName:R,lib:Z,connectionInProgress:J});f.filter(te),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,A,N){const P=J$(R),I=f==null?void 0:f.constrain()(P,A,N);return I&&await b(I),I}async function x(R,A){const N=J$(R);return await b(N,A),N}function O(R){if(h){const A=J$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const R=h?m8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function S(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).scaleTo(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}async function E(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).scaleBy(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function C(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const A=!df(R)||R<0?0:R;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:k,scaleTo:S,scaleBy:E,setScaleExtent:C,setTranslateExtent:j,syncViewport:O,setClickDistance:T}}var A1;(function(e){e.Line="line",e.Handle="handle"})(A1||(A1={}));function jVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function Vae(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 Fm(e,t){return Math.max(0,t-e)}function Bm(e,t){return Math.max(0,e-t)}function yj(e,t,n){return Math.max(0,t-e,e-n)}function Hae(e,t){return e?!t:t}function NVt(e,t,n,i,r,s,o,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:k,height:S,aspectRatio:E}=e;let C=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=k+(c?-C:C),R=S+(u?-j:j),A=-s[0]*k,N=-s[1]*S;let P=yj(T,b,v),I=yj(R,y,w);if(o){let L=0,F=0;c&&C<0?L=Fm(x+C+A,o[0][0]):!c&&C>0&&(L=Bm(x+T+A,o[1][0])),u&&j<0?F=Fm(O+j+N,o[0][1]):!u&&j>0&&(F=Bm(O+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&C>0?L=Bm(x+C,l[0][0]):!c&&C<0&&(L=Fm(x+T,l[1][0])),u&&j>0?F=Bm(O+j,l[0][1]):!u&&j<0&&(F=Fm(O+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=yj(T/E,y,w)*E;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=Bm(O+N+T/E,o[1][1])*E:F=Fm(O+N+(c?C:-C)/E,o[0][1])*E,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Fm(O+T/E,l[1][1])*E:F=Bm(O+(c?C:-C)/E,l[0][1])*E,P=Math.max(P,F)}}if(f){const L=yj(R*E,b,v)/E;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=Bm(x+R*E+A,o[1][0])/E:F=Fm(x+(u?j:-j)*E+A,o[0][0])/E,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Fm(x+R*E,l[1][0])/E:F=Bm(x+(u?j:-j)*E,l[0][0])/E,I=Math.max(I,F)}}}j=j+(j<0?I:-I),C=C+(C<0?P:-P),r&&(h?T>R*E?j=(Hae(c,u)?-C:C)/E:C=(Hae(c,u)?-j:j)*E:d?(j=C/E,u=c):(C=j*E,c=u));const D=c?x+C:x,_=u?O+j:O;return{width:k+(c?-C:C),height:S+(u?-j:j),x:s[0]*C*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const V8e={width:0,height:0,x:0,y:0},RVt={...V8e,pointerX:0,pointerY:0,aspectRatio:1};function IVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function PVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=xu(e);let o={controlDirection:Vae("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={...V8e},w={...RVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Vae(u)};let x,O=null,k=[],S,E,C,j=!1;const T=e8e().on("start",R=>{const{nodeLookup:A,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=A.get(t),!x)return;O=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=jE(R.sourceEvent,{transform:N,snapGrid:P,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:F,aspectRatio:y.width/y.height},S=void 0,E=N0(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=A.get(x.parentId)),S&&x.extent==="parent"&&(E=[[0,0],[S.measured.width,S.measured.height]]),k=[],C=void 0;for(const[M,H]of A)if(H.parentId===t&&(k.push({id:M,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const q=IVt(H,x,H.origin??D);C?C=[[Math.min(q[0][0],C[0][0]),Math.min(q[0][1],C[0][1])],[Math.max(q[1][0],C[1][0]),Math.max(q[1][1],C[1][1])]]:C=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=jE(R.sourceEvent,{transform:A,snapGrid:N,snapToGrid:P,containerBounds:O}),_=[];if(!x)return;const{x:L,y:F,width:M,height:H}=y,q={},U=x.origin??I,{width:Z,height:z,x:J,y:ne}=NVt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,E,C),W=Z!==M,X=z!==H,V=J!==L&&W,ae=ne!==F&&X;if(!V&&!ae&&!W&&!X)return;if((V||ae||U[0]===1||U[1]===1)&&(q.x=V?J:y.x,q.y=ae?ne:y.y,y.x=q.x,y.y=q.y,k.length>0)){const ue=J-L,fe=ne-F;for(const se of k)se.position={x:se.position.x-ue+U[0]*(Z-M),y:se.position.y-fe+U[1]*(z-H)},_.push(se)}if((W||X)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Z:y.width,q.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),S&&x.expandParent){const ue=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const DVt={},qae=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:()=>{(DVt?"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},MVt=e=>e?qae(e):qae,{useDebugValue:LVt}=Ni,{useSyncExternalStoreWithSelector:$Vt}=vnt,FVt=e=>e;function H8e(e,t=FVt,n){const i=$Vt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return LVt(i),i}const Wae=(e,t)=>{const n=MVt(e),i=(r,s=t)=>H8e(n,r,s);return Object.assign(i,n),i},BVt=(e,t)=>e?Wae(e,t):Wae;function zs(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 EL=p.createContext(null),UVt=EL.Provider,q8e=Sf.error001("react");function ir(e,t){const n=p.useContext(EL);if(n===null)throw new Error(q8e);return H8e(n,e,t)}function Vs(){const e=p.useContext(EL);if(e===null)throw new Error(q8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Kae={display:"none"},QVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},W8e="react-flow__node-desc",K8e="react-flow__edge-desc",zVt="react-flow__aria-live",VVt=e=>e.ariaLiveMessage,HVt=e=>e.ariaLabelConfig;function qVt({rfId:e}){const t=ir(VVt);return a.jsx("div",{id:`${zVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:QVt,children:t})}function WVt({rfId:e,disableKeyboardA11y:t}){const n=ir(HVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${W8e}-${e}`,style:Kae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${K8e}-${e}`,style:Kae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(qVt,{rfId:e})]})}const CL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:eo(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});CL.displayName="Panel";function KVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(CL,{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:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const GVt=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}},vj=e=>e.id;function XVt(e,t){return zs(e.selectedNodes.map(vj),t.selectedNodes.map(vj))&&zs(e.selectedEdges.map(vj),t.selectedEdges.map(vj))}function YVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=ir(GVt,XVt);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 ZVt=e=>!!e.onSelectionChangeHandlers;function JVt({onSelectionChange:e}){const t=ir(ZVt);return e||t?a.jsx(YVt,{onSelectionChange:e}):null}const G8e=[0,0],eHt={x:0,y:0,zoom:1},tHt=["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"],Gae=[...tHt,"rfId"],nHt=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}),Xae={translateExtent:oA,nodeOrigin:G8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=ir(nHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Xae,l()}),[]);const d=p.useRef(Xae);return p.useEffect(()=>{for(const f of Gae){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"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Wzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Gae.map(f=>e[f])),null}function Yae(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=Yae(),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=Yae())!=null&&i.matches?"dark":"light"}const Zae=typeof document<"u"?document:null;function fA(e=null,t={target:Zae,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`,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 z9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function V9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function hae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.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 H9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function q9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=_e("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(hae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(hae,{direction:"right"})})]})]})}function W9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Title,{children:t}),n?a.jsx(qn.Description,{children:n}):null,i?a.jsx(Rs,{error:i}):null,r?a.jsx(qn.ActionRow,{children:a.jsx(At,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function pae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=_e("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:Sh(s,t)}),a.jsx(Rs,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function K9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,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]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:LFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(bP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(z9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:MFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Nc(t),children:t.isShared?b("skillCenter.sharedSpace"):Nc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:Sh(n,i)})]})]}),a.jsx(rb,{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}),a.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?a.jsx(fl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Rs,{error:f})}):a.jsx(VW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(H9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Rs,{error:l})}):s.length>0?a.jsx(uL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:Q9t(w.content)}:w)}):a.jsx(W9t,{children:b("skillCenter.noSkillContent")})})]})})}function G9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=_e("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Nc(e),children:Nc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(bP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function X9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var Ut;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(()=>_Fe(v),[v]),[x,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,C]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,H]=p.useState([]),[q,U]=p.useState(1),[Z,z]=p.useState(0),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[le,V]=p.useState(!1),[Y,K]=p.useState(""),[ue,te]=p.useState("overview"),[Oe,fe]=p.useState(null),[pe,Se]=p.useState(null),[ve,Le]=p.useState(null),[He,Ge]=p.useState([]),[De,se]=p.useState(!1),[ce,ye]=p.useState(null),[Ae,Ee]=p.useState(null),[Ce,Be]=p.useState(!1),[he,ie]=p.useState(null),[we,Re]=p.useState(null),[Ue,_t]=p.useState(null),[Pt,Gt]=p.useState(0),[St,Lt]=p.useState(0),[qe,yt]=p.useState(""),[je,kt]=p.useState(""),[Tt,fn]=p.useState(null),[tn,We]=p.useState(r),vt=p.useRef(0),Ke=p.useRef(0),ot=p.useRef(!1),it=p.useRef(null),tt=p.useRef(null),Ct=p.useRef(null),Ot=p.useDeferredValue(I),Bt=p.useDeferredValue(Y),Dt=tn&&(_||tn.selectPublishSpace)?tn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((Ut=tn.source)==null?void 0:Ut.name)||u("skillCenter.skill")}):"",Ze=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Nc(_),bt=!(_!=null&&_.isShared)||_.canWrite===!0,gt=Dt||Ze||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(gt))},[n,o,gt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const an=p.useMemo(()=>{const Qe=Ot.trim().toLocaleLowerCase(),xt=h.filter(Qt=>!Qt.isShared);return Qe?xt.filter(Qt=>`${Nc(Qt)} ${Qt.name} ${Qt.description||""} ${Qt.projectName||""}`.toLocaleLowerCase().includes(Qe)):xt},[Ot,h]),Ft=p.useMemo(()=>{const Qe=Bt.trim().toLocaleLowerCase();return Qe?M.filter(xt=>`${xt.skillName} ${xt.skillDescription||""}`.toLocaleLowerCase().includes(Qe)):M},[Bt,M]),cn=(_==null?void 0:_.region)||nr(e);p.useEffect(()=>{if(!n||!_)return;const Qe=()=>Lt(Qt=>Qt+1),xt=()=>{document.visibilityState==="visible"&&Qe()};return window.addEventListener("focus",Qe),document.addEventListener("visibilitychange",xt),()=>{window.removeEventListener("focus",Qe),document.removeEventListener("visibilitychange",xt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Qe=_?`${cn}:${_.id}`:"";if(j.current!==Qe&&(j.current=Qe,y([]),k(null),Se(null)),O(null),E(!1),!n||!_||_.isShared)return;const xt=new AbortController;return E(!0),$pt({spaceId:_.id,region:cn,signal:xt.signal}).then(Qt=>{xt.signal.aborted||y(Qt.items)}).catch(Qt=>{xt.signal.aborted||O(Lr(Qt,u("skillCenter.reviewStatusFailed")))}).finally(()=>{xt.signal.aborted||E(!1)}),()=>xt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,St,n,i,u]);const Je=p.useMemo(()=>f.flatMap(Qe=>{var Qt;const xt=(Qt=R[Qe])==null?void 0:Qt.error;return xt?[{region:Qe,error:xt}]:[]}),[R,f]),lt=f.some(Qe=>{const xt=R[Qe];return!!(xt&&!xt.done&&!xt.error)}),hn=Je.length===f.length;p.useEffect(()=>{const Qe=new AbortController;return _M(Qe.signal).then(Ee).catch(()=>Ee({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Qe.abort()},[u]);const Sn=p.useCallback(async(Qe,xt)=>{var ts;if(ot.current||Qe.length===0)return;ot.current=!0,P(!0),xt&&((ts=it.current)==null||ts.abort(),m([]),C(Object.fromEntries(Qe.map(({region:ci})=>[ci,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Qt=new AbortController;it.current=Qt;const jn=++Ke.current,lr=await Promise.allSettled(Qe.map(async({region:ci,page:Ei})=>({region:ci,page:Ei,result:await Npt({region:ci,page:Ei,pageSize:L9t,signal:Qt.signal})})));if(Ke.current!==jn)return;const ta=lr.map((ci,Ei)=>{const $r=Qe[Ei];return ci.status==="rejected"?{request:$r,error:Lr(ci.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:$r,error:null,items:(ci.value.result.items||[]).map(na=>({...na,region:na.region||ci.value.region})),totalCount:ci.value.result.totalCount||0,scannedCount:ci.value.result.scannedCount??ci.value.result.items.length}}),Ms=ta.flatMap(ci=>ci.items);C(ci=>{const Ei={...ci};return ta.forEach(({request:$r,error:na,scannedCount:ns,totalCount:Il})=>{const fs=Ei[$r.region]||{nextPage:$r.page,loadedCount:0,done:!1,error:null};if(na){Ei[$r.region]={...fs,error:na};return}const ge=fs.loadedCount+ns;Ei[$r.region]={nextPage:$r.page+1,loadedCount:ge,done:ns===0||ge>=Il,error:null}}),Ei}),m(ci=>U9t(xt?[]:ci,Ms)),L(ci=>ci&&(Ms.find(Ei=>hu(Ei)===hu(ci))||ci)),ot.current=!1,P(!1)},[]),Ji=p.useCallback(()=>{if(ot.current)return;const Qe=f.flatMap(xt=>{const Qt=R[xt];return Qt&&!Qt.done&&!Qt.error?[{region:xt,page:Qt.nextPage}]:[]});Sn(Qe,!1)},[Sn,R,f]);p.useEffect(()=>{Nn(),L(null),H([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Qe=>({region:Qe,page:1})),!0),()=>{var Qe;Ke.current+=1,(Qe=it.current)==null||Qe.abort(),ot.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const Qe=Ct.current,xt=tt.current;if(!Qe||!xt||!lt||N)return;const Qt=new IntersectionObserver(([jn])=>{jn.isIntersecting&&Ji()},{root:xt,rootMargin:"240px 0px",threshold:.01});return Qt.observe(Qe),()=>Qt.disconnect()},[lt,Ji,N]);const Qn=()=>{const Qe=tt.current;!Qe||!lt||N||Qe.scrollHeight-Qe.scrollTop-Qe.clientHeight<=240&&Ji()};p.useEffect(()=>{if(!_){H([]),z(0),V(!1);return}let Qe=!0;return ne(!0),X(null),TIe(_.id,{region:cn,page:q,pageSize:dae,project:_.projectName}).then(xt=>{Qe&&(H(xt.items||[]),z(xt.totalCount||0),V(xt.degraded===!0))}).catch(xt=>{Qe&&(H([]),z(0),V(!1),X(Lr(xt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Qe&&ne(!1)}),()=>{Qe=!1}},[cn,_,q,St,u]);const _n=Qe=>{Nn(),L(Qe),te("overview"),U(1),K("")},pi=()=>{Nn(),L(null),H([]),z(0),V(!1),te("overview"),U(1),K(""),fn(null)},Nn=()=>{vt.current+=1,fe(null),Le(null),Ge([]),ye(null),se(!1)},Dn=async Qe=>{if(!_)return;const xt=Ey(Qe),Qt=vt.current+1;vt.current=Qt,fe(Qe),Le(null),ye(null),se(!0);try{const[jn,lr]=await Promise.all([Hpt(_.id,xt,Qe.version,cn,_.projectName,Qe.skillName,_.name),EIe({spaceId:_.id,skillId:xt,version:Qe.version,region:cn,skillSpaceName:_.name,skillName:Qe.skillName})]);vt.current===Qt&&(Le(jn),Ge(lr))}catch(jn){vt.current===Qt&&ye(Lr(jn,u("skillCenter.errors.loadSkillDetails")))}finally{vt.current===Qt&&se(!1)}},_i=Qe=>{if(_)return{kind:"skill-center",skillId:Ey(Qe),version:Qe.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Qe.skillName,description:Qe.skillDescription}},Fn=Qe=>{const xt=_i(Qe);!xt||!(Ae!=null&&Ae.enabled)||(Nn(),We({operation:"optimize",source:xt}))},Kn=async Qe=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Qe.skillName})))){yt(Qe.skillId),fn(null);try{await zpt({spaceId:_.id,skillId:Qe.skillId,region:cn}),Lt(xt=>xt+1),Gt(xt=>xt+1)}catch(xt){fn(Lr(xt,u("skillCenter.errors.deleteSkill")))}finally{yt("")}}},Rn=async Qe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Nc(Qe)})))return;const xt=hu(Qe);kt(xt),fn(null);try{await Bpt({spaceId:Qe.id,region:Qe.region||nr(e)}),_&&hu(_)===xt&&pi(),Gt(Qt=>Qt+1)}catch(Qt){fn(Lr(Qt,u("skillCenter.errors.deleteSpace")))}finally{kt("")}},nt=async(Qe,xt=Qe.version,Qt=!1)=>{var ta,Ms,ts,ci;if(!_||T.current)return;const jn=_,lr=`${jn.region}:${jn.id}:${Qe.skillId}:${xt}`;T.current=!0,b(lr),fn(null);try{const Ei=await Ppt({spaceId:jn.id,skillId:Qe.skillId,version:xt,region:jn.region||cn});((ta=F.current)==null?void 0:ta.id)===jn.id&&((Ms=F.current)==null?void 0:Ms.region)===jn.region&&y($r=>[...$r.filter(na=>na.id!==Ei.id),Ei])}catch(Ei){if(Qt)throw Lr(Ei,u("skillCenter.reviewFailed"));((ts=F.current)==null?void 0:ts.id)===jn.id&&((ci=F.current)==null?void 0:ci.region)===jn.region&&fn(Lr(Ei,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return tn&&(_||tn.selectPublishSpace)?a.jsx(h9t,{operation:tn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Qe=>!Qe.isShared),spacesLoading:N,initialIntent:tn.initialIntent,source:tn.source,onBack:()=>We(null),onPublished:()=>{Lt(Qe=>Qe+1),Gt(Qe=>Qe+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(dT,{className:"skillcenter-detail",title:Ze||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:pi,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>Lt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(yH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:Z})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?B9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>Lt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ze||_.name}),children:[a.jsx(ePe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:Z}),actions:a.jsxs(a.Fragment,{children:[a.jsx(em,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Qe=>K(Qe.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(At,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:J||A,onClick:()=>Lt(Qe=>Qe+1),children:u("common.refresh")})]})}),le?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,J&&M.length===0?a.jsx(fl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>Lt(Qe=>Qe+1)}}):Ft.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&bt?{label:u("skillCenter.localUpload"),onClick:()=>_t(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Ft.map(Qe=>{const xt=w.get(`${Qe.skillId}:${Qe.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Dn(Qe),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Qe.skillName,children:Qe.skillName}),Qe.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Qe.sourceVersion||Qe.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:LFe(Qe.skillDescription,u)}),_.isShared&&Qe.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Qe.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${F9t(Qe.skillStatus)}`,children:MFe(Qe.skillStatus,u)}),xt?a.jsx(QT,{status:xt.status}):null,xt!=null&&xt.reviewer||xt!=null&&xt.reviewedBy?a.jsx(QW,{compact:!0,person:xt.reviewer,fallback:xt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Dn(Qe),children:u("common.view")}),!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",onClick:()=>Se(Qe),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",disabled:A||S!==null||g!==null||xt!==void 0&&xt.status!=="returned",onClick:()=>void nt(Qe),children:g===`${_.region}:${_.id}:${Qe.skillId}:${Qe.version}`?u("skillCenter.reviewSubmitting"):u(xt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[xt.status]:"skillCenter.requestPublication")}):null,v.some(Qt=>Qt.sourceSkillId===Qe.skillId)?a.jsx("button",{type:"button",onClick:()=>k(Qe),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ae!=null&&Ae.enabled),children:a.jsx("button",{type:"button",disabled:!(Ae!=null&&Ae.enabled),onClick:()=>Fn(Qe),children:u("skillCenter.optimize")})}),!Qe.lookupByName&&bt?a.jsx("button",{type:"button",className:"is-danger",disabled:qe===Qe.skillId,onClick:()=>void Kn(Qe),children:qe===Qe.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Ey(Qe)}:${Qe.version}`)})})]})}),!Y.trim()&&!J&&!W&&Z>0?a.jsx(q9t,{page:q,total:Z,pageSize:dae,onPage:U}):null]})]})}],activeSectionKey:ue,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Qe=>te(Qe),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ie(_),children:u("skillCenter.editSpace")}),a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:je===hu(_),onClick:()=>void Rn(_),children:je===hu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),bt?a.jsx(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>_t(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ae!=null&&Ae.enabled),children:a.jsxs(At,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Ae!=null&&Ae.enabled),onClick:()=>We({operation:"create"}),children:[a.jsx(Mje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(em,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Qe=>D(Qe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,a.jsxs(tm,{className:"skillcenter-list-results",ref:tt,"aria-label":u("skillCenter.spaceList"),onScroll:Qn,children:[Je.length>0&&!hn?a.jsx(pae,{errors:Je,cloudProvider:e,onRetry:()=>Gt(Qe=>Qe+1)}):null,a.jsxs(zv,{children:[a.jsx(R9t,{region:t,active:n,revision:Pt+i,onOpen:_n},`${e}:${t}`),I.trim()?null:a.jsx(ab,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(V9t,{}),onClick:()=>Be(!0),children:u("skillCenter.newSpace")}),an.map(Qe=>{const xt=hu(Qe);return a.jsx(Hv,{className:"skillcenter-space-card",title:Nc(Qe),description:Qe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Qe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:zT(Qe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Re(Qe)},detailAction:{label:u("common.viewDetails"),onClick:()=>_n(Qe)}},xt)})]}),N&&h.length===0?a.jsx(fl,{}):hn&&h.length===0?a.jsx(pae,{errors:Je,cloudProvider:e,fullPage:!0,onRetry:()=>Gt(Qe=>Qe+1)}):an.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!hn&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Ct,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):lt?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Je.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),pe&&_?a.jsx(N9t,{skill:pe,space:_,region:cn,reviews:v.filter(Qe=>Qe.sourceSkillId===pe.skillId),onClose:()=>Se(null),onChanged:()=>Lt(Qe=>Qe+1),onSubmitReview:!_.isShared&&!A&&!S?Qe=>nt(pe,Qe,!0):void 0},`${cn}:${_.id}:${pe.skillId}`):null,x?a.jsx(j9t,{name:x.skillName,applications:v.filter(Qe=>Qe.sourceSkillId===x.skillId),onClose:()=>k(null)}):null,Oe&&_&&a.jsx(K9t,{skill:Oe,space:_,region:cn,cloudProvider:e,detail:ve,files:He,loading:De,error:ce,reviews:v.filter(Qe=>Qe.sourceSkillId===Oe.skillId),reviewsLoading:A,reviewsError:S,canOptimize:!_.isShared&&(Ae==null?void 0:Ae.enabled)===!0,onOptimize:()=>Fn(Oe),onDownload:()=>void Vpt({spaceId:_.id,skillId:Ey(Oe),version:Oe.version,region:cn,fallbackName:Oe.skillName,skillSpaceName:_.name,skillName:Oe.skillName}).catch(Qe=>ye(Lr(Qe,u("skillCenter.errors.downloadSkill")))),onClose:Nn}),Ce?a.jsx(I9t,{region:t,regionOptions:Pu(e),onClose:()=>Be(!1),onCreated:Qe=>{Be(!1),Gt(xt=>xt+1),L({...Qe,region:Qe.region||t})}}):null,he?a.jsx(P9t,{space:he,region:he.region||nr(e),onClose:()=>ie(null),onUpdated:Qe=>{const xt={...Qe,region:Qe.region||he.region||nr(e)};ie(null),L(Qt=>Qt&&hu(Qt)===hu(xt)?xt:Qt),m(Qt=>Qt.map(jn=>hu(jn)===hu(xt)?xt:jn)),Gt(Qt=>Qt+1)}}):null,we?a.jsx(G9t,{space:we,canUseSandbox:(Ae==null?void 0:Ae.enabled)===!0,onClose:()=>Re(null),onUpload:()=>{_t(we),Re(null)},onSandbox:()=>{const Qe=we;Re(null),_n(Qe),We({operation:"create"})}}):null,Ue?a.jsx(D9t,{space:Ue,region:Ue.region||nr(e),onClose:()=>_t(null),onUploaded:()=>{_t(null),Lt(Qe=>Qe+1),Gt(Qe=>Qe+1)}}):null]})}function Y9t(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 Z9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=_e("workspaceTools"),m=p.useMemo(()=>Y9t(f),[f]),g=f("library.tabs.skills"),b=ED(t)?t:nr(e),[v,y]=p.useState(b),[w,x]=p.useState(g),k=p.useRef(g),[S,O]=p.useState(!1),[A,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[C,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=cbt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,H=p.useMemo(()=>Pu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=k.current;x(W=>W===ne?g:W),k.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(X=>X.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await ybt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const X=new Set(W);return X.add(ne),X}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},Z=a.jsx(rb,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(sb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),J=n==="skills"?w!==g:n==="knowledge"&&S;return a.jsxs(Ch,{className:`library-view${J?" is-detail":""}`,"aria-label":f("library.title"),children:[J?null:a.jsx(Qv,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[A.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(X9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:Z,toolbarFilters:z("library-skills-region-filter")})}):null,A.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(d2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:O,toolbarLeading:Z,toolbarFilters:z("library-knowledge-region-filter")})}):null,A.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(mbt,{items:C,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?_o(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:vbt,onDelete:xbt,onDownload:wbt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:Z,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const $Fe="veadk_agentkit_connections",J9t=3e3,mae=6e4;function nf(){try{const e=localStorage.getItem($Fe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function fL(e){try{localStorage.setItem($Fe,JSON.stringify(e))}catch{}}function pf(e,t){return`agentkit:${e}:${t}`}function FFe(e){try{return new URL(e).host}catch{return e}}function kk(e){YAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)XAe(pf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function BFe(e,t,n,i,r,s,o,l){const c=nf(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,fL(c),kk(c),f}async function e7t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of UA(n))try{const g=await Xw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await E2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof V1)throw yP(e),g;if(g instanceof Ea&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw yP(e),u||new Ea(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=BFe(e,t,c,l,f,i,s,o);return pf(h.id,l[0])}function t7t(e){return new Promise(t=>window.setTimeout(t,e))}async function XN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await e7t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Ea)||!o.retryable||l>=mae)throw o;const c=Math.min(J9t,mae-l);await t7t(c)}}async function UFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await QA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||FFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...nf().filter(c=>c.base!==r),o];return fL(l),kk(l),o}function n7t(e){const t=nf().filter(n=>n.id!==e);return fL(t),kk(t),t}function yP(e){const t=nf().filter(n=>n.runtimeId!==e);return fL(t),kk(t),t}function QFe(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 o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:pf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:FFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const gae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:UFe,addRuntimeConnection:BFe,buildAgentEntries:QFe,connectRuntime:XN,loadConnections:nf,registerConnections:kk,remoteAppId:pf,removeConnection:n7t,removeRuntimeConnection:yP},Symbol.toStringTag,{value:"Module"}));function i7t({onAdded:e,onCancel:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(""),[s,o]=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 UFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(pf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Vi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const r7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,s7t={"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"},a7t={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",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function hL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?s7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!r7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?a7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function no(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function pL(){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}})}YN.prototype=pL.prototype={constructor:YN,on:function(e,t){var n=this._,i=l7t(e+"",n),r,s=-1,o=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)),yae.hasOwnProperty(t)?{space:yae[t],local:e}:e}function u7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function d7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zFe(e){var t=mL(e);return(t.local?d7t:u7t)(t)}function f7t(){}function qW(e){return e==null?f7t:function(){return this.querySelector(e)}}function h7t(e){typeof e!="function"&&(e=qW(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;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function $7t(e){e||(e=F7t);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 B7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function U7t(){return Array.from(this)}function Q7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?J7t:typeof t=="function"?tUt:eUt)(e,t,n??"")):O1(this.node(),e)}function O1(e,t){return e.style.getPropertyValue(t)||KFe(e).getComputedStyle(e,null).getPropertyValue(t)}function iUt(e){return function(){delete this[e]}}function rUt(e,t){return function(){this[e]=t}}function sUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function aUt(e,t){return arguments.length>1?this.each((t==null?iUt:typeof t=="function"?sUt:rUt)(e,t)):this.node()[e]}function GFe(e){return e.trim().split(/^|\s+/)}function WW(e){return e.classList||new XFe(e)}function XFe(e){this._node=e,this._names=GFe(e.getAttribute("class")||"")}XFe.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 YFe(e,t){for(var n=WW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function PUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,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:o,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}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function VUt(e){return!e.ctrlKey&&!e.button}function HUt(){return this.parentNode}function qUt(e,t){return t??{x:e.x,y:e.y}}function WUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function i8e(){var e=VUt,t=HUt,n=qUt,i=WUt,r={},s=pL("start","drag","end"),o=0,l,c,u,d,f=0;function h(k){k.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,zUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(k,S){if(!(d||!e.call(this,k,S))){var O=x(this,t.call(this,k,S),k,S,"mouse");O&&(Su(k.view).on("mousemove.drag",g,sA).on("mouseup.drag",b,sA),t8e(k.view),W$(k),u=!1,l=k.clientX,c=k.clientY,O("start",k))}}function g(k){if(Aw(k),!u){var S=k.clientX-l,O=k.clientY-c;u=S*S+O*O>f}r.mouse("drag",k)}function b(k){Su(k.view).on("mousemove.drag mouseup.drag",null),n8e(k.view,u),Aw(k),r.mouse("end",k)}function v(k,S){if(e.call(this,k,S)){var O=k.changedTouches,A=t.call(this,k,S),E=O.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fj(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=GUt.exec(e))?new Pc(t[1],t[2],t[3],1):(t=XUt.exec(e))?new Pc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=YUt.exec(e))?fj(t[1],t[2],t[3],t[4]):(t=ZUt.exec(e))?fj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=JUt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,1):(t=eQt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,t[4]):vae.hasOwnProperty(e)?kae(vae[e]):e==="transparent"?new Pc(NaN,NaN,NaN,0):null}function kae(e){return new Pc(e>>16&255,e>>8&255,e&255,1)}function fj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Pc(e,t,n,i)}function iQt(e){return e instanceof HT||(e=Ov(e)),e?(e=e.rgb(),new Pc(e.r,e.g,e.b,e.opacity)):new Pc}function _7(e,t,n,i){return arguments.length===1?iQt(e):new Pc(e,t,n,i??1)}function Pc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}KW(Pc,_7,r8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pc(Xy(this.r),Xy(this.g),Xy(this.b),wP(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:Oae,formatHex:Oae,formatHex8:rQt,formatRgb:Sae,toString:Sae}));function Oae(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}`}function rQt(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}${Iy((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sae(){const e=wP(this.opacity);return`${e===1?"rgb(":"rgba("}${Xy(this.r)}, ${Xy(this.g)}, ${Xy(this.b)}${e===1?")":`, ${e})`}`}function wP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Iy(e){return e=Xy(e),(e<16?"0":"")+e.toString(16)}function Eae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new af(e,t,n,i)}function s8e(e){if(e instanceof af)return new af(e.h,e.s,e.l,e.opacity);if(e instanceof HT||(e=Ov(e)),!e)return new af;if(e instanceof af)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),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new af(o,l,c,e.opacity)}function sQt(e,t,n,i){return arguments.length===1?s8e(e):new af(e,t,n,i??1)}function af(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}KW(af,sQt,r8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new af(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new af(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 Pc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new af(Cae(this.h),hj(this.s),hj(this.l),wP(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=wP(this.opacity);return`${e===1?"hsl(":"hsla("}${Cae(this.h)}, ${hj(this.s)*100}%, ${hj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cae(e){return e=(e||0)%360,e<0?e+360:e}function hj(e){return Math.max(0,Math.min(1,e||0))}function K$(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 gL=e=>()=>e;function a8e(e,t){return function(n){return e+n*t}}function aQt(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 Yhn(e,t){var n=t-e;return n?a8e(e,n>180||n<-180?n-360*Math.round(n/360):n):gL(isNaN(e)?t:e)}function oQt(e){return(e=+e)==1?o8e:function(t,n){return n-t?aQt(t,n,e):gL(isNaN(t)?n:t)}}function o8e(e,t){var n=t-e;return n?a8e(e,n):gL(isNaN(e)?t:e)}const kP=function e(t){var n=oQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=o8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function lQt(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[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Yf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Yf(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:Yf(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:Yf(u,f)},{i:b-2,x:Yf(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),o(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;--S1}function _ae(){Sv=(SP=lA.now())+bL,S1=SS=0;try{OQt()}finally{S1=0,EQt(),Sv=0}}function SQt(){var e=lA.now(),t=e-SP;t>d8e&&(bL-=t,SP=e)}function EQt(){for(var e,t=OP,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:OP=n);ES=e,R7(i)}function R7(e){if(!S1){SS&&(SS=clearTimeout(SS));var t=e-Sv;t>24?(e<1/0&&(SS=setTimeout(_ae,e-lA.now()-bL)),IO&&(IO=clearInterval(IO))):(IO||(SP=lA.now(),IO=setInterval(SQt,d8e)),S1=1,f8e(_ae))}}function jae(e,t,n){var i=new EP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var CQt=pL("start","end","cancel","interrupt"),AQt=[],p8e=0,Nae=1,I7=2,JN=3,Rae=4,P7=5,eR=6;function yL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;TQt(e,n,{name:t,index:i,group:r,on:CQt,tween:AQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:p8e})}function XW(e,t){var n=Nf(e,t);if(n.state>p8e)throw new Error("too late; already scheduled");return n}function Lh(e,t){var n=Nf(e,t);if(n.state>JN)throw new Error("too late; already running");return n}function Nf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function TQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=h8e(s,0,n.time);function s(u){n.state=Nae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Nae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===JN)return jae(o);m.state===Rae?(m.state=eR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function rzt(e,t,n){var i,r,s=izt(t)?XW:Lh;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function szt(e,t){var n=this._id;return arguments.length<2?Nf(this.node(),n).on.on(e):this.each(rzt(n,e,t))}function azt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ozt(){return this.on("end.remove",azt(this._id))}function lzt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function Izt(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 Tp(e,t,n){this.k=e,this.x=t,this.y=n}Tp.prototype={constructor:Tp,scale:function(e){return e===1?this:new Tp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Tp(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 vL=new Tp(1,0,0);y8e.prototype=Tp.prototype;function y8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function PO(e){e.preventDefault(),e.stopImmediatePropagation()}function Pzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dzt(){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 Iae(){return this.__zoom||vL}function Mzt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Lzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function $zt(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],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function v8e(){var e=Pzt,t=Dzt,n=$zt,i=Mzt,r=Lzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ZN,u=pL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",Iae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",Iae),P!==L?S(P,I,D,_):L.interrupt().each(function(){O(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?k(L):typeof D=="function"?D.apply(this,arguments):D,H=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,H),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,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),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,H=_==null?k(F):typeof _=="function"?_.apply(this,arguments):_;return n(vL.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),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Tp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Tp(P.k,_,L)}function k(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,I,D,_){P.on("start.zoom",function(){O(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=O(L,F).event(_),H=t.apply(L,F),q=D==null?k(H):typeof D=="function"?D.apply(L,F):D,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Z=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,J=c(Z.invert(q).concat(U/Z.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=J(ne),X=U/W[2];ne=new Tp(X,q[0]-W[0]*X,q[1]-W[1]*X)}M.zoom(null,ne)}})}function O(P,I,D){return!D&&P.__zooming||new A(P,I)}function A(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="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(P){var I=Su(this.that).datum();u.call(P,this.that,new Izt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=O(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=Jd(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],tR(this),D.start()}PO(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=O(this,I,!0).event(P),L=Su(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=Jd(P,D),M=P.clientX,H=P.clientY;t8e(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],tR(this),_.start();function q(Z){if(PO(Z),!_.moved){var z=Z.clientX-M,J=Z.clientY-H;_.moved=z*z+J*J>b}_.event(Z).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=Jd(Z,D),_.mouse[1]),_.extent,o))}function U(Z){L.on("mousemove.zoom mouseup.zoom",null),n8e(Z.view,_.moved),PO(Z),_.event(Z).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=Jd(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);PO(P),l>0?Su(this).transition().duration(l).call(S,M,_,P):Su(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=O(this,I,P.changedTouches.length===_).event(P),F,M,H,q;for(X$(P),M=0;M<_;++M)H=D[M],q=Jd(H,this),q=[q,this.__zoom.invert(q),H.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),tR(this),L.start())}}function C(P,...I){if(this.__zooming){var D=O(this,I).event(P),_=P.changedTouches,L=_.length,F,M,H,q;for(PO(P),F=0;F`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.`},cA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],x8e=["Enter"," ","Escape"],w8e={"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 E1;(function(e){e.Strict="strict",e.Loose="loose"})(E1||(E1={}));var Yy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yy||(Yy={}));var uA;(function(e){e.Partial="partial",e.Full="full"})(uA||(uA={}));const k8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var og;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(og||(og={}));var dA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(dA||(dA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const Pae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function O8e(e){return e===null?null:e?"valid":"invalid"}const S8e=e=>"id"in e&&"source"in e&&"target"in e,Fzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),qT=(e,t=[0,0])=>{const{width:n,height:i}=km(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Bzt=(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 o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):ZW(r)?r:t.nodeLookup.get(r.id));const l=o?CP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wL(n)},WT=(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=xL(n,CP(r)),i=!0)}),i?wL(n):{x:0,y:0,width:0,height:0}},JW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...Ok(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(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=fA(l,A1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},Uzt=(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 Qzt(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 zzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Qzt(e,o),c=WT(l),u=tK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function E8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",wf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Cv(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=Cv(f)?Ev(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",wf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Vzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=Uzt(o,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:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const C1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ev=(e={x:0,y:0},t,n)=>({x:C1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:C1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function C8e(e,t,n){const{width:i,height:r}=km(n),{x:s,y:o}=n.internals.positionAbsolute;return Ev(e,[[s,o],[s+i,o+r]],t)}const Dae=(e,t,n)=>en?-C1(Math.abs(e-n),1,t)/t:0,eK=(e,t,n=15,i=40)=>{const r=Dae(e.x,i,t.width-i)*n,s=Dae(e.y,i,t.height-i)*n;return[r,s]},xL=(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)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),wL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),A1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(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}},CP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(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)}},A8e=(e,t)=>wL(xL(D7(e),D7(t))),fA=(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)},Mae=e=>lf(e.width)&&lf(e.height)&&lf(e.x)&&lf(e.y),lf=e=>!isNaN(e)&&isFinite(e),T8e=(e,t)=>(n,i)=>{},KT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ok=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?KT(l,o):l},T1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function W0(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 Hzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=W0(e,n),r=W0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=W0(e.top??e.y??0,n),r=W0(e.bottom??e.y??0,n),s=W0(e.left??e.x??0,t),o=W0(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function qzt(e,t,n,i,r,s){const{x:o,y:l}=T1(e,[t,n,i]),{x:c,y:u}=T1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const tK=(e,t,n,i,r,s)=>{const o=Hzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=C1(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=qzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},hA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Cv(e){return e!=null&&e!=="parent"}function km(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 nK(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 _8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Lae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Wzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Kzt(e){return{...w8e,...e||{}}}function RE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=cf(e),l=Ok({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?KT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const iK=e=>({width:e.offsetWidth,height:e.offsetHeight}),j8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Gzt=["INPUT","SELECT","TEXTAREA"];function N8e(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:Gzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const R8e=e=>"clientX"in e,cf=(e,t)=>{var s,o;const n=R8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$ae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...iK(o)}})};function I8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.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 gj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Fae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-gj(t-i,s),n];case vn.Right:return[t+gj(i-t,s),n];case vn.Top:return[t,n-gj(n-r,s)];case vn.Bottom:return[t,n+gj(r-n,s)]}}function P8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Fae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Fae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=I8e({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 D8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Zzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Jzt=(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)),eVt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",wf.error006()),t;const i=n.getEdgeId||Zzt;let r;return S8e(e)?r={...e}:r={...e,id:i(e)},Jzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function M8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=D8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Bae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},tVt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function nVt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Bae[t],c=Bae[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=tVt({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,k]=D8e({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)*o,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)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);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 P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},O={x:d.x+w.x,y:d.y+w.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...O.x!==g[g.length-1].x||O.y!==g[g.length-1].y?[O]:[],n],b,v,x,k]}function iVt(e,t,n,i){const r=Math.min(Uae(e,t)/2,Uae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function sVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const L8e=1e3,aVt=10,rK={nodeOrigin:[0,0],nodeExtent:cA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},oVt={...rK,checkEquality:!0};function sK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function lVt(e,t,n){const i=sK(rK,n);for(const r of e.values())if(r.parentId)oK(r,e,t,i);else{const s=qT(r,i.nodeOrigin),o=Cv(r.extent)?r.extent:i.nodeExtent,l=Ev(s,o,km(r));r.internals.positionAbsolute=l}}function cVt(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 aK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=sK(oVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!aK(r.zIndexMode)?L8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=qT(h,r.nodeOrigin),b=Cv(h.extent)?h.extent:r.nodeExtent,v=Ev(g,b,km(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:cVt(h,m),z:$8e(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&&oK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function uVt(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 oK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=sK(rK,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}uVt(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*aVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!aK(c)?L8e:0,{x:h,y:m,z:g}=dVt(e,d,o,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 $8e(e,t,n){const i=lf(e.zIndex)?e.zIndex:0;return aK(n)?i:i+(e.selected?t:0)}function dVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=km(e),u=qT(e,n),d=Cv(e.extent)?Ev(u,e.extent,c):u;let f=Ev({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=C8e(f,c,t));const h=$8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function lK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??A1(c),d=A8e(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=km(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(k=>{e.some(S=>S.id===k.id)||r.push({id:k.id,type:"position",position:{x:k.position.x+m,y:k.position.y+g}})})),(f.width0){const m=lK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function hVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Hae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function F8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Hae("source",c,d,e,r,o),Hae("target",c,u,e,s,l),t.set(i.id,i)}}function B8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:B8e(n,t):!1}function qae(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 pVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!B8e(o,e))&&(o.draggable||t&&typeof o.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 Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.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 mVt({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},o=KT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function gVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=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:k,isSelectable:S,nodeId:O,nodeClickDistance:A=0}){h=Su(k);function E({x:C,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:H,updateNodePositions:q}=t();s={x:C,y:N};let U=!1;const Z=l.size>1,z=Z&&I?D7(WT(l)):null,J=Z&&_?mVt({dragItems:l,snapGrid:D,x:C,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let X={x:C-W.distance.x,y:N-W.distance.y};_&&(X=J?{x:Math.round(X.x+J.x),y:Math.round(X.y+J.y)}:KT(X,D));let le=null;if(Z&&I&&!W.extent&&z){const{positionAbsolute:K}=W.internals,ue=K.x-z.x+I[0][0],te=K.x+W.measured.width-z.x2+I[1][0],Oe=K.y-z.y+I[0][1],fe=K.y+W.measured.height-z.y2+I[1][1];le=[[ue,Oe],[te,fe]]}const{position:V,positionAbsolute:Y}=E8e({nodeId:ne,nextPosition:X,nodeLookup:P,nodeExtent:le||I,nodeOrigin:L,onError:H});U=U||W.position.x!==V.x||W.position.y!==V.y,W.position=V,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!O&&M))){const[ne,W]=Y$({nodeId:O,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),O||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:C,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=eK(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/C[2],s.y=(s.y??0)-_/C[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(C){var Z;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:q}=t();f=!0,(!F||!S)&&!P&&O&&((Z=N.get(O))!=null&&Z.selected||q()),S&&F&&O&&(e==null||e(O));const U=RE(C.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=pVt(N,I,U,O),l.size>0&&(n||M||!O&&H)){const[z,J]=Y$({nodeId:O,dragItems:l,nodeLookup:N});n==null||n(C.sourceEvent,l,z,J),M==null||M(C.sourceEvent,z,J),O||H==null||H(C.sourceEvent,J)}}const R=i8e().clickDistance(A).on("start",C=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=C.sourceEvent,P===0&&T(C),s=RE(C.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=cf(C.sourceEvent,d)}).on("drag",C=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=RE(C.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||O&&!L.has(O))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=cf(C.sourceEvent,d),H=M.x-u.x,q=M.y-u.y;Math.sqrt(H*H+q*q)>_&&T(C)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=cf(C.sourceEvent,d),E(F))}}).on("end",C=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!O&&D){const[_,L]=Y$({nodeId:O,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(C.sourceEvent,l,_,L),I==null||I(C.sourceEvent,_,L),O||D==null||D(C.sourceEvent,L)}}}).filter(C=>{const N=C.target;return!C.button&&(!w||!qae(N,`.${w}`,k))&&(!x||qae(N,x,k))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function bVt(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())fA(r,A1(s))>0&&i.push(s);return i}const yVt=250;function vVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=bVt(e,n,t+yVt);for(const u of o){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}=Av(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 U8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.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,...Av(o,c,c.position,!0)}:c}function Q8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function xVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const z8e=()=>!0;function wVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=z8e,onReconnectEnd:w,updateConnection:x,getTransform:k,getFromHandle:S,autoPanSpeed:O,dragThreshold:A=1,handleDomNode:E}){const j=j8e(e.target);let T=0,R;const{x:C,y:N}=cf(e),P=Q8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=U8e(r,P,i,c,t);if(!_)return;let L=cf(e,I),F=!1,M=null,H=!1,q=null;function U(){if(!d||!I)return;const[V,Y]=eK(L,I,O);h({x:V,y:Y}),T=requestAnimationFrame(U)}const Z={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:Av(z,Z,vn.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:z,to:L,toHandle:null,toPosition:Pae[Z.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}A===0&&W();function X(V){if(!D){const{x:fe,y:pe}=cf(V),Se=fe-C,ve=pe-N;if(!(Se*Se+ve*ve>A*A))return;W()}if(!S()||!Z){le(V);return}const Y=k();L=cf(V,I),R=vVt(Ok(L,Y,!1,[1,1]),n,c,Z),F||(U(),F=!0);const K=V8e(V,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=K.handleDomNode,M=K.connection,H=xVt(!!R,K.isValid);const ue=c.get(r),te=ue?Av(ue,Z,vn.Left,!0):ne.from,Oe={...ne,from:te,isValid:H,to:K.toHandle&&H?T1({x:K.toHandle.x,y:K.toHandle.y},Y):L,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:Pae[Z.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null,pointer:L};x(Oe),ne=Oe}function le(V){if(!("touches"in V&&V.touches.length>0)){if(D){(R||q)&&M&&H&&(b==null||b(M));const{inProgress:Y,...K}=ne,ue={...K,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(V,ue),s&&(w==null||w(V,ue))}m(),cancelAnimationFrame(T),F=!1,H=!1,M=null,q=null,j.removeEventListener("mousemove",X),j.removeEventListener("mouseup",le),j.removeEventListener("touchmove",X),j.removeEventListener("touchend",le)}}j.addEventListener("mousemove",X),j.addEventListener("mouseup",le),j.addEventListener("touchmove",X),j.addEventListener("touchend",le)}function V8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=z8e,nodeLookup:d}){const f=s==="target",h=t?o.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}=cf(e),b=o.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=Q8e(void 0,v),x=v.getAttribute("data-nodeid"),k=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),O=v.classList.contains("connectableend");if(!x||!w)return y;const A={source:f?x:i,sourceHandle:f?k:r,target:f?i:x,targetHandle:f?r:k};y.connection=A;const j=S&&O&&(n===E1.Strict?f&&w==="source"||!f&&w==="target":x!==i||k!==r);y.isValid=j&&u(A),y.toHandle=U8e(x,w,k,d,n,!0)}return y}const $7={onPointerDown:wVt,isValid:V8e};function kVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Su(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 k=n(),S=x.sourceEvent.ctrlKey&&hA()?10:1,O=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,A=k[2]*Math.pow(2,O*S);t.scaleTo(A)};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 k=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],O=[S[0]-b[0],S[1]-b[1]];b=S;const A=i()*Math.max(k[2],Math.log(k[2]))*(m?-1:1),E={x:k[0]-O[0]*A,y:k[1]-O[1]*A},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:k[2]},j,l)},w=v8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:Jd}}const kL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>vL.translate(e,t).scale(n),Vx=(e,t)=>e.target.closest(`.${t}`),H8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),OVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=OVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},q8e=e=>{const t=e.ctrlKey&&hA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Vx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=Jd(d),y=q8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===Yy.Vertical?0:d.deltaX*h,g=r===Yy.Horizontal?0:d.deltaY*h;!hA()&&d.shiftKey&&r!==Yy.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=kL(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 EVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Vx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function CVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=kL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.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 AVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&H8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,kL(s.transform)))}}function TVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&H8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=kL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function _Vt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,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"&&(Vx(f,`${u}-flow__node`)||Vx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Vx(f,l)&&g||Vx(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 jVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,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=v8e().scaleExtent([t,n]).translateExtent(i),h=Su(e).call(f);w({x:r.x,y:r.y,zoom:C1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(q8e);async function b(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).transform(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:C,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:H,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Z,onTransformChange:z,connectionInProgress:J,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const X=I&&!U&&!P;f.clickDistance(W?1/0:!lf(ne)||ne<0?0:ne);const le=X?SVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):EVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",le,{passive:!1});const V=CVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",V);const Y=AVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const K=TVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",K);const ue=_Vt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:H,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:C,noWheelClassName:R,lib:Z,connectionInProgress:J});f.filter(ue),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,C,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,C,N);return I&&await b(I),I}async function x(R,C){const N=Z$(R);return await b(N,C),N}function k(R){if(h){const C=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,C,null,{sync:!0}))}}function S(){const R=h?y8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function O(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleTo(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}async function A(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleBy(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const C=!lf(R)||R<0?0:R;f==null||f.clickDistance(C)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:S,scaleTo:O,scaleBy:A,setScaleExtent:E,setTranslateExtent:j,syncViewport:k,setClickDistance:T}}var _1;(function(e){e.Line="line",e.Handle="handle"})(_1||(_1={}));function NVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function Wae(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 Lm(e,t){return Math.max(0,t-e)}function $m(e,t){return Math.max(0,e-t)}function bj(e,t,n){return Math.max(0,t-e,e-n)}function Kae(e,t){return e?!t:t}function RVt(e,t,n,i,r,s,o,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:k,width:S,height:O,aspectRatio:A}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=S+(c?-E:E),R=O+(u?-j:j),C=-s[0]*S,N=-s[1]*O;let P=bj(T,b,v),I=bj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=Lm(x+E+C,o[0][0]):!c&&E>0&&(L=$m(x+T+C,o[1][0])),u&&j<0?F=Lm(k+j+N,o[0][1]):!u&&j>0&&(F=$m(k+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=$m(x+E,l[0][0]):!c&&E<0&&(L=Lm(x+T,l[1][0])),u&&j>0?F=$m(k+j,l[0][1]):!u&&j<0&&(F=Lm(k+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=bj(T/A,y,w)*A;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=$m(k+N+T/A,o[1][1])*A:F=Lm(k+N+(c?E:-E)/A,o[0][1])*A,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Lm(k+T/A,l[1][1])*A:F=$m(k+(c?E:-E)/A,l[0][1])*A,P=Math.max(P,F)}}if(f){const L=bj(R*A,b,v)/A;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=$m(x+R*A+C,o[1][0])/A:F=Lm(x+(u?j:-j)*A+C,o[0][0])/A,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Lm(x+R*A,l[1][0])/A:F=$m(x+(u?j:-j)*A,l[0][0])/A,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*A?j=(Kae(c,u)?-E:E)/A:E=(Kae(c,u)?-j:j)*A:d?(j=E/A,u=c):(E=j*A,c=u));const D=c?x+E:x,_=u?k+j:k;return{width:S+(c?-E:E),height:O+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const W8e={width:0,height:0,x:0,y:0},IVt={...W8e,pointerX:0,pointerY:0,aspectRatio:1};function PVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function DVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Su(e);let o={controlDirection:Wae("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={...W8e},w={...IVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Wae(u)};let x,k=null,S=[],O,A,E,j=!1;const T=i8e().on("start",R=>{const{nodeLookup:C,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=C.get(t),!x)return;k=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=RE(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:k});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:F,aspectRatio:y.width/y.height},O=void 0,A=Cv(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(O=C.get(x.parentId)),O&&x.extent==="parent"&&(A=[[0,0],[O.measured.width,O.measured.height]]),S=[],E=void 0;for(const[M,H]of C)if(H.parentId===t&&(S.push({id:M,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const q=PVt(H,x,H.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=RE(R.sourceEvent,{transform:C,snapGrid:N,snapToGrid:P,containerBounds:k}),_=[];if(!x)return;const{x:L,y:F,width:M,height:H}=y,q={},U=x.origin??I,{width:Z,height:z,x:J,y:ne}=RVt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,A,E),W=Z!==M,X=z!==H,le=J!==L&&W,V=ne!==F&&X;if(!le&&!V&&!W&&!X)return;if((le||V||U[0]===1||U[1]===1)&&(q.x=le?J:y.x,q.y=V?ne:y.y,y.x=q.x,y.y=q.y,S.length>0)){const te=J-L,Oe=ne-F;for(const fe of S)fe.position={x:fe.position.x-te+U[0]*(Z-M),y:fe.position.y-Oe+U[1]*(z-H)},_.push(fe)}if((W||X)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Z:y.width,q.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),O&&x.expandParent){const te=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const MVt={},Gae=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:()=>{(MVt?"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},LVt=e=>e?Gae(e):Gae,{useDebugValue:$Vt}=Pi,{useSyncExternalStoreWithSelector:FVt}=xnt,BVt=e=>e;function K8e(e,t=BVt,n){const i=FVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $Vt(i),i}const Xae=(e,t)=>{const n=LVt(e),i=(r,s=t)=>K8e(n,r,s);return Object.assign(i,n),i},UVt=(e,t)=>e?Xae(e,t):Xae;function zs(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 OL=p.createContext(null),QVt=OL.Provider,G8e=wf.error001("react");function or(e,t){const n=p.useContext(OL);if(n===null)throw new Error(G8e);return K8e(n,e,t)}function Vs(){const e=p.useContext(OL);if(e===null)throw new Error(G8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Yae={display:"none"},zVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},X8e="react-flow__node-desc",Y8e="react-flow__edge-desc",VVt="react-flow__aria-live",HVt=e=>e.ariaLiveMessage,qVt=e=>e.ariaLabelConfig;function WVt({rfId:e}){const t=or(HVt);return a.jsx("div",{id:`${VVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zVt,children:t})}function KVt({rfId:e,disableKeyboardA11y:t}){const n=or(qVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${X8e}-${e}`,style:Yae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${Y8e}-${e}`,style:Yae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(WVt,{rfId:e})]})}const SL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:no(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});SL.displayName="Panel";function GVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(SL,{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:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const XVt=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}},yj=e=>e.id;function YVt(e,t){return zs(e.selectedNodes.map(yj),t.selectedNodes.map(yj))&&zs(e.selectedEdges.map(yj),t.selectedEdges.map(yj))}function ZVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=or(XVt,YVt);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 JVt=e=>!!e.onSelectionChangeHandlers;function eHt({onSelectionChange:e}){const t=or(JVt);return e||t?a.jsx(ZVt,{onSelectionChange:e}):null}const Z8e=[0,0],tHt={x:0,y:0,zoom:1},nHt=["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"],Zae=[...nHt,"rfId"],iHt=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}),Jae={translateExtent:cA,nodeOrigin:Z8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function rHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=or(iHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Jae,l()}),[]);const d=p.useRef(Jae);return p.useEffect(()=>{for(const f of Zae){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"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Kzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Zae.map(f=>e[f])),null}function eoe(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function sHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=eoe(),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=eoe())!=null&&i.matches?"dark":"light"}const toe=typeof document<"u"?document:null;function pA(e=null,t={target:toe,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,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)??Zae,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)&&T8e(m))return!1;const b=eoe(m.code,l);if(s.current.add(m[b]),Jae(o,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=eoe(m.code,l);Jae(o,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 Jae(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function eoe(e,t){return t.includes(e)?"code":"key"}const sHt=()=>{const e=Vs();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:o}=e.getState();return o?(await o.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:o,panZoom:l}=e.getState(),c=tK(t,i,r,s,o,(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:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return wO(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=C1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function X8e(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 o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)aHt(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 aHt(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 Y8e(e,t){return X8e(e,t)}function Z8e(e,t){return X8e(e,t)}function vy(e,t){return{id:e,type:"select",selected:t}}function Vx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(vy(s.id,o)))}return i}function toe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function noe(e){return{id:e.id,type:"remove"}}const oHt=E8e();function lHt(e,t,n={}){return Jzt(e,t,{...n,onError:n.onError??oHt})}const ioe=e=>$zt(e),cHt=e=>w8e(e);function J8e(e){return p.forwardRef(e)}const uHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function roe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>dHt(()=>n(r=>r+BigInt(1))));return uHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function dHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const eBe=p.createContext(null);function fHt({children:e}){const t=Vs(),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=toe({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=roe(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(toe({items:m,lookup:h}))},[]),s=roe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(eBe.Provider,{value:o,children:e})}function hHt(){const e=p.useContext(eBe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pHt=e=>!!e.panZoom;function AL(){const e=sHt(),t=Vs(),n=hHt(),i=ir(pHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=ioe(f)?f:h.get(f.id),b=g.parentId?C8e(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 E1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&ioe(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&&cHt(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:o,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:k,edges:S}=await zzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),E=S.length>0,C=k.length>0;if(E){const j=S.map(noe);v==null||v(S),w(j)}if(C){const j=k.map(noe);b==null||b(k),y(j)}return(C||E)&&(x==null||x({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=Iae(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=E1(v?y:w),O=uA(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Iae(f)?f:c(f);if(!b)return!1;const v=uA(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 Fzt(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??qzt();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 soe=e=>e.selected,mHt=typeof window<"u"?window:void 0;function gHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=AL(),r=fA(e,{actInsideInputWithModifier:!1}),s=fA(t,{target:mHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(soe),edges:o.filter(soe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function bHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=iK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Sf.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 TL={position:"absolute",width:"100%",height:"100%",top:0,left:0},yHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=n0.Free,zoomOnDoubleClick:o=!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 k=Vs(),S=p.useRef(null),{userSelectionActive:E,lib:C,connectionInProgress:j}=ir(yHt,zs),T=fA(h),R=p.useRef();bHt(S);const A=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||k.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(S.current){R.current=_Vt({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>k.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=k.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[N,P,I],domNode:S.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:E,noWheelClassName:b,lib:C,onTransformChange:A,connectionInProgress:j,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,E,b,C,A,j,O,x]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:TL,children:g})}const xHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function wHt(){const{userSelectionActive:e,userSelectionRect:t}=ir(xHt,zs);return e&&t?a.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 t6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function kHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=lA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:k,panBy:S,autoPanSpeed:E}=ir(OHt,zs),C=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),A=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||k){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var se,me;const{domNode:X,transform:V}=y.getState();if(T.current=X==null?void 0:X.getBoundingClientRect(),!T.current)return;const ae=W.target===j.current;if(!ae&&!!W.target.closest(".nokey")||!e||!(o&&ae||t)||W.button!==0||!W.isPrimary)return;(me=(se=W.target)==null?void 0:se.setPointerCapture)==null||me.call(se,W.pointerId),N.current=!1;const{x:te,y:ue}=ff(W.nativeEvent,T.current),fe=wO({x:te,y:ue},V);y.setState({userSelectionRect:{width:0,height:0,startX:fe.x,startY:fe.y,x:te,y:ue}}),ae||(W.stopPropagation(),W.preventDefault())};function H(W,X){const{userSelectionRect:V}=y.getState();if(!V)return;const{transform:ae,nodeLookup:Y,edgeLookup:K,connectionLookup:te,triggerNodeChanges:ue,triggerEdgeChanges:fe,defaultEdgeOptions:se}=y.getState(),me={x:V.startX,y:V.startY},{x:Ee,y:xe}=C1(me,ae),Ne={startX:me.x,startY:me.y,x:Wre.id)),A.current=new Set;const Re=(se==null?void 0:se.selectable)??!0;for(const re of R.current){const ce=te.get(re);if(ce)for(const{edgeId:ve}of ce.values()){const Se=K.get(ve);Se&&(Se.selectable??Re)&&A.current.add(ve)}}if(!Pae(We,R.current)){const re=Vx(Y,R.current,!0);ue(re)}if(!Pae(Xe,A.current)){const re=Vx(K,A.current);fe(re)}y.setState({userSelectionRect:Ne,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,X]=eK(P.current,T.current,E);S({x:W,y:X}).then(V=>{if(!N.current||!V){v.current=requestAnimationFrame(q);return}const{x:ae,y:Y}=P.current;H(ae,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const Z=W=>{const{userSelectionRect:X,transform:V,resetSelectedElements:ae}=y.getState();if(!T.current||!X)return;const{x:Y,y:K}=ff(W.nativeEvent,T.current);P.current={x:Y,y:K};const te=C1({x:X.startX,y:X.startY},V);if(!N.current){const ue=t?0:s;if(Math.hypot(Y-te.x,K-te.y)<=ue)return;ae(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),H(Y,K)},z=W=>{var X,V;W.button===0&&((V=(X=W.target)==null?void 0:X.releasePointerCapture)==null||V.call(X,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},J=W=>{var X,V;(V=(X=W.target)==null?void 0:X.releasePointerCapture)==null||V.call(X,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:eo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:C?void 0:t6(D,j),onContextMenu:t6(_,j),onWheel:t6(L,j),onPointerEnter:C?void 0:h,onPointerMove:C?Z:m,onPointerUp:C?z:void 0,onPointerCancel:C?J:void 0,onPointerDownCapture:C?M:void 0,onClickCapture:C?F:void 0,onPointerLeave:g,ref:j,style:TL,children:[b,a.jsx(wHt,{})]})}function B7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Sf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function tBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=mVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{B7({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:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const SHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function nBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=SHt(o),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=HT(w,s));const{position:x,positionAbsolute:O}=O8e({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 cK=p.createContext(null),EHt=cK.Provider;cK.Consumer;const iBe=()=>p.useContext(cK),CHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),AHt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,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===k1.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 THt({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=iBe(),{connectOnClick:w,noPanClassName:x,rfId:O}=ir(CHt,zs),{connectingFrom:k,connectingTo:S,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=ir(AHt(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",Sf.error010());const A=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),H={...L,..._};if(M){const{edges:q,setEdges:U,onError:Z}=v.getState();U(lHt(H,q,{onError:Z}))}F==null||F(H),l==null||l(H)},N=_=>{if(!y)return;const L=_8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();F7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var H,q;return(q=(H=v.getState()).onConnectEnd)==null?void 0:q.call(H,...M)},updateConnection:F.updateConnection,onConnect:A,isValidConnection:n||((...M)=>{var H,q;return((q=(H=v.getState()).isValidConnection)==null?void 0:q.call(H,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:H,isValidConnection:q,lib:U,rfId:Z,nodeLookup:z,connection:J}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=A8e(_.target),W=n||q,{connection:X,isValid:V}=F7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:Z,doc:ne,lib:U,nodeLookup:z});V&&X&&A(X);const ae=structuredClone(J);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,F==null||F(_,ae),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:eo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:S,valid:R,connectionindicator:i&&(!j||C)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const Fc=p.memo(J8e(THt));function _Ht({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Fc,{type:"source",position:n,isConnectable:t})]})}function jHt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Fc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Fc,{type:"source",position:i,isConnectable:t})]})}function NHt(){return null}function RHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Fc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _P={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},aoe={input:_Ht,default:jHt,output:RHt,group:NHt};function IHt(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 PHt=e=>{const{width:t,height:n,x:i,y:r}=VT(e.nodeLookup,{filter:s=>!!s.selected});return{width:df(t)?t:null,height:df(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 DHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=ir(PHt,zs),c=nBe(),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(tBe({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(_P,m.key)&&(m.preventDefault(),c({direction:_P[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:eo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.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 ooe=typeof window<"u"?window:void 0,MHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function rBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,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:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:C,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:H,userSelectionActive:q}=ir(MHt,zs),U=fA(u,{target:ooe}),Z=fA(b,{target:ooe}),z=Z||C,J=Z||O,ne=d&&z!==!0,W=U||q||ne;return gHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(vHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:J,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(kHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&a.jsx(DHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}rBe.displayName="FlowRenderer";const LHt=p.memo(rBe),$Ht=e=>t=>e?JW(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 FHt(e){return ir(p.useCallback($Ht(e),[e]),zs)}const BHt=e=>e.updateNodeInternals;function UHt(){const e=ir(BHt),[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 QHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=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||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.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 zHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,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:k}=ir(W=>{const X=W.nodeLookup.get(e),V=W.parentLookup.has(e);return{node:X,internals:X.internals,isParent:V}},zs);let S=x.type||"default",E=(v==null?void 0:v[S])||aoe[S];E===void 0&&(w==null||w("003",Sf.error003(S)),S="default",E=(v==null?void 0:v.default)||aoe.default);const C=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),A=Vs(),N=nK(x),P=QHt({node:x,nodeType:S,hasDimensions:N,resizeObserver:f}),I=tBe({nodeRef:P,disabled:x.hidden||!C,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=nBe();if(x.hidden)return null;const _=wm(x),L=IHt(x),F=j||C||t||n||i||r,M=n?W=>n(W,{...O.userNode}):void 0,H=i?W=>i(W,{...O.userNode}):void 0,q=r?W=>r(W,{...O.userNode}):void 0,U=s?W=>s(W,{...O.userNode}):void 0,Z=o?W=>o(W,{...O.userNode}):void 0,z=W=>{const{selectNodesOnDrag:X,nodeDragThreshold:V}=A.getState();j&&(!X||!C||V>0)&&B7({id:e,store:A,nodeRef:P}),t&&t(W,{...O.userNode})},J=W=>{if(!(T8e(W.nativeEvent)||g)){if(b8e.includes(W.key)&&j){const X=W.key==="Escape";B7({id:e,store:A,unselect:X,nodeRef:P})}else if(C&&x.selected&&Object.prototype.hasOwnProperty.call(_P,W.key)){W.preventDefault();const{ariaLabelConfig:X}=A.getState();A.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:_P[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var te;if(g||!((te=P.current)!=null&&te.matches(":focus-visible")))return;const{transform:W,width:X,height:V,autoPanOnNodeFocus:ae,setCenter:Y}=A.getState();if(!ae)return;JW(new Map([[e,x]]),{x:0,y:0,width:X,height:V},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:eo(["react-flow__node",`react-flow__node-${S}`,{[m]:C},x.className,{selected:x.selected,selectable:j,parent:k,draggable:C,dragging:I}]),ref:P,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:H,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:Z,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${W8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(EHt,{value:e,children:a.jsx(E,{id:e,data:x.data,type:S,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:C,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,..._})})})}var VHt=p.memo(zHt);const HHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=ir(HHt,zs),o=FHt(e.onlyRenderVisibleElements),l=UHt();return a.jsx("div",{className:"react-flow__nodes",style:TL,children:o.map(c=>a.jsx(VHt,{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))})}sBe.displayName="NodeRenderer";const qHt=p.memo(sBe);function WHt(e){return ir(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),o=n.nodeLookup.get(r.target);s&&o&&Xzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const KHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},GHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},loe={[cA.Arrow]:KHt,[cA.ArrowClosed]:GHt};function XHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(loe,e)?loe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Sf.error009(e)),null)},[e])}const YHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=XHt(t);return c?a.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:a.jsx(c,{color:n,strokeWidth:o})}):null},aBe=({defaultColor:e,rfId:t})=>{const n=ir(s=>s.edges),i=ir(s=>s.defaultEdgeOptions),r=p.useMemo(()=>rVt(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?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(YHt,{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};aBe.displayName="MarkerDefinitions";var ZHt=p.memo(aBe);function oBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=eo(["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?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}oBe.displayName="EdgeText";const JHt=p.memo(oBe);function qT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:eo(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&df(t)&&df(n)?a.jsx(JHt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function coe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function lBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=coe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=coe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=j8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function cBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,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]=lBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return a.jsx(qT,{id:k,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 eqt=cBe({isInternal:!1}),uBe=cBe({isInternal:!0});eqt.displayName="SimpleBezierEdge";uBe.displayName="SimpleBezierEdgeInternal";function dBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=TP({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}),S=e.isInternal?void 0:t;return a.jsx(qT,{id:S,path:x,labelX:O,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const fBe=dBe({isInternal:!1}),hBe=dBe({isInternal:!0});fBe.displayName="SmoothStepEdge";hBe.displayName="SmoothStepEdgeInternal";function pBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(fBe,{...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 tqt=pBe({isInternal:!1}),mBe=pBe({isInternal:!0});tqt.displayName="StepEdge";mBe.displayName="StepEdgeInternal";function gBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=I8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(qT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const nqt=gBe({isInternal:!1}),bBe=gBe({isInternal:!0});nqt.displayName="StraightEdge";bBe.displayName="StraightEdgeInternal";function yBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.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,k]=N8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return a.jsx(qT,{id:S,path:x,labelX:O,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const iqt=yBe({isInternal:!1}),vBe=yBe({isInternal:!0});iqt.displayName="BezierEdge";vBe.displayName="BezierEdgeInternal";const uoe={default:vBe,straight:bBe,step:mBe,smoothstep:hBe,simplebezier:uBe},doe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},rqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,sqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,foe="react-flow__edgeupdater";function hoe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:eo([foe,`${foe}-${l}`]),cx:rqt(t,i,e),cy:sqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function aqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:C,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:A,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=k.type==="target",L=(H,q)=>{h(!1),f==null||f(H,n,k.type,q)},F=H=>u==null?void 0:u(n,H),M=(H,q)=>{h(!0),d==null||d(O,n,k.type),R==null||R(H,q)};F7.onPointerDown(O.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:j,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:k.type,lib:T,flowId:P,cancelConnection:A,panBy:I,isValidConnection:(...H)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...H))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...H)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...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 a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(hoe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(hoe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function oqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,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=ir(Y=>Y.edgeLookup.get(e));const O=ir(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let k=x.type||"default",S=(b==null?void 0:b[k])||uoe[k];S===void 0&&(y==null||y("011",Sf.error011(k)),k="default",S=(b==null?void 0:b.default)||uoe.default);const E=!!(x.focusable||t&&typeof x.focusable>"u"),C=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,A]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q}=ir(p.useCallback(Y=>{const K=Y.nodeLookup.get(x.source),te=Y.nodeLookup.get(x.target);if(!K||!te)return{zIndex:x.zIndex,...doe};const ue=iVt({id:e,sourceNode:K,targetNode:te,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Gzt({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:te,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ue||doe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${L7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),Z=p.useMemo(()=>x.markerEnd?`url('#${L7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var fe;const{addSelectedEdges:K,unselectNodesAndEdges:te,multiSelectionActive:ue}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&ue?(te({nodes:[],edges:[x]}),(fe=T.current)==null||fe.blur()):K([e])),r&&r(Y,x)},J=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,X=c?Y=>{c(Y,{...x})}:void 0,V=u?Y=>{u(Y,{...x})}:void 0,ae=Y=>{var K;if(!w&&b8e.includes(Y.key)&&j){const{unselectNodesAndEdges:te,addSelectedEdges:ue}=I.getState();Y.key==="Escape"?((K=T.current)==null||K.blur(),te({edges:[x]})):ue([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:eo(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:J,onContextMenu:ne,onMouseEnter:W,onMouseMove:X,onMouseLeave:V,onKeyDown:E?ae:void 0,tabIndex:E?0:void 0,role:x.ariaRole??(E?"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":E?`${K8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),C&&a.jsx(aqt,{edge:x,isReconnectable:C,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,setUpdateHover:A,setReconnecting:P})]})})}var lqt=p.memo(oqt);const cqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,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}=ir(cqt,zs),O=WHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(ZHt,{defaultColor:e,rfId:n}),O.map(k=>a.jsx(lqt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},k))]})}xBe.displayName="EdgeRenderer";const uqt=p.memo(xBe),dqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fqt({children:e}){const t=ir(dqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function hqt(e){const t=AL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const pqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function mqt(e){const t=ir(pqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function gqt(e){return e.connection.inProgress?{...e.connection,to:wO(e.connection.to,e.transform)}:{...e.connection}}function bqt(e){return gqt}function yqt(e){const t=bqt();return ir(t,zs)}const vqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=ir(vqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:eo(["react-flow__connection",x8e(l)]),children:a.jsx(wBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const wBe=({style:e,type:t=cg.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=yqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:x8e(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 cg.Bezier:[g]=N8e(b);break;case cg.SimpleBezier:[g]=lBe(b);break;case cg.Step:[g]=TP({...b,borderRadius:0});break;case cg.SmoothStep:[g]=TP(b);break;default:[g]=I8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};wBe.displayName="ConnectionLine";const wqt={};function poe(e=wqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function Oqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function OBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,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:k,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:X,onPaneContextMenu:V,paneClickDistance:ae,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ue,onEdgeMouseLeave:fe,reconnectRadius:se,onReconnect:me,onReconnectStart:Ee,onReconnectEnd:xe,noDragClassName:Ne,noWheelClassName:We,noPanClassName:Xe,disableKeyboardA11y:Re,nodeExtent:re,rfId:ce,viewport:ve,onViewportChange:Se}){return poe(e),poe(t),Oqt(),hqt(n),mqt(ve),a.jsx(LHt,{onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:V,onPaneScroll:X,paneClickDistance:ae,deleteKeyCode:C,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Ne,noWheelClassName:We,noPanClassName:Xe,disableKeyboardA11y:Re,onViewportChange:Se,isControlledViewport:!!ve,children:a.jsxs(fqt,{children:[a.jsx(uqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:me,onReconnectStart:Ee,onReconnectEnd:xe,onlyRenderVisibleElements:j,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ue,onEdgeMouseLeave:fe,reconnectRadius:se,defaultMarkerColor:D,noPanClassName:Xe,disableKeyboardA11y:Re,rfId:ce}),a.jsx(xqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(qHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Xe,noDragClassName:Ne,disableKeyboardA11y:Re,nodeExtent:re,rfId:ce}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}OBe.displayName="GraphView";const kqt=p.memo(OBe),Sqt=E8e(),moe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,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??oA;M8e(b,v,y);const{nodesInitialized:k}=$7(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let S=[0,0,1];if(o&&r&&s){const E=VT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:C,y:j,zoom:T}=tK(E,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[C,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:w,nodesInitialized:k,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:oA,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:k1.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Sqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:y8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Eqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>BVt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:k,minZoom:S,maxZoom:E}=g();y&&(await Qzt({nodes:v,width:O,height:k,panZoom:y,minZoom:S,maxZoom:E},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...moe({nodes:e,edges:t,width:r,height:s,fitView:o,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:k,zIndexMode:S,nodesSelectionActive:E}=g(),{nodesInitialized:C,hasSelectedNodes:j}=$7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:S}),T=E&&j;k&&C?(b(),m({nodes:v,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:C,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();M8e(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:k,nodeExtent:S,debug:E,fitViewQueued:C,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=dVt(v,w,x,O,k,S,j);R&&(oVt(w,x,{nodeOrigin:k,nodeExtent:S,zIndexMode:j}),C?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(E&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:k,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:C}=g();for(const[j,T]of v){const R=O.get(j),A=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:A?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&S.inProgress&&S.fromNode.id===R.id){const P=R0(R,S.fromHandle,vn.Left,!0);E({...S,from:P})}A&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=lK(w,O,j,T);x.push(...R)}for(const j of C.values())x=j(x);k(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Y8e(v,x);w(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Z8e(v,x);w(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>vy(E,!0));O(S);return}O(Vx(x,new Set([...v]),!0)),k(Vx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>vy(E,!0));k(S);return}k(Vx(w,new Set([...v]))),O(Vx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),E=v||x,C=y||w,j=[];for(const R of E){if(!R.selected)continue;const A=O.get(R.id);A&&(A.selected=!1),j.push(vy(R.id,!1))}const T=[];for(const R of C)R.selected&&T.push(vy(R.id,!1));k(j),S(T)},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 k=y.reduce((E,C)=>C.selected?[...E,vy(C.id,!1)]:E,[]),S=v.reduce((E,C)=>C.selected?[...E,vy(C.id,!1)]:E,[]);w(k),x(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:E}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||($7(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:k}=g();return fVt({delta:v,panZoom:O,transform:y,translateExtent:k,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:k,panZoom:S}=g();if(!S)return!1;const E=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await S.setViewport({x:x/2-v*E,y:O/2-y*E,zoom:E},{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:{...v8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...moe()})}},Object.is);function kBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>Eqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(UVt,{value:g,children:a.jsx(fHt,{children:m})})}function Cqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(EL)?a.jsx(a.Fragment,{children:e}):a.jsx(kBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Aqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Tqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,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:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:H,connectionLineType:q=cg.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:X=lA.Full,panActivationKeyCode:V="Space",multiSelectionKeyCode:ae=dA()?"Meta":"Control",zoomActivationKeyCode:Y=dA()?"Meta":"Control",snapToGrid:K,snapGrid:te,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:fe,nodesDraggable:se,autoPanOnNodeFocus:me,nodesConnectable:Ee,nodesFocusable:xe,nodeOrigin:Ne=G8e,edgesFocusable:We,edgesReconnectable:Xe,elementsSelectable:Re=!0,defaultViewport:re=eHt,minZoom:ce=.5,maxZoom:ve=2,translateExtent:Se=oA,preventScrolling:oe=!0,nodeExtent:$e,defaultMarkerColor:Ue="#b1b1b7",zoomOnScroll:be=!0,zoomOnPinch:ke=!0,panOnScroll:Ae=!1,panOnScrollSpeed:He=.5,panOnScrollMode:Qe=n0.Free,zoomOnDoubleClick:jt=!0,panOnDrag:Pt=!0,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:_e,paneClickDistance:Ot=1,nodeClickDistance:Nt=0,children:Yt,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At=10,onNodesChange:It,onEdgesChange:Gt,noDragClassName:Ye="nodrag",noWheelClassName:wt="nowheel",noPanClassName:vt="nopan",fitView:tn,fitViewOptions:Qt,connectOnClick:un,attributionPosition:De,proOptions:on,defaultEdgeOptions:On,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:zi=!1,disableKeyboardA11y:dn=!1,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanOnSelection:ei=!0,autoPanSpeed:Bn,connectionRadius:ki,isValidConnection:zn,onError:Rn,style:di,id:rt,nodeDragThreshold:zt,connectionDragThreshold:ze,viewport:bt,onViewportChange:Ht,width:_n,height:jr,colorMode:Hs="light",debug:qs,onScroll:Dr,ariaLabelConfig:ti,zIndexMode:Si="basic",...Zr},Jr){const ga=rt||"1",go=rHt(Hs),us=p.useCallback(ge=>{ge.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(ge)},[Dr]);return a.jsx("div",{"data-testid":"rf__wrapper",...Zr,onScroll:us,style:{...di,...Aqt},ref:Jr,className:eo(["react-flow",r,go]),id:rt,role:"application",children:a.jsxs(Cqt,{nodes:e,edges:t,width:_n,height:jr,fitView:tn,fitViewOptions:Qt,minZoom:ce,maxZoom:ve,nodeOrigin:Ne,nodeExtent:$e,zIndexMode:Si,children:[a.jsx(iHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:se,autoPanOnNodeFocus:me,nodesConnectable:Ee,nodesFocusable:xe,edgesFocusable:We,edgesReconnectable:Xe,elementsSelectable:Re,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:zi,minZoom:ce,maxZoom:ve,nodeExtent:$e,onNodesChange:It,onEdgesChange:Gt,snapToGrid:K,snapGrid:te,connectionMode:H,translateExtent:Se,connectOnClick:un,defaultEdgeOptions:On,fitView:tn,fitViewOptions:Qt,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:vt,nodeOrigin:Ne,rfId:ga,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanSpeed:Bn,onError:Rn,connectionRadius:ki,isValidConnection:zn,selectNodesOnDrag:fe,nodeDragThreshold:zt,connectionDragThreshold:ze,onBeforeDelete:M,debug:qs,ariaLabelConfig:ti,zIndexMode:Si}),a.jsx(kqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:X,deleteKeyCode:J,multiSelectionKeyCode:ae,panActivationKeyCode:V,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ue,defaultViewport:re,translateExtent:Se,minZoom:ce,maxZoom:ve,preventScrolling:oe,zoomOnScroll:be,zoomOnPinch:ke,zoomOnDoubleClick:jt,panOnScroll:Ae,panOnScrollSpeed:He,panOnScrollMode:Qe,panOnDrag:Pt,autoPanOnSelection:ei,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:_e,paneClickDistance:Ot,nodeClickDistance:Nt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At,defaultMarkerColor:Ue,noDragClassName:Ye,noWheelClassName:wt,noPanClassName:vt,rfId:ga,disableKeyboardA11y:dn,nodeExtent:$e,viewport:bt,onViewportChange:Ht}),a.jsx(JVt,{onSelectionChange:N}),Yt,a.jsx(KVt,{proOptions:on,position:De}),a.jsx(WVt,{rfId:ga,disableKeyboardA11y:dn})]})})}var _qt=J8e(Tqt);const jqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nqt({children:e}){const t=ir(jqt);return t?yi.createPortal(e,t):null}function Rqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Y8e(r,s)),[]);return[t,n,i]}function Iqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Z8e(r,s)),[]);return[t,n,i]}const Pqt=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||!nK(n.userNode))return!1;return!0};function Dqt(e={includeHiddenNodes:!1}){return ir(Pqt(e))}function Mqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:eo(["react-flow__background-pattern",n,i])})}function Lqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:eo(["react-flow__background-pattern","dots",t])})}var Ug;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ug||(Ug={}));const $qt={[Ug.Dots]:1,[Ug.Lines]:1,[Ug.Cross]:6},Fqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function SBe({id:e,variant:t=Ug.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=ir(Fqt,zs),g=i||$qt[t],b=t===Ug.Dots,v=t===Ug.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],k=v?[x,x]:w,S=[O[0]*h[2]||1+k[0]/2,O[1]*h[2]||1+k[1]/2],E=`${m}${e||""}`;return a.jsxs("svg",{className:eo(["react-flow__background",u]),style:{...c,...TL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:E,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?a.jsx(Lqt,{radius:x/2,className:d}):a.jsx(Mqt,{dimensions:k,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}SBe.displayName="Background";const Bqt=p.memo(SBe);function Uqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 Vqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 Hqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 xj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:eo(["react-flow__controls-button",t]),...n,children:e})}const qqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function EBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=ir(qqt,zs),{zoomIn:x,zoomOut:O,fitView:k}=AL(),S=()=>{x(),s==null||s()},E=()=>{O(),o==null||o()},C=()=>{k(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(CL,{className:eo(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(xj,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Uqt,{})}),a.jsx(xj,{onClick:E,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Qqt,{})})]}),n&&a.jsx(xj,{className:"react-flow__controls-fitview",onClick:C,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(zqt,{})}),i&&a.jsx(xj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(Hqt,{}):a.jsx(Vqt,{})}),d]})}EBe.displayName="Controls";const Wqt=p.memo(EBe);function Kqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:eo(["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 Gqt=p.memo(Kqt),Xqt=e=>e.nodes.map(t=>t.id),n6=e=>e instanceof Function?e:()=>e;function Yqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Gqt,onClick:o}){const l=ir(Xqt,zs),c=n6(t),u=n6(e),d=n6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(Jqt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Zqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=ir(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}=wm(v);return{node:v,x:y,y:w,width:x,height:O}},zs);return!u||u.hidden||!nK(u)?null:a.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:o,onClick:c,id:u.id})}const Jqt=p.memo(Zqt);var eWt=p.memo(Yqt);const tWt=200,nWt=150,iWt=e=>!e.hidden,rWt=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?S8e(VT(e.nodeLookup,{filter:iWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},sWt="react-flow__minimap-desc";function CBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,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 k=Vs(),S=p.useRef(null),{boundingRect:E,viewBB:C,rfId:j,panZoom:T,translateExtent:R,flowWidth:A,flowHeight:N,ariaLabelConfig:P}=ir(rWt,zs),I=(e==null?void 0:e.width)??tWt,D=(e==null?void 0:e.height)??nWt,_=E.width/I,L=E.height/D,F=Math.max(_,L),M=F*I,H=F*D,q=O*F,U=E.x-(M-E.width)/2-q,Z=E.y-(H-E.height)/2-q,z=M+q*2,J=H+q*2,ne=`${sWt}-${j}`,W=p.useRef(0),X=p.useRef();W.current=F,p.useEffect(()=>{if(S.current&&T)return X.current=wVt({domNode:S.current,panZoom:T,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var K;(K=X.current)==null||K.destroy()}},[T]),p.useEffect(()=>{var K;(K=X.current)==null||K.update({translateExtent:R,width:A,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,A,N]);const V=m?K=>{var fe;const[te,ue]=((fe=X.current)==null?void 0:fe.pointer(K))||[0,0];m(K,{x:te,y:ue})}:void 0,ae=g?p.useCallback((K,te)=>{const ue=k.getState().nodeLookup.get(te).internals.userNode;g(K,ue)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(CL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:eo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${Z} ${z} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:S,onClick:V,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(eWt,{onClick:ae,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${Z-q}h${z+q*2}v${J+q*2}h${-z-q*2}z - M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CBe.displayName="MiniMap";p.memo(CBe);const aWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,oWt={[A1.Line]:"right",[A1.Handle]:"bottom-right"};function lWt({nodeId:e,position:t,variant:n=A1.Handle,className:i,style:r=void 0,children:s,color:o,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=iBe(),x=typeof e=="string"?e:w,O=Vs(),k=p.useRef(null),S=n===A1.Handle,E=ir(p.useCallback(aWt(S&&m),[S,m]),zs),C=p.useRef(null),j=t??oWt[n];p.useEffect(()=>{if(!(!k.current||!x))return C.current||(C.current=PVt({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=O.getState();return{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,A)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=O.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,H=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:H,height:q,...C8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:H,height:q},F.parentId,P,M)}},Z=lK([U],P,I,D);_.push(...Z),L.x=R.x?Math.max(M[0]*H,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(H)}for(const M of A){const H={...M,type:"position"};_.push(H)}N(_)},onEnd:({width:R,height:A})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:A}};O.getState().triggerNodeChanges([N])}})),C.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=C.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:eo(["react-flow__resize-control","nodrag",...T,n,i]),ref:k,style:{...r,scale:E,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(lWt);var ABe=Object.defineProperty,cWt=(e,t,n)=>t in e?ABe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uWt=(e,t)=>{for(var n in t)ABe(e,n,{get:t[n],enumerable:!0})},dWt=(e,t,n)=>cWt(e,t+"",n),TBe={};uWt(TBe,{Graph:()=>Md,alg:()=>uK,json:()=>jBe,version:()=>pWt});var fWt=Object.defineProperty,_Be=(e,t)=>{for(var n in t)fWt(e,n,{get:t[n],enumerable:!0})},Md=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=SS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=hWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,goe(this._preds[s],r),goe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],boe(this._preds[o],s),boe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function goe(e,t){e[t]?e[t]++:e[t]=1}function boe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function SS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function hWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function i6(e,t){return SS(e,t.v,t.w,t.name)}var pWt="4.0.1",jBe={};_Be(jBe,{read:()=>yWt,write:()=>mWt});function mWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:gWt(e),edges:bWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function gWt(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 bWt(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 yWt(e){let t=new Md(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 uK={};_Be(uK,{CycleException:()=>NP,bellmanFord:()=>NBe,components:()=>wWt,dijkstra:()=>jP,dijkstraAll:()=>SWt,findCycles:()=>EWt,floydWarshall:()=>AWt,isAcyclic:()=>_Wt,postorder:()=>NWt,preorder:()=>RWt,prim:()=>IWt,shortestPaths:()=>PWt,tarjan:()=>IBe,topsort:()=>PBe});var vWt=()=>1;function NBe(e,t,n,i){return xWt(e,String(t),n||vWt,i||function(r){return e.outEdges(r)})}function xWt(e,t,n,i){let r={},s,o=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 jP(e,t,n,i){let r=function(s){return e.outEdges(s)};return kWt(e,String(t),n||OWt,i||r)}function kWt(e,t,n,i){let r={},s=new RBe,o,l,c=function(u){let d=u.v!==o?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&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function SWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=jP(e,r,t,n),i},{})}function IBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).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(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function EWt(e){return IBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var CWt=()=>1;function AWt(e,t,n){return TWt(e,t||CWt,n||function(i){return e.outEdges(i)})}function TWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=DBe(e,l,n==="post",o,s,i,r)}),r}function DBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=DBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function MBe(e,t,n){return jWt(e,t,n,function(i,r){return i.push(r),i},[])}function NWt(e,t){return MBe(e,t,"post")}function RWt(e,t){return MBe(e,t,"pre")}function IWt(e,t){let n=new Md,i={},r=new RBe,s;function o(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(o)}return n}function PWt(e,t,n,i){return DWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function DWt(e,t,n,i){if(n===void 0)return jP(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.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 LBe(e){let t=new Md({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 yoe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=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)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function WT(e){let t=hA(FBe(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 LWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=fh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function $Wt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=fh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function voe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),OO(e,"border",r,t)}function FWt(e,t=$Be){let n=[];for(let i=0;i$Be){let n=FWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function FBe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return fh(Math.max,t)}function BWt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function BBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function UBe(e,t){return t()}var UWt=0;function dK(e){let t=++UWt;return e+(""+t)}function hA(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 QWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var jL="\0",zWt="3.0.0",VWt=class{constructor(){dWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return xoe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&xoe(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,HWt)),n=n._prev;return"["+e.join(", ")+"]"}};function xoe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function HWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var qWt=VWt,WWt=()=>1;function KWt(e,t){if(e.nodeCount()<=1)return[];let n=XWt(e,t||WWt);return GWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function GWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)r6(e,t,n,l);for(;l=s.dequeue();)r6(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(r6(e,t,n,l,!0)||[]);break}}}return r}function r6(e,t,n,i,r){let s=[],o=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,U7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,U7(t,n,d)}),e.removeNode(i.v),o}function XWt(e,t){let n=new Md,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=YWt(r+i+3).map(()=>new qWt),o=i+1;return n.nodes().forEach(l=>{U7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function U7(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 YWt(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,dK("rev"))});function t(n){return i=>n.edge(i).weight}}function JWt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function eKt(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 tKt(e){e.graph().dummyChains=[],e.edges().forEach(t=>nKt(e,t))}function nKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=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 fK(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),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=fh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function T1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var QBe=rKt;function rKt(e){let t=new Md({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,o;for(;sKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!T1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function aKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=T1(t,i)),rt.node(i).rank+=n)}var{preorder:lKt,postorder:cKt}=uK,uKt=ov;ov.initLowLimValues=pK;ov.initCutValues=hK;ov.calcCutValue=zBe;ov.leaveEdge=HBe;ov.enterEdge=qBe;ov.exchangeEdges=WBe;function ov(e){e=MWt(e),fK(e);let t=QBe(e);pK(t),hK(t,e);let n,i;for(;n=HBe(t);)i=qBe(t,e,n),WBe(t,e,n,i)}function hK(e,t){let n=cKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>dKt(e,t,i))}function dKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=zBe(e,t,n)}function zBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=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(o+=f?h:-h,hKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function pK(e,t){arguments.length<2&&(t=e.nodes()[0]),VBe(e,{},1,t)}function VBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=VBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function HBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function qBe(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),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===woe(e,e.node(u.v),l)&&c!==woe(e,e.node(u.w),l)).reduce((u,d)=>T1(t,d)!e.node(r).parent);if(!n)return;let i=lKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function hKt(e,t,n){return e.hasEdge(t,n)}function woe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var pKt=mKt;function mKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Ooe(e);break;case"tight-tree":bKt(e);break;case"longest-path":gKt(e);break;case"none":break;default:Ooe(e)}}var gKt=fK;function bKt(e){fK(e),QBe(e)}function Ooe(e){uKt(e)}var yKt=vKt;function vKt(e){let t=wKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=xKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||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 wKt(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(jL).forEach(i),t}function OKt(e){let t=OO(e,"root",{},"_root"),n=kKt(e),i=Object.values(n),r=fh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=SKt(e)+1;e.children(jL).forEach(l=>KBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function KBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=voe(e,"_bt"),d=voe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;KBe(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[o])!=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(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function kKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(jL).forEach(i=>n(i,1)),t}function SKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function EKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var CKt=AKt;function AKt(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,o=r.maxRank+1;sSoe(e.node(t))),e.edges().forEach(t=>Soe(e.edge(t)))}function Soe(e){let t=e.width;e.width=e.height,e.height=t}function jKt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"y")&&s6(i)})}function s6(e){e.y=-e.y}function NKt(e){e.nodes().forEach(t=>a6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(a6),Object.hasOwn(i,"x")&&a6(i)})}function a6(e){let t=e.x;e.x=e.y,e.y=t}function RKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=fh(Math.max,i),s=hA(r+1).map(()=>[]);function o(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(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function IKt(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 DKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.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 MKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return LKt(i)}function LKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&$Kt(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=>RP(r,["vs","i","barycenter","weight"]))}function $Kt(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 FKt(e,t){let n=BWt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort(BKt(!!t)),c=Eoe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Eoe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Eoe(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 BKt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function XBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=DKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=XBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&QKt(h,m)}});let d=MKt(u,n);UKt(d,c);let f=FKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);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 UKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function QKt(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 zKt(e,t,n,i){i||(i=e.nodes());let r=VKt(e),s=new Md({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function VKt(e){let t;for(;e.hasNode(t=dK("_root")););return t}function HKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function YBe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,YBe);return}let n=FBe(e),i=Coe(e,hA(1,n+1),"inEdges"),r=Coe(e,hA(n-1,-1,-1),"outEdges"),s=RKt(e);if(Aoe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){qKt(u%2?i:r,u%4>=2,c),s=WT(e);let f=IKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return zKt(e,s,n,i.get(s)||[])})}function qKt(e,t,n){let i=new Md;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=XBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),HKt(r,i,o.vs)})}function Aoe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function WKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=GKt(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)&&ZBe(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.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(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function GKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function ZBe(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 XKt(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 YKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[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=o[m],v=o[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=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=o.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 o.predecessors(m)||[]}function h(m){return o.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 JKt(e,t,n,i){let r=new Md,s=e.graph(),o=rGt(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(o(e,u,c),h||0))}}c=u}})}),r}function eGt(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=sGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-fh(Math.min,u);o!=="l"&&(d=r-fh(Math.max,u)),d&&(e[l]=_L(c,f=>f+d))})})}function nGt(e,t=void 0){let n=e.ul;return n?_L(n,(i,r)=>{var s,o;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)+((o=l[2])!=null?o:0))/2}):{}}function iGt(e){let t=WT(e),n=Object.assign(WKt(e,t),KKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=YKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=ZKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=_L(u,d=>-d)),i[o+l]=u})});let s=eGt(e,i);return tGt(i,s),nGt(i,e.graph().align)}function rGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.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 sGt(e,t){return e.node(t).width}function aGt(e){e=LBe(e),oGt(e),Object.entries(iGt(e)).forEach(([t,n])=>e.node(t).x=n)}function oGt(e){let t=WT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.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 lGt(e,t={}){let n=t.debugTiming?BBe:UBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>yGt(e));return n(" runLayout",()=>cGt(i,n,t)),n(" updateInputGraph",()=>uGt(e,i)),i})}function cGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>vGt(e)),t(" removeSelfEdges",()=>TGt(e)),t(" acyclic",()=>ZWt(e)),t(" nestingGraph.run",()=>OKt(e)),t(" rank",()=>pKt(LBe(e))),t(" injectEdgeLabelProxies",()=>xGt(e)),t(" removeEmptyRanks",()=>$Wt(e)),t(" nestingGraph.cleanup",()=>EKt(e)),t(" normalizeRanks",()=>LWt(e)),t(" assignRankMinMax",()=>wGt(e)),t(" removeEdgeLabelProxies",()=>OGt(e)),t(" normalize.run",()=>tKt(e)),t(" parentDummyChains",()=>yKt(e)),t(" addBorderSegments",()=>CKt(e)),t(" order",()=>YBe(e,n)),t(" insertSelfEdges",()=>_Gt(e)),t(" adjustCoordinateSystem",()=>TKt(e)),t(" position",()=>aGt(e)),t(" positionSelfEdges",()=>jGt(e)),t(" removeBorderNodes",()=>AGt(e)),t(" normalize.undo",()=>iKt(e)),t(" fixupEdgeLabelCoords",()=>EGt(e)),t(" undoCoordinateSystem",()=>_Kt(e)),t(" translateGraph",()=>kGt(e)),t(" assignNodeIntersects",()=>SGt(e)),t(" reversePoints",()=>CGt(e)),t(" acyclic.undo",()=>eKt(e))}function uGt(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 dGt=["nodesep","edgesep","ranksep","marginx","marginy"],fGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},hGt=["acyclicer","ranker","rankdir","align","rankalign"],pGt=["width","height","rank"],Toe={width:0,height:0},mGt=["minlen","weight","width","height","labeloffset"],gGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bGt=["labelpos"];function yGt(e){let t=new Md({multigraph:!0,compound:!0}),n=l6(e.graph());return t.setGraph(Object.assign({},fGt,o6(n,dGt),RP(n,hGt))),e.nodes().forEach(i=>{let r=l6(e.node(i)),s=o6(r,pGt);Object.keys(Toe).forEach(l=>{s[l]===void 0&&(s[l]=Toe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=l6(e.edge(i));t.setEdge(i,Object.assign({},gGt,o6(r,mGt),RP(r,bGt)))}),t}function vGt(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 xGt(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};OO(e,"edge-proxy",r,"_ep")}})}function wGt(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 OGt(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 kGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=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-=o,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+o,s.height=r-i+l}function SGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(yoe(i,s)),n.points.push(yoe(r,o))})}function EGt(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 CGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function AGt(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]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.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 TGt(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 _Gt(e){WT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{OO(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function jGt(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,o=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:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function o6(e,t){return _L(RP(e,t),Number)}function l6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function NGt(e){let t=WT(e),n=new Md({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((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var RGt={graphlib:TBe,version:zWt,layout:lGt,debug:NGt,util:{time:BBe,notime:UBe}},_oe=RGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const ES={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:$je},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Qat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Oat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:zje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:nM}},Q7=220,z7=88,joe=96,Noe=34,NE=64,c6=310,Hx=24,JBe=56,V7=40,Roe=40,IGt=18,PGt=58,DGt=!1,MGt=e=>e==="sequential"||e==="parallel"||e==="loop";function H7(e,t){const n=e.agentType??"llm";return MGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function q7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!H7(e,t))return{width:Q7,height:z7};if(i&&e.subAgents.length===0)return{width:c6,height:NE};const s=e.subAgents.map((f,h)=>q7(f,[...t,h],n,i)),o=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"?JBe:Hx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?IGt+Roe:r==="loop"?PGt:0:Roe;return u?{width:Math.max(c6,s.reduce((f,h)=>f+h.width,0)+V7*Math.max(0,s.length-1)+c*2),height:NE+Hx+l+d+Hx}:{width:Math.max(c6,o+Hx*2),height:NE+c+s.reduce((f,h)=>f+h.height,0)+V7*Math.max(0,s.length-1)+d+c}}function Ik(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function LGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Ioe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Pk(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:cA.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 Poe(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 o(f,h,m,g,b){const v=f.agentType??"llm",y=Ik(h);return H7(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(ES[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=Ik(h),w=q7(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(ES[v].labelKey)),pattern:v,description:f.description.trim()||i(ES[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((C,j)=>q7(C,[...h,j],t,n)),O=x.length&&v!=="parallel"?JBe:Hx,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=O;const E=f.subAgents.map((C,j)=>{const T=x[j],R=k?{x:S,y:NE+Hx}:{x:(w.width-T.width)/2,y:NE+S};return S+=(k?T.width:T.height)+V7,o(C,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let C=0;C1&&s.push(Pk(E[E.length-1],E[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=Ik(h);if(H7(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(ES[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=Ik(w);s.push(Pk(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=Ik([]),d=c(e,[]);return s.push(Pk("terminal-input",u)),d.forEach(f=>s.push(Pk(f,"terminal-output"))),$Gt(r,s,t)}function $Gt(e,t,n){const i=new _oe.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 o=s.data.kind==="terminal";i.setNode(s.id,{width:o?joe:s.data.layoutWidth??Q7,height:o?Noe:s.data.layoutHeight??z7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),_oe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?joe:s.data.layoutWidth??Q7,u=l?Noe:s.data.layoutHeight??z7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const NL=p.createContext(null),RL=p.createContext("horizontal");function FGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(NL),[m,g]=p.useState(!1),[b,v,y]=TP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(qT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(Nqt,{children:a.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&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.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:a.jsx(ic,{})})]})})]})}function BGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=ES[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx(Fc,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.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:a.jsx(eb,{})}),a.jsx(Fc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Fc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Fc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function UGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.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 a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx(Fc,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.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:a.jsx(ic,{})}),a.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:a.jsx(ic,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.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:a.jsx(eb,{})}),a.jsx(Fc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Fc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Fc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function QGt({data:e}){const t=p.useContext(RL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx(Fc,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx(Fc,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const zGt={agent:BGt,group:UGt,terminal:QGt},VGt={insertStep:FGt};function HGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>Poe(e,c,o,u),[]),[f,h,m]=Rqt(d.nodes),[g,b,v]=Iqt(d.edges),y=Dqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Ioe(e)}`),x=p.useRef(null),{fitView:O}=AL(),k=p.useMemo(()=>Poe(e,c,o,u),[c,e,o,u]),[S,E]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=x.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&R<8){j(R+1);return}O(C)})})},[C,O]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),A=N=>E(N.matches);return R.addEventListener("change",A),()=>R.removeEventListener("change",A)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Ioe(e)}`,A=R!==w.current;w.current=R,b(k.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return k.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!A&&D&&D.type===I.type?D.measured:void 0,position:!A&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&LGt(I.data.path,t)}})}),A&&j()},[k,e,j,t,b,h]),p.useEffect(()=>{j()},[S,j]),p.useEffect(()=>{y&&j()},[k,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(RL.Provider,{value:c,children:a.jsx(NL.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(_qt,{nodes:f,edges:g,nodeTypes:zGt,edgeTypes:VGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,A)=>{!o&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:C,onInit:()=>j(),minZoom:o?.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:[a.jsx(Bqt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Wqt,{showInteractive:!1}),DGt]})})})})})}function IP(e){return a.jsx(kBe,{children:a.jsx(HGt,{...e})})}function qGt(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 WGt=[{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"}]}],KGt={核心能力回归:"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 CS(e,t){const n=KGt[e];return n?t(n):e}const GGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],XGt=20;function e9e(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 Dk=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function t9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function px(e){var t;return t9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function Doe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function n9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(t9e).filter(Boolean):[]}function YGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function ZGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function JGt({preview:e,t}){const n=e.blockers.map(i=>YGt(i,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(i=>a.jsx("li",{children:t(`agentWorkspace.mpaDeleteStage.${i.stage}`,{count:i.count})},i.stage))})]})}function u6(e,t){return e instanceof iw&&e.status===412?t:e instanceof Error?e.message:String(e)}function eXt(e){return n9e(e).length}function Moe(e,t){const n=n9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Loe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function tXt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function d6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function nXt(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 $oe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Foe(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 iXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function W7(e){return JSON.stringify(e)}function i9e(e){return e==="key_auth"?`API_KEY = "" +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??toe,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)&&N8e(m))return!1;const b=ioe(m.code,l);if(s.current.add(m[b]),noe(o,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=ioe(m.code,l);noe(o,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 noe(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function ioe(e,t){return t.includes(e)?"code":"key"}const aHt=()=>{const e=Vs();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:o}=e.getState();return o?(await o.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:o,panZoom:l}=e.getState(),c=tK(t,i,r,s,o,(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:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return Ok(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=T1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function J8e(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 o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)oHt(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 oHt(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 eBe(e,t){return J8e(e,t)}function tBe(e,t){return J8e(e,t)}function py(e,t){return{id:e,type:"select",selected:t}}function Hx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(py(s.id,o)))}return i}function roe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function soe(e){return{id:e.id,type:"remove"}}const lHt=T8e();function cHt(e,t,n={}){return eVt(e,t,{...n,onError:n.onError??lHt})}const aoe=e=>Fzt(e),uHt=e=>S8e(e);function nBe(e){return p.forwardRef(e)}const dHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ooe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>fHt(()=>n(r=>r+BigInt(1))));return dHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function fHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const iBe=p.createContext(null);function hHt({children:e}){const t=Vs(),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=roe({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=ooe(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(roe({items:m,lookup:h}))},[]),s=ooe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(iBe.Provider,{value:o,children:e})}function pHt(){const e=p.useContext(iBe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mHt=e=>!!e.panZoom;function EL(){const e=aHt(),t=Vs(),n=pHt(),i=or(mHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=aoe(f)?f:h.get(f.id),b=g.parentId?_8e(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 A1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&aoe(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&&uHt(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:o,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:k}=t.getState(),{nodes:S,edges:O}=await Vzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:k}),A=O.length>0,E=S.length>0;if(A){const j=O.map(soe);v==null||v(O),w(j)}if(E){const j=S.map(soe);b==null||b(S),y(j)}return(E||A)&&(x==null||x({nodes:S,edges:O})),{deletedNodes:S,deletedEdges:O}},getIntersectingNodes:(f,h=!0,m)=>{const g=Mae(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=A1(v?y:w),k=fA(x,b);return h&&k>0||k>=x.width*x.height||k>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Mae(f)?f:c(f);if(!b)return!1;const v=fA(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 Bzt(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??Wzt();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 loe=e=>e.selected,gHt=typeof window<"u"?window:void 0;function bHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=EL(),r=pA(e,{actInsideInputWithModifier:!1}),s=pA(t,{target:gHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(loe),edges:o.filter(loe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function yHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=iK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",wf.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 CL={position:"absolute",width:"100%",height:"100%",top:0,left:0},vHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function xHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=Yy.Free,zoomOnDoubleClick:o=!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:k}){const S=Vs(),O=p.useRef(null),{userSelectionActive:A,lib:E,connectionInProgress:j}=or(vHt,zs),T=pA(h),R=p.useRef();yHt(O);const C=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(O.current){R.current=jVt({domNode:O.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>S.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=S.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[N,P,I],domNode:O.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:A,noWheelClassName:b,lib:E,onTransformChange:C,connectionInProgress:j,selectionOnDrag:k,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,A,b,E,C,j,k,x]),a.jsx("div",{className:"react-flow__renderer",ref:O,style:CL,children:g})}const wHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kHt(){const{userSelectionActive:e,userSelectionRect:t}=or(wHt,zs);return e&&t?a.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 e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function SHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:k,connectionInProgress:S,panBy:O,autoPanSpeed:A}=or(OHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),C=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||S){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var fe,pe;const{domNode:X,transform:le}=y.getState();if(T.current=X==null?void 0:X.getBoundingClientRect(),!T.current)return;const V=W.target===j.current;if(!V&&!!W.target.closest(".nokey")||!e||!(o&&V||t)||W.button!==0||!W.isPrimary)return;(pe=(fe=W.target)==null?void 0:fe.setPointerCapture)==null||pe.call(fe,W.pointerId),N.current=!1;const{x:ue,y:te}=cf(W.nativeEvent,T.current),Oe=Ok({x:ue,y:te},le);y.setState({userSelectionRect:{width:0,height:0,startX:Oe.x,startY:Oe.y,x:ue,y:te}}),V||(W.stopPropagation(),W.preventDefault())};function H(W,X){const{userSelectionRect:le}=y.getState();if(!le)return;const{transform:V,nodeLookup:Y,edgeLookup:K,connectionLookup:ue,triggerNodeChanges:te,triggerEdgeChanges:Oe,defaultEdgeOptions:fe}=y.getState(),pe={x:le.startX,y:le.startY},{x:Se,y:ve}=T1(pe,V),Le={startX:pe.x,startY:pe.y,x:Wse.id)),C.current=new Set;const De=(fe==null?void 0:fe.selectable)??!0;for(const se of R.current){const ce=ue.get(se);if(ce)for(const{edgeId:ye}of ce.values()){const Ae=K.get(ye);Ae&&(Ae.selectable??De)&&C.current.add(ye)}}if(!Lae(He,R.current)){const se=Hx(Y,R.current,!0);te(se)}if(!Lae(Ge,C.current)){const se=Hx(K,C.current);Oe(se)}y.setState({userSelectionRect:Le,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,X]=eK(P.current,T.current,A);O({x:W,y:X}).then(le=>{if(!N.current||!le){v.current=requestAnimationFrame(q);return}const{x:V,y:Y}=P.current;H(V,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const Z=W=>{const{userSelectionRect:X,transform:le,resetSelectedElements:V}=y.getState();if(!T.current||!X)return;const{x:Y,y:K}=cf(W.nativeEvent,T.current);P.current={x:Y,y:K};const ue=T1({x:X.startX,y:X.startY},le);if(!N.current){const te=t?0:s;if(Math.hypot(Y-ue.x,K-ue.y)<=te)return;V(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),H(Y,K)},z=W=>{var X,le;W.button===0&&((le=(X=W.target)==null?void 0:X.releasePointerCapture)==null||le.call(X,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},J=W=>{var X,le;(le=(X=W.target)==null?void 0:X.releasePointerCapture)==null||le.call(X,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:no(["react-flow__pane",{draggable:ne,dragging:k,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?Z:m,onPointerUp:E?z:void 0,onPointerCancel:E?J:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:CL,children:[b,a.jsx(kHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",wf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function rBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=gVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({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:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const EHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function sBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=EHt(o),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=KT(w,s));const{position:x,positionAbsolute:k}=E8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=k,f.set(y.id,y)}c(f)},[])}const cK=p.createContext(null),CHt=cK.Provider;cK.Consumer;const aBe=()=>p.useContext(cK),AHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),THt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,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===E1.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 _Ht({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=aBe(),{connectOnClick:w,noPanClassName:x,rfId:k}=or(AHt,zs),{connectingFrom:S,connectingTo:O,clickConnecting:A,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=or(THt(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",wf.error010());const C=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),H={...L,..._};if(M){const{edges:q,setEdges:U,onError:Z}=v.getState();U(cHt(H,q,{onError:Z}))}F==null||F(H),l==null||l(H)},N=_=>{if(!y)return;const L=R8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var H,q;return(q=(H=v.getState()).onConnectEnd)==null?void 0:q.call(H,...M)},updateConnection:F.updateConnection,onConnect:C,isValidConnection:n||((...M)=>{var H,q;return((q=(H=v.getState()).isValidConnection)==null?void 0:q.call(H,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:H,isValidConnection:q,lib:U,rfId:Z,nodeLookup:z,connection:J}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=j8e(_.target),W=n||q,{connection:X,isValid:le}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:Z,doc:ne,lib:U,nodeLookup:z});le&&X&&C(X);const V=structuredClone(J);delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,F==null||F(_,V),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${k}-${y}-${g}-${e}`,className:no(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:A,connectingfrom:S,connectingto:O,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const Dc=p.memo(nBe(_Ht));function jHt({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:n,isConnectable:t})]})}function NHt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:i,isConnectable:t})]})}function RHt(){return null}function IHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const TP={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},coe={input:jHt,default:NHt,output:IHt,group:RHt};function PHt(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 DHt=e=>{const{width:t,height:n,x:i,y:r}=WT(e.nodeLookup,{filter:s=>!!s.selected});return{width:lf(t)?t:null,height:lf(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 MHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=or(DHt,zs),c=sBe(),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(rBe({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(TP,m.key)&&(m.preventDefault(),c({direction:TP[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:no(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.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 uoe=typeof window<"u"?window:void 0,LHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function oBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,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:k,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:H,userSelectionActive:q}=or(LHt,zs),U=pA(u,{target:uoe}),Z=pA(b,{target:uoe}),z=Z||E,J=Z||k,ne=d&&z!==!0,W=U||q||ne;return bHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(xHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:J,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(SHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&a.jsx(MHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}oBe.displayName="FlowRenderer";const $Ht=p.memo(oBe),FHt=e=>t=>e?JW(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 BHt(e){return or(p.useCallback(FHt(e),[e]),zs)}const UHt=e=>e.updateNodeInternals;function QHt(){const e=or(UHt),[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 zHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=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||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.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 VHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,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:k,isParent:S}=or(W=>{const X=W.nodeLookup.get(e),le=W.parentLookup.has(e);return{node:X,internals:X.internals,isParent:le}},zs);let O=x.type||"default",A=(v==null?void 0:v[O])||coe[O];A===void 0&&(w==null||w("003",wf.error003(O)),O="default",A=(v==null?void 0:v.default)||coe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),C=Vs(),N=nK(x),P=zHt({node:x,nodeType:O,hasDimensions:N,resizeObserver:f}),I=rBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=sBe();if(x.hidden)return null;const _=km(x),L=PHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...k.userNode}):void 0,H=i?W=>i(W,{...k.userNode}):void 0,q=r?W=>r(W,{...k.userNode}):void 0,U=s?W=>s(W,{...k.userNode}):void 0,Z=o?W=>o(W,{...k.userNode}):void 0,z=W=>{const{selectNodesOnDrag:X,nodeDragThreshold:le}=C.getState();j&&(!X||!E||le>0)&&F7({id:e,store:C,nodeRef:P}),t&&t(W,{...k.userNode})},J=W=>{if(!(N8e(W.nativeEvent)||g)){if(x8e.includes(W.key)&&j){const X=W.key==="Escape";F7({id:e,store:C,unselect:X,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(TP,W.key)){W.preventDefault();const{ariaLabelConfig:X}=C.getState();C.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),D({direction:TP[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ue;if(g||!((ue=P.current)!=null&&ue.matches(":focus-visible")))return;const{transform:W,width:X,height:le,autoPanOnNodeFocus:V,setCenter:Y}=C.getState();if(!V)return;JW(new Map([[e,x]]),{x:0,y:0,width:X,height:le},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:no(["react-flow__node",`react-flow__node-${O}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:S,draggable:E,dragging:I}]),ref:P,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:H,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:Z,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${X8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(CHt,{value:e,children:a.jsx(A,{id:e,data:x.data,type:O,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:k.z,parentId:x.parentId,..._})})})}var HHt=p.memo(VHt);const qHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function lBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=or(qHt,zs),o=BHt(e.onlyRenderVisibleElements),l=QHt();return a.jsx("div",{className:"react-flow__nodes",style:CL,children:o.map(c=>a.jsx(HHt,{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))})}lBe.displayName="NodeRenderer";const WHt=p.memo(lBe);function KHt(e){return or(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),o=n.nodeLookup.get(r.target);s&&o&&Yzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const GHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},XHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},doe={[dA.Arrow]:GHt,[dA.ArrowClosed]:XHt};function YHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(doe,e)?doe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",wf.error009(e)),null)},[e])}const ZHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=YHt(t);return c?a.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:a.jsx(c,{color:n,strokeWidth:o})}):null},cBe=({defaultColor:e,rfId:t})=>{const n=or(s=>s.edges),i=or(s=>s.defaultEdgeOptions),r=p.useMemo(()=>sVt(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?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(ZHt,{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};cBe.displayName="MarkerDefinitions";var JHt=p.memo(cBe);function uBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=no(["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?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}uBe.displayName="EdgeText";const eqt=p.memo(uBe);function GT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:no(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&lf(t)&&lf(n)?a.jsx(eqt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function foe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function dBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=foe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=foe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=I8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function fBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,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,k]=dBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),S=e.isInternal?void 0:t;return a.jsx(GT,{id:S,path:w,labelX:x,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const tqt=fBe({isInternal:!1}),hBe=fBe({isInternal:!0});tqt.displayName="SimpleBezierEdge";hBe.displayName="SimpleBezierEdgeInternal";function pBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,k,S]=AP({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}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const mBe=pBe({isInternal:!1}),gBe=pBe({isInternal:!0});mBe.displayName="SmoothStepEdge";gBe.displayName="SmoothStepEdgeInternal";function bBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(mBe,{...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 nqt=bBe({isInternal:!1}),yBe=bBe({isInternal:!0});nqt.displayName="StepEdge";yBe.displayName="StepEdgeInternal";function vBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=M8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(GT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const iqt=vBe({isInternal:!1}),xBe=vBe({isInternal:!0});iqt.displayName="StraightEdge";xBe.displayName="StraightEdgeInternal";function wBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.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,k,S]=P8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const rqt=wBe({isInternal:!1}),kBe=wBe({isInternal:!0});rqt.displayName="BezierEdge";kBe.displayName="BezierEdgeInternal";const hoe={default:kBe,straight:xBe,step:yBe,smoothstep:gBe,simplebezier:hBe},poe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},sqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,aqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,moe="react-flow__edgeupdater";function goe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:no([moe,`${moe}-${l}`]),cx:sqt(t,i,e),cy:aqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function oqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(k,S)=>{if(k.button!==0)return;const{autoPanOnConnect:O,domNode:A,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:C,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=S.type==="target",L=(H,q)=>{h(!1),f==null||f(H,n,S.type,q)},F=H=>u==null?void 0:u(n,H),M=(H,q)=>{h(!0),d==null||d(k,n,S.type),R==null||R(H,q)};$7.onPointerDown(k.nativeEvent,{autoPanOnConnect:O,connectionMode:E,connectionRadius:j,domNode:A,handleId:S.id,nodeId:S.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:S.type,lib:T,flowId:P,cancelConnection:C,panBy:I,isValidConnection:(...H)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...H))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...H)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...H)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},v=k=>b(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=k=>b(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(goe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(goe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function lqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,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=or(Y=>Y.edgeLookup.get(e));const k=or(Y=>Y.defaultEdgeOptions);x=k?{...k,...x}:x;let S=x.type||"default",O=(b==null?void 0:b[S])||hoe[S];O===void 0&&(y==null||y("011",wf.error011(S)),S="default",O=(b==null?void 0:b.default)||hoe.default);const A=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,C]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q}=or(p.useCallback(Y=>{const K=Y.nodeLookup.get(x.source),ue=Y.nodeLookup.get(x.target);if(!K||!ue)return{zIndex:x.zIndex,...poe};const te=rVt({id:e,sourceNode:K,targetNode:ue,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Xzt({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ue,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...te||poe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),Z=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var Oe;const{addSelectedEdges:K,unselectNodesAndEdges:ue,multiSelectionActive:te}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&te?(ue({nodes:[],edges:[x]}),(Oe=T.current)==null||Oe.blur()):K([e])),r&&r(Y,x)},J=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,X=c?Y=>{c(Y,{...x})}:void 0,le=u?Y=>{u(Y,{...x})}:void 0,V=Y=>{var K;if(!w&&x8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ue,addSelectedEdges:te}=I.getState();Y.key==="Escape"?((K=T.current)==null||K.blur(),ue({edges:[x]})):te([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:no(["react-flow__edge",`react-flow__edge-${S}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:J,onContextMenu:ne,onMouseEnter:W,onMouseMove:X,onMouseLeave:le,onKeyDown:A?V:void 0,tabIndex:A?0:void 0,role:x.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":A?`${Y8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(O,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(oqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,setUpdateHover:C,setReconnecting:P})]})})}var cqt=p.memo(lqt);const uqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function OBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,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}=or(uqt,zs),k=KHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(JHt,{defaultColor:e,rfId:n}),k.map(S=>a.jsx(cqt,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,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))]})}OBe.displayName="EdgeRenderer";const dqt=p.memo(OBe),fqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hqt({children:e}){const t=or(fqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function pqt(e){const t=EL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const mqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function gqt(e){const t=or(mqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function bqt(e){return e.connection.inProgress?{...e.connection,to:Ok(e.connection.to,e.transform)}:{...e.connection}}function yqt(e){return bqt}function vqt(e){const t=yqt();return or(t,zs)}const xqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=or(xqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:no(["react-flow__connection",O8e(l)]),children:a.jsx(SBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const SBe=({style:e,type:t=og.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=vqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:O8e(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 og.Bezier:[g]=P8e(b);break;case og.SimpleBezier:[g]=dBe(b);break;case og.Step:[g]=AP({...b,borderRadius:0});break;case og.SmoothStep:[g]=AP(b);break;default:[g]=M8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};SBe.displayName="ConnectionLine";const kqt={};function boe(e=kqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function Oqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function EBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,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:k,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:X,onPaneContextMenu:le,paneClickDistance:V,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:ue,onEdgeMouseMove:te,onEdgeMouseLeave:Oe,reconnectRadius:fe,onReconnect:pe,onReconnectStart:Se,onReconnectEnd:ve,noDragClassName:Le,noWheelClassName:He,noPanClassName:Ge,disableKeyboardA11y:De,nodeExtent:se,rfId:ce,viewport:ye,onViewportChange:Ae}){return boe(e),boe(t),Oqt(),pqt(n),gqt(ye),a.jsx($Ht,{onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:le,onPaneScroll:X,paneClickDistance:V,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:k,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Le,noWheelClassName:He,noPanClassName:Ge,disableKeyboardA11y:De,onViewportChange:Ae,isControlledViewport:!!ye,children:a.jsxs(hqt,{children:[a.jsx(dqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:Se,onReconnectEnd:ve,onlyRenderVisibleElements:j,onEdgeContextMenu:K,onEdgeMouseEnter:ue,onEdgeMouseMove:te,onEdgeMouseLeave:Oe,reconnectRadius:fe,defaultMarkerColor:D,noPanClassName:Ge,disableKeyboardA11y:De,rfId:ce}),a.jsx(wqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(WHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Ge,noDragClassName:Le,disableKeyboardA11y:De,nodeExtent:se,rfId:ce}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}EBe.displayName="GraphView";const Sqt=p.memo(EBe),Eqt=T8e(),yoe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,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],k=f??cA;F8e(b,v,y);const{nodesInitialized:S}=L7(w,m,g,{nodeOrigin:x,nodeExtent:k,zIndexMode:h});let O=[0,0,1];if(o&&r&&s){const A=WT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=tK(A,r,s,c,u,(l==null?void 0:l.padding)??.1);O=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:O,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:cA,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E1.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...k8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Eqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:w8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Cqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>UVt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:k,height:S,minZoom:O,maxZoom:A}=g();y&&(await zzt({nodes:v,width:k,height:S,panZoom:y,minZoom:O,maxZoom:A},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...yoe({nodes:e,edges:t,width:r,height:s,fitView:o,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:k,fitViewQueued:S,zIndexMode:O,nodesSelectionActive:A}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:O}),T=A&&j;S&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();F8e(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:k,nodeOrigin:S,nodeExtent:O,debug:A,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=fVt(v,w,x,k,S,O,j);R&&(lVt(w,x,{nodeOrigin:S,nodeExtent:O,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(A&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:k,triggerNodeChanges:S,connection:O,updateConnection:A,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=k.get(j),C=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:C?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&O.inProgress&&O.fromNode.id===R.id){const P=Av(R,O.fromHandle,vn.Left,!0);A({...O,from:P})}C&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=lK(w,k,j,T);x.push(...R)}for(const j of E.values())x=j(x);S(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=eBe(v,x);w(O)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=tBe(v,x);w(O)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));k(O);return}k(Hx(x,new Set([...v]),!0)),S(Hx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));S(O);return}S(Hx(w,new Set([...v]))),k(Hx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:k,triggerNodeChanges:S,triggerEdgeChanges:O}=g(),A=v||x,E=y||w,j=[];for(const R of A){if(!R.selected)continue;const C=k.get(R.id);C&&(C.selected=!1),j.push(py(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(py(R.id,!1));S(j),O(T)},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:k}=g();if(!k)return;const S=y.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]),O=v.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]);w(S),x(O)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:k,elevateNodesOnSelect:S,nodeExtent:O,zIndexMode:A}=g();v[0][0]===O[0][0]&&v[0][1]===O[0][1]&&v[1][0]===O[1][0]&&v[1][1]===O[1][1]||(L7(y,w,x,{nodeOrigin:k,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:A}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:k,translateExtent:S}=g();return hVt({delta:v,panZoom:k,transform:y,translateExtent:S,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:k,maxZoom:S,panZoom:O}=g();if(!O)return!1;const A=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:S;return await O.setViewport({x:x/2-v*A,y:k/2-y*A,zoom:A},{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:{...k8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...yoe()})}},Object.is);function CBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>Cqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(QVt,{value:g,children:a.jsx(hHt,{children:m})})}function Aqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(OL)?a.jsx(a.Fragment,{children:e}):a.jsx(CBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Tqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function _qt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,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:k,onNodeContextMenu:S,onNodeDoubleClick:O,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:H,connectionLineType:q=og.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:X=uA.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:V=hA()?"Meta":"Control",zoomActivationKeyCode:Y=hA()?"Meta":"Control",snapToGrid:K,snapGrid:ue,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:Oe,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:Se,nodesFocusable:ve,nodeOrigin:Le=Z8e,edgesFocusable:He,edgesReconnectable:Ge,elementsSelectable:De=!0,defaultViewport:se=tHt,minZoom:ce=.5,maxZoom:ye=2,translateExtent:Ae=cA,preventScrolling:Ee=!0,nodeExtent:Ce,defaultMarkerColor:Be="#b1b1b7",zoomOnScroll:he=!0,zoomOnPinch:ie=!0,panOnScroll:we=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:Ue=Yy.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Pt=!0,onPaneClick:Gt,onPaneMouseEnter:St,onPaneMouseMove:Lt,onPaneMouseLeave:qe,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt=1,nodeClickDistance:Tt=0,children:fn,onReconnect:tn,onReconnectStart:We,onReconnectEnd:vt,onEdgeContextMenu:Ke,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:Ct,reconnectRadius:Ot=10,onNodesChange:Bt,onEdgesChange:Dt,noDragClassName:Ze="nodrag",noWheelClassName:bt="nowheel",noPanClassName:gt="nopan",fitView:an,fitViewOptions:Ft,connectOnClick:cn,attributionPosition:Je,proOptions:lt,defaultEdgeOptions:hn,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:Ji=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanOnSelection:Nn=!0,autoPanSpeed:Dn,connectionRadius:_i,isValidConnection:Fn,onError:Kn,style:Rn,id:nt,nodeDragThreshold:Ut,connectionDragThreshold:Qe,viewport:xt,onViewportChange:Qt,width:jn,height:lr,colorMode:ta="light",debug:Ms,onScroll:ts,ariaLabelConfig:ci,zIndexMode:Ei="basic",...$r},na){const ns=nt||"1",Il=sHt(ta),fs=p.useCallback(ge=>{ge.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ts==null||ts(ge)},[ts]);return a.jsx("div",{"data-testid":"rf__wrapper",...$r,onScroll:fs,style:{...Rn,...Tqt},ref:na,className:no(["react-flow",r,Il]),id:nt,role:"application",children:a.jsxs(Aqt,{nodes:e,edges:t,width:jn,height:lr,fitView:an,fitViewOptions:Ft,minZoom:ce,maxZoom:ye,nodeOrigin:Le,nodeExtent:Ce,zIndexMode:Ei,children:[a.jsx(rHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:Se,nodesFocusable:ve,edgesFocusable:He,edgesReconnectable:Ge,elementsSelectable:De,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:Ji,minZoom:ce,maxZoom:ye,nodeExtent:Ce,onNodesChange:Bt,onEdgesChange:Dt,snapToGrid:K,snapGrid:ue,connectionMode:H,translateExtent:Ae,connectOnClick:cn,defaultEdgeOptions:hn,fitView:an,fitViewOptions:Ft,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:gt,nodeOrigin:Le,rfId:ns,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanSpeed:Dn,onError:Kn,connectionRadius:_i,isValidConnection:Fn,selectNodesOnDrag:Oe,nodeDragThreshold:Ut,connectionDragThreshold:Qe,onBeforeDelete:M,debug:Ms,ariaLabelConfig:ci,zIndexMode:Ei}),a.jsx(Sqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:k,onNodeContextMenu:S,onNodeDoubleClick:O,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:X,deleteKeyCode:J,multiSelectionKeyCode:V,panActivationKeyCode:le,zoomActivationKeyCode:Y,onlyRenderVisibleElements:te,defaultViewport:se,translateExtent:Ae,minZoom:ce,maxZoom:ye,preventScrolling:Ee,zoomOnScroll:he,zoomOnPinch:ie,zoomOnDoubleClick:_t,panOnScroll:we,panOnScrollSpeed:Re,panOnScrollMode:Ue,panOnDrag:Pt,autoPanOnSelection:Nn,onPaneClick:Gt,onPaneMouseEnter:St,onPaneMouseMove:Lt,onPaneMouseLeave:qe,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt,nodeClickDistance:Tt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:tn,onReconnectStart:We,onReconnectEnd:vt,onEdgeContextMenu:Ke,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:Ct,reconnectRadius:Ot,defaultMarkerColor:Be,noDragClassName:Ze,noWheelClassName:bt,noPanClassName:gt,rfId:ns,disableKeyboardA11y:Qn,nodeExtent:Ce,viewport:xt,onViewportChange:Qt}),a.jsx(eHt,{onSelectionChange:N}),fn,a.jsx(GVt,{proOptions:lt,position:Je}),a.jsx(KVt,{rfId:ns,disableKeyboardA11y:Qn})]})})}var jqt=nBe(_qt);const Nqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Rqt({children:e}){const t=or(Nqt);return t?vi.createPortal(e,t):null}function Iqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>eBe(r,s)),[]);return[t,n,i]}function Pqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>tBe(r,s)),[]);return[t,n,i]}const Dqt=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||!nK(n.userNode))return!1;return!0};function Mqt(e={includeHiddenNodes:!1}){return or(Dqt(e))}function Lqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:no(["react-flow__background-pattern",n,i])})}function $qt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:no(["react-flow__background-pattern","dots",t])})}var $g;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($g||($g={}));const Fqt={[$g.Dots]:1,[$g.Lines]:1,[$g.Cross]:6},Bqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ABe({id:e,variant:t=$g.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=or(Bqt,zs),g=i||Fqt[t],b=t===$g.Dots,v=t===$g.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],k=Array.isArray(s)?s:[s,s],S=v?[x,x]:w,O=[k[0]*h[2]||1+S[0]/2,k[1]*h[2]||1+S[1]/2],A=`${m}${e||""}`;return a.jsxs("svg",{className:no(["react-flow__background",u]),style:{...c,...CL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:A,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:b?a.jsx($qt,{radius:x/2,className:d}):a.jsx(Lqt,{dimensions:S,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}ABe.displayName="Background";const Uqt=p.memo(ABe);function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 Hqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 vj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:no(["react-flow__controls-button",t]),...n,children:e})}const Wqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function TBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=or(Wqt,zs),{zoomIn:x,zoomOut:k,fitView:S}=EL(),O=()=>{x(),s==null||s()},A=()=>{k(),o==null||o()},E=()=>{S(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(SL,{className:no(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(vj,{onClick:O,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Qqt,{})}),a.jsx(vj,{onClick:A,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(zqt,{})})]}),n&&a.jsx(vj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Vqt,{})}),i&&a.jsx(vj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(qqt,{}):a.jsx(Hqt,{})}),d]})}TBe.displayName="Controls";const Kqt=p.memo(TBe);function Gqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:no(["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 Xqt=p.memo(Gqt),Yqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Zqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Xqt,onClick:o}){const l=or(Yqt,zs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(eWt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Jqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=or(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:k}=km(v);return{node:v,x:y,y:w,width:x,height:k}},zs);return!u||u.hidden||!nK(u)?null:a.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:o,onClick:c,id:u.id})}const eWt=p.memo(Jqt);var tWt=p.memo(Zqt);const nWt=200,iWt=150,rWt=e=>!e.hidden,sWt=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?A8e(WT(e.nodeLookup,{filter:rWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},aWt="react-flow__minimap-desc";function _Be({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,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:k=5}){const S=Vs(),O=p.useRef(null),{boundingRect:A,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:C,flowHeight:N,ariaLabelConfig:P}=or(sWt,zs),I=(e==null?void 0:e.width)??nWt,D=(e==null?void 0:e.height)??iWt,_=A.width/I,L=A.height/D,F=Math.max(_,L),M=F*I,H=F*D,q=k*F,U=A.x-(M-A.width)/2-q,Z=A.y-(H-A.height)/2-q,z=M+q*2,J=H+q*2,ne=`${aWt}-${j}`,W=p.useRef(0),X=p.useRef();W.current=F,p.useEffect(()=>{if(O.current&&T)return X.current=kVt({domNode:O.current,panZoom:T,getTransform:()=>S.getState().transform,getViewScale:()=>W.current}),()=>{var K;(K=X.current)==null||K.destroy()}},[T]),p.useEffect(()=>{var K;(K=X.current)==null||K.update({translateExtent:R,width:C,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,C,N]);const le=m?K=>{var Oe;const[ue,te]=((Oe=X.current)==null?void 0:Oe.pointer(K))||[0,0];m(K,{x:ue,y:te})}:void 0,V=g?p.useCallback((K,ue)=>{const te=S.getState().nodeLookup.get(ue).internals.userNode;g(K,te)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(SL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:no(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${Z} ${z} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:O,onClick:le,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(tWt,{onClick:V,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${Z-q}h${z+q*2}v${J+q*2}h${-z-q*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}_Be.displayName="MiniMap";p.memo(_Be);const oWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,lWt={[_1.Line]:"right",[_1.Handle]:"bottom-right"};function cWt({nodeId:e,position:t,variant:n=_1.Handle,className:i,style:r=void 0,children:s,color:o,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=aBe(),x=typeof e=="string"?e:w,k=Vs(),S=p.useRef(null),O=n===_1.Handle,A=or(p.useCallback(oWt(O&&m),[O,m]),zs),E=p.useRef(null),j=t??lWt[n];p.useEffect(()=>{if(!(!S.current||!x))return E.current||(E.current=DVt({domNode:S.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=k.getState();return{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,C)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=k.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,H=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:H,height:q,..._8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:H,height:q},F.parentId,P,M)}},Z=lK([U],P,I,D);_.push(...Z),L.x=R.x?Math.max(M[0]*H,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(H)}for(const M of C){const H={...M,type:"position"};_.push(H)}N(_)},onEnd:({width:R,height:C})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:C}};k.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:no(["react-flow__resize-control","nodrag",...T,n,i]),ref:S,style:{...r,scale:A,...o&&{[O?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(cWt);var jBe=Object.defineProperty,uWt=(e,t,n)=>t in e?jBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dWt=(e,t)=>{for(var n in t)jBe(e,n,{get:t[n],enumerable:!0})},fWt=(e,t,n)=>uWt(e,t+"",n),NBe={};dWt(NBe,{Graph:()=>Ld,alg:()=>uK,json:()=>IBe,version:()=>mWt});var hWt=Object.defineProperty,RBe=(e,t)=>{for(var n in t)hWt(e,n,{get:t[n],enumerable:!0})},Ld=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=CS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=pWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,voe(this._preds[s],r),voe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],xoe(this._preds[o],s),xoe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function voe(e,t){e[t]?e[t]++:e[t]=1}function xoe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function CS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function pWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return CS(e,t.v,t.w,t.name)}var mWt="4.0.1",IBe={};RBe(IBe,{read:()=>vWt,write:()=>gWt});function gWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:bWt(e),edges:yWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function bWt(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 yWt(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 vWt(e){let t=new Ld(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 uK={};RBe(uK,{CycleException:()=>jP,bellmanFord:()=>PBe,components:()=>kWt,dijkstra:()=>_P,dijkstraAll:()=>EWt,findCycles:()=>CWt,floydWarshall:()=>TWt,isAcyclic:()=>jWt,postorder:()=>RWt,preorder:()=>IWt,prim:()=>PWt,shortestPaths:()=>DWt,tarjan:()=>MBe,topsort:()=>LBe});var xWt=()=>1;function PBe(e,t,n,i){return wWt(e,String(t),n||xWt,i||function(r){return e.outEdges(r)})}function wWt(e,t,n,i){let r={},s,o=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 _P(e,t,n,i){let r=function(s){return e.outEdges(s)};return SWt(e,String(t),n||OWt,i||r)}function SWt(e,t,n,i){let r={},s=new DBe,o,l,c=function(u){let d=u.v!==o?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&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function EWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=_P(e,r,t,n),i},{})}function MBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).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(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function CWt(e){return MBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var AWt=()=>1;function TWt(e,t,n){return _Wt(e,t||AWt,n||function(i){return e.outEdges(i)})}function _Wt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=$Be(e,l,n==="post",o,s,i,r)}),r}function $Be(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=$Be(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function FBe(e,t,n){return NWt(e,t,n,function(i,r){return i.push(r),i},[])}function RWt(e,t){return FBe(e,t,"post")}function IWt(e,t){return FBe(e,t,"pre")}function PWt(e,t){let n=new Ld,i={},r=new DBe,s;function o(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(o)}return n}function DWt(e,t,n,i){return MWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function MWt(e,t,n,i){if(n===void 0)return _P(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.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 BBe(e){let t=new Ld({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 woe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=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)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function XT(e){let t=mA(QBe(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 $Wt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=hh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function FWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=hh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function koe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Sk(e,"border",r,t)}function BWt(e,t=UBe){let n=[];for(let i=0;iUBe){let n=BWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function QBe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return hh(Math.max,t)}function UWt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function zBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function VBe(e,t){return t()}var QWt=0;function dK(e){let t=++QWt;return e+(""+t)}function mA(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 zWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var TL="\0",VWt="3.0.0",HWt=class{constructor(){fWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ooe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ooe(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,qWt)),n=n._prev;return"["+e.join(", ")+"]"}};function Ooe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var WWt=HWt,KWt=()=>1;function GWt(e,t){if(e.nodeCount()<=1)return[];let n=YWt(e,t||KWt);return XWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function XWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(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(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=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,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function YWt(e,t){let n=new Ld,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=ZWt(r+i+3).map(()=>new WWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(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 ZWt(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,dK("rev"))});function t(n){return i=>n.edge(i).weight}}function eKt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function tKt(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 nKt(e){e.graph().dummyChains=[],e.edges().forEach(t=>iKt(e,t))}function iKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=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 fK(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),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=hh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function j1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var HBe=sKt;function sKt(e){let t=new Ld({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,o;for(;aKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!j1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function oKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=j1(t,i)),rt.node(i).rank+=n)}var{preorder:cKt,postorder:uKt}=uK,dKt=n0;n0.initLowLimValues=pK;n0.initCutValues=hK;n0.calcCutValue=qBe;n0.leaveEdge=KBe;n0.enterEdge=GBe;n0.exchangeEdges=XBe;function n0(e){e=LWt(e),fK(e);let t=HBe(e);pK(t),hK(t,e);let n,i;for(;n=KBe(t);)i=GBe(t,e,n),XBe(t,e,n,i)}function hK(e,t){let n=uKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>fKt(e,t,i))}function fKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=qBe(e,t,n)}function qBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=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(o+=f?h:-h,pKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function pK(e,t){arguments.length<2&&(t=e.nodes()[0]),WBe(e,{},1,t)}function WBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=WBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function KBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function GBe(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),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===Soe(e,e.node(u.v),l)&&c!==Soe(e,e.node(u.w),l)).reduce((u,d)=>j1(t,d)!e.node(r).parent);if(!n)return;let i=cKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function pKt(e,t,n){return e.hasEdge(t,n)}function Soe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var mKt=gKt;function gKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Eoe(e);break;case"tight-tree":yKt(e);break;case"longest-path":bKt(e);break;case"none":break;default:Eoe(e)}}var bKt=fK;function yKt(e){fK(e),HBe(e)}function Eoe(e){dKt(e)}var vKt=xKt;function xKt(e){let t=kKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=wKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||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 kKt(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(TL).forEach(i),t}function OKt(e){let t=Sk(e,"root",{},"_root"),n=SKt(e),i=Object.values(n),r=hh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=EKt(e)+1;e.children(TL).forEach(l=>YBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function YBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=koe(e,"_bt"),d=koe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;YBe(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[o])!=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(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function SKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(TL).forEach(i=>n(i,1)),t}function EKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function CKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var AKt=TKt;function TKt(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,o=r.maxRank+1;sAoe(e.node(t))),e.edges().forEach(t=>Aoe(e.edge(t)))}function Aoe(e){let t=e.width;e.width=e.height,e.height=t}function NKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function RKt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function IKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=hh(Math.max,i),s=mA(r+1).map(()=>[]);function o(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(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function PKt(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 MKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.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 LKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return $Kt(i)}function $Kt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&FKt(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=>NP(r,["vs","i","barycenter","weight"]))}function FKt(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 BKt(e,t){let n=UWt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort(UKt(!!t)),c=Toe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Toe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Toe(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 UKt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function JBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=MKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=JBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&zKt(h,m)}});let d=LKt(u,n);QKt(d,c);let f=BKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);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 QKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function zKt(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 VKt(e,t,n,i){i||(i=e.nodes());let r=HKt(e),s=new Ld({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function HKt(e){let t;for(;e.hasNode(t=dK("_root")););return t}function qKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function e9e(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,e9e);return}let n=QBe(e),i=_oe(e,mA(1,n+1),"inEdges"),r=_oe(e,mA(n-1,-1,-1),"outEdges"),s=IKt(e);if(joe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){WKt(u%2?i:r,u%4>=2,c),s=XT(e);let f=PKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return VKt(e,s,n,i.get(s)||[])})}function WKt(e,t,n){let i=new Ld;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=JBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),qKt(r,i,o.vs)})}function joe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function KKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=XKt(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)&&t9e(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.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(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function XKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function t9e(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 YKt(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 ZKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[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=o[m],v=o[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=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],k=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(k!==void 0?k: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 o.predecessors(m)||[]}function h(m){return o.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 eGt(e,t,n,i){let r=new Ld,s=e.graph(),o=sGt(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(o(e,u,c),h||0))}}c=u}})}),r}function tGt(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=aGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-hh(Math.min,u);o!=="l"&&(d=r-hh(Math.max,u)),d&&(e[l]=AL(c,f=>f+d))})})}function iGt(e,t=void 0){let n=e.ul;return n?AL(n,(i,r)=>{var s,o;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)+((o=l[2])!=null?o:0))/2}):{}}function rGt(e){let t=XT(e),n=Object.assign(KKt(e,t),GKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=ZKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=JKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=AL(u,d=>-d)),i[o+l]=u})});let s=tGt(e,i);return nGt(i,s),iGt(i,e.graph().align)}function sGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.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 aGt(e,t){return e.node(t).width}function oGt(e){e=BBe(e),lGt(e),Object.entries(rGt(e)).forEach(([t,n])=>e.node(t).x=n)}function lGt(e){let t=XT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.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 cGt(e,t={}){let n=t.debugTiming?zBe:VBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>vGt(e));return n(" runLayout",()=>uGt(i,n,t)),n(" updateInputGraph",()=>dGt(e,i)),i})}function uGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>xGt(e)),t(" removeSelfEdges",()=>_Gt(e)),t(" acyclic",()=>JWt(e)),t(" nestingGraph.run",()=>OKt(e)),t(" rank",()=>mKt(BBe(e))),t(" injectEdgeLabelProxies",()=>wGt(e)),t(" removeEmptyRanks",()=>FWt(e)),t(" nestingGraph.cleanup",()=>CKt(e)),t(" normalizeRanks",()=>$Wt(e)),t(" assignRankMinMax",()=>kGt(e)),t(" removeEdgeLabelProxies",()=>OGt(e)),t(" normalize.run",()=>nKt(e)),t(" parentDummyChains",()=>vKt(e)),t(" addBorderSegments",()=>AKt(e)),t(" order",()=>e9e(e,n)),t(" insertSelfEdges",()=>jGt(e)),t(" adjustCoordinateSystem",()=>_Kt(e)),t(" position",()=>oGt(e)),t(" positionSelfEdges",()=>NGt(e)),t(" removeBorderNodes",()=>TGt(e)),t(" normalize.undo",()=>rKt(e)),t(" fixupEdgeLabelCoords",()=>CGt(e)),t(" undoCoordinateSystem",()=>jKt(e)),t(" translateGraph",()=>SGt(e)),t(" assignNodeIntersects",()=>EGt(e)),t(" reversePoints",()=>AGt(e)),t(" acyclic.undo",()=>tKt(e))}function dGt(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 fGt=["nodesep","edgesep","ranksep","marginx","marginy"],hGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},pGt=["acyclicer","ranker","rankdir","align","rankalign"],mGt=["width","height","rank"],Noe={width:0,height:0},gGt=["minlen","weight","width","height","labeloffset"],bGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yGt=["labelpos"];function vGt(e){let t=new Ld({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},hGt,a6(n,fGt),NP(n,pGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,mGt);Object.keys(Noe).forEach(l=>{s[l]===void 0&&(s[l]=Noe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},bGt,a6(r,gGt),NP(r,yGt)))}),t}function xGt(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 wGt(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};Sk(e,"edge-proxy",r,"_ep")}})}function kGt(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 OGt(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 SGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=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-=o,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+o,s.height=r-i+l}function EGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(woe(i,s)),n.points.push(woe(r,o))})}function CGt(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 AGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function TGt(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]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.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 _Gt(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 jGt(e){XT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{Sk(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function NGt(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,o=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:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return AL(NP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function RGt(e){let t=XT(e),n=new Ld({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((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var IGt={graphlib:NBe,version:VWt,layout:cGt,debug:RGt,util:{time:zBe,notime:VBe}},Roe=IGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const AS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Uje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:zat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Oat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:qje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:eM}},U7=220,Q7=88,Ioe=96,Poe=34,IE=64,l6=310,qx=24,n9e=56,z7=40,Doe=40,PGt=18,DGt=58,MGt=!1,LGt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return LGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:IE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=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"?n9e:qx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?PGt+Doe:r==="loop"?DGt:0:Doe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:IE+qx+l+d+qx}:{width:Math.max(l6,o+qx*2),height:IE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function DO(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function $Gt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Moe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function MO(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:dA.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 Loe(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 o(f,h,m,g,b){const v=f.agentType??"llm",y=DO(h);return V7(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(AS[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=H7(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(AS[v].labelKey)),pattern:v,description:f.description.trim()||i(AS[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,j)=>H7(E,[...h,j],t,n)),k=x.length&&v!=="parallel"?n9e:qx,S=t==="horizontal"?v!=="parallel":v==="parallel";let O=k;const A=f.subAgents.map((E,j)=>{const T=x[j],R=S?{x:O,y:IE+qx}:{x:(w.width-T.width)/2,y:IE+O};return O+=(S?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(MO(A[A.length-1],A[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=DO(h);if(V7(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(AS[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(MO(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(MO("terminal-input",u)),d.forEach(f=>s.push(MO(f,"terminal-output"))),FGt(r,s,t)}function FGt(e,t,n){const i=new Roe.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 o=s.data.kind==="terminal";i.setNode(s.id,{width:o?Ioe:s.data.layoutWidth??U7,height:o?Poe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Roe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?Ioe:s.data.layoutWidth??U7,u=l?Poe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const _L=p.createContext(null),jL=p.createContext("horizontal");function BGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=_e("create"),h=p.useContext(_L),[m,g]=p.useState(!1),[b,v,y]=AP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(GT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(Rqt,{children:a.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&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.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:a.jsx(ec,{})})]})})]})}function UGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=AS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.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:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function QGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.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 a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.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:a.jsx(ec,{})}),a.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:a.jsx(ec,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.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:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function zGt({data:e}){const t=p.useContext(jL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx(Dc,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx(Dc,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const VGt={agent:UGt,group:QGt,terminal:zGt},HGt={insertStep:BGt};function qGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=_e("create"),d=p.useMemo(()=>Loe(e,c,o,u),[]),[f,h,m]=Iqt(d.nodes),[g,b,v]=Pqt(d.edges),y=Mqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Moe(e)}`),x=p.useRef(null),{fitView:k}=EL(),S=p.useMemo(()=>Loe(e,c,o,u),[c,e,o,u]),[O,A]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:O?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[O,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const C=x.current;if(C&&(C.clientWidth===0||C.clientHeight===0)&&R<8){j(R+1);return}k(E)})})},[E,k]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),C=N=>A(N.matches);return R.addEventListener("change",C),()=>R.removeEventListener("change",C)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Moe(e)}`,C=R!==w.current;w.current=R,b(S.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return S.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!C&&D&&D.type===I.type?D.measured:void 0,position:!C&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&$Gt(I.data.path,t)}})}),C&&j()},[S,e,j,t,b,h]),p.useEffect(()=>{j()},[O,j]),p.useEffect(()=>{y&&j()},[S,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(jL.Provider,{value:c,children:a.jsx(_L.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(jqt,{nodes:f,edges:g,nodeTypes:VGt,edgeTypes:HGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,C)=>{!o&&C.data.kind==="agent"&&C.data.path&&n(C.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.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:[a.jsx(Uqt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Kqt,{showInteractive:!1}),MGt]})})})})})}function RP(e){return a.jsx(CBe,{children:a.jsx(qGt,{...e})})}function WGt(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 KGt=[{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"}]}],GGt={核心能力回归:"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 TS(e,t){const n=GGt[e];return n?t(n):e}const XGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],YGt=20;function i9e(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 LO=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function r9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function mx(e){var t;return r9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function $oe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function s9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(r9e).filter(Boolean):[]}function ZGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function JGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function eXt({preview:e,t}){var i,r;const n=e.blockers.map(s=>ZGt(s,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(s=>a.jsx("li",{children:s},s))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(s=>a.jsxs("li",{children:[t(`agentWorkspace.mpaDeleteStage.${s.stage}`,{count:s.count}),s.resourceId&&a.jsxs("span",{children:[" (",s.resourceId,")"]})]},s.stage))}),!!((i=e.retainedResources)!=null&&i.length)&&a.jsxs("div",{children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteRetained")}),a.jsx("ul",{children:(r=e.retainedResources)==null?void 0:r.map(s=>a.jsxs("li",{children:[s.resourceId," — ",t(`agentWorkspace.mpaDeleteRetainedReason.${s.reason}`,{defaultValue:s.reason})]},`${s.stage}:${s.resourceId}`))})]})]})}function c6(e,t){return e instanceof rw&&e.status===412?t:e instanceof Error?e.message:String(e)}function tXt(e){return s9e(e).length}function Foe(e,t){const n=s9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Boe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function nXt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function iXt(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 Uoe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Qoe(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 rXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function a9e(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 rXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python +HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function sXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python import uuid import requests -BASE_URL = ${W7(i)} -APP_NAME = ${W7(t)} +BASE_URL = ${q7(i)} +APP_NAME = ${q7(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${i9e(n)} +${a9e(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -819,13 +819,13 @@ with requests.post( for line in response.iter_lines(): if line: print(line.decode("utf-8")) -\`\`\``}function sXt(e,t){return`\`\`\`python +\`\`\``}function aXt(e,t){return`\`\`\`python import uuid import requests -AGENT_URL = ${W7(e)} -${i9e(t)} +AGENT_URL = ${q7(e)} +${a9e(t)} response = requests.post( AGENT_URL, @@ -846,23 +846,23 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function aXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function Boe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.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:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(aXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Uoe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(jd,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function qv(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function K7(e){return Array.isArray(e)?`[${e.map(K7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${K7(i)}`).join(",")}}`:JSON.stringify(e)}async function oXt(e,t,n){const i=new TextEncoder().encode(K7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function lXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=Te("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:qv(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",qv(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:qv(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",qv(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:qv(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",qv(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function cXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=Te("ui"),O=r||s||o,k=Doe(e,"model"),S=Doe(e,"mcpServers"),E=px(e),C=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":O,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:O,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:C??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&C!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:C})}),a.jsx("button",{type:"button",onClick:y,disabled:O,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(k?`agentWorkspace.executionConfigMode.${k}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:E||x("agentWorkspace.inheritProfileDefault"),disabled:O})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:O||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:O||!Loe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:eXt(e)})}),a.jsx("small",{title:Moe(e,x),children:Moe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:O||S==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:O||!Loe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Qoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function uXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function dXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function fXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=Te("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:e9e(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Qoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:uXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:dXt(g.durationMs,l)}),a.jsx("td",{children:Qoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function hXt(e,t,n){var i;return hH({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 r9e(e){return e?1+e.children.reduce((t,n)=>t+r9e(n),0):1}function s9e(e){return 1+e.subAgents.reduce((t,n)=>t+s9e(n),0)}function G7(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 pXt(e,t,n){const i=G7(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 mXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function gXt(e,t){return t(`agentWorkspace.priority.${e}`)}const bXt={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 yXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(bXt[e.module])}function vXt(e,t){return e.find(n=>n.kind===t)}function zoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>G7(i.createdAt)-G7(n.createdAt))}function xXt(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 wXt(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 OXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function a9e(e,t){const n=wXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(OXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.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 o9e(e,t){const n=a9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function kXt(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 l9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=Te("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 oXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function zoe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=_e("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.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:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(oXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Voe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=_e("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(Nd,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function K0(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function lXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function cXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=_e("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:K0(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",K0(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",K0(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",K0(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function uXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=_e("ui"),k=r||s||o,S=$oe(e,"model"),O=$oe(e,"mcpServers"),A=mx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":k,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:k,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:k,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:A||x("agentWorkspace.inheritProfileDefault"),disabled:k})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:k||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:k||!Boe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(O?`agentWorkspace.executionConfigMode.${O}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:tXt(e)})}),a.jsx("small",{title:Foe(e,x),children:Foe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:k||O==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:k||!Boe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Hoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function dXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function fXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function hXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=_e("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:i9e(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Hoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:dXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:fXt(g.durationMs,l)}),a.jsx("td",{children:Hoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function pXt(e,t,n){var i;return hH({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 o9e(e){return e?1+e.children.reduce((t,n)=>t+o9e(n),0):1}function l9e(e){return 1+e.subAgents.reduce((t,n)=>t+l9e(n),0)}function K7(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 mXt(e,t,n){const i=K7(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 gXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function bXt(e,t){return t(`agentWorkspace.priority.${e}`)}const yXt={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 vXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(yXt[e.module])}function xXt(e,t){return e.find(n=>n.kind===t)}function qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function wXt(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 kXt(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 OXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function c9e(e,t){const n=kXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(OXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.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 u9e(e,t){const n=c9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function SXt(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 d9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,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 C=c.current;C&&(C.scrollTop=C.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=kXt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",S=[O,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",k,x].filter(Boolean).join(" · ");async function E(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:S})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(C=>!C),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void E(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function SXt({task:e}){var n;const{t}=Te("ui");return a.jsx(l9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&o9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function EXt({task:e}){var n;const{t}=Te("ui");return a.jsx(l9e,{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 CXt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),[i,r]=p.useState(!1),s=a9e(e,n),o=o9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=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"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(bN,{}):e.status==="running"?a.jsx(Bi,{className:"spin"}):e.status==="success"?a.jsx(Tat,{}):e.status==="error"?a.jsx(bN,{}):a.jsx(lB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[lr,Mn]=p.useState(()=>new Set),[ei,Bn]=p.useState(!1),[ki,zn]=p.useState(""),[Rn,di]=p.useState(null),[rt,zt]=p.useState([]),[ze,bt]=p.useState([]),[Ht,_n]=p.useState(!1),[jr,Hs]=p.useState(""),[qs,Dr]=p.useState(""),[ti,Si]=p.useState(0),[Zr,Jr]=p.useState([]),[ga,go]=p.useState(!1),[us,ge]=p.useState(""),[pr,bo]=p.useState(0),[to,fl]=p.useState(null),[no,ws]=p.useState(1),[Ws,Ti]=p.useState(!1),[rr,Ds]=p.useState(""),[Pl,hl]=p.useState(0),[mr,Mr]=p.useState(null),[pl,Mo]=p.useState(null),[Nr,Lo]=p.useState(null),[es,ba]=p.useState(!1),[Mi,Ms]=p.useState(""),[zr,ds]=p.useState(null),[ml,na]=p.useState(!1),[gi,Dl]=p.useState(""),[$o,Ks]=p.useState(0),[gl,Fo]=p.useState(""),[Pa,bl]=p.useState(!1),[Qu,Bo]=p.useState(!1),[hc,Ld]=p.useState(!1),[$d,yo]=p.useState(""),[Fd,yl]=p.useState(""),[Ml,Da]=p.useState(0),[Uo,Qo]=p.useState({saving:!1,error:"",notice:""}),[zu,vl]=p.useState(!1),[Ll,Ls]=p.useState(()=>new Set),[Ma,rn]=p.useState(!1),[$l,Os]=p.useState(""),[ts,ns]=p.useState(""),[Bd,Fl]=p.useState(()=>new Set),zo=p.useRef(!1),Bl=p.useRef(""),Gc=p.useRef(null),vo=p.useRef(0),ia=p.useRef(0),io=p.useRef(0),je=p.useRef(0),[lt,Lt]=p.useState(WGt),[Ln,wn]=p.useState("");p.useEffect(()=>{e.length!==0&&Lt(de=>de.map((Le,Ge)=>Ge===0&&Le.agentIds.length===0?{...Le,agentIds:e.slice(0,2).map(pt=>pt.id)}:Le))},[e]);const pn=p.useMemo(()=>{const de=new Map;for(const Le of e)Le.runtimeId&&de.set(Le.runtimeId,Le);return de},[e]),jn=p.useMemo(()=>{var Le;const de=new Map;for(const Ge of t){const pt=(Le=Ge.deploymentTarget)==null?void 0:Le.runtimeId;if(!pt||!pn.has(pt))continue;const ln=de.get(pt);(!ln||Ge.updatedAt>ln.updatedAt)&&de.set(pt,Ge)}return de},[pn,t]),Wt=p.useMemo(()=>{const de=new Map;for(const Le of f){if(!Le.runtimeId)continue;const Ge=de.get(Le.runtimeId);(!Ge||Le.startedAt>Ge.startedAt)&&de.set(Le.runtimeId,Le)}return de},[f]),gn=p.useMemo(()=>{const de=et.trim().toLowerCase();return de?e.filter(Le=>{const Ge=Le.runtimeId?jn.get(Le.runtimeId):void 0,pt=Le.runtimeId?Wt.get(Le.runtimeId):void 0;return[Le.label,Le.app,Le.host??"",(Ge==null?void 0:Ge.draft.name)??"",(Ge==null?void 0:Ge.draft.description)??"",(pt==null?void 0:pt.runtimeName)??""].join(" ").toLowerCase().includes(de)}):e},[e,Wt,et,jn]),$n=p.useMemo(()=>{const de=et.trim().toLowerCase();return t.filter(Le=>{var pt;const Ge=(pt=Le.deploymentTarget)==null?void 0:pt.runtimeId;return Ge&&pn.has(Ge)?!1:de?`${Le.draft.name} ${Le.draft.description}`.toLowerCase().includes(de):!0})},[pn,t,et]),ai=p.useMemo(()=>t.filter(de=>{var Ge;const Le=(Ge=de.deploymentTarget)==null?void 0:Ge.runtimeId;return!Le||!pn.has(Le)}).length,[pn,t]),is=p.useMemo(()=>{const de=et.trim().toLowerCase();return de?lt.filter(Le=>Le.name.toLowerCase().includes(de)):lt},[lt,et]),ie=e.find(de=>de.id===U),Vn=t.find(de=>de.id===z),bi=h?f.find(de=>de.id===h):void 0,La=ie!=null&&ie.runtimeId?jn.get(ie.runtimeId):void 0,le=x?xt:U&&r===U?i:null,Me=(le==null?void 0:le.appName)||(ie==null?void 0:ie.runtimeApp)||(ie==null?void 0:ie.app)||"",st=(ie==null?void 0:ie.agentCategory)??"general",Fe=st==="mpa"?"basic":H,he=(ne==null?void 0:ne.runtimeId)===(ie==null?void 0:ie.runtimeId)?ne:null,Be=he==null?void 0:he.mpaInstanceId,at=(ie==null?void 0:ie.mpaInstanceId)??Be??(ie==null?void 0:ie.runtimeId)??"",$t=GGt.filter(de=>st==="mpa"?de==="basic":de==="profileConfig"?!1:de==="usage"?c&&(ie==null?void 0:ie.runtimeId):!(de==="sessionConfig"||de==="diagnostics")).map(de=>({id:de,label:_(`agentWorkspace.sections.${de}`)})),kn=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",(ie==null?void 0:ie.region)??"cn-beijing",Me,no]),_i=(to==null?void 0:to.requestKey)===kn?to.value:null,sn=`${(ie==null?void 0:ie.region)??"cn-beijing"}:${(ie==null?void 0:ie.runtimeId)??""}`,oi=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",at,(ie==null?void 0:ie.region)??"cn-beijing",y]),Vt=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",at,(ie==null?void 0:ie.region)??"cn-beijing"]),fi=Vt,Un=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",(ie==null?void 0:ie.region)??"cn-beijing",y]),sr=(Ee==null?void 0:Ee.requestKey)===sn?Ee.value:"",Hn=(X==null?void 0:X.requestKey)===sn?X:null,gr=(mr==null?void 0:mr.requestKey)===oi&&y?mr.value:null,ks=(Nr==null?void 0:Nr.requestKey)===Vt?Nr.value:null,Vi=(pl==null?void 0:pl.requestKey)===fi?pl.value:(ks==null?void 0:ks.profile)??null,wr=(ks==null?void 0:ks.bindingStatus)??"",Ud=ZGt((f2=ks==null?void 0:ks.safeError)==null?void 0:f2.code,_),Mb=(ks==null?void 0:ks.capabilities.canWrite)===!0,fv=(zr==null?void 0:zr.requestKey)===Un?zr:null,hv=!!(ie!=null&&ie.runtimeId&&st==="mpa"&&wr!=="runtime_missing"&&wr!=="binding_ambiguous"),$h=!!((ie==null?void 0:ie.agentCategory)==="mpa"&&(ie!=null&&ie.runtimeId)&&(ie==null?void 0:ie.runtimeId)===w&&wr==="bound"&&y),Df=(Vi==null?void 0:Vi.status)==="applied"?Vi.profileRevision:null,Rr=!!($h&&gr&&Df!=null&&Df>gr.profileRevision),xl=px(gr),Vu=gl.trim()!==xl,pc=!!((bc=Hn==null?void 0:Hn.apiApps)!=null&&bc.length),$a=!!(Hn!=null&&Hn.a2a),km=((xv=Hn==null?void 0:Hn.apiApps)==null?void 0:xv[0])??Me,Hu=(ne==null?void 0:ne.endpoint)??"",Mf=nXt(((Vd=Hn==null?void 0:Hn.a2a)==null?void 0:Vd.endpoint)??"",Hu),Ul=(ie==null?void 0:ie.runtimeApp)||"",ro=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",(ie==null?void 0:ie.region)??"",(ie==null?void 0:ie.currentVersion)??null,Ul]),mc=l&&(ie!=null&&ie.runtimeId)&&ie.region&&qe===0?q8({runtimeId:ie.runtimeId,region:ie.region,appName:Ul,currentVersion:ie.currentVersion}):null,yt=(He==null?void 0:He.requestKey)===ro?He.value:mc,Vo=yt!=null&&yt.reason?So(yt.reason,L.resolvedLanguage||L.language):"",Xi=(yt==null?void 0:yt.warnings.filter(de=>So(de,L.resolvedLanguage||L.language)))??[],Fa=st!=="mpa";p.useEffect(()=>{const de=vo.current+1;vo.current=de,Qe(null),Ct("");const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"";if(!Fa||!l||!Le||!Ge){Pt(!1);return}const pt=qe===0?q8({runtimeId:Le,region:Ge,appName:Ul,currentVersion:ie==null?void 0:ie.currentVersion}):null;if(pt){Qe({requestKey:ro,value:pt}),Pt(!1);return}const ln=new AbortController;let Ze,En=0;const Lr=60;Pt(!0);const Ii=hs=>{PD({runtimeId:Le,region:Ge,appName:Ul,currentVersion:ie==null?void 0:ie.currentVersion,signal:ln.signal,force:hs&&qe>0}).then(sa=>{var BO,Qb;if(de!==vo.current)return;const Qh=sa.recoveryStatus==="preparing";if(sa.runtime.runtimeId!==Le||sa.runtime.region!==Ge||!Qh&&Ul&&((BO=sa.agent)==null?void 0:BO.appName)!==Ul||sa.canUpdate&&!((Qb=sa.agent)!=null&&Qb.appName)){Ct(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Qe({requestKey:ro,value:sa}),Pt(!1),!!Qh){if(En+=1,En>=Lr){Ct(_("agentWorkspace.errors.updateConfigRestoring"));return}Ze=window.setTimeout(()=>Ii(!1),1e3)}}).catch(()=>{de!==vo.current||ln.signal.aborted||Ct(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{de===vo.current&&!ln.signal.aborted&&Pt(!1)})};return Ii(!0),()=>{ln.abort(),Ze!=null&&window.clearTimeout(Ze)}},[l,Ul,qe,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,Fa,ro]);const Nn=p.useMemo(()=>{const de=new Map(e.map((Ge,pt)=>[Ge.id,pt])),Le=new Map(n.map((Ge,pt)=>[Ge,pt]));return[...gn].sort((Ge,pt)=>{const ln=Ge.runtimeId?Wt.get(Ge.runtimeId):void 0,Ze=pt.runtimeId?Wt.get(pt.runtimeId):void 0,En=(ln==null?void 0:ln.status)==="running"?ln.startedAt:0,Lr=(Ze==null?void 0:Ze.status)==="running"?Ze.startedAt:0;if(En!==Lr)return Lr-En;const Ii=Le.get(Ge.id),hs=Le.get(pt.id);return Ii!=null&&hs!=null?Ii-hs:Ii!=null?-1:hs!=null?1:(de.get(Ge.id)??0)-(de.get(pt.id)??0)})},[n,e,gn,Wt]),Qd=(ie==null?void 0:ie.label)||(le==null?void 0:le.name)||(Vn==null?void 0:Vn.draft.name)||(bi==null?void 0:bi.agentName)||((FO=bi==null?void 0:bi.agentDraft)==null?void 0:FO.name)||_("agentWorkspace.noAgentSelected"),_O=lt.find(de=>de.id===Ln),pv=Nn.filter(de=>de.canDelete===!0),Lb=Nn.filter(de=>zi.has(de.id)&&de.canDelete===!0),gc=$n.filter(de=>lr.has(de.id)),e2=pv.length+$n.length,Lf=Lb.length+gc.length,Ba=p.useMemo(()=>{var Le;if(bi!=null&&bi.agentDraft)return bi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const de=(Le=ie==null?void 0:ie.region)!=null&&Le.startsWith("ap-")?"byteplus":"volcengine";return yt!=null&&yt.agent&&(yt.recoveryStatus==="complete"||yt.recoveryStatus==="draft-only")?hH(yt.agent,de,yt.runtime.configuredEnvKeys):hXt(le,Me||(ie==null?void 0:ie.label)||"agent",de)},[le,Me,ie==null?void 0:ie.label,ie==null?void 0:ie.region,Vn==null?void 0:Vn.draft,bi==null?void 0:bi.agentDraft,yt]),Dn=((ra=le==null?void 0:le.draft)==null?void 0:ra.harnessSidecar)??umt(ne==null?void 0:ne.envs),t2=Dn?J1.filter(de=>Dn.componentOverrides[de]):[],n2=p.useMemo(()=>BA(Ba),[Ba]),Fh=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):st==="mpa"?"":l?ie!=null&&ie.runtimeId?ie.region?jt?_("agentWorkspace.errors.checkingUpdateConfig"):Kt||(yt?yt.recoveryStatus!=="complete"&&yt.recoveryStatus!=="draft-only"?Vo||_("agentWorkspace.errors.originalConfigUnavailable"):yt.canUpdate?(h2=yt.agent)!=null&&h2.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Vo||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),$b="aw-update-disabled-reason",WL=ie?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr&&!hv?_("agentWorkspace.mpaRuntimeMissing"):Mb?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),Fb=ie?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?ie.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),i2=ie?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||(wr!=="bound"?Fb:y?ie.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Sm=p.useMemo(()=>{if(le)return le.tools;const de=(Ba.builtinTools??[]).map(Le=>{var Ge;return((Ge=sT.find(pt=>pt.id===Le))==null?void 0:Ge.label)??Le});return Array.from(new Set([...Ba.tools,...de,...(Ba.customTools??[]).map(Le=>Le.name),...(Ba.mcpTools??[]).map(Le=>Le.name)].filter(Boolean)))},[Ba,le]),Bb=p.useMemo(()=>le?le.skillsPreviewSupported?le.skills.map(de=>de.name):null:Array.from(new Set([...(Ba.selectedSkills??[]).map(de=>de.name),...Ba.skills].filter(Boolean))),[Ba,le]),Vr=p.useMemo(()=>{if(bi)return bi;if(Vn){const de=f.filter(Le=>Le.draftId===Vn.id).sort((Le,Ge)=>Ge.startedAt-Le.startedAt)[0];return de||f.filter(Le=>{var Ge,pt;return((Ge=Le.agentDraft)==null?void 0:Ge.name)===Vn.draft.name||Le.agentName===Vn.draft.name||!!((pt=Vn.deploymentTarget)!=null&&pt.runtimeId)&&Le.runtimeId===Vn.deploymentTarget.runtimeId}).sort((Le,Ge)=>Ge.startedAt-Le.startedAt)[0]}if(ie)return f.filter(de=>!!ie.runtimeId&&de.runtimeId===ie.runtimeId||de.agentName===ie.label).sort((de,Le)=>Le.startedAt-de.startedAt)[0]},[f,ie,Vn,bi]),r2=!!(h&&Vr&&Vr.id===h),mv=!!(Vr&&(Vr.status!=="success"||r2)),qu=(Vr==null?void 0:Vr.status)==="running",Em=Vr!=null&&Vr.draftId?t.find(de=>de.id===Vr.draftId)??(Vr.agentDraft?{id:Vr.draftId,draft:Vr.agentDraft,updatedAt:Vr.startedAt}:void 0):void 0,Xc=p.useMemo(()=>xXt(Ba),[Ba]),Bh=(ie==null?void 0:ie.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,$f=Bh??(bi==null?void 0:bi.startedAt)??"unknown",Di=le?`runtime:${(ie==null?void 0:ie.runtimeId)??le.name}:v${$f}:${Xc}`:`draft:${(bi==null?void 0:bi.id)??(Vn==null?void 0:Vn.id)??(ie==null?void 0:ie.id)??Qd}:${Xc}`;p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=at||Le,pt=(ie==null?void 0:ie.region)??"cn-beijing",ln=Vt;if(Ms(""),st!=="mpa"||!Le||Fe!=="profileConfig"&&Fe!=="sessionConfig"){Lo(null),ba(!1);return}const Ze=new AbortController;return ba(!0),CTe({mpaInstanceId:Ge,runtimeId:Le,region:pt,signal:Ze.signal}).then(En=>{de||(Lo({requestKey:ln,value:En}),Mo(En.profile?{requestKey:fi,value:En.profile}:null))}).catch(En=>{de||Ze.signal.aborted||(Lo(null),Ms(En instanceof Error?En.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{de||ba(!1)}),()=>{de=!0,Ze.abort()}},[qe,Vt,Fe,at,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,st,fi,_]),p.useEffect(()=>{Fe==="usage"&&!c&&q("basic")},[c,Fe]),p.useEffect(()=>{Fe==="sessionConfig"&&(!(ie!=null&&ie.runtimeId)||st!=="mpa")&&q("basic")},[Fe,ie==null?void 0:ie.runtimeId,st]),p.useEffect(()=>{Fe==="diagnostics"&&(!(ie!=null&&ie.runtimeId)||st!=="mpa")&&q("basic")},[Fe,ie==null?void 0:ie.runtimeId,st]),p.useEffect(()=>{if(!h)return;const de=f.find(Ge=>Ge.id===h),Le=de!=null&&de.runtimeId?pn.get(de.runtimeId):void 0;if(Le){J(""),Z(Le.id),q("basic");return}Z(""),J(""),q("basic")},[pn,f,h]),p.useEffect(()=>{if(!m){Bl.current="";return}const de=`${m}:${g}:${b}:${c}`;Bl.current!==de&&e.some(Le=>Le.id===m)&&(Bl.current=de,J(""),Z(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(At(b),Gt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const de of Nn.slice(0,8)){if(!de.runtimeId)continue;const Le=de.region??"cn-beijing";T2e(de.runtimeId,Le),xTe(de.runtimeId,Le,de.runtimeApp??"")}},[Nn]),p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing",pt=(ie==null?void 0:ie.runtimeApp)??"",ln=Le?vTe(Le,Ge,pt):null;if(tt(ln),Nt(""),xn(!1),_e(!!ln||!x||!Le),!(!x||!Le))return Az(Le,Ge,pt,{force:!0}).then(Ze=>{de||tt(Ze)}).catch(Ze=>{!de&&!ln&&tt(null),de||(xn(Ze instanceof Oa&&Ze.unsupported),Nt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{de||_e(!0)}),()=>{de=!0}},[x,qe,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeApp,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing";if(Jr([]),ge(""),Fe!=="optimizations"||!Le){go(!1);return}if(x&&!Me){go(!mt);return}return go(!0),sTe({runtimeId:Le,region:Ge,appName:Me}).then(pt=>{de||Jr(pt.groups)}).catch(()=>{de||ge(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{de||go(!1)}),()=>{de=!0}},[mt,x,pr,Fe,Me,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{ws(1)},[ie==null?void 0:ie.runtimeId,Me]),p.useEffect(()=>{const de=io.current+1;io.current=de;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing",pt=Me;if(Ds(""),Fe!=="usage"||!Le){Ti(!1);return}if(!pt){Ti(x&&!mt);return}const ln=new AbortController;return Ti(!0),p2e({runtimeId:Le,region:Ge,appName:pt,page:no,pageSize:XGt,signal:ln.signal}).then(Ze=>{if(de===io.current){if(Ze.runtimeId!==Le||Ze.appName!==pt||Ze.page!==no){Ds(_("agentWorkspace.errors.usageMismatch"));return}fl({requestKey:kn,value:Ze})}}).catch(()=>{de!==io.current||ln.signal.aborted||Ds(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{de===io.current&&Ti(!1)}),()=>{ln.abort()}},[no,Pl,kn,mt,x,Fe,Me,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{ia.current+=1,xe(null),We(!1),Re(!1),ce(""),me("api-server")},[sn,Fe]),p.useEffect(()=>{const de=(ie==null?void 0:ie.runtimeId)??"",Le=(ie==null?void 0:ie.region)??"cn-beijing",Ge=Un;if(Dl(""),Fe!=="diagnostics"||st!=="mpa"||wr!=="bound"||!de||!y||de!==w){na(!1),Fe!=="diagnostics"&&ds(null);return}const pt=new AbortController;let ln=!1;return na(!0),TTe({runtimeId:de,region:Le,sessionId:y,signal:pt.signal}).then(async Ze=>{const En=Ze.runs[0],Lr=En?await _Te({runtimeId:de,region:Le,sessionId:y,invocationId:En.invocationId,signal:pt.signal}):null;return{runs:Ze.runs,trace:Lr}}).then(Ze=>{ln||ds({requestKey:Ge,...Ze})}).catch(Ze=>{ln||pt.signal.aborted||(ds(null),Dl(Ze instanceof Error?Ze.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{ln||na(!1)}),()=>{ln=!0,pt.abort()}},[w,y,$o,Un,Fe,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,st,wr,_]);function so(){ia.current+=1,xe(null),We(!1),Re(!1),ce("")}function fs(de){de!==se&&(so(),me(de))}async function jO(){if(Ne){so();return}const de=(ie==null?void 0:ie.runtimeId)??"",Le=(ie==null?void 0:ie.region)??"cn-beijing";if(!de)return;const Ge=ia.current+1;ia.current=Ge,Re(!0),ce("");try{const pt=await S2e(de,Le);if(Ge!==ia.current)return;xe({requestKey:sn,value:pt}),We(!0)}catch(pt){if(Ge!==ia.current)return;xe(null),We(!1),ce(pt instanceof Error?pt.message:_("agentWorkspace.errors.loadApiKey"))}finally{Ge===ia.current&&Re(!1)}}p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing",pt=Le?A2e(Le,Ge):null;if(W(pt),St(""),!!Le)return DD(Le,Ge,{force:!0}).then(ln=>{de||W(ln)}).catch(()=>{!de&&!pt&&W(null),de||St(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{de=!0}},[qe,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{const de=je.current+1;if(je.current=de,yo(""),yl(""),Bo(!1),Ld(!1),Fe!=="sessionConfig"||!$h||!(ie!=null&&ie.runtimeId)){bl(!1),Mr(null),Fo("");return}const Le=ie.runtimeId,Ge=at||Le,pt=ie.region??"cn-beijing",ln=oi,Ze=new AbortController;return bl(!0),Promise.all([Iz({runtimeId:Le,region:pt,sessionId:y,signal:Ze.signal}),ETe({runtimeId:Le,region:pt,mpaInstanceId:Ge,signal:Ze.signal}).catch(()=>null)]).then(([En,Lr])=>{de===je.current&&(Mr({requestKey:ln,value:En}),Fo(px(En)),Mo(Lr?{requestKey:fi,value:Lr}:null))}).catch(En=>{de!==je.current||Ze.signal.aborted||(En==null?void 0:En.name)==="AbortError"||(Mr(null),Fo(""),yo(En instanceof Error?En.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{de===je.current&&!Ze.signal.aborted&&bl(!1)}),()=>{Ze.abort()}},[y,Ml,oi,$h,Fe,fi,at,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,_]),p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"";if(be(""),Fe!=="versions"||!Le){$e(!1),Le||Se(null);return}return $e(!0),fN(Le).then(Ge=>{de||Se(Ge)}).catch(()=>{de||(Se(null),be(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{de||$e(!1)}),()=>{de=!0}},[Fe,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing",pt=`${Ge}:${Le}`;if(te(""),Fe!=="integrations"||!Le){Y(!1),Le||V(null);return}Y(!0);const ln=Kw(Le,Ge,{retryProbe:!0}).catch(Ze=>{if(Ze instanceof Oa&&Ze.unsupported)return null;throw Ze});return Promise.all([ln,k2e(Le,Ge,{retryProbe:!0})]).then(([Ze,En])=>{de||V({requestKey:pt,apiApps:Ze,a2a:En})}).catch(()=>{de||(V(null),te(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{de||Y(!1)}),()=>{de=!0}},[ue,Fe,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{let de=!1;const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=(ie==null?void 0:ie.region)??"cn-beijing",pt=Le&&Me?aTe({runtimeId:Le,region:Ge,appName:Me,pageSize:100}):null;if(zt(pt?zoe(pt,_):[]),bt((pt==null?void 0:pt.sets)??[]),Hs(""),Dr((pt==null?void 0:pt.unsupportedMessage)??""),Fe!=="evaluations"||!Le){_n(!1);return}if(x&&!Me){_n(!mt);return}return _n(!pt),_D({runtimeId:Le,region:Ge,appName:Me,pageSize:100},{force:!0}).then(ln=>{de||(bt(ln.sets),zt(zoe(ln,_)),Dr(ln.unsupportedMessage??""))}).catch(()=>{de||(Hs(_("agentWorkspace.errors.loadEvaluations")),Dr(""))}).finally(()=>{de||_n(!1)}),()=>{de=!0}},[mt,x,ti,Fe,Me,le==null?void 0:le.appName,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,_]);async function NO(de){const Le=(ie==null?void 0:ie.runtimeId)??"",Ge=de.commitSha??"";if(!(!Le||!Ge||ke)){Ae(Ge),be("");try{await s2e({runtimeId:Le,targetCommitSha:Ge,region:ie==null?void 0:ie.region,agentCategory:st});const pt=await fN(Le);Se(pt)}catch(pt){be(pt instanceof Error?pt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ae("")}}}function RO(de,Le){return!(de instanceof iw)||de.status!==412||!de.currentState?!1:(Mr({requestKey:oi,value:de.currentState}),Fo(px(de.currentState)),yo(Le),!0)}async function s2(de="replace"){if(!(ie!=null&&ie.runtimeId)||!gr)return;const Le=ie.runtimeId,Ge=ie.region??"cn-beijing",pt=gl.trim(),ln=de==="inherit"?{category:"model",mode:de}:pt?{category:"model",mode:de,value:{id:pt}}:{category:"model",mode:"inherit"};Bo(!0),yo(""),yl("");try{const Ze=await U8({runtimeId:Le,region:Ge,sessionId:y,etag:gr.etag,changes:[ln]});Mr({requestKey:oi,value:Ze}),Fo(px(Ze)),yl(_("agentWorkspace.sessionConfigSaved"))}catch(Ze){RO(Ze,_("agentWorkspace.sessionConfigStale"))||yo(u6(Ze,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function IO(de){if(!(ie!=null&&ie.runtimeId)||!gr)return;const Le=ie.runtimeId,Ge=ie.region??"cn-beijing";Bo(!0),yo(""),yl("");try{const pt=await U8({runtimeId:Le,region:Ge,sessionId:y,etag:gr.etag,changes:[{category:"mcpServers",mode:de}]});Mr({requestKey:oi,value:pt}),yl(_("agentWorkspace.sessionConfigSaved"))}catch(pt){RO(pt,_("agentWorkspace.sessionConfigStale"))||yo(u6(pt,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function KL(){if(!(ie!=null&&ie.runtimeId)||!gr||!Df)return;const de=ie.runtimeId,Le=ie.region??"cn-beijing";Ld(!0),yo(""),yl("");try{const Ge=await jTe({runtimeId:de,region:Le,sessionId:y,etag:gr.etag,idempotencyKey:tXt(de,y,Df),targetProfileRevision:Df});Mr({requestKey:oi,value:Ge}),Fo(px(Ge)),yl(_("agentWorkspace.sessionProfileUpgraded"))}catch(Ge){RO(Ge,_("agentWorkspace.sessionConfigStale"))||yo(u6(Ge,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{Ld(!1)}}async function gv(){if(!(ie!=null&&ie.runtimeId))return;const de=ie.runtimeId,Le=ie.region??"cn-beijing",Ge=at||de,pt=(Vi==null?void 0:Vi.status)==="applied"?"update":"create",ln=(Vi==null?void 0:Vi.runtimeRevision)||(Vi==null?void 0:Vi.etag)||"",Ze=await oXt(de,pt,n2);Qo({saving:!0,error:"",notice:""});try{const En=await Nz({operationKind:pt,runtimeId:de,region:Le,mpaInstanceId:Ge,sourceProfileId:`studio-runtime:${de}:${Me||"a2a-default"}`,targetKey:pt==="update"?Ge:`runtime:${Le}:${de}`,runtimeRevision:pt==="update"?ln:void 0,draft:Ba,idempotencyKey:Ze});Qo({saving:!1,error:En.status==="succeeded"?"":En.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:En.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:En.profileRevision??_("agentWorkspace.notAvailable")}):""}),nt(Lr=>Lr+1),Da(Lr=>Lr+1)}catch(En){Qo({saving:!1,error:En instanceof Error?En.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function a2(){!(ie!=null&&ie.runtimeId)||st!=="mpa"||I==null||I({draft:Ba,runtimeId:ie.runtimeId,mpaInstanceId:at||ie.runtimeId,name:Qd,region:ie.region??"cn-beijing",appName:Me||"a2a-default",currentVersion:ie.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(Vi==null?void 0:Vi.runtimeRevision)||(Vi==null?void 0:Vi.etag)||void 0})}p.useEffect(()=>{Qo({saving:!1,error:"",notice:""})},[Vt]),p.useEffect(()=>{const de=new Set(rt.map(Le=>Le.id));Ls(Le=>{const Ge=new Set([...Le].filter(pt=>de.has(pt)));return Ge.size===Le.size?Le:Ge}),Fl(Le=>{const Ge=new Set([...Le].filter(pt=>de.has(pt)));return Ge.size===Le.size?Le:Ge}),ts&&!de.has(ts)&&ns("")},[rt,ts]),p.useEffect(()=>{vl(!1),Ls(new Set),Fl(new Set),Os(""),ns("")},[ie==null?void 0:ie.runtimeId]),p.useEffect(()=>{const de=new Set(Nn.filter(Le=>Le.canDelete===!0).map(Le=>Le.id));dn(Le=>{const Ge=new Set([...Le].filter(pt=>de.has(pt)));return Ge.size===Le.size?Le:Ge})},[Nn]),p.useEffect(()=>{const de=new Set($n.map(Le=>Le.id));Mn(Le=>{const Ge=new Set([...Le].filter(pt=>de.has(pt)));return Ge.size===Le.size?Le:Ge})},[$n]);const Cm=p.useMemo(()=>!v||!(ie!=null&&ie.runtimeId)||v.runtimeId!==ie.runtimeId||Me&&v.agentName&&v.agentName!==Me?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,ie==null?void 0:ie.runtimeId,Me,_]),xo=p.useMemo(()=>qGt(_),[_]),In=p.useMemo(()=>ie!=null&&ie.runtimeId?Cm?[Cm,...rt.filter(de=>de.id!==Cm.id&&(!de.messageId||de.messageId!==Cm.messageId))]:rt:xo,[xo,rt,Cm,ie==null?void 0:ie.runtimeId]),Am=In.filter(de=>{if(de.kind!==Et||(de.source==="auto"?"auto":"user")!==Ye)return!1;const Ge=It.trim().toLowerCase();return Ge?[de.input,de.output,de.referenceOutput,de.comment,de.tag??"",de.sessionId,de.messageId,de.userId,de.evaluationSetName].join(" ").toLowerCase().includes(Ge):!0}),PO=Am.filter(de=>Ll.has(de.id)),DO=!!(ie!=null&&ie.runtimeId),o2=de=>{At(de),Gt(""),Os("");const Le=In.find(Ge=>Ge.kind===de);ns((Le==null?void 0:Le.id)??""),window.setTimeout(()=>{var Ge;(Ge=Gc.current)==null||Ge.scrollIntoView({behavior:"smooth",block:"start"})},0)},GL=de=>{Os(""),Ls(Le=>{const Ge=new Set(Le);return Ge.has(de.id)?Ge.delete(de.id):Ge.add(de.id),Ge})},MO=()=>{Os(""),Ls(new Set(Am.map(de=>de.id)))},zd=()=>{Os(""),Ls(new Set),vl(!1)},l2=de=>{Fl(Le=>{const Ge=new Set(Le);return Ge.has(de)?Ge.delete(de):Ge.add(de),Ge})},LO=de=>{ns(de.id),Os(""),!(!de.sessionId||!de.messageId)&&(R==null||R(de))},c2=async de=>{if(!(ie!=null&&ie.runtimeId)||!Me||Ma||de.length===0)return;const Le=de.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:de.length});if(!window.confirm(Le))return;const Ge=de.map(ln=>ln.id),pt=new Set(Ge);rn(!0),Os("");try{await cTe({runtimeId:ie.runtimeId,region:ie.region??"cn-beijing",appName:Me,itemIds:Ge});const ln=new Map;for(const Ze of de)ln.set(Ze.kind,(ln.get(Ze.kind)??0)+1);zt(Ze=>Ze.filter(En=>!pt.has(En.id))),bt(Ze=>Ze.map(En=>({...En,itemCount:Math.max(0,En.itemCount-(ln.get(En.kind)??0))}))),Ls(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),Fl(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),ts&&pt.has(ts)&&ns(""),de.length>1&&vl(!1),A==null||A(de)}catch(ln){Os(ln instanceof Error?ln.message:String(ln))}finally{rn(!1)}},u2=de=>{Lt(Le=>Le.map(Ge=>Ge.id===de.id?de:Ge))},Uh=()=>{const de=new Set(e.map(pt=>pt.id)),Le=n.filter(pt=>de.has(pt)),Ge=new Set(Le);return[...Le,...e.filter(pt=>!Ge.has(pt.id)).map(pt=>pt.id)]},Ss=(de,Le,Ge)=>{if(!S||de===Le)return;const pt=Uh().filter(En=>En!==de),ln=pt.indexOf(Le),Ze=ln<0?pt.length:Ge==="after"?ln+1:ln;pt.splice(Ze,0,de),S(pt)},d2=(de,Le)=>{if(!vt||vt===Le)return;const Ge=de.currentTarget.getBoundingClientRect();un(Le),on(de.clientY>Ge.top+Ge.height/2?"after":"before")},bv=(de,Le)=>{if(!S)return;const Ge=Uh(),pt=Ge.indexOf(de),ln=Math.max(0,Math.min(Ge.length-1,pt+Le));pt<0||pt===ln||(Ge.splice(pt,1),Ge.splice(ln,0,de),S(Ge))},yv=de=>{de.canDelete===!0&&(zn(""),dn(Le=>{const Ge=new Set(Le);return Ge.has(de.id)?Ge.delete(de.id):Ge.add(de.id),Ge}))},$O=de=>{zn(""),Mn(Le=>{const Ge=new Set(Le);return Ge.has(de.id)?Ge.delete(de.id):Ge.add(de.id),Ge})},XL=()=>{zn(""),dn(new Set(pv.map(de=>de.id))),Mn(new Set($n.map(de=>de.id)))},YL=()=>{zn(""),dn(new Set),Mn(new Set),Sn(!1)},ZL=()=>{if(Lf===0||ei)return;const de=Lb.length,Le=gc.length;if(de===1&&Le===0){Ub(Lb[0]);return}zn(""),di({kind:"selection",title:_(de===1&&Le===0?"agentWorkspace.deleteAgentTitle":de===0&&Le===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:de===1&&Le===0?_("agentWorkspace.deleteAgentDescription",{name:Lb[0].label}):de===0&&Le===1?_("agentWorkspace.deleteDraftDescription",{name:gc[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:Lf,warning:de>0?_("agentWorkspace.runtimeDeletionWarning",{count:de}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(de===0&&Le===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:Lb,drafts:gc})},vv=async()=>{if(!(!Rn||ei)){Bn(!0),zn("");try{if(Rn.kind==="selection"){const{agents:de,drafts:Le}=Rn;if(de.length>0){if(!E)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await E(de)}Le.length>0&&(C==null||C(Le)),dn(new Set),Mn(new Set),Sn(!1),de.some(Ge=>Ge.id===U)&&Z(""),Le.some(Ge=>Ge.id===z)&&J("")}else if(Rn.kind==="agent"){if(!E)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await E([Rn.agent]),U===Rn.agent.id&&Z("")}else{if(!C)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));C([Rn.draft]),z===Rn.draft.id&&J("")}di(null)}catch(de){zn(de instanceof Error?de.message:String(de))}finally{Bn(!1)}}},Ub=async de=>{if(!E||de.canDelete!==!0||ei)return;zn("");let Le=null;if(de.agentCategory==="mpa"){if(!de.runtimeId||!de.region){zn(_("agentWorkspace.errors.loadMpaDeletePreview"));return}try{Le=await ATe({mpaInstanceId:de.mpaInstanceId??de.runtimeId,runtimeId:de.runtimeId,region:de.region})}catch(Ge){zn(Ge instanceof Error?Ge.message:String(Ge));return}}di({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:Le?a.jsx(JGt,{preview:Le,t:_}):_("agentWorkspace.deleteAgentDescription",{name:de.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:Le?Le.canDelete:!0,agent:de})},rs=de=>{if(!C||ei)return;const Le=de.draft.name||_("agentSelector.unnamedAgent");zn(""),di({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:Le}),confirmLabel:_("myAgents.deleteDraft"),draft:de})},Tm=()=>{const de=`eval-${Date.now()}`,Le={id:de,name:_("agentWorkspace.newEvaluationGroupName",{count:lt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Lt(Ge=>[Le,...Ge]),wn(de)},mi=de=>{u2({...de,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+de.history.length%7,status:"completed"},...de.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),ft("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),ft("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:de=>{de==null||de.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{value:et,onChange:de=>ft(de.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:Tm,disabled:F==="library"&&!o,children:[a.jsx(ic,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(E||C)&&a.jsx("div",{className:`aw-selection-toolbar${On?" is-active":""}`,children:On?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:Lf})}),a.jsx("button",{type:"button",onClick:XL,disabled:e2===0||ei,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void ZL(),disabled:Lf===0||ei,children:_(ei?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:YL,disabled:ei,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{zn(""),Sn(!0)},disabled:e2===0,children:_("common.select")})}),F==="library"&&ki&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:ki}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?is.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):is.map(de=>a.jsxs("button",{type:"button",className:`aw-agent-item${de.id===Ln?" is-active":""}`,onClick:()=>wn(de.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:CS(de.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:de.agentIds.length,runs:de.history.length})})]}),a.jsx(iE,{"aria-hidden":!0})]},de.id)):u&&Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&Nn.length===0&&$n.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),k&&a.jsx("button",{type:"button",onClick:k,children:_("common.retry")})]}):Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[$n.map(de=>{const Ge=f.filter(ln=>ln.draftId===de.id).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0]??f.filter(ln=>{var Ze,En;return((Ze=ln.agentDraft)==null?void 0:Ze.name)===de.draft.name||ln.agentName===de.draft.name||!!((En=de.deploymentTarget)!=null&&En.runtimeId)&&ln.runtimeId===de.deploymentTarget.runtimeId}).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0],pt=lr.has(de.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",On?"is-selecting":"",pt?"is-selected-for-delete":"",de.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":On?pt:void 0,onClick:()=>{if(On){$O(de);return}Z(""),J(de.id),q("basic")},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Ge==null?void 0:Ge.status)==="running"?" is-deploying":""}`,children:(Ge==null?void 0:Ge.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:de.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(iE,{"aria-hidden":!0})]},de.id)}),Nn.map(de=>{const Le=de.runtimeId?Wt.get(de.runtimeId):void 0,Ge=de.runtimeId?jn.get(de.runtimeId):void 0,pt=zi.has(de.id),ln=de.canDelete===!0,Ze=(Le==null?void 0:Le.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:(Le==null?void 0:Le.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:(Le==null?void 0:Le.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Ge?{label:_("agentWorkspace.updatePending"),className:""}:null,En=(Le==null?void 0:Le.status)==="running"?_("agentWorkspace.updatingDeployment"):Ge?_("agentWorkspace.updatePending"):de.remote?de.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Lr=["aw-agent-item","aw-agent-item--sortable",de.id===U?"is-active":"",On?"is-selecting":"",pt?"is-selected-for-delete":"",On&&!ln?"is-selection-disabled":"",de.id===vt?"is-dragging":"",de.id===Qt&&de.id!==vt?`is-drop-target is-drop-${De}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!S&&!On,className:Lr,"aria-pressed":On?pt:void 0,"aria-keyshortcuts":S?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ii=>{S&&(zo.current=!0,tn(de.id),Ii.dataTransfer.effectAllowed="move",Ii.dataTransfer.setData("text/plain",de.id))},onDragEnter:Ii=>{d2(Ii,de.id)},onDragOver:Ii=>{!vt||vt===de.id||(Ii.preventDefault(),Ii.dataTransfer.dropEffect="move",d2(Ii,de.id))},onDragLeave:Ii=>{const hs=Ii.relatedTarget;hs instanceof Node&&Ii.currentTarget.contains(hs)||Qt===de.id&&un("")},onDrop:Ii=>{Ii.preventDefault();const hs=Ii.dataTransfer.getData("text/plain")||vt;Ss(hs,de.id,De),tn(""),un(""),on("before")},onDragEnd:()=>{tn(""),un(""),on("before"),window.setTimeout(()=>{zo.current=!1},0)},onKeyDown:Ii=>{Ii.altKey&&(Ii.key==="ArrowUp"?(Ii.preventDefault(),bv(de.id,-1)):Ii.key==="ArrowDown"&&(Ii.preventDefault(),bv(de.id,1)))},onClick:Ii=>{if(On){Ii.preventDefault(),yv(de);return}if(zo.current){Ii.preventDefault(),zo.current=!1;return}J(""),Z(de.id),q("basic"),j(de.id)},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.label}),de.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",de.currentVersion]}),Ze&&a.jsx("span",{className:`aw-draft-badge${Ze.className}`,children:Ze.label})]}),a.jsx("small",{children:En})]}),a.jsx(iE,{"aria-hidden":!0})]},de.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+ai:lt.length})})]}),F==="evaluation"&&_O?a.jsx(NXt,{group:_O,agents:e,cases:In,onChange:u2,onRun:mi}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!ie&&!Vn&&!bi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${qu?" is-deploying":""}${x?" resource-page":""}`,children:[ie&&!le&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),Fe==="integrations"&&ae&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(lT,{className:"aw-agent-detail",title:Qd,description:Ba.description||_(s||x&&!mt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Qd,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?O:void 0,meta:a.jsxs(a.Fragment,{children:[Bh!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",Bh]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),La&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!ie&&!Vn&&bi&&a.jsx("span",{className:"aw-agent-meta",children:bi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||La||ie!=null&&ie.canDelete?a.jsxs(a.Fragment,{children:[(Vn||La)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const de=Vn??La;de&&rs(de)},disabled:ei,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(ie==null?void 0:ie.canDelete)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Ub(ie),disabled:ei,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_(ei?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:$t.map(de=>{var Le,Ge,pt,ln;return{key:de.id,label:de.label,disabled:qu,content:de.id===Fe?a.jsxs(a.Fragment,{children:[Vr&&mv&&a.jsx("div",{className:`aw-detail-deployment${qu?" is-running":""}`,children:a.jsx(CXt,{task:Vr,onReturnToEdit:Em&&D?()=>D(Em):void 0})}),a.jsxs("div",{className:"aw-content",children:[Fe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[Yt&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(Ot&&!Yt||Ke)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>nt(Ze=>Ze+1),children:_("common.retry")})}),st==="mpa"&&(es||Mi||wr)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:wr==="bound"&&!Mi?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||_(wr==="bound"?"agentWorkspace.mpaRuntimeBound":wr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":wr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),ie&&st!=="mpa"&&yt&&!yt.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:yt.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:yt.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Vo&&a.jsx("span",{children:Vo}),Xi.map(Ze=>a.jsx("span",{children:Ze},Ze))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(ie==null?void 0:ie.region)||(Vr==null?void 0:Vr.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(IP,{draft:Ba,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Di)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:fH(le==null?void 0:le.model)||Ba.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:le!=null&&le.graph?r9e(le.graph):s9e(Ba)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:Sm.length?Sm.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Bb===null?_("agentSelector.previewUnsupported"):Bb.length?Bb.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:Bh!=null?`v${Bh}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Vr==null?void 0:Vr.status)==="error"?_("agentWorkspace.deploymentFailed"):(Vr==null?void 0:Vr.status)==="cancelled"?_("agentWorkspace.cancelled"):La?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Dn!=null&&Dn.enabled?"is-ready":void 0,children:Dn?Dn.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Dn?lmt(Dn.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Dn?t2.length?t2.map(Ze=>a.jsx("span",{children:EN(Ze)},Ze)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),Fe==="usage"&&(ie==null?void 0:ie.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":Ws,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ws&&!_i&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),rr&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:rr}),a.jsx("button",{type:"button",onClick:()=>hl(Ze=>Ze+1),children:_("common.retry")})]}),!Ws&&!rr&&!_i&&!Me&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),_i&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:_i.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:_i.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ws&&a.jsx(cn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),_i.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:_i.users.map(Ze=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ze.displayName||Ze.userId||_("agentWorkspace.unknownUser")}),Ze.displayName&&Ze.userId&&a.jsx("small",{title:Ze.userId,children:Ze.userId})]}),a.jsx("td",{children:Ze.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ze.lastUsedAt,children:e9e(Ze.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ze.userId))})]})}),_i.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:Ws||_i.page<=1,onClick:()=>ws(Ze=>Math.max(1,Ze-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:_i.page,total:_i.totalPages})}),a.jsx("button",{type:"button",disabled:Ws||_i.page>=_i.totalPages,onClick:()=>ws(Ze=>Ze+1),children:_("common.nextPage")})]})]})]}),Fe==="sessionConfig"&&a.jsx(cXt,{config:gr,profileStatus:Vi,loadable:$h,disabledReason:Fb,loading:Pa,saving:Qu,upgrading:hc,error:$d,notice:Fd,modelValue:gl,modelDirty:Vu,profileUpgradeAvailable:Rr,onModelChange:Fo,onSaveModel:()=>void s2(),onInheritModel:()=>void s2("inherit"),onClearMcp:()=>void IO("clear"),onInheritMcp:()=>void IO("inherit"),onUpgradeProfile:()=>void KL(),onRefresh:()=>Da(Ze=>Ze+1)}),Fe==="profileConfig"&&a.jsx(lXt,{profile:n2,profileStatus:Vi,runtimeReady:Mb,disabledReason:WL,saving:Uo.saving,error:Uo.error,notice:Uo.notice,onApply:()=>void gv(),onEditProfile:a2,onRefresh:()=>nt(Ze=>Ze+1)}),Fe==="diagnostics"&&a.jsx(fXt,{data:fv,loadable:!i2,disabledReason:i2,loading:ml,error:gi,onRefresh:()=>Ks(Ze=>Ze+1),locale:L.resolvedLanguage??L.language}),Fe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:(Le=ve==null?void 0:ve.cicd)!=null&&Le.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),oe&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Ue&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Ue}),(ie==null?void 0:ie.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void fN(ie.runtimeId??"").then(Se),children:_("common.retry")})]}),!oe&&!Ue&&a.jsxs("div",{className:"aw-version-list",children:[(ve==null?void 0:ve.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ve.githubSyncError})}),(ve==null?void 0:ve.latestSourceRuntimeStatus)&&ve.latestSourceRuntimeStatus!=="published"&&((Ge=ve.versions[0])==null?void 0:Ge.commitSha)&&ve.versions[0].commitSha!==ve.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Foe(ve.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ve!=null&&ve.versions.length?ve.versions.map(Ze=>{var sa;const En=Ze.commitSha??"",Lr=Ze.runtimeStatus??Ze.status,Ii=Ze.changeType==="rollback",hs=!!((sa=ve.cicd)!=null&&sa.enabled)&&!!En&&!Ii&&En!==ve.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:iXt(Ze,_)}),a.jsx("small",{children:Ze.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ze.pullRequestUrl?a.jsx("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ze.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:Foe(Lr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!hs||ke===En,onClick:()=>void NO(Ze),children:_(ke===En?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ze.workflowRunUrl&&a.jsx("a",{href:Ze.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ze.version}-${En||Ze.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:Bh!=null?`v${Bh}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),Fe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),K&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>fe(Ze=>Ze+1),children:_("common.retry")})]}),!K&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${se==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),Dk.map((Ze,En)=>a.jsx("button",{type:"button",id:`integration-${Ze.id}-tab`,role:"tab","aria-selected":se===Ze.id,"aria-controls":`integration-${Ze.id}-panel`,tabIndex:se===Ze.id?0:-1,onClick:()=>fs(Ze.id),onKeyDown:Lr=>{var sa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Lr.key))return;Lr.preventDefault();const Ii=Lr.key==="Home"?0:Lr.key==="End"?Dk.length-1:(En+(Lr.key==="ArrowRight"?1:-1)+Dk.length)%Dk.length,hs=Dk[Ii];fs(hs.id),(sa=document.getElementById(`integration-${hs.id}-tab`))==null||sa.focus()},children:Ze.label},Ze.id))]}),se==="api-server"?a.jsx(Uoe,{protocol:"api-server",title:"API Server",available:pc,fields:[{label:"Agent",value:pc?((pt=Hn==null?void 0:Hn.apiApps)==null?void 0:pt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:pc?d6(Hu,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:pc?d6(Hu,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:pc?$oe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Boe,{available:pc,authType:ne==null?void 0:ne.authType,value:sr,visible:Ne&&!!sr,loading:Xe,error:re,onToggle:()=>void jO()})}],example:pc?rXt(Hu,km,ne==null?void 0:ne.authType):""}):a.jsx(Uoe,{protocol:"a2a",title:"A2A",available:$a,fields:[{label:"Agent",value:((ln=Hn==null?void 0:Hn.a2a)==null?void 0:ln.name)??""},{label:"Agent Card",value:$a?d6(Hu,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Mf},{label:_("agentWorkspace.authentication"),value:$a?$oe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Boe,{available:$a,authType:ne==null?void 0:ne.authType,value:sr,visible:Ne&&!!sr,loading:Xe,error:re,onToggle:()=>void jO()})}],example:$a?sXt(Mf,ne==null?void 0:ne.authType):""})]})]}),Fe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(ie==null?void 0:ie.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ze=>{const En=vXt(ze,Ze),Lr=In.filter(hs=>hs.kind===Ze).length,Ii=Cm?Lr:(En==null?void 0:En.itemCount)??Lr;return a.jsxs("button",{type:"button",onClick:()=>o2(Ze),children:[a.jsx("strong",{children:Ii}),a.jsx("span",{children:_(Ze==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ze)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ze=>a.jsx("button",{type:"button",className:Et===Ze?"is-active":"","aria-pressed":Et===Ze,onClick:()=>At(Ze),children:_(Ze==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ze))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ze=>a.jsx("button",{type:"button",className:Ye===Ze?"is-active":"","aria-pressed":Ye===Ze,onClick:()=>wt(Ze),children:_(Ze==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ze))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:It,onChange:Ze=>Gt(Ze.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),DO&&a.jsx("div",{className:`aw-case-toolbar${zu?" is-active":""}`,children:zu?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:PO.length})}),a.jsx("button",{type:"button",onClick:MO,disabled:Am.length===0||Ma,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void c2(PO),disabled:PO.length===0||Ma,children:_(Ma?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:zd,disabled:Ma,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Os(""),vl(!0)},disabled:Am.length===0||Ma,children:_("agentWorkspace.selectCases")})}),$l&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:$l}),a.jsx("div",{ref:Gc,children:a.jsx(jXt,{cases:Am,loading:Ht&&Am.length===0,error:jr,notice:qs,runtimeBacked:!!(ie!=null&&ie.runtimeId),selectionMode:zu,selectedCaseIds:Ll,focusedCaseId:ts,expandedCaseIds:Bd,deleting:Ma,canDelete:DO,onOpenCase:LO,onToggleCase:GL,onToggleExpanded:l2,onDeleteCase:Ze=>void c2([Ze]),onRetry:()=>Si(Ze=>Ze+1)})})]}),Fe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ga?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):us?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:us}),a.jsx("button",{type:"button",onClick:()=>bo(Ze=>Ze+1),children:_("common.retry")})]}):Zr.length>0?a.jsx(TXt,{groups:Zr}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),Fe==="basic"&&(ie||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[ie&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(ie),children:[a.jsx(Hat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),st!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${Fh?" is-disabled":""}`,tabIndex:Fh?0:void 0,"aria-describedby":Fh?$b:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Fh,"aria-busy":jt||void 0,"aria-describedby":Fh?$b:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}yt&&P(yt)},children:jt?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||La?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Fh&&a.jsx("span",{id:$b,className:"aw-update-disabled-reason",role:"tooltip",children:Fh})]})]})]}):null}}),activeSectionKey:Fe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(Td,{variant:"danger",title:Rn.title,description:Rn.description,confirmLabel:ei?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:ei,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>di(null),onConfirm:()=>void vv()})]})}function TXt({groups:e}){const{t}=Te("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:gXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:yXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function _Xt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function jXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,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}=Te("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),O=(o==null?void 0:o.has(w.id))??!1,k=(c==null?void 0:c.has(w.id))??!1,E=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,C=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.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){C&&(h==null||h(w));return}f==null||f(w)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?C&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&C&&a.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:pXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),E&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(w.id)},children:v(k?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:mXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:C&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(_Xt,{})})})]},w.id)})]})}function NXt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[o,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 a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:CS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:CS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx($at,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:CS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:CS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Cf,{}),s("agentWorkspace.completed")]}),a.jsx(iE,{"aria-hidden":!0})]},h.id))})]})})]})}async function mK(e,t={}){const n=await fetch(Ta(`/web/agent-reviews${e}`),{...t,headers:ul(uc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function RXt(e,t){return mK(`?${new URLSearchParams({region:e})}`,{signal:t})}function IXt(e,t,n){return mK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function PXt(e,t,n){return mK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const DXt=20,Voe=256;function f6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=Te("agentReviews");return a.jsxs("label",{children:[e,a.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}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function PP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function c9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=Te("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,k]=p.useState(""),[S,E]=p.useState(0),[C,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),IXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,S]);async function A(_,L){if(!h){m(!0),b("");try{const F=await PXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(F),x(""),k(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(av,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"agent-review-backdrop"}),a.jsxs(rv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(vO,{children:n}),a.jsx($T,{children:o("dialogDescription")})]}),a.jsx(hL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(cl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>E(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(PP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(PP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(f6,{label:o("message"),value:v,onChange:y,limit:DXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(f6,{label:o("comment"),value:w,onChange:x,limit:Voe,disabled:h}):null,C?a.jsx(f6,{label:o("reasonRequired"),value:O,onChange:k,limit:Voe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void A(T),children:o("confirm")})]}):C?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void A("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void A("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void A(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const MXt=5e3,LXt=4;let h6=0;const Hoe=[];function qoe(e){return e instanceof Error&&e.name==="AbortError"}function $Xt(e){return e instanceof Error&&e.name==="TimeoutError"}function FXt(e){return $Xt(e)||e instanceof ID&&[500,502,503,504].includes(e.status)}function BXt(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 UXt(e={},t={}){const n=t.request??z0,i=t.wait??BXt;try{return await n(e)}catch(r){if(!FXt(r))throw r;return await i(MXt,e.signal),n(e)}}async function u9e(e){var t;h6>=LXt&&await new Promise(n=>Hoe.push(n)),h6+=1;try{return await e()}finally{h6-=1,(t=Hoe.shift())==null||t()}}async function QXt(e,t){await Promise.allSettled(e.map(n=>u9e(()=>t(n))))}function Cy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}function Tp({className:e="icon"}){return a.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:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function zXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function VXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.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"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.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 HXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.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 qXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function pA({kind:e,...t}){return e==="codex"?a.jsx(zXt,{...t}):e==="deepseek-harness"?a.jsx(qXt,{...t}):e==="openclaw"?a.jsx(VXt,{...t}):a.jsx(HXt,{...t})}const WXt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function d9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(Ci,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:WXt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(Ci,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(Ci,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class f9e extends Error{constructor(t,n){super(n),this.status=t,this.name="MpaCreationRequestError"}}async function IL(e,t,n){const i=await fetch(Ta(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:ul(uc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,ho)});if(!i.ok){const r=await i.json().catch(()=>({}));throw new f9e(i.status,typeof r.detail=="string"?r.detail:`HTTP ${i.status}`)}return i.json()}const KXt=(e,t)=>IL(`config?region=${encodeURIComponent(e)}`,t),GXt=(e,t)=>IL("tasks",t,e),XXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}`,t),YXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),ZXt=/^[A-Za-z0-9_-]+$/,h9e=4,DP=64,MP=6,Woe="agent-runtime";function p9e(e){const t=e.trim();if(!t)return Woe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,DP);return n?(n.lengthXt(`validation.runtimeName.${n}`)){return e?ZXt.test(e)?e.lengthDP?t("length"):null:t("characters"):t("required")}function tYt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function nYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}const iYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",rYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function m9e(e){return{region:e,requestId:crypto.randomUUID(),name:"",description:""}}function LP(e){return{...e,tosAccessKey:void 0,tosSecretKey:void 0}}function sYt(e){var t;try{const n=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((t=n==null?void 0:n.input)==null?void 0:t.region)===e&&typeof n.input.requestId=="string"){if(n.submitted||n.taskId)return{...n,input:LP(n.input)};const i={...n.input,name:typeof n.input.name=="string"?n.input.name:""};return delete i.agentId,delete i.runtimeImage,delete i.workerImage,{...n,input:LP(i)}}}catch{}return{input:m9e(e)}}function aYt({region:e,cloudProvider:t="volcengine",onClose:n,onCreated:i}){var te,ue;const{t:r}=Te("ui"),s=fe=>`myAgents.mpaCreate.${fe}`,[o]=p.useState(()=>sYt(e)),[l,c]=p.useState(o.input),[u,d]=p.useState(""),[f,h]=p.useState(o.submitted||o.taskId?2:Math.min(2,Math.max(0,o.step??0))),[m,g]=p.useState(o.taskId),[b,v]=p.useState(!!(o.submitted||o.taskId)),[y,w]=p.useState(null),[x,O]=p.useState(null),[k,S]=p.useState(!0),[E,C]=p.useState(!1),[j,T]=p.useState(""),[R,A]=p.useState(0),[N,P]=p.useState(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(!0),L=p.useRef(null),F=p.useRef(i);F.current=i;const M=(y==null?void 0:y.state)==="running"||(y==null?void 0:y.state)==="cancelling",q=b&&l.name===void 0&&!!l.agentId?null:lv((l.name??"").trim(),fe=>r(`validation.runtimeName.${fe}`,{ns:"create"})),U=!q,Z=(x==null?void 0:x.postgresMode)==="auto",z=Z?!l.pgHost&&!l.pgPort:tYt(l.pgHost,l.pgPort),J=nYt(l.openvikingUrl,l.openvikingResourceId,u),ne=[l.tosAccessKey,l.tosSecretKey,l.tosBucket].map(fe=>(fe==null?void 0:fe.trim())??""),W=ne.every(Boolean)||ne.every(fe=>!fe),X=E||b&&(!y||M||y.state==="succeeded");p.useEffect(()=>{if(!(b||m))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(l),step:f}))}catch{}},[l,f,e,b,m]);function V(fe){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(l),taskId:fe,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(_.current=!0,()=>{var fe;_.current=!1,(fe=L.current)==null||fe.abort()}),[]),p.useEffect(()=>{const fe=new AbortController;return S(!0),KXt(e,fe.signal).then(se=>{fe.signal.aborted||(O(se),se.configured&&!o.submitted&&!o.taskId&&!I.current&&c(me=>({...me,pgHost:se.postgresMode==="auto"?"":me.pgHost??se.pgHost??"",pgPort:se.postgresMode==="auto"?"":me.pgPort??se.pgPort??""})))}).catch(()=>{fe.signal.aborted||T(r(s("loadFailed")))}).finally(()=>{fe.signal.aborted||S(!1)}),()=>fe.abort()},[e,R,r]),p.useEffect(()=>{if(!m)return;const fe=new AbortController;let se;async function me(){try{const Ee=await XXt(m,fe.signal);if(fe.signal.aborted)return;if(w(Ee),T(""),Ee.state==="succeeded"&&!D.current){D.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}F.current()}if(Ee.state!=="running"&&Ee.state!=="cancelling")return}catch{if(fe.signal.aborted)return;T(r(s("pollFailed")))}se=setTimeout(me,2e3)}return me(),()=>{fe.abort(),clearTimeout(se)}},[m,e,R,r]);async function ae(){if(I.current||!(x!=null&&x.configured)||!U||!z||!J||!W||f!==2||M||(y==null?void 0:y.state)==="succeeded")return;I.current=!0,C(!0),v(!0),T(""),V(m);const fe=new AbortController;L.current=fe;try{const se=await GXt({...l,...l.name===void 0?{}:{name:l.name.trim()},openvikingApiKey:u},fe.signal);if(!_.current||fe.signal.aborted)return;V(se.taskId),g(se.taskId),w(se),A(me=>me+1)}catch(se){_.current&&!fe.signal.aborted&&(se instanceof f9e&&(se.status===400||se.status===422)&&v(!1),T(se instanceof Error?se.message:r(s("creationFailed"))))}finally{I.current=!1,_.current&&C(!1)}}async function Y(){if(!m||I.current)return;P(!1),I.current=!0,C(!0);const fe=new AbortController;L.current=fe;try{const se=await YXt(m,fe.signal);_.current&&!fe.signal.aborted&&w(se)}catch{_.current&&!fe.signal.aborted&&T(r(s("cancelFailed")))}finally{I.current=!1,_.current&&C(!1)}}function K(){const fe={...m9e(e),pgHost:Z?"":(x==null?void 0:x.pgHost)??"",pgPort:Z?"":(x==null?void 0:x.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:fe,step:0}))}catch{}c(fe),d(""),h(0),g(void 0),v(!1),w(null),T(""),P(!1),D.current=!1}return a.jsx(a.Fragment,{children:a.jsx(av,{open:!0,onOpenChange:fe=>{!fe&&!E&&(N?P(!1):n())},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(rv,{className:"mpa-create-popup","aria-label":r(s("title")),children:a.jsx(d9e,{className:"mpa-create-dialog",title:r(s("title")),topGlow:!1,footer:null,onClose:()=>{E||n()},closeLabel:r(s("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":r(s("stepsLabel")),children:["basics","postgres","openviking"].map((fe,se)=>a.jsx("li",{"aria-current":f===se?"step":void 0,children:a.jsxs("button",{type:"button",disabled:E||se>f&&!b&&(!U||se===2&&!z),onClick:()=>h(se),children:[a.jsx("span",{children:se+1}),r(s(`steps.${fe==="postgres"&&Z?"autoPostgres":fe}`))]})},fe))}),f===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r(s("region")),":",e]}),a.jsxs("label",{children:[r(s("name")),a.jsx("input",{name:"name",placeholder:r(s("namePlaceholder")),value:l.name??l.agentId??"",maxLength:64,disabled:E||b,required:!0,autoComplete:"off","aria-invalid":!!q,"aria-describedby":"mpa-name-help",onChange:fe=>c({...l,name:fe.target.value})}),a.jsx("p",{id:"mpa-name-help",role:q?"alert":void 0,children:q||r(s("nameHelp"))})]}),a.jsxs("label",{children:[r(s("description")),a.jsx(CIe,{className:"mpa-create-description",value:l.description,maxLength:512,disabled:E||b,onChange:fe=>c({...l,description:fe.target.value})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":r(s("plan")),children:[a.jsx("strong",{children:r(s("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:r(s("sharedResources"))}),a.jsx("li",{children:r(s("agentResources"))}),a.jsx("li",{children:r(s("readiness"))})]})]})]}),f===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Z?"pgAutoDescription":(x==null?void 0:x.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/aidap/":iYt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"pgConsoleByteplus":"pgConsole"))}),!Z&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("pgHost")),a.jsx("input",{name:"pgHost",value:l.pgHost??"",maxLength:255,disabled:E||b,"aria-invalid":!z,onChange:fe=>c(se=>({...se,pgHost:fe.target.value}))})]}),a.jsxs("label",{children:[r(s("pgPort")),a.jsx("input",{name:"pgPort",value:l.pgPort??"",inputMode:"numeric",maxLength:5,disabled:E||b,"aria-invalid":!z,onChange:fe=>c(se=>({...se,pgPort:fe.target.value}))})]}),!z&&a.jsx("p",{role:"alert",children:r(s("pgInvalid"))}),a.jsx("p",{children:r(s("pgCredentials"))})]})]}),f===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s("openvikingDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/vikingdb/":rYt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"openvikingConsoleByteplus":"openvikingConsole"))}),a.jsxs("label",{children:[r(s("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:l.openvikingUrl??"",maxLength:1024,disabled:E||b,autoComplete:"off",spellCheck:!1,"aria-invalid":!J,onChange:fe=>c(se=>({...se,openvikingUrl:fe.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:l.openvikingResourceId??"",maxLength:128,disabled:E||b,autoComplete:"off",spellCheck:!1,"aria-invalid":!J,onChange:fe=>c(se=>({...se,openvikingResourceId:fe.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:u,maxLength:512,disabled:E||M||(y==null?void 0:y.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:fe=>d(fe.target.value)})]}),!J&&a.jsx("p",{role:"alert",children:r(s("openvikingInvalid"))}),a.jsx("p",{children:r(s("openvikingCredentials"))}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:r(s("tosTitle"))}),a.jsx("p",{children:r(s("tosDescription"))}),["tosAccessKey","tosSecretKey","tosBucket"].map(fe=>a.jsxs("label",{children:[r(s(fe)),a.jsx("input",{name:fe,type:fe==="tosBucket"?"text":"password",value:l[fe]??"",maxLength:256,disabled:X,autoComplete:fe==="tosBucket"?"off":"new-password",spellCheck:!1,"aria-invalid":!W,onChange:se=>c(me=>({...me,[fe]:se.target.value}))})]},fe)),!W&&a.jsx("p",{role:"alert",children:r(s("tosInvalid"))}),a.jsx("p",{children:r(s("tosCredentials"))})]})]}),k?a.jsx("p",{role:"status",children:r(s("checking"))}):x!=null&&x.configured?a.jsx("p",{children:r(s("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:r(s("notConfigured"))}),a.jsx("p",{children:x!=null&&x.postgresMigrationRequired?r(s("pgMigrationRequired")):x==null?void 0:x.error}),a.jsx(Ci,{variant:"outline",onClick:()=>A(fe=>fe+1),children:r(s("reload"))})]}),y&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:r(s(`states.${y.state}`))}),y.state!=="succeeded"&&a.jsx("p",{children:r(s(`stages.${y.stage}`),{defaultValue:y.stage})}),y.state==="failed"||y.state==="cancelled"?a.jsx("p",{children:r(s(y.error||"creationFailed"))}):null,((te=y.result)==null?void 0:te.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",y.result.runtime_id]}),((ue=y.result)==null?void 0:ue.skill_space_id)&&a.jsxs("p",{children:[r(s("skillSpace")),":",y.result.skill_space_id]})]}),Z&&!z&&a.jsx("p",{role:"alert",children:r(s("pgModeChanged"))}),j&&a.jsx("p",{role:"alert",children:j}),M&&a.jsx("p",{children:r(s("background"))}),b&&a.jsx("p",{children:r(s("newAgentDescription"))}),N?a.jsxs("section",{role:"alertdialog","aria-label":r(s("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:r(s("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ci,{autoFocus:!0,variant:"outline",onClick:()=>P(!1),children:r(s("back"))}),a.jsx(Ci,{onClick:()=>void Y(),children:r(s("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ci,{variant:"outline",disabled:E,onClick:n,children:r(s("close"))}),b&&a.jsx(Ci,{variant:"outline",disabled:E||k,onClick:K,children:r(s("newAgent"))}),f>0&&a.jsx(Ci,{variant:"outline",disabled:E,onClick:()=>h(fe=>fe-1),children:r(s("previousStep"))}),M?a.jsx(Ci,{variant:"outline",disabled:E||(y==null?void 0:y.state)==="cancelling",onClick:()=>P(!0),children:r(s("cancel"))}):(y==null?void 0:y.state)!=="succeeded"&&f<2?a.jsx(Ci,{disabled:E||f===0&&!U||f===1&&!z,onClick:()=>h(fe=>fe+1),children:r(s("next"))}):(y==null?void 0:y.state)!=="succeeded"?a.jsx(Ci,{loading:E,disabled:k||!(x!=null&&x.configured)||!U||!z||!J||!W,onClick:()=>void ae(),children:r(s(y?"retry":"submit"))}):null]})]})})})]})})})}const oYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function lYt(e){return e!=="general"&&e!=="mpa"}const cYt=24,uYt=3e4,dYt=7e3,fYt=2e4,hYt=6,pYt=2,mYt=250,kg=new Map,Tw=new Map,gYt=new Set;function ny(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Koe(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Oa&&e.unsupported?"unsupported":"error",message:n}}function Jm(e){if(!e){kg.clear(),Tw.clear(),K8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Tw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Tw.delete(n);for(const n of t)K8(n);kg.clear()}}function bYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function yYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 vYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 xYt({type:e}){return e==="general"||e==="mpa"?a.jsx(Tp,{}):a.jsx(pA,{kind:e})}function wYt(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),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function Goe(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:XMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function OYt(e,t){const n=MD(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:XMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function kYt(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 SYt(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,mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function EYt(e,t){return e.trim()||Zi(t)}async function CYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=Tw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>Goe(f,s,e))),c.page.nextToken;c&&Tw.delete(l);let u=kg.get(l);u||(u=UXt({agentCategory:e,scope:t,region:n,pageSize:cYt,nextToken:i,signal:o}),kg.set(l,u),u.then(()=>kg.delete(l),()=>kg.delete(l)));const d=await u;return Tw.set(l,{page:d,expiresAt:Date.now()+uYt}),r(d.runtimes.map(f=>Goe(f,s,e))),d.nextToken}function AYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,A,N,P;const{t:b,i18n:v}=Te("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",k=(s==null?void 0:s.status)==="unsupported",S=(s==null?void 0:s.status)==="error",E=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,C=()=>{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))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=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 a.jsxs(xH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?C:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(ZIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:BT(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"):wYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(AN,{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?a.jsxs(a.Fragment,{children:[a.jsx(AN,{"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")}),a.jsx(AN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):S||k?a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(JD,{}),b("common.retry")]}):a.jsx(LB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||k||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?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(yYt,{})}),children:[a.jsx(wH,{leading:a.jsx(n1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:E,children:E}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":MD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Ya,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):k?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):S?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(ka,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(cn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(OH,{children:e.description})]})}function TYt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=gYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:E}){const{t:C}=Te("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),A=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=EYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[H,q]=p.useState(s==="mine"?"mine":"all"),[U,Z]=p.useState(D),[z,J]=p.useState(null),[ne,W]=p.useState([]),[X,V]=p.useState(""),[ae,Y]=p.useState(!0),[K,te]=p.useState(""),[ue,fe]=p.useState([]),[se,me]=p.useState(!1),[Ee,xe]=p.useState(""),[Ne,We]=p.useState(""),[Xe,Re]=p.useState({}),[re,ce]=p.useState({}),[ve,Se]=p.useState(null),[oe,$e]=p.useState(()=>Date.now()),Ue=p.useMemo(()=>oYt.map(qe=>({value:qe,label:C(`myAgents.agentTypes.${qe}`)})),[C]),be=p.useMemo(()=>{const qe=ju(e);return qe.some(nt=>nt.value===D)?qe:[{value:D,label:D},...qe]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{Z(D)},[D]),p.useEffect(()=>{$e(Date.now());const qe=window.setInterval(()=>$e(Date.now()),1e3);return()=>window.clearInterval(qe)},[]);const ke=p.useMemo(()=>w.map(qe=>kYt(qe,C)),[w,C]),Ae=p.useMemo(()=>{const qe=new Map,nt=new Map,et=new Map;for(const ft of x){if(ft.status!=="running")continue;if(qe.set(ft.id,ft),ft.draftId){const At=nt.get(ft.draftId);(!At||ft.startedAt>At.startedAt)&&nt.set(ft.draftId,ft)}if(!ft.runtimeId)continue;const Et=et.get(ft.runtimeId);(!Et||ft.startedAt>Et.startedAt)&&et.set(ft.runtimeId,ft)}return{byId:qe,byDraftId:nt,byRuntimeId:et}},[x]),He=p.useCallback(qe=>{var et;if(qe.draft){const ft=O[qe.draft.id];return Ae.byDraftId.get(qe.draft.id)??(ft?Ae.byId.get(ft):void 0)}const nt=(et=qe.runtime)==null?void 0:et.runtimeId;return nt?Ae.byRuntimeId.get(nt):void 0},[Ae,O]),Qe=p.useCallback((qe,nt)=>{var At;(At=A.current)==null||At.abort(),kg.clear();const et=new AbortController;A.current=et;const ft=++R.current;return Y(!0),te(""),CYt(m==="mpa"?"mpa":"general",H,U,qe,It=>{R.current===ft&&W(Gt=>nt?It:[...Gt,...It])},C,et.signal).then(It=>{R.current===ft&&V(It)}).catch(It=>{R.current===ft&&(qoe(It)||te(Cy(It,C("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===ft&&Y(!1),A.current===et&&(A.current=null)})},[m,H,U,C]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),V(""),Qe("",!0),()=>{var qe;(qe=A.current)==null||qe.abort(),A.current=null,kg.clear(),R.current+=1}},[m,Qe]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const et of I.current.values())et.abort();I.current.clear();return}const qe=new Set(ne.filter(et=>{var ft,Et;return((ft=et.runtime)==null?void 0:ft.runtimeId)!==v&&((Et=et.runtime)==null?void 0:Et.region)===U}).map(ny).filter(Boolean));for(const[et,ft]of I.current)qe.has(et)||(ft.abort(),I.current.delete(et));const nt=ne.filter(et=>{var It,Gt,Ye;const ft=(It=et.runtime)==null?void 0:It.runtimeId;if(!ft||ft===v||((Gt=et.runtime)==null?void 0:Gt.region)!==U)return!1;const Et=ny(et),At=(Ye=re[Et])==null?void 0:Ye.status;return!I.current.has(Et)&&(!At||At==="checking")});for(const et of nt)I.current.set(ny(et),new AbortController);ce(et=>{var At,It;let ft=!1;const Et={...et};for(const Gt of ne){const Ye=ny(Gt);if(!Ye)continue;const wt=((At=Gt.runtime)==null?void 0:At.runtimeId)===v;wt&&((It=Et[Ye])==null?void 0:It.status)!=="compatible"?(Et[Ye]={status:"compatible",message:C("myAgents.compatibility.supported")},ft=!0):!wt&&!Et[Ye]&&(Et[Ye]={status:"checking",message:C("myAgents.compatibility.checking")},ft=!0)}return ft?Et:et}),QXt(nt,async et=>{const ft=et.runtime;if(!ft)return;const Et=ny(et),At=I.current.get(Et);if(At)try{const It=await Kw(ft.runtimeId,ft.region,{signal:At.signal,preferCached:!0,timeoutMs:dYt,currentVersion:ft.currentVersion});if(At.signal.aborted)return;ce(Gt=>({...Gt,[Et]:It&&It.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(It){if(At.signal.aborted||(It==null?void 0:It.name)==="AbortError")return;ce(Gt=>({...Gt,[Et]:Koe(It,C)}))}finally{I.current.get(Et)===At&&I.current.delete(Et)}})},[m,v,U,ne,C]),p.useEffect(()=>()=>{var qe;(qe=A.current)==null||qe.abort();for(const nt of I.current.values())nt.abort();I.current.clear()},[]);const jt=p.useCallback(async qe=>{var ft;(ft=P.current)==null||ft.abort();const nt=new AbortController;P.current=nt;const et=++N.current;me(!0),xe(""),fe([]);try{const Et=qe==="codex"?await Br.listSessions({signal:nt.signal,autoResumeSnapshots:!1}):await Br.listAgentSessions(qe,{signal:nt.signal,autoResumeSnapshots:!1});if(N.current!==et)return;fe(Et.map(At=>OYt(At,C)))}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||N.current!==et)return;xe(Cy(Et,C("myAgents.loadAgentType",{type:C(`myAgents.agentTypes.${qe}`)}),`GET /web/${qe==="codex"?"sandbox":qe}/sessions`))}finally{P.current===nt&&(P.current=null),N.current===et&&me(!1)}},[C]);function Pt(qe){var nt;qe!==m&&(qe==="general"||qe==="mpa"?(R.current+=1,W([]),V(""),te(""),Y(!0)):((nt=P.current)==null||nt.abort(),P.current=null,N.current+=1,fe([]),xe(""),me(!0)),g(qe))}function Kt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),V(""),te(""),Y(!0))}function Ct(qe){qe!==H&&(Kt(),q(qe))}function xt(qe){qe!==U&&(Kt(),Z(qe))}p.useEffect(()=>{var qe;if(m==="general"||m==="mpa"){(qe=P.current)==null||qe.abort(),P.current=null,N.current+=1;return}return jt(m),()=>{var nt;(nt=P.current)==null||nt.abort(),P.current=null,N.current+=1}},[m,jt,b]),p.useEffect(()=>{const qe=T.current,nt=j.current;if(!qe||!nt||m!=="general"&&m!=="mpa"||!X||ae)return;const et=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Qe(X,!1)},{root:nt,rootMargin:"240px 0px",threshold:.01});return et.observe(qe),()=>et.disconnect()},[m,Qe,ae,X]);const tt=p.useCallback(async qe=>{if(!Ne){We(qe.id),Re(nt=>({...nt,[qe.id]:""}));try{await new Promise(nt=>requestAnimationFrame(()=>nt())),qe.sandbox?await f(qe.sandbox):await c(qe)}catch(nt){Re(et=>({...et,[qe.id]:nt instanceof Error?nt.message:String(nt)}))}finally{We("")}}},[Ne,c,f]),mt=p.useCallback(async qe=>{var Et;const nt=qe.runtime;if(!nt)return;const et=ny(qe);ce(At=>({...At,[et]:{status:"checking",message:C("myAgents.compatibility.checking")}})),(Et=I.current.get(et))==null||Et.abort();const ft=new AbortController;I.current.set(et,ft);try{const At=await u9e(()=>Kw(nt.runtimeId,nt.region,{retryProbe:!0,signal:ft.signal,timeoutMs:fYt,currentVersion:nt.currentVersion}));if(ft.signal.aborted)return;ce(It=>({...It,[et]:At&&At.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(At){if(ft.signal.aborted||qoe(At))return;ce(It=>({...It,[et]:Koe(At,C)}))}finally{I.current.get(et)===ft&&I.current.delete(et)}},[C]),_e=p.useCallback(qe=>{const nt=qe.runtime;!r||!nt||He(qe)||W8({runtimeId:nt.runtimeId,region:nt.region,appName:qe.appName,currentVersion:nt.currentVersion})},[r,He]),Ot=p.useMemo(()=>{const qe=F.trim().toLocaleLowerCase(),nt=m==="general"||m==="mpa"?[...ke,...ne]:ue,ft=(H==="mine"?nt.filter(Gt=>Gt.isMine):nt).filter(Gt=>{var wt;const Ye=((wt=Gt.runtime)==null?void 0:wt.region)??Gt.region;return!Ye||Ye===U}),Et=qe?ft.filter(Gt=>Gt.name.toLocaleLowerCase().includes(qe)):ft;if(m!=="general"&&m!=="mpa")return Et;const At=y.size>0?Et.filter(Gt=>!Gt.runtime||!y.has(Gt.runtime.runtimeId)):Et,It=At.findIndex(Gt=>{var Ye;return((Ye=Gt.runtime)==null?void 0:Ye.runtimeId)===v});return It<=0?At:[At[It],...At.slice(0,It),...At.slice(It+1)]},[m,v,ke,y,F,H,U,ne,ue]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const qe=Ot.filter(At=>!!At.runtime).filter(At=>!He(At)).slice(0,hYt);if(qe.length===0)return;let nt=!1,et=0;const ft=async()=>{for(;!nt;){const At=qe[et];if(et+=1,!(At!=null&&At.runtime)||(await W8({runtimeId:At.runtime.runtimeId,region:At.runtime.region,appName:At.appName,currentVersion:At.runtime.currentVersion}),nt))return}},Et=window.setTimeout(()=>{for(let At=0;At{nt=!0,window.clearTimeout(Et)}},[m,r,He,Ot]);const Nt=C(`myAgents.agentTypes.${m}`,{defaultValue:C("myAgents.agent")}),Yt=m==="general"||m==="mpa"?ae&&ne.length===0&&ke.length===0:se&&ue.length===0,xn=!Yt&&Ot.length===0;let Ke;m==="general"&&n?Ke=()=>o(U,"general"):m==="mpa"&&n?Ke=()=>J(U):lYt(m)&&i&&(Ke=()=>d(m));const St=m==="codex"&&i&&!!l;return a.jsxs(Sh,{className:"my-agents-page","aria-label":C("myAgents.agent"),children:[a.jsx(W0,{title:C("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ab,{className:"my-agent-toolbar",children:[a.jsx(ob,{idPrefix:"my-agent-ownership",ariaLabel:C("myAgents.creatorFilter"),value:H,items:[{id:"all",label:C("common.all"),disabled:s==="mine"},{id:"mine",label:C("agentSelector.createdByMe")}],onChange:Ct}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(lb,{id:"my-agent-type-filter",ariaLabel:C("myAgents.agentType"),value:m,options:Ue,onChange:Pt}),a.jsx(lb,{id:"my-agent-region-filter",ariaLabel:C("myAgents.region"),value:U,options:be,onChange:xt}),a.jsx(Jp,{className:"my-agent-search","aria-label":C("myAgents.searchAgents"),value:F,onChange:qe=>M(qe.target.value),placeholder:C("common.search")}),St?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(vYt,{}),a.jsx("span",{children:C("myAgents.handoff")})]}):null]})]}),a.jsxs(em,{className:"my-agent-results",ref:j,"aria-label":C("myAgents.agentList",{type:Nt}),children:[Yt?a.jsx(cl,{}):(m==="general"||m==="mpa"?K:Ee)&&Ot.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?K:Ee}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Qe("",!0):jt(m)},children:C("common.reload")})]}):xn&&!Ke?F.trim()||H==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(aat,{})}),a.jsx(Wn.Title,{children:C("myAgents.noMatchingAgents")}),a.jsx(Wn.Description,{children:C("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(xYt,{type:m})}),a.jsx(Wn.Title,{className:"my-agent-sandbox-empty-title",children:C("myAgents.noAgentType",{type:Nt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(Tp,{})}),a.jsx(Wn.Title,{children:C("myAgents.noGeneralAgents")}),a.jsx(Wn.Description,{children:C("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&K?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>void Qe("",!0),children:C("common.reload")})]}):null,a.jsxs(K0,{className:"my-agent-grid",children:[Ke?a.jsx(cb,{className:"my-agent-create-card","aria-label":C("myAgents.createAgentType",{type:Nt}),onClick:Ke,icon:a.jsx(bYt,{}),children:C(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,Ot.map(qe=>{var et,ft,Et,At,It;const nt=SYt(qe,ne,C);return a.jsx(AYt,{agent:qe,onReview:L,deploymentTask:He(qe),nowMs:oe,onViewDeploymentTask:k,onUse:tt,compatibility:qe.runtime?re[ny(qe)]??{status:"checking",message:C("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:mt,onPrepareUpdate:((et=qe.runtime)==null?void 0:et.canManage)===!1||((ft=qe.runtime)==null?void 0:ft.visibility)==="enterprise"||((Et=qe.runtime)==null?void 0:Et.reviewStatus)==="pending"?void 0:_e,onViewDetails:nt&&((At=qe.runtime)==null?void 0:At.canManage)!==!1?()=>{nt.sandbox?h(nt.sandbox):u(nt)}:void 0,connecting:qe.id===Ne,connectError:Xe[qe.id],connected:((It=qe.runtime)==null?void 0:It.runtimeId)===v,onEditDraft:S,onDeleteDraft:Se},qe.id)})]})]}),(m==="general"||m==="mpa")&&!K&&!Yt&&(Ot.length>0||!!X)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:ae?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:C("myAgents.loadingMore")})]}):X?a.jsx("span",{children:C("myAgents.scrollForMore")}):a.jsx("span",{children:C("myAgents.allLoaded")})})]}),z&&a.jsx(aYt,{region:z,cloudProvider:e,onClose:()=>J(null),onCreated:()=>{Jm(),U===z&&m==="mpa"&&Qe("",!0)}},z),_!=null&&_.runtime?a.jsx(c9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Jm(),Qe("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ve?a.jsx(Td,{title:C("myAgents.deleteDraftTitle"),description:C("myAgents.deleteDraftDescription",{name:ve.draft.name||C("agentSelector.unnamedAgent")}),confirmLabel:C("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Se(null),onConfirm:()=>{E==null||E(ve),Se(null)}}):null]})}function bK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=Te("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Sh,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(W0,{title:c}),a.jsxs(ab,{children:[(t||n)&&a.jsx(ob,{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"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const _Yt="_Container_13560_1",jYt="_Textarea_13560_174",Xoe={Container:_Yt,Textarea:jYt},xb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="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:k,autoResize:S,ref:E,onChange:C,...j}=e,[T,R]=p.useState(!1),A=S?Math.max(k??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[S,A]);return p.useEffect(()=>{P()},[e.value,O,P]),a.jsx("div",{className:Qi(Xoe.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:V0({"textarea-min-rows":`${O}`,"textarea-max-rows":`${A}`}),children:a.jsx("textarea",{...j,onChange:I=>{C==null||C(I),P()},ref:tT([t,E]),id:r||(g?void 0:i),className:Xoe.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="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",NYt="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",RYt="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",IYt="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",PYt="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",DYt="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",MYt="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",LYt="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",$Yt="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",FYt="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 yK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.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"})})}al.registerLanguage("bash",EM);const BYt=48;function UYt(e,t=BYt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function QYt(e){return al.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function zYt({status:e}){return e==="succeeded"?a.jsx(Cf,{"aria-hidden":!0}):e==="failed"?a.jsx(lB,{"aria-hidden":!0}):e==="running"?a.jsx(Bi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(_at,{"aria-hidden":!0})}function Yoe(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 VYt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>QYt(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 a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(zYt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",Yoe(r,l.resolvedLanguage??l.language)?` · ${Yoe(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=UYt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Zoe({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(cat,{}):a.jsx(fat,{})})]})}function iy(e,t){return e[t]|e[t+1]<<8}function Wv(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function HYt(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 g9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Wv(e,u)===101010256){i=u;break}if(i<0)throw new Error(Xt("helpers.zip.invalid"));const r=iy(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Xt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Wv(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Xt("helpers.zip.tooLarge"));const w=iy(e,v+26),x=iy(e,v+28),O=v+30+w+x,k=e.subarray(O,O+f);let S;if(d===0)S=k;else if(d===8)S=await HYt(k);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(S)}),s+=46+m+g+b}return l}const X7=/(^|\/)skill\.md$/i;function qYt(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=SXt(e.updatedAt,l.resolvedLanguage??l.language),k=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),S=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",O=[k,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",S,x].filter(Boolean).join(" · ");async function A(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:O})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void A(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function EXt({task:e}){var n;const{t}=_e("ui");return a.jsx(d9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&u9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function CXt({task:e}){var n;const{t}=_e("ui");return a.jsx(d9e,{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 AXt({task:e,onReturnToEdit:t}){const{t:n}=_e("ui"),[i,r]=p.useState(!1),s=c9e(e,n),o=u9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=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"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(gN,{}):e.status==="running"?a.jsx(Vi,{className:"spin"}):e.status==="success"?a.jsx(_at,{}):e.status==="error"?a.jsx(gN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[_n,pi]=p.useState(()=>new Set),[Nn,Dn]=p.useState(!1),[_i,Fn]=p.useState(""),Kn=p.useRef(null);p.useEffect(()=>()=>{var de;return(de=Kn.current)==null?void 0:de.abort()},[]);const[Rn,nt]=p.useState(null),[Ut,Qe]=p.useState([]),[xt,Qt]=p.useState([]),[jn,lr]=p.useState(!1),[ta,Ms]=p.useState(""),[ts,ci]=p.useState(""),[Ei,$r]=p.useState(0),[na,ns]=p.useState([]),[Il,fs]=p.useState(!1),[ge,Sr]=p.useState(""),[go,bo]=p.useState(0),[La,uc]=p.useState(null),[Ls,Hs]=p.useState(1),[ml,ji]=p.useState(!1),[mi,Pl]=p.useState(""),[yo,dc]=p.useState(0),[Ni,io]=p.useState(null),[Uo,$s]=p.useState(null),[Es,is]=p.useState(null),[qs,$a]=p.useState(!1),[Li,rs]=p.useState(""),[vr,gl]=p.useState(null),[ia,ss]=p.useState(!1),[Ir,Dl]=p.useState(""),[Fr,Bh]=p.useState(0),[vo,xo]=p.useState(""),[wo,Qo]=p.useState(!1),[$d,zo]=p.useState(!1),[Hc,qu]=p.useState(!1),[Rf,Fa]=p.useState(""),[Uh,ra]=p.useState(""),[Vo,Ho]=p.useState(0),[qo,qc]=p.useState({saving:!1,error:"",notice:""}),[Wc,ko]=p.useState(!1),[ya,ro]=p.useState(()=>new Set),[nn,Oo]=p.useState(!1),[Kc,Pr]=p.useState(""),[dr,Gc]=p.useState(""),[Wu,Wo]=p.useState(()=>new Set),bl=p.useRef(!1),fc=p.useRef(""),Ml=p.useRef(null),Ba=p.useRef(0),va=p.useRef(0),Ua=p.useRef(0),Ie=p.useRef(0),[dt,zt]=p.useState(KGt),[Mn,mn]=p.useState("");p.useEffect(()=>{e.length!==0&&zt(de=>de.map(($e,Xe)=>Xe===0&&$e.agentIds.length===0?{...$e,agentIds:e.slice(0,2).map(ut=>ut.id)}:$e))},[e]);const gn=p.useMemo(()=>{const de=new Map;for(const $e of e)$e.runtimeId&&de.set($e.runtimeId,$e);return de},[e]),On=p.useMemo(()=>{var $e;const de=new Map;for(const Xe of t){const ut=($e=Xe.deploymentTarget)==null?void 0:$e.runtimeId;if(!ut||!gn.has(ut))continue;const Xt=de.get(ut);(!Xt||Xe.updatedAt>Xt.updatedAt)&&de.set(ut,Xe)}return de},[gn,t]),Rt=p.useMemo(()=>{const de=new Map;for(const $e of f){if(!$e.runtimeId)continue;const Xe=de.get($e.runtimeId);(!Xe||$e.startedAt>Xe.startedAt)&&de.set($e.runtimeId,$e)}return de},[f]),wn=p.useMemo(()=>{const de=it.trim().toLowerCase();return de?e.filter($e=>{const Xe=$e.runtimeId?On.get($e.runtimeId):void 0,ut=$e.runtimeId?Rt.get($e.runtimeId):void 0;return[$e.label,$e.app,$e.host??"",(Xe==null?void 0:Xe.draft.name)??"",(Xe==null?void 0:Xe.draft.description)??"",(ut==null?void 0:ut.runtimeName)??""].join(" ").toLowerCase().includes(de)}):e},[e,Rt,it,On]),zn=p.useMemo(()=>{const de=it.trim().toLowerCase();return t.filter($e=>{var ut;const Xe=(ut=$e.deploymentTarget)==null?void 0:ut.runtimeId;return Xe&&gn.has(Xe)?!1:de?`${$e.draft.name} ${$e.draft.description}`.toLowerCase().includes(de):!0})},[gn,t,it]),Gn=p.useMemo(()=>t.filter(de=>{var Xe;const $e=(Xe=de.deploymentTarget)==null?void 0:Xe.runtimeId;return!$e||!gn.has($e)}).length,[gn,t]),hs=p.useMemo(()=>{const de=it.trim().toLowerCase();return de?dt.filter($e=>$e.name.toLowerCase().includes(de)):dt},[dt,it]),re=e.find(de=>de.id===U),Vn=t.find(de=>de.id===z),gi=h?f.find(de=>de.id===h):void 0,So=re!=null&&re.runtimeId?On.get(re.runtimeId):void 0,ae=x?Lt:U&&r===U?i:null,ze=(ae==null?void 0:ae.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",Ne=(re==null?void 0:re.agentCategory)??"general",oe=Ne==="mpa"?"basic":H,Fe=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,st=Fe==null?void 0:Fe.mpaInstanceId,ct=(re==null?void 0:re.mpaInstanceId)??st??(re==null?void 0:re.runtimeId)??"",An=XGt.filter(de=>Ne==="mpa"?de==="basic":de==="profileConfig"?!1:de==="usage"?c&&(re==null?void 0:re.runtimeId):!(de==="sessionConfig"||de==="diagnostics")).map(de=>({id:de,label:_(`agentWorkspace.sections.${de}`)})),Ci=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",ze,Ls]),Bi=(La==null?void 0:La.requestKey)===Ci?La.value:null,un=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,ui=JSON.stringify([(re==null?void 0:re.runtimeId)??"",ct,(re==null?void 0:re.region)??"cn-beijing",y]),Wt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",ct,(re==null?void 0:re.region)??"cn-beijing"]),di=Wt,Bn=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),$i=(Se==null?void 0:Se.requestKey)===un?Se.value:"",Xn=(X==null?void 0:X.requestKey)===un?X:null,er=(Ni==null?void 0:Ni.requestKey)===ui&&y?Ni.value:null,as=(Es==null?void 0:Es.requestKey)===Wt?Es.value:null,Br=(Uo==null?void 0:Uo.requestKey)===di?Uo.value:(as==null?void 0:as.profile)??null,xr=(as==null?void 0:as.bindingStatus)??"",If=JGt((hc=as==null?void 0:as.safeError)==null?void 0:hc.code,_),Ib=(as==null?void 0:as.capabilities.canWrite)===!0,o0=(vr==null?void 0:vr.requestKey)===Bn?vr:null,l0=!!(re!=null&&re.runtimeId&&Ne==="mpa"&&xr!=="runtime_missing"&&xr!=="binding_ambiguous"),Qh=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&xr==="bound"&&y),fr=(Br==null?void 0:Br.status)==="applied"?Br.profileRevision:null,zh=!!(Qh&&er&&fr!=null&&fr>er.profileRevision),Xc=mx(er),Yc=vo.trim()!==Xc,Zc=!!((k0=Xn==null?void 0:Xn.apiApps)!=null&&k0.length),xa=!!(Xn!=null&&Xn.a2a),Pb=((Ud=Xn==null?void 0:Xn.apiApps)==null?void 0:Ud[0])??ze,Ll=(ne==null?void 0:ne.endpoint)??"",Pf=iXt(((Uk=Xn==null?void 0:Xn.a2a)==null?void 0:Uk.endpoint)??"",Ll),Jc=(re==null?void 0:re.runtimeApp)||"",so=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,Jc]),Nt=l&&(re!=null&&re.runtimeId)&&re.region&&Ke===0?H8({runtimeId:re.runtimeId,region:re.region,appName:Jc,currentVersion:re.currentVersion}):null,Ri=(Re==null?void 0:Re.requestKey)===so?Re.value:Nt,yl=Ri!=null&&Ri.reason?_o(Ri.reason,L.resolvedLanguage||L.language):"",Wi=(Ri==null?void 0:Ri.warnings.filter(de=>_o(de,L.resolvedLanguage||L.language)))??[],Pn=Ne!=="mpa";p.useEffect(()=>{const de=Ba.current+1;Ba.current=de,Ue(null),St("");const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"";if(!Pn||!l||!$e||!Xe){Pt(!1);return}const ut=Ke===0?H8({runtimeId:$e,region:Xe,appName:Jc,currentVersion:re==null?void 0:re.currentVersion}):null;if(ut){Ue({requestKey:so,value:ut}),Pt(!1);return}const Xt=new AbortController;let Ye,kn=0;const Dr=60;Pt(!0);const yi=bs=>{RD({runtimeId:$e,region:Xe,appName:Jc,currentVersion:re==null?void 0:re.currentVersion,signal:Xt.signal,force:bs&&Ke>0}).then(Qa=>{var Lb,Ws;if(de!==Ba.current)return;const Qk=Qa.recoveryStatus==="preparing";if(Qa.runtime.runtimeId!==$e||Qa.runtime.region!==Xe||!Qk&&Jc&&((Lb=Qa.agent)==null?void 0:Lb.appName)!==Jc||Qa.canUpdate&&!((Ws=Qa.agent)!=null&&Ws.appName)){St(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Ue({requestKey:so,value:Qa}),Pt(!1),!!Qk){if(kn+=1,kn>=Dr){St(_("agentWorkspace.errors.updateConfigRestoring"));return}Ye=window.setTimeout(()=>yi(!1),1e3)}}).catch(()=>{de!==Ba.current||Xt.signal.aborted||St(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{de===Ba.current&&!Xt.signal.aborted&&Pt(!1)})};return yi(!0),()=>{Xt.abort(),Ye!=null&&window.clearTimeout(Ye)}},[l,Jc,Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Pn,so]);const ps=p.useMemo(()=>{const de=new Map(e.map((Xe,ut)=>[Xe.id,ut])),$e=new Map(n.map((Xe,ut)=>[Xe,ut]));return[...wn].sort((Xe,ut)=>{const Xt=Xe.runtimeId?Rt.get(Xe.runtimeId):void 0,Ye=ut.runtimeId?Rt.get(ut.runtimeId):void 0,kn=(Xt==null?void 0:Xt.status)==="running"?Xt.startedAt:0,Dr=(Ye==null?void 0:Ye.status)==="running"?Ye.startedAt:0;if(kn!==Dr)return Dr-kn;const yi=$e.get(Xe.id),bs=$e.get(ut.id);return yi!=null&&bs!=null?yi-bs:yi!=null?-1:bs!=null?1:(de.get(Xe.id)??0)-(de.get(ut.id)??0)})},[n,e,wn,Rt]),Db=(re==null?void 0:re.label)||(ae==null?void 0:ae.name)||(Vn==null?void 0:Vn.draft.name)||(gi==null?void 0:gi.agentName)||((aa=gi==null?void 0:gi.agentDraft)==null?void 0:aa.name)||_("agentWorkspace.noAgentSelected"),c0=dt.find(de=>de.id===Mn),i2=ps.filter(de=>de.canDelete===!0),$l=ps.filter(de=>Ji.has(de.id)&&de.canDelete===!0),u0=zn.filter(de=>_n.has(de.id)),Sm=i2.length+zn.length,d0=$l.length+u0.length,xn=p.useMemo(()=>{var $e;if(gi!=null&&gi.agentDraft)return gi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const de=($e=re==null?void 0:re.region)!=null&&$e.startsWith("ap-")?"byteplus":"volcengine";return Ri!=null&&Ri.agent&&(Ri.recoveryStatus==="complete"||Ri.recoveryStatus==="draft-only")?hH(Ri.agent,de,Ri.runtime.configuredEnvKeys):pXt(ae,ze||(re==null?void 0:re.label)||"agent",de)},[ae,ze,re==null?void 0:re.label,re==null?void 0:re.region,Vn==null?void 0:Vn.draft,gi==null?void 0:gi.agentDraft,Ri]),Ku=((f2=ae==null?void 0:ae.draft)==null?void 0:f2.harnessSidecar)??dmt(ne==null?void 0:ne.envs),r2=Ku?tk.filter(de=>Ku.componentOverrides[de]):[],s2=p.useMemo(()=>zA(xn),[xn]),Fd=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):Ne==="mpa"?"":l?re!=null&&re.runtimeId?re.region?_t?_("agentWorkspace.errors.checkingUpdateConfig"):Gt||(Ri?Ri.recoveryStatus!=="complete"&&Ri.recoveryStatus!=="draft-only"?yl||_("agentWorkspace.errors.originalConfigUnavailable"):Ri.canUpdate?(Mf=Ri.agent)!=null&&Mf.appName?"":_("agentWorkspace.errors.agentInfoMissing"):yl||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),Rk="aw-update-disabled-reason",f0=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr&&!l0?_("agentWorkspace.mpaRuntimeMissing"):Ib?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),a2=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Em=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||(xr!=="bound"?a2:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),h0=p.useMemo(()=>{if(ae)return ae.tools;const de=(xn.builtinTools??[]).map($e=>{var Xe;return((Xe=lT.find(ut=>ut.id===$e))==null?void 0:Xe.label)??$e});return Array.from(new Set([...xn.tools,...de,...(xn.customTools??[]).map($e=>$e.name),...(xn.mcpTools??[]).map($e=>$e.name)].filter(Boolean)))},[xn,ae]),Ik=p.useMemo(()=>ae?ae.skillsPreviewSupported?ae.skills.map(de=>de.name):null:Array.from(new Set([...(xn.selectedSkills??[]).map(de=>de.name),...xn.skills].filter(Boolean))),[xn,ae]),Ur=p.useMemo(()=>{if(gi)return gi;if(Vn){const de=f.filter($e=>$e.draftId===Vn.id).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0];return de||f.filter($e=>{var Xe,ut;return((Xe=$e.agentDraft)==null?void 0:Xe.name)===Vn.draft.name||$e.agentName===Vn.draft.name||!!((ut=Vn.deploymentTarget)!=null&&ut.runtimeId)&&$e.runtimeId===Vn.deploymentTarget.runtimeId}).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0]}if(re)return f.filter(de=>!!re.runtimeId&&de.runtimeId===re.runtimeId||de.agentName===re.label).sort((de,$e)=>$e.startedAt-de.startedAt)[0]},[f,re,Vn,gi]),p0=!!(h&&Ur&&Ur.id===h),Df=!!(Ur&&(Ur.status!=="success"||p0)),Vh=(Ur==null?void 0:Ur.status)==="running",eu=Ur!=null&&Ur.draftId?t.find(de=>de.id===Ur.draftId)??(Ur.agentDraft?{id:Ur.draftId,draft:Ur.agentDraft,updatedAt:Ur.startedAt}:void 0):void 0,o2=p.useMemo(()=>wXt(xn),[xn]),vl=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,Fi=vl??(gi==null?void 0:gi.startedAt)??"unknown",Eo=ae?`runtime:${(re==null?void 0:re.runtimeId)??ae.name}:v${Fi}:${o2}`:`draft:${(gi==null?void 0:gi.id)??(Vn==null?void 0:Vn.id)??(re==null?void 0:re.id)??Db}:${o2}`;p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=ct||$e,ut=(re==null?void 0:re.region)??"cn-beijing",Xt=Wt;if(rs(""),Ne!=="mpa"||!$e||oe!=="profileConfig"&&oe!=="sessionConfig"){is(null),$a(!1);return}const Ye=new AbortController;return $a(!0),_Te({mpaInstanceId:Xe,runtimeId:$e,region:ut,signal:Ye.signal}).then(kn=>{de||(is({requestKey:Xt,value:kn}),$s(kn.profile?{requestKey:di,value:kn.profile}:null))}).catch(kn=>{de||Ye.signal.aborted||(is(null),rs(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{de||$a(!1)}),()=>{de=!0,Ye.abort()}},[Ke,Wt,oe,ct,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Ne,di,_]),p.useEffect(()=>{oe==="usage"&&!c&&q("basic")},[c,oe]),p.useEffect(()=>{oe==="sessionConfig"&&(!(re!=null&&re.runtimeId)||Ne!=="mpa")&&q("basic")},[oe,re==null?void 0:re.runtimeId,Ne]),p.useEffect(()=>{oe==="diagnostics"&&(!(re!=null&&re.runtimeId)||Ne!=="mpa")&&q("basic")},[oe,re==null?void 0:re.runtimeId,Ne]),p.useEffect(()=>{if(!h)return;const de=f.find(Xe=>Xe.id===h),$e=de!=null&&de.runtimeId?gn.get(de.runtimeId):void 0;if($e){J(""),Z($e.id),q("basic");return}Z(""),J(""),q("basic")},[gn,f,h]),p.useEffect(()=>{if(!m){fc.current="";return}const de=`${m}:${g}:${b}:${c}`;fc.current!==de&&e.some($e=>$e.id===m)&&(fc.current=de,J(""),Z(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(Ot(b),Dt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const de of ps.slice(0,8)){if(!de.runtimeId)continue;const $e=de.region??"cn-beijing";N2e(de.runtimeId,$e),OTe(de.runtimeId,$e,de.runtimeApp??"")}},[ps]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=(re==null?void 0:re.runtimeApp)??"",Xt=$e?kTe($e,Xe,ut):null;if(qe(Xt),Tt(""),tn(!1),je(!!Xt||!x||!$e),!(!x||!$e))return Az($e,Xe,ut,{force:!0}).then(Ye=>{de||qe(Ye)}).catch(Ye=>{!de&&!Xt&&qe(null),de||(tn(Ye instanceof Ea&&Ye.unsupported),Tt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{de||je(!0)}),()=>{de=!0}},[x,Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing";if(ns([]),Sr(""),oe!=="optimizations"||!$e){fs(!1);return}if(x&&!ze){fs(!yt);return}return fs(!0),lTe({runtimeId:$e,region:Xe,appName:ze}).then(ut=>{de||ns(ut.groups)}).catch(()=>{de||Sr(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{de||fs(!1)}),()=>{de=!0}},[yt,x,go,oe,ze,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{Hs(1)},[re==null?void 0:re.runtimeId,ze]),p.useEffect(()=>{const de=Ua.current+1;Ua.current=de;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=ze;if(Pl(""),oe!=="usage"||!$e){ji(!1);return}if(!ut){ji(x&&!yt);return}const Xt=new AbortController;return ji(!0),b2e({runtimeId:$e,region:Xe,appName:ut,page:Ls,pageSize:YGt,signal:Xt.signal}).then(Ye=>{if(de===Ua.current){if(Ye.runtimeId!==$e||Ye.appName!==ut||Ye.page!==Ls){Pl(_("agentWorkspace.errors.usageMismatch"));return}uc({requestKey:Ci,value:Ye})}}).catch(()=>{de!==Ua.current||Xt.signal.aborted||Pl(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{de===Ua.current&&ji(!1)}),()=>{Xt.abort()}},[Ls,yo,Ci,yt,x,oe,ze,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{va.current+=1,ve(null),He(!1),De(!1),ce(""),pe("api-server")},[un,oe]),p.useEffect(()=>{const de=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing",Xe=Bn;if(Dl(""),oe!=="diagnostics"||Ne!=="mpa"||xr!=="bound"||!de||!y||de!==w){ss(!1),oe!=="diagnostics"&&gl(null);return}const ut=new AbortController;let Xt=!1;return ss(!0),NTe({runtimeId:de,region:$e,sessionId:y,signal:ut.signal}).then(async Ye=>{const kn=Ye.runs[0],Dr=kn?await RTe({runtimeId:de,region:$e,sessionId:y,invocationId:kn.invocationId,signal:ut.signal}):null;return{runs:Ye.runs,trace:Dr}}).then(Ye=>{Xt||gl({requestKey:Xe,...Ye})}).catch(Ye=>{Xt||ut.signal.aborted||(gl(null),Dl(Ye instanceof Error?Ye.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{Xt||ss(!1)}),()=>{Xt=!0,ut.abort()}},[w,y,Fr,Bn,oe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Ne,xr,_]);function ms(){va.current+=1,ve(null),He(!1),De(!1),ce("")}function Pk(de){de!==fe&&(ms(),pe(de))}async function m0(){if(Le){ms();return}const de=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing";if(!de)return;const Xe=va.current+1;va.current=Xe,De(!0),ce("");try{const ut=await A2e(de,$e);if(Xe!==va.current)return;ve({requestKey:un,value:ut}),He(!0)}catch(ut){if(Xe!==va.current)return;ve(null),He(!1),ce(ut instanceof Error?ut.message:_("agentWorkspace.errors.loadApiKey"))}finally{Xe===va.current&&De(!1)}}p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=$e?j2e($e,Xe):null;if(W(ut),vt(""),!!$e)return ID($e,Xe,{force:!0}).then(Xt=>{de||W(Xt)}).catch(()=>{!de&&!ut&&W(null),de||vt(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{de=!0}},[Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const de=Ie.current+1;if(Ie.current=de,Fa(""),ra(""),zo(!1),qu(!1),oe!=="sessionConfig"||!Qh||!(re!=null&&re.runtimeId)){Qo(!1),io(null),xo("");return}const $e=re.runtimeId,Xe=ct||$e,ut=re.region??"cn-beijing",Xt=ui,Ye=new AbortController;return Qo(!0),Promise.all([Iz({runtimeId:$e,region:ut,sessionId:y,signal:Ye.signal}),TTe({runtimeId:$e,region:ut,mpaInstanceId:Xe,signal:Ye.signal}).catch(()=>null)]).then(([kn,Dr])=>{de===Ie.current&&(io({requestKey:Xt,value:kn}),xo(mx(kn)),$s(Dr?{requestKey:di,value:Dr}:null))}).catch(kn=>{de!==Ie.current||Ye.signal.aborted||(kn==null?void 0:kn.name)==="AbortError"||(io(null),xo(""),Fa(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{de===Ie.current&&!Ye.signal.aborted&&Qo(!1)}),()=>{Ye.abort()}},[y,Vo,ui,Qh,oe,di,ct,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"";if(he(""),oe!=="versions"||!$e){Ce(!1),$e||Ae(null);return}return Ce(!0),dN($e).then(Xe=>{de||Ae(Xe)}).catch(()=>{de||(Ae(null),he(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{de||Ce(!1)}),()=>{de=!0}},[oe,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=`${Xe}:${$e}`;if(ue(""),oe!=="integrations"||!$e){Y(!1),$e||le(null);return}Y(!0);const Xt=Xw($e,Xe,{retryProbe:!0}).catch(Ye=>{if(Ye instanceof Ea&&Ye.unsupported)return null;throw Ye});return Promise.all([Xt,C2e($e,Xe,{retryProbe:!0})]).then(([Ye,kn])=>{de||le({requestKey:ut,apiApps:Ye,a2a:kn})}).catch(()=>{de||(le(null),ue(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{de||Y(!1)}),()=>{de=!0}},[te,oe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=$e&&ze?cTe({runtimeId:$e,region:Xe,appName:ze,pageSize:100}):null;if(Qe(ut?qoe(ut,_):[]),Qt((ut==null?void 0:ut.sets)??[]),Ms(""),ci((ut==null?void 0:ut.unsupportedMessage)??""),oe!=="evaluations"||!$e){lr(!1);return}if(x&&!ze){lr(!yt);return}return lr(!ut),AD({runtimeId:$e,region:Xe,appName:ze,pageSize:100},{force:!0}).then(Xt=>{de||(Qt(Xt.sets),Qe(qoe(Xt,_)),ci(Xt.unsupportedMessage??""))}).catch(()=>{de||(Ms(_("agentWorkspace.errors.loadEvaluations")),ci(""))}).finally(()=>{de||lr(!1)}),()=>{de=!0}},[yt,x,Ei,oe,ze,ae==null?void 0:ae.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function zL(de){const $e=(re==null?void 0:re.runtimeId)??"",Xe=de.commitSha??"";if(!(!$e||!Xe||ie)){we(Xe),he("");try{await l2e({runtimeId:$e,targetCommitSha:Xe,region:re==null?void 0:re.region,agentCategory:Ne});const ut=await dN($e);Ae(ut)}catch(ut){he(ut instanceof Error?ut.message:_("agentWorkspace.errors.rollbackVersion"))}finally{we("")}}}function Dk(de,$e){return!(de instanceof rw)||de.status!==412||!de.currentState?!1:(io({requestKey:ui,value:de.currentState}),xo(mx(de.currentState)),Fa($e),!0)}async function Mk(de="replace"){if(!(re!=null&&re.runtimeId)||!er)return;const $e=re.runtimeId,Xe=re.region??"cn-beijing",ut=vo.trim(),Xt=de==="inherit"?{category:"model",mode:de}:ut?{category:"model",mode:de,value:{id:ut}}:{category:"model",mode:"inherit"};zo(!0),Fa(""),ra("");try{const Ye=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[Xt]});io({requestKey:ui,value:Ye}),xo(mx(Ye)),ra(_("agentWorkspace.sessionConfigSaved"))}catch(Ye){Dk(Ye,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Ye,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function l2(de){if(!(re!=null&&re.runtimeId)||!er)return;const $e=re.runtimeId,Xe=re.region??"cn-beijing";zo(!0),Fa(""),ra("");try{const ut=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[{category:"mcpServers",mode:de}]});io({requestKey:ui,value:ut}),ra(_("agentWorkspace.sessionConfigSaved"))}catch(ut){Dk(ut,_("agentWorkspace.sessionConfigStale"))||Fa(c6(ut,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function g0(){if(!(re!=null&&re.runtimeId)||!er||!fr)return;const de=re.runtimeId,$e=re.region??"cn-beijing";qu(!0),Fa(""),ra("");try{const Xe=await ITe({runtimeId:de,region:$e,sessionId:y,etag:er.etag,idempotencyKey:nXt(de,y,fr),targetProfileRevision:fr});io({requestKey:ui,value:Xe}),xo(mx(Xe)),ra(_("agentWorkspace.sessionProfileUpgraded"))}catch(Xe){Dk(Xe,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Xe,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{qu(!1)}}async function c2(){if(!(re!=null&&re.runtimeId))return;const de=re.runtimeId,$e=re.region??"cn-beijing",Xe=ct||de,ut=(Br==null?void 0:Br.status)==="applied"?"update":"create",Xt=(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||"",Ye=await lXt(de,ut,s2);qc({saving:!0,error:"",notice:""});try{const kn=await Nz({operationKind:ut,runtimeId:de,region:$e,mpaInstanceId:Xe,sourceProfileId:`studio-runtime:${de}:${ze||"a2a-default"}`,targetKey:ut==="update"?Xe:`runtime:${$e}:${de}`,runtimeRevision:ut==="update"?Xt:void 0,draft:xn,idempotencyKey:Ye});qc({saving:!1,error:kn.status==="succeeded"?"":kn.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:kn.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:kn.profileRevision??_("agentWorkspace.notAvailable")}):""}),ot(Dr=>Dr+1),Ho(Dr=>Dr+1)}catch(kn){qc({saving:!1,error:kn instanceof Error?kn.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function VL(){!(re!=null&&re.runtimeId)||Ne!=="mpa"||I==null||I({draft:xn,runtimeId:re.runtimeId,mpaInstanceId:ct||re.runtimeId,name:Db,region:re.region??"cn-beijing",appName:ze||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||void 0})}p.useEffect(()=>{qc({saving:!1,error:"",notice:""})},[Wt]),p.useEffect(()=>{const de=new Set(Ut.map($e=>$e.id));ro($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe}),Wo($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe}),dr&&!de.has(dr)&&Gc("")},[Ut,dr]),p.useEffect(()=>{ko(!1),ro(new Set),Wo(new Set),Pr(""),Gc("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const de=new Set(ps.filter($e=>$e.canDelete===!0).map($e=>$e.id));Qn($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe})},[ps]),p.useEffect(()=>{const de=new Set(zn.map($e=>$e.id));pi($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe})},[zn]);const sa=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||ze&&v.agentName&&v.agentName!==ze?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,ze,_]),Ln=p.useMemo(()=>WGt(_),[_]),b0=p.useMemo(()=>re!=null&&re.runtimeId?sa?[sa,...Ut.filter(de=>de.id!==sa.id&&(!de.messageId||de.messageId!==sa.messageId))]:Ut:Ln,[Ln,Ut,sa,re==null?void 0:re.runtimeId]),Cm=b0.filter(de=>{if(de.kind!==Ct||(de.source==="auto"?"auto":"user")!==Ze)return!1;const Xe=Bt.trim().toLowerCase();return Xe?[de.input,de.output,de.referenceOutput,de.comment,de.tag??"",de.sessionId,de.messageId,de.userId,de.evaluationSetName].join(" ").toLowerCase().includes(Xe):!0}),y0=Cm.filter(de=>ya.has(de.id)),Lk=!!(re!=null&&re.runtimeId),HL=de=>{Ot(de),Dt(""),Pr("");const $e=b0.find(Xe=>Xe.kind===de);Gc(($e==null?void 0:$e.id)??""),window.setTimeout(()=>{var Xe;(Xe=Ml.current)==null||Xe.scrollIntoView({behavior:"smooth",block:"start"})},0)},$k=de=>{Pr(""),ro($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe})},Bd=()=>{Pr(""),ro(new Set(Cm.map(de=>de.id)))},u2=()=>{Pr(""),ro(new Set),ko(!1)},Fk=de=>{Wo($e=>{const Xe=new Set($e);return Xe.has(de)?Xe.delete(de):Xe.add(de),Xe})},qL=de=>{Gc(de.id),Pr(""),!(!de.sessionId||!de.messageId)&&(R==null||R(de))},d2=async de=>{if(!(re!=null&&re.runtimeId)||!ze||nn||de.length===0)return;const $e=de.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:de.length});if(!window.confirm($e))return;const Xe=de.map(Xt=>Xt.id),ut=new Set(Xe);Oo(!0),Pr("");try{await fTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:ze,itemIds:Xe});const Xt=new Map;for(const Ye of de)Xt.set(Ye.kind,(Xt.get(Ye.kind)??0)+1);Qe(Ye=>Ye.filter(kn=>!ut.has(kn.id))),Qt(Ye=>Ye.map(kn=>({...kn,itemCount:Math.max(0,kn.itemCount-(Xt.get(kn.kind)??0))}))),ro(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),Wo(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),dr&&ut.has(dr)&&Gc(""),de.length>1&&ko(!1),C==null||C(de)}catch(Xt){Pr(Xt instanceof Error?Xt.message:String(Xt))}finally{Oo(!1)}},Hh=de=>{zt($e=>$e.map(Xe=>Xe.id===de.id?de:Xe))},gs=()=>{const de=new Set(e.map(ut=>ut.id)),$e=n.filter(ut=>de.has(ut)),Xe=new Set($e);return[...$e,...e.filter(ut=>!Xe.has(ut.id)).map(ut=>ut.id)]},WL=(de,$e,Xe)=>{if(!O||de===$e)return;const ut=gs().filter(kn=>kn!==de),Xt=ut.indexOf($e),Ye=Xt<0?ut.length:Xe==="after"?Xt+1:Xt;ut.splice(Ye,0,de),O(ut)},v0=(de,$e)=>{if(!gt||gt===$e)return;const Xe=de.currentTarget.getBoundingClientRect();cn($e),lt(de.clientY>Xe.top+Xe.height/2?"after":"before")},Mb=(de,$e)=>{if(!O)return;const Xe=gs(),ut=Xe.indexOf(de),Xt=Math.max(0,Math.min(Xe.length-1,ut+$e));ut<0||ut===Xt||(Xe.splice(ut,1),Xe.splice(Xt,0,de),O(Xe))},Bk=de=>{de.canDelete===!0&&(Fn(""),Qn($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe}))},KL=de=>{Fn(""),pi($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe})},GL=()=>{Fn(""),Qn(new Set(i2.map(de=>de.id))),pi(new Set(zn.map(de=>de.id)))},XL=()=>{Fn(""),Qn(new Set),pi(new Set),Sn(!1)},x0=()=>{if(d0===0||Nn)return;const de=$l.length,$e=u0.length;if(de===1&&$e===0){Qr($l[0]);return}Fn(""),nt({kind:"selection",title:_(de===1&&$e===0?"agentWorkspace.deleteAgentTitle":de===0&&$e===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:de===1&&$e===0?_("agentWorkspace.deleteAgentDescription",{name:$l[0].label}):de===0&&$e===1?_("agentWorkspace.deleteDraftDescription",{name:u0[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:d0,warning:de>0?_("agentWorkspace.runtimeDeletionWarning",{count:de}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(de===0&&$e===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:$l,drafts:u0})},w0=async()=>{if(!(!Rn||Nn)){if(Rn.kind==="agent"&&Rn.previewFailed){await Qr(Rn.agent);return}if(Rn.canConfirm!==!1){Dn(!0),Fn("");try{if(Rn.kind==="selection"){const{agents:de,drafts:$e}=Rn;if(de.length>0){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A(de)}$e.length>0&&(E==null||E($e)),Qn(new Set),pi(new Set),Sn(!1),de.some(Xe=>Xe.id===U)&&Z(""),$e.some(Xe=>Xe.id===z)&&J("")}else if(Rn.kind==="agent"){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A([Rn.agent]),U===Rn.agent.id&&Z("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&J("")}nt(null)}catch(de){Fn(de instanceof Error?de.message:String(de))}finally{Dn(!1)}}}},Qr=async de=>{var Xe;if(!A||de.canDelete!==!0||Nn)return;(Xe=Kn.current)==null||Xe.abort(),Fn("");let $e=null;if(de.agentCategory==="mpa"){const ut=new AbortController;if(Kn.current=ut,nt({kind:"agent",agent:de,title:_("agentWorkspace.deleteAgentTitle"),description:a.jsx("p",{role:"status",children:_("agentWorkspace.mpaDeleteChecking")}),confirmLabel:_("agentWorkspace.mpaDeleteChecking"),canConfirm:!1,previewLoading:!0}),!de.runtimeId||!de.region){Fn(_("agentWorkspace.errors.loadMpaDeletePreview")),nt(Xt=>(Xt==null?void 0:Xt.kind)==="agent"?{...Xt,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.errors.loadMpaDeletePreview")}:Xt);return}try{if($e=await jTe({mpaInstanceId:de.mpaInstanceId??de.runtimeId,runtimeId:de.runtimeId,region:de.region,signal:ut.signal}),ut.signal.aborted||Kn.current!==ut)return}catch(Xt){if(ut.signal.aborted||Kn.current!==ut)return;Fn(Xt instanceof Error?Xt.message:String(Xt)),nt(Ye=>(Ye==null?void 0:Ye.kind)==="agent"?{...Ye,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.mpaDeletePreviewFailed")}:Ye);return}}nt({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:$e?a.jsx(eXt,{preview:$e,t:_}):_("agentWorkspace.deleteAgentDescription",{name:de.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:$e?$e.canDelete:!0,agent:de})},Am=de=>{if(!E||Nn)return;const $e=de.draft.name||_("agentSelector.unnamedAgent");Fn(""),nt({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:$e}),confirmLabel:_("myAgents.deleteDraft"),draft:de})},bi=()=>{const de=`eval-${Date.now()}`,$e={id:de,name:_("agentWorkspace.newEvaluationGroupName",{count:dt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};zt(Xe=>[$e,...Xe]),mn(de)},YL=de=>{Hh({...de,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+de.history.length%7,status:"completed"},...de.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),tt("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),tt("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:de=>{de==null||de.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{value:it,onChange:de=>tt(de.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:bi,disabled:F==="library"&&!o,children:[a.jsx(ec,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(A||E)&&a.jsx("div",{className:`aw-selection-toolbar${hn?" is-active":""}`,children:hn?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:d0})}),a.jsx("button",{type:"button",onClick:GL,disabled:Sm===0||Nn,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void x0(),disabled:d0===0||Nn,children:_(Nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:XL,disabled:Nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Fn(""),Sn(!0)},disabled:Sm===0,children:_("common.select")})}),F==="library"&&_i&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:_i}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?hs.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):hs.map(de=>a.jsxs("button",{type:"button",className:`aw-agent-item${de.id===Mn?" is-active":""}`,onClick:()=>mn(de.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:TS(de.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:de.agentIds.length,runs:de.history.length})})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)):u&&ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&ps.length===0&&zn.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),S&&a.jsx("button",{type:"button",onClick:S,children:_("common.retry")})]}):ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[zn.map(de=>{const Xe=f.filter(Xt=>Xt.draftId===de.id).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0]??f.filter(Xt=>{var Ye,kn;return((Ye=Xt.agentDraft)==null?void 0:Ye.name)===de.draft.name||Xt.agentName===de.draft.name||!!((kn=de.deploymentTarget)!=null&&kn.runtimeId)&&Xt.runtimeId===de.deploymentTarget.runtimeId}).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0],ut=_n.has(de.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",hn?"is-selecting":"",ut?"is-selected-for-delete":"",de.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":hn?ut:void 0,onClick:()=>{if(hn){KL(de);return}Z(""),J(de.id),q("basic")},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Xe==null?void 0:Xe.status)==="running"?" is-deploying":""}`,children:(Xe==null?void 0:Xe.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:de.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)}),ps.map(de=>{const $e=de.runtimeId?Rt.get(de.runtimeId):void 0,Xe=de.runtimeId?On.get(de.runtimeId):void 0,ut=Ji.has(de.id),Xt=de.canDelete===!0,Ye=($e==null?void 0:$e.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:($e==null?void 0:$e.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:($e==null?void 0:$e.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Xe?{label:_("agentWorkspace.updatePending"),className:""}:null,kn=($e==null?void 0:$e.status)==="running"?_("agentWorkspace.updatingDeployment"):Xe?_("agentWorkspace.updatePending"):de.remote?de.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Dr=["aw-agent-item","aw-agent-item--sortable",de.id===U?"is-active":"",hn?"is-selecting":"",ut?"is-selected-for-delete":"",hn&&!Xt?"is-selection-disabled":"",de.id===gt?"is-dragging":"",de.id===Ft&&de.id!==gt?`is-drop-target is-drop-${Je}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!O&&!hn,className:Dr,"aria-pressed":hn?ut:void 0,"aria-keyshortcuts":O?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:yi=>{O&&(bl.current=!0,an(de.id),yi.dataTransfer.effectAllowed="move",yi.dataTransfer.setData("text/plain",de.id))},onDragEnter:yi=>{v0(yi,de.id)},onDragOver:yi=>{!gt||gt===de.id||(yi.preventDefault(),yi.dataTransfer.dropEffect="move",v0(yi,de.id))},onDragLeave:yi=>{const bs=yi.relatedTarget;bs instanceof Node&&yi.currentTarget.contains(bs)||Ft===de.id&&cn("")},onDrop:yi=>{yi.preventDefault();const bs=yi.dataTransfer.getData("text/plain")||gt;WL(bs,de.id,Je),an(""),cn(""),lt("before")},onDragEnd:()=>{an(""),cn(""),lt("before"),window.setTimeout(()=>{bl.current=!1},0)},onKeyDown:yi=>{yi.altKey&&(yi.key==="ArrowUp"?(yi.preventDefault(),Mb(de.id,-1)):yi.key==="ArrowDown"&&(yi.preventDefault(),Mb(de.id,1)))},onClick:yi=>{if(hn){yi.preventDefault(),Bk(de);return}if(bl.current){yi.preventDefault(),bl.current=!1;return}J(""),Z(de.id),q("basic"),j(de.id)},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.label}),de.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",de.currentVersion]}),Ye&&a.jsx("span",{className:`aw-draft-badge${Ye.className}`,children:Ye.label})]}),a.jsx("small",{children:kn})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+Gn:dt.length})})]}),F==="evaluation"&&c0?a.jsx(RXt,{group:c0,agents:e,cases:b0,onChange:Hh,onRun:YL}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!Vn&&!gi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Vh?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!ae&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),oe==="integrations"&&V&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(dT,{className:"aw-agent-detail",title:Db,description:xn.description||_(s||x&&!yt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Db,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?k:void 0,meta:a.jsxs(a.Fragment,{children:[vl!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",vl]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),So&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!Vn&&gi&&a.jsx("span",{className:"aw-agent-meta",children:gi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||So||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(Vn||So)&&a.jsxs(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const de=Vn??So;de&&Am(de)},disabled:Nn,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Qr(re),disabled:Nn,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_(Nn?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:An.map(de=>{var $e,Xe,ut,Xt;return{key:de.id,label:de.label,disabled:Vh,content:de.id===oe?a.jsxs(a.Fragment,{children:[Ur&&Df&&a.jsx("div",{className:`aw-detail-deployment${Vh?" is-running":""}`,children:a.jsx(AXt,{task:Ur,onReturnToEdit:eu&&D?()=>D(eu):void 0})}),a.jsxs("div",{className:"aw-content",children:[oe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[fn&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(kt&&!fn||We)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>ot(Ye=>Ye+1),children:_("common.retry")})}),Ne==="mpa"&&(qs||Li||xr)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:xr==="bound"&&!Li?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||_(xr==="bound"?"agentWorkspace.mpaRuntimeBound":xr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":xr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&Ne!=="mpa"&&Ri&&!Ri.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:Ri.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:Ri.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),yl&&a.jsx("span",{children:yl}),Wi.map(Ye=>a.jsx("span",{children:Ye},Ye))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Ur==null?void 0:Ur.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(RP,{draft:xn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Eo)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:fH(ae==null?void 0:ae.model)||xn.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:ae!=null&&ae.graph?o9e(ae.graph):l9e(xn)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:h0.length?h0.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Ik===null?_("agentSelector.previewUnsupported"):Ik.length?Ik.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:vl!=null?`v${vl}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Ur==null?void 0:Ur.status)==="error"?_("agentWorkspace.deploymentFailed"):(Ur==null?void 0:Ur.status)==="cancelled"?_("agentWorkspace.cancelled"):So?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Ku!=null&&Ku.enabled?"is-ready":void 0,children:Ku?Ku.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Ku?cmt(Ku.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Ku?r2.length?r2.map(Ye=>a.jsx("span",{children:SN(Ye)},Ye)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),oe==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":ml,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),ml&&!Bi&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:_("agentWorkspace.loadingUsage")})}),mi&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:mi}),a.jsx("button",{type:"button",onClick:()=>dc(Ye=>Ye+1),children:_("common.retry")})]}),!ml&&!mi&&!Bi&&!ze&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Bi&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:Bi.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:Bi.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),ml&&a.jsx(on,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Bi.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:Bi.users.map(Ye=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ye.displayName||Ye.userId||_("agentWorkspace.unknownUser")}),Ye.displayName&&Ye.userId&&a.jsx("small",{title:Ye.userId,children:Ye.userId})]}),a.jsx("td",{children:Ye.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ye.lastUsedAt,children:i9e(Ye.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ye.userId))})]})}),Bi.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:ml||Bi.page<=1,onClick:()=>Hs(Ye=>Math.max(1,Ye-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Bi.page,total:Bi.totalPages})}),a.jsx("button",{type:"button",disabled:ml||Bi.page>=Bi.totalPages,onClick:()=>Hs(Ye=>Ye+1),children:_("common.nextPage")})]})]})]}),oe==="sessionConfig"&&a.jsx(uXt,{config:er,profileStatus:Br,loadable:Qh,disabledReason:a2,loading:wo,saving:$d,upgrading:Hc,error:Rf,notice:Uh,modelValue:vo,modelDirty:Yc,profileUpgradeAvailable:zh,onModelChange:xo,onSaveModel:()=>void Mk(),onInheritModel:()=>void Mk("inherit"),onClearMcp:()=>void l2("clear"),onInheritMcp:()=>void l2("inherit"),onUpgradeProfile:()=>void g0(),onRefresh:()=>Ho(Ye=>Ye+1)}),oe==="profileConfig"&&a.jsx(cXt,{profile:s2,profileStatus:Br,runtimeReady:Ib,disabledReason:f0,saving:qo.saving,error:qo.error,notice:qo.notice,onApply:()=>void c2(),onEditProfile:VL,onRefresh:()=>ot(Ye=>Ye+1)}),oe==="diagnostics"&&a.jsx(hXt,{data:o0,loadable:!Em,disabledReason:Em,loading:ia,error:Ir,onRefresh:()=>Bh(Ye=>Ye+1),locale:L.resolvedLanguage??L.language}),oe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:($e=ye==null?void 0:ye.cicd)!=null&&$e.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Ee&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Be&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Be}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void dN(re.runtimeId??"").then(Ae),children:_("common.retry")})]}),!Ee&&!Be&&a.jsxs("div",{className:"aw-version-list",children:[(ye==null?void 0:ye.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ye.githubSyncError})}),(ye==null?void 0:ye.latestSourceRuntimeStatus)&&ye.latestSourceRuntimeStatus!=="published"&&((Xe=ye.versions[0])==null?void 0:Xe.commitSha)&&ye.versions[0].commitSha!==ye.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Qoe(ye.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ye!=null&&ye.versions.length?ye.versions.map(Ye=>{var Qa;const kn=Ye.commitSha??"",Dr=Ye.runtimeStatus??Ye.status,yi=Ye.changeType==="rollback",bs=!!((Qa=ye.cicd)!=null&&Qa.enabled)&&!!kn&&!yi&&kn!==ye.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:rXt(Ye,_)}),a.jsx("small",{children:Ye.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ye.pullRequestUrl?a.jsx("a",{href:Ye.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ye.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:Qoe(Dr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!bs||ie===kn,onClick:()=>void zL(Ye),children:_(ie===kn?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ye.workflowRunUrl&&a.jsx("a",{href:Ye.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ye.version}-${kn||Ye.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:vl!=null?`v${vl}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),oe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),K&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>Oe(Ye=>Ye+1),children:_("common.retry")})]}),!K&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${fe==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),LO.map((Ye,kn)=>a.jsx("button",{type:"button",id:`integration-${Ye.id}-tab`,role:"tab","aria-selected":fe===Ye.id,"aria-controls":`integration-${Ye.id}-panel`,tabIndex:fe===Ye.id?0:-1,onClick:()=>Pk(Ye.id),onKeyDown:Dr=>{var Qa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Dr.key))return;Dr.preventDefault();const yi=Dr.key==="Home"?0:Dr.key==="End"?LO.length-1:(kn+(Dr.key==="ArrowRight"?1:-1)+LO.length)%LO.length,bs=LO[yi];Pk(bs.id),(Qa=document.getElementById(`integration-${bs.id}-tab`))==null||Qa.focus()},children:Ye.label},Ye.id))]}),fe==="api-server"?a.jsx(Voe,{protocol:"api-server",title:"API Server",available:Zc,fields:[{label:"Agent",value:Zc?((ut=Xn==null?void 0:Xn.apiApps)==null?void 0:ut.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:Zc?u6(Ll,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:Zc?u6(Ll,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:Zc?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:Zc,authType:ne==null?void 0:ne.authType,value:$i,visible:Le&&!!$i,loading:Ge,error:se,onToggle:()=>void m0()})}],example:Zc?sXt(Ll,Pb,ne==null?void 0:ne.authType):""}):a.jsx(Voe,{protocol:"a2a",title:"A2A",available:xa,fields:[{label:"Agent",value:((Xt=Xn==null?void 0:Xn.a2a)==null?void 0:Xt.name)??""},{label:"Agent Card",value:xa?u6(Ll,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Pf},{label:_("agentWorkspace.authentication"),value:xa?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:xa,authType:ne==null?void 0:ne.authType,value:$i,visible:Le&&!!$i,loading:Ge,error:se,onToggle:()=>void m0()})}],example:xa?aXt(Pf,ne==null?void 0:ne.authType):""})]})]}),oe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ye=>{const kn=xXt(xt,Ye),Dr=b0.filter(bs=>bs.kind===Ye).length,yi=sa?Dr:(kn==null?void 0:kn.itemCount)??Dr;return a.jsxs("button",{type:"button",onClick:()=>HL(Ye),children:[a.jsx("strong",{children:yi}),a.jsx("span",{children:_(Ye==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ye)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ye=>a.jsx("button",{type:"button",className:Ct===Ye?"is-active":"","aria-pressed":Ct===Ye,onClick:()=>Ot(Ye),children:_(Ye==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ye))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ye=>a.jsx("button",{type:"button",className:Ze===Ye?"is-active":"","aria-pressed":Ze===Ye,onClick:()=>bt(Ye),children:_(Ye==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ye))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:Bt,onChange:Ye=>Dt(Ye.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),Lk&&a.jsx("div",{className:`aw-case-toolbar${Wc?" is-active":""}`,children:Wc?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:y0.length})}),a.jsx("button",{type:"button",onClick:Bd,disabled:Cm.length===0||nn,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void d2(y0),disabled:y0.length===0||nn,children:_(nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:u2,disabled:nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Pr(""),ko(!0)},disabled:Cm.length===0||nn,children:_("agentWorkspace.selectCases")})}),Kc&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:Kc}),a.jsx("div",{ref:Ml,children:a.jsx(NXt,{cases:Cm,loading:jn&&Cm.length===0,error:ta,notice:ts,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:Wc,selectedCaseIds:ya,focusedCaseId:dr,expandedCaseIds:Wu,deleting:nn,canDelete:Lk,onOpenCase:qL,onToggleCase:$k,onToggleExpanded:Fk,onDeleteCase:Ye=>void d2([Ye]),onRetry:()=>$r(Ye=>Ye+1)})})]}),oe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),Il?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):ge?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:ge}),a.jsx("button",{type:"button",onClick:()=>bo(Ye=>Ye+1),children:_("common.retry")})]}):na.length>0?a.jsx(_Xt,{groups:na}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),oe==="basic"&&(re||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(qat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),Ne!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${Fd?" is-disabled":""}`,tabIndex:Fd?0:void 0,"aria-describedby":Fd?Rk:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Fd,"aria-busy":_t||void 0,"aria-describedby":Fd?Rk:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}Ri&&P(Ri)},children:_t?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||So?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Fd&&a.jsx("span",{id:Rk,className:"aw-update-disabled-reason",role:"tooltip",children:Fd})]})]})]}):null}}),activeSectionKey:oe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(_d,{variant:"danger",title:Rn.title,description:Rn.description,error:_i||void 0,confirmLabel:Nn?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:Nn,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>{var de;(de=Kn.current)==null||de.abort(),Kn.current=null,nt(null),Fn("")},onConfirm:()=>void w0()})]})}function _Xt({groups:e}){const{t}=_e("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:bXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:vXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function jXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function NXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,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 a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),k=(o==null?void 0:o.has(w.id))??!1,S=(c==null?void 0:c.has(w.id))??!1,A=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",k?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?k:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:C=>{C.target===C.currentTarget&&(C.key!=="Enter"&&C.key!==" "||(C.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${k?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:mXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),A&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:C=>{C.stopPropagation(),m==null||m(w.id)},children:v(S?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:gXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:C=>{C.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(jXt,{})})})]},w.id)})]})}function RXt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=_e("ui"),[o,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 a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:TS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:TS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Fat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:TS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:TS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Of,{}),s("agentWorkspace.completed")]}),a.jsx(sE,{"aria-hidden":!0})]},h.id))})]})})]})}async function mK(e,t={}){const n=await fetch(Na(`/web/agent-reviews${e}`),{...t,headers:hl(oc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function IXt(e,t){return mK(`?${new URLSearchParams({region:e})}`,{signal:t})}function PXt(e,t,n){return mK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function DXt(e,t,n){return mK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const MXt=20,Woe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=_e("agentReviews");return a.jsxs("label",{children:[e,a.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}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function IP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function f9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,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(""),[k,S]=p.useState(""),[O,A]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),PXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,O]);async function C(_,L){if(!h){m(!0),b("");try{const F=await DXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:k}:{}});u(F),x(""),S(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(t0,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"agent-review-backdrop"}),a.jsxs(Jv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:n}),a.jsx(UT,{children:o("dialogDescription")})]}),a.jsx(dL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(fl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>A(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(IP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(IP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:MXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:Woe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:k,onChange:S,limit:Woe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void C(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!k.trim(),onClick:()=>void C("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void C("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void C(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const LXt=5e3,$Xt=4;let f6=0;const Koe=[];function Goe(e){return e instanceof Error&&e.name==="AbortError"}function FXt(e){return e instanceof Error&&e.name==="TimeoutError"}function BXt(e){return FXt(e)||e instanceof ND&&[500,502,503,504].includes(e.status)}function UXt(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 QXt(e={},t={}){const n=t.request??$v,i=t.wait??UXt;try{return await n(e)}catch(r){if(!BXt(r))throw r;return await i(LXt,e.signal),n(e)}}async function h9e(e){var t;f6>=$Xt&&await new Promise(n=>Koe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Koe.shift())==null||t()}}async function zXt(e,t){await Promise.allSettled(e.map(n=>h9e(()=>t(n))))}function wy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}const VXt=/^[A-Za-z_][A-Za-z0-9_]*$/,NL=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Xoe(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function HXt(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function Ek(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&VXt.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(NL))==null?void 0:r[1])??""}function PP(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)PP(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])PP(i.agent,t)}function p9e(e){try{const t=(e??"").trim(),n=new URL(t);if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password||n.search||n.hash)return null;const i=t.indexOf("://")+3,r=t.indexOf("/",i),s=(r>=0?t.slice(r):"").replace(/\/+$/,"");return`${n.protocol}//${n.host}${s}`}catch{return null}}function qXt(e,t){let n=e.name.trim();if(!n){const i=p9e(e.url),r=(i==null?void 0:i.split("/").filter(Boolean))??[];n=r[r.length-1]??""}return n=n.replace(/[^A-Za-z0-9_.-]+/g,"_").replace(/^[_.-]+|[_.-]+$/g,""),n||`mcp_${t+1}`}function m9e(e){const t=new Set,n=new Set;let i=null;const r=s=>{var o;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=qXt(l,c),d=p9e(l.url);if(t.has(u)){i="duplicateName";return}if(d&&n.has(d)){i="duplicateUrl";return}t.add(u),d&&n.add(d)}),!i&&(s.subAgents.forEach(r),(o=s.workflow)==null||o.nodes.forEach(l=>r(l.agent)))};return r(e),i}function h6(e){const t=new Set;return PP(e,n=>{const i=Ek(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function g9e(e){const t=new Set;return PP(e,n=>{const i=Ek(n);i&&t.add(i)}),[...t]}function WXt(e,t){const n=new Set(g9e(t));return[...new Set(e)].filter(i=>!n.has(i))}function KXt(e){if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=Ek(e);return t?`\${${t}}`:""}function GXt(e,t){if(!t){const i={...e,credentialConfigured:!1};return delete i.authToken,delete i.authTokenEnv,delete i.credentialSourceUrl,delete i.credentialSourceAuthTokenEnv,i}const n=t.trim().match(NL);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&Ek(e)===n[1]};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1}}function XXt(e){if(!e.trim())return!1;try{return new URL(e).pathname.replace(/\/+$/,"")===""}catch{return!1}}function Yoe(e){return(e??"").trim().replace(/\/+$/,"")}function YXt(e,t){return{...e,url:t}}function ZXt(e,t){const n=new Map(t.map(r=>[[r.agentName.trim(),r.authTokenEnv.trim(),Yoe(r.url)].join("\0"),r.value])),i=r=>({...r,mcpTools:(r.mcpTools??[]).map(s=>{var c;const o=Ek(s);if(!o)return s;const l=n.get([r.name.trim(),o,Yoe(s.url)].join("\0"));return l?{...s,authToken:l,credentialConfigured:!0,credentialSourceUrl:((c=s.url)==null?void 0:c.trim())??"",credentialSourceAuthTokenEnv:o}:s}),subAgents:r.subAgents.map(i),...r.workflow?{workflow:{...r.workflow,nodes:r.workflow.nodes.map(s=>({...s,agent:i(s.agent)}))}}:{}});return i(e)}function JXt(e){const t=Ck(e),n={},i=o=>{var l,c;Object.assign(n,((l=o.deployment)==null?void 0:l.envValues)??{}),o.subAgents.forEach(i),(c=o.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=o=>{var l,c,u;for(const d of o.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:o.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}o.subAgents.forEach(s),(u=o.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function eYt(e){const t=[],n=i=>{var r,s,o;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||NL.test(c)||t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",value:c})}i.subAgents.forEach(n),(o=i.workflow)==null||o.nodes.forEach(l=>n(l.agent))};return n(e),t}function Ck(e){const t=new Set,n={},i=r=>{var u;const s=Xoe(r.name,"AGENT"),o=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,w;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((w=h.match(NL))==null?void 0:w[1])??"";let b=Ek(d);if(!b&&h){const x=Xoe(d.name,`TOOL_${f+1}`);b=HXt(`MCP_${s}_${x}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!m&&(n[b]=h);const v={...d};return delete v.authToken,delete v.credentialConfigured,delete v.credentialSourceUrl,delete v.credentialSourceAuthTokenEnv,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=r.subAgents.map(i),c=r.workflow?{...r.workflow,nodes:r.workflow.nodes.map(d=>({...d,agent:i(d.agent)}))}:void 0;return{...r,subAgents:l,...o?{mcpTools:o}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const tYt=/^[A-Za-z_][A-Za-z0-9_]*$/;function xj(e){return typeof e=="string"?e.trim():""}function Zy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.modelName=="string"}function b9e(e){return typeof e=="string"?e:e.modelName}function y9e(e){var t,n,i;return typeof e=="string"||!((t=e.modelProvider)!=null&&t.trim())&&!((n=e.modelApiBase)!=null&&n.trim())&&!((i=e.modelApiKeyEnv)!=null&&i.trim())}function gK(e,t){return`FALLBACK_MODEL_${(e??"").trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"AGENT"}_${t+1}_API_KEY`}function v9e(e){return tYt.test(e)}function x9e(e,t,n){const i=new Set((n??[]).map(o=>{var l;return Zy(o)?(l=o.modelApiKeyEnv)==null?void 0:l.trim():""}).filter(o=>!!o)),r=gK(e,t);if(!i.has(r))return r;let s=2;for(;i.has(`${r}_${s}`);)s+=1;return`${r}_${s}`}function nYt(e,t,n,i){var s;const r=((s=i.modelApiKeyEnv)==null?void 0:s.trim())??"";return r&&v9e(r)?r:x9e(e,t,n)}function Lu(e,t){var s,o,l;const n=(e??"").trim(),i=new Set;n&&i.add(`same:${n}`);const r=[];for(const c of t??[]){const u=iYt(c);if(!u)continue;const d=b9e(u).trim(),f=y9e(u);if(!d||f&&d===n)continue;const h=typeof u=="string"?`same:${d}`:["endpoint",d,((s=u.modelProvider)==null?void 0:s.trim())??"",((o=u.modelApiBase)==null?void 0:o.trim())??"",((l=u.modelApiKeyEnv)==null?void 0:l.trim())??""].join("\0");i.has(h)||(i.add(h),r.push(u))}return r}function iYt(e){if(typeof e=="string")return e.trim()||null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=xj(t.modelName??t.model_name??t.model);if(!n)return null;const i={modelName:n},r=xj(t.modelProvider??t.model_provider??t.provider),s=xj(t.modelApiBase??t.model_api_base??t.apiBase??t.api_base??t.baseUrl??t.base_url),o=xj(t.modelApiKeyEnv??t.model_api_key_env??t.apiKeyEnv??t.api_key_env);return r&&(i.modelProvider=r),s&&(i.modelApiBase=s),o&&v9e(o)&&(i.modelApiKeyEnv=o),y9e(i)?n:i}function w9e(e,t){return Lu(e,t).filter(n=>typeof n=="string")}function k9e(e,t){const n=Array.isArray(e)?e:[e],i=typeof n[0]=="string"?n[0].trim():"";return{modelName:i,modelFallbacks:Lu(i,[...n.slice(1),...Array.isArray(t)?t:[]])}}function rYt(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function wj(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function O9e(e,t){const n=e==null?void 0:e.trim();if(!n)return!1;try{const i=new URL(n),r=new URL(t),s=i.pathname.replace(/\/+$/,""),o=r.pathname.replace(/\/+$/,"");return i.protocol==="https:"&&i.username===""&&i.password===""&&i.search===""&&i.hash===""&&i.hostname.toLowerCase()===r.hostname.toLowerCase()&&i.port===r.port&&s===o}catch{return!1}}function RL(e,t){const n=[],i=new Set,r=(s,o=[])=>{var u,d,f,h;const l=rYt(s.name,"AGENT"),c=s.agentType===void 0||s.agentType==="llm";if(c&&s.modelSource!=="ark"&&(s.modelSource==="custom"||(u=s.modelApiBase)!=null&&u.trim()&&!O9e(s.modelApiBase,t))){const m=((d=s.modelProvider)==null?void 0:d.trim())??"",g=((f=s.modelApiBase)==null?void 0:f.trim())??"",b=m?wj(`CUSTOM_MODEL_${l}_PROVIDER`,i):void 0;b&&i.add(b);const v=g?wj(`CUSTOM_MODEL_${l}_API_BASE`,i):void 0;v&&i.add(v);const y=wj(`CUSTOM_MODEL_${l}_API_KEY`,i);i.add(y),n.push({providerKey:b,apiBaseKey:v,apiKeyKey:y,provider:m,apiBase:g,label:Yt("helpers.customModel.apiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName")}),path:o})}if(!c){s.subAgents.forEach((m,g)=>r(m,[...o,g]));return}(h=s.modelFallbacks)==null||h.forEach((m,g)=>{var w,x,k;if(!Zy(m))return;const b=m.modelName.trim();if(!b)return;const y=(((w=m.modelApiKeyEnv)==null?void 0:w.trim())??"")||wj(gK(s.name,g),i);i.add(y),n.push({apiKeyKey:y,provider:((x=m.modelProvider)==null?void 0:x.trim())??"",apiBase:((k=m.modelApiBase)==null?void 0:k.trim())??"",label:Yt("helpers.customModel.fallbackApiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName"),model:b}),path:o})}),s.subAgents.forEach((m,g)=>r(m,[...o,g]))};return r(e),n}function bK(e,t){return RL(e,t).map(({apiKeyKey:n,label:i})=>({key:n,label:i}))}function S9e(e,t,n,i=[]){const r=new Set(i);return RL(e,t).map(({apiKeyKey:s,label:o,path:l})=>({key:s,label:o,path:l})).find(({key:s})=>{var o;return!((o=n[s])!=null&&o.trim())&&!r.has(s)})??null}function Zoe(e){const t=new Set,n=i=>{var r,s;for(const o of i.modelFallbacks??[]){if(!Zy(o))continue;const l=((r=o.modelApiKeyEnv)==null?void 0:r.trim())??"";l&&t.add(l)}i.subAgents.forEach(n),(s=i.workflow)==null||s.nodes.forEach(o=>n(o.agent))};return n(e),[...t]}const E9e=1,sYt="MODEL_AGENT_API_KEY",C9e="WorkspaceDraftError";function G7(e){const t=new Error(Yt(e));return t.name=C9e,t}function DP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function aYt(e){return DP(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&(e.creationMode===void 0||e.creationMode==="quick"||e.creationMode==="traditional")&&DP(e.draft)}function _w(e){return(e==null?void 0:e.agentCategory)??((e==null?void 0:e.mpaProfileOnly)===!0?"mpa":"general")}function p6(e){return e.creationMode?e.creationMode:e.draft.dynamicAgentDelegation===!0?"quick":"traditional"}function IL(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function X7(e,t,n,i){const r=e.deployment,s=r==null?void 0:r.envValues,o=r?{...r,...s?{envValues:Object.fromEntries(Object.entries(s).filter(([l])=>l!==sYt&&!t.has(l)&&!i.has(l)))}:{}}:void 0;return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map(l=>{if(!l.authTokenEnv||!n.has(l.authTokenEnv))return l;const c={...l};return delete c.authTokenEnv,c})}:{},...o?{deployment:o}:{},subAgents:e.subAgents.map(l=>X7(l,t,n,i)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(l=>({...l,agent:X7(l.agent,t,n,i)}))}}:{}}}function Y7(e,t){return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map((n,i)=>{var r,s;return{...n,...((s=(r=t.mcpTools)==null?void 0:r[i])==null?void 0:s.credentialConfigured)===!0?{credentialConfigured:!0}:{}}})}:{},subAgents:e.subAgents.map((n,i)=>Y7(n,t.subAgents[i]??n)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map((n,i)=>{var r,s;return{...n,agent:Y7(n.agent,((s=(r=t.workflow)==null?void 0:r.nodes[i])==null?void 0:s.agent)??n.agent)}})}}:{}}}function oYt(e){const t=Ck(e),n=Y7(t.draft,e),i=new Set([...bK(t.draft,Fo(t.draft.cloudProvider??"volcengine")).map(r=>r.key),...Zoe(t.draft),...Zoe(e)]);return X7(n,new Set(g9e(t.draft)),new Set(Object.keys(t.envValues)),i)}function A9e(e){return{...e,draft:oYt(e.draft)}}function lYt(e){const t=Array.isArray(e)?e:DP(e)&&e.version===E9e?e.drafts:void 0;if(!Array.isArray(t)||!t.every(aYt))throw DP(e)&&typeof e.version=="number"?G7("helpers.drafts.unsupportedVersion"):G7("helpers.drafts.invalidFormat");return t.map(A9e)}function cYt(e,t){if(!t)return[];const n=e.getItem(IL(t));if(!n)return[];try{return lYt(JSON.parse(n))}catch(i){throw i instanceof Error&&i.name===C9e?i:G7("helpers.drafts.readFailed")}}function Joe(e,t,n){if(!t)return;const i={version:E9e,drafts:n.map(A9e)};try{e.setItem(IL(t),JSON.stringify(i))}catch(r){throw r instanceof DOMException&&(r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error(Yt("helpers.drafts.quotaExceeded")):new Error(Yt("helpers.drafts.writeRejected"))}}function _p({className:e="icon"}){return a.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:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function uYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function dYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.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"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.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 fYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.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 hYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function gA({kind:e,...t}){return e==="codex"?a.jsx(uYt,{...t}):e==="deepseek-harness"?a.jsx(hYt,{...t}):e==="openclaw"?a.jsx(dYt,{...t}):a.jsx(fYt,{...t})}const pYt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function T9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(ki,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:pYt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(ki,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(ki,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class Z7 extends Error{constructor(t,n,i){super(n),this.status=t,this.code=i,this.name="MpaCreationRequestError"}}async function Ak(e,t,n){var r;const i=await fetch(Na(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:hl(oc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,eo)});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Z7(i.status,typeof s.detail=="string"?s.detail:`HTTP ${i.status}`,typeof((r=s.detail)==null?void 0:r.code)=="string"?s.detail.code:void 0)}return i.json()}const mYt=(e,t)=>Ak(`config?region=${encodeURIComponent(e)}`,t),gYt=(e,t)=>Ak("tasks",t,e),bYt=(e,t)=>Ak(`tasks?region=${encodeURIComponent(e)}`,t),yYt=(e,t)=>Ak("name-check",t,e),vYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}`,t),xYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),wYt=/^[A-Za-z0-9_-]+$/,_9e=4,MP=64,LP=6,ele="agent-runtime";function j9e(e){const t=e.trim();if(!t)return ele;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,MP);return n?(n.length<_9e&&(n=`${n}-rt`.slice(0,MP)),n):ele}function kYt(e,t){const n=t.toLowerCase().replace(/[^a-z0-9]+/g,"").slice(0,LP).padEnd(LP,"0"),i=MP-n.length-1;return`${j9e(e).slice(0,i).replace(/[-_]+$/g,"")||"agent"}-${n}`}function yK(e,t=Math.random){const n=Math.min(Math.max(t(),0),1-Number.EPSILON),i=Math.floor(n*36**LP).toString(36).padStart(LP,"0");return kYt(e,i)}function OYt(e,t,n){return n??!!(t!=null&&t.trim())?t??"":j9e(e)}function i0(e,t=n=>Yt(`validation.runtimeName.${n}`)){return e?wYt.test(e)?e.length<_9e||e.length>MP?t("length"):null:t("characters"):t("required")}function SYt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function EYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}function CYt(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 N9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function Zf(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=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,k]=p.useState(""),[S,O]=p.useState(0),A=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=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("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),A.current=!0,h(!0),g(null),PTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(H=>{if(D)return M.items;const q=new Set(H.map(U=>`${U.id}\0${U.name}`));return[...H,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),k(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(k(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,A.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,A.current=!1,n([]),r(""),o(1),c(0),d(!1),k(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,S]);const C=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{k(""),O(I=>I+1)},[]),P=p.useCallback(()=>{!C||A.current||!u||R(s+1,!1)},[u,R,s,C]);return{items:t,serviceRegion:i,totalCount:l,hasMore:C?u:!1,loading:!!T&&(!C||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function AYt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Jf({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=_e("ui"),u=p.useMemo(()=>AYt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(bf,{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[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.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 R9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=_e("ui"),s=Zf(e?{kind:"cr-registry",region:e}:null),o=Zf(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=Zf(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 a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(Jf,{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:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(Jf,{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 m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(bf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:CYt(r),disabled:n,onChange:s=>i(s)})]})}function G0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=_e("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function I9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.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()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function P9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){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=Zf(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=Zf(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=Zf(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=Zf(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=Zf(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=Zf(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(G0,{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"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(Jf,{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"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(G0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(G0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(G0,{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"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(Jf,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(Jf,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(Jf,{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"&&a.jsx(g6,{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")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(G0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(G0,{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"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(Jf,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(Jf,{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"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}const TYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",_Yt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function vK(e){return e==="byteplus"?10:20}function D9e(e,t){return{region:e,requestId:crypto.randomUUID(),name:"",description:"",maxInstance:vK(t)}}function bA(e){const t={...e};return Reflect.deleteProperty(t,"tosAccessKey"),Reflect.deleteProperty(t,"tosSecretKey"),t}function jYt(e){const t=bA(e);for(const n of Object.keys(t))(t[n]===void 0||t[n]==="")&&delete t[n];return t}function NYt(e,t){var n;try{const i=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((n=i==null?void 0:i.input)==null?void 0:n.region)===e&&typeof i.input.requestId=="string"){if(i.submitted||i.taskId)return{...i,input:bA(i.input)};const r={...i.input,name:typeof i.input.name=="string"?i.input.name:"",maxInstance:i.input.maxInstance??vK(t)};return delete r.agentId,delete r.runtimeImage,delete r.workerImage,{...i,input:bA(r)}}}catch{}return{input:D9e(e,t)}}function RYt({region:e,cloudProvider:t="volcengine",onClose:n,onCreated:i}){var Ce,Be,he;const{t:r}=_e("ui"),s=ie=>`myAgents.mpaCreate.${ie}`,o=vK(t),[l]=p.useState(()=>NYt(e,t)),c=!!(l.step||l.input.name||l.input.description||l.input.agentId||l.input.pgHost||l.input.pgPort||l.input.openvikingUrl||l.input.openvikingResourceId||l.input.tosBucket),[u,d]=p.useState(l.input),[f,h]=p.useState(String(l.input.maxInstance??o)),[m,g]=p.useState(""),[b,v]=p.useState(l.submitted||l.taskId?2:Math.min(2,Math.max(0,l.step??0))),[y,w]=p.useState(l.taskId),[x,k]=p.useState(!!(l.submitted||l.taskId)),S=p.useRef(x);S.current=x;const[O,A]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(!0),[C,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(0),[L,F]=p.useState(!1),M=p.useRef(!1),H=p.useRef(!1),q=p.useRef(!0),U=p.useRef(null),Z=p.useRef(!1),z=p.useRef(i);z.current=i;const J=(O==null?void 0:O.state)==="running"||(O==null?void 0:O.state)==="cancelling",W=x&&u.name===void 0&&!!u.agentId?null:i0((u.name??"").trim(),ie=>r(`validation.runtimeName.${ie}`,{ns:"create"})),X=!W,le=x&&u.maxInstance===void 0,V=le||f.trim()!==""&&Number.isSafeInteger(Number(f))&&Number(f)>=1,Y=(E==null?void 0:E.postgresMode)==="auto",K=(x?u.businessDatabaseName:E==null?void 0:E.businessDatabaseName)==="aidb",ue=(x?u.businessWorkspaceMode:E==null?void 0:E.businessWorkspaceMode)==="per-agent",te=Y?!u.pgHost&&!u.pgPort:SYt(u.pgHost,u.pgPort),Oe=u.openvikingMode==="auto",fe=Oe||EYt(u.openvikingUrl,u.openvikingResourceId,m),pe=((Ce=u.tosBucket)==null?void 0:Ce.trim())??"",Se=!pe||pe.startsWith("agentkit-platform-")&&/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(pe),ve=C||x&&(!O||J||O.state==="succeeded"),Le=Zf(b===2&&!ve?{kind:"tos-bucket",region:e,namePrefix:"agentkit-platform-"}:null);p.useEffect(()=>{if(!(x||y))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),step:b}))}catch{}},[u,b,e,x,y]);function He(ie){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),taskId:ie,submitted:!0,step:2}))}catch{}}function Ge(ie){const we=jYt({requestId:ie.requestId,agentId:ie.agentId,name:ie.name,description:ie.description??"",maxInstance:ie.maxInstance??o,region:ie.region,runtimeImage:ie.runtimeImage,workerImage:ie.workerImage,pgHost:ie.pgHost,pgPort:ie.pgPort,openvikingUrl:ie.openvikingUrl,openvikingResourceId:ie.openvikingResourceId,openvikingMode:ie.openvikingMode,businessWorkspaceMode:ie.businessWorkspaceMode,businessDatabaseName:ie.businessDatabaseName,tosBucket:ie.tosBucket});d(we),h(String(we.maxInstance??o)),v(2),k(!0),w(ie.taskId),A(ie);try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:we,taskId:ie.taskId,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(q.current=!0,()=>{var ie;q.current=!1,(ie=U.current)==null||ie.abort()}),[]),p.useEffect(()=>{if(Z.current||y||l.taskId||c&&!x&&!l.submitted)return;Z.current=!0;const ie=new AbortController;return bYt(e,ie.signal).then(we=>{if(ie.signal.aborted||!q.current)return;const Re=we.tasks.find(Ue=>Ue.requestId===u.requestId)??we.tasks.find(Ue=>Ue.state!=="succeeded");Re&&Ge(Re)}).catch(()=>{}),()=>ie.abort()},[c,u.requestId,e,l.submitted,l.taskId,x,y]),p.useEffect(()=>{const ie=new AbortController;return R(!0),mYt(e,ie.signal).then(we=>{ie.signal.aborted||(j(we),we.configured&&!S.current&&!l.submitted&&!l.taskId&&!M.current&&d(Re=>({...Re,...we.businessDatabaseName==="aidb"?{businessDatabaseName:"aidb"}:{},...we.businessWorkspaceMode==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...we.openvikingMode==="auto"?{openvikingMode:"auto",openvikingUrl:void 0,openvikingResourceId:void 0}:{},pgHost:we.postgresMode==="auto"?"":Re.pgHost??we.pgHost??"",pgPort:we.postgresMode==="auto"?"":Re.pgPort??we.pgPort??""})))}).catch(()=>{ie.signal.aborted||I(r(s("loadFailed")))}).finally(()=>{ie.signal.aborted||R(!1)}),()=>ie.abort()},[e,D,t,r]),p.useEffect(()=>{if(!y)return;const ie=new AbortController;let we;async function Re(){try{const Ue=await vYt(y,ie.signal);if(ie.signal.aborted)return;if(A(Ue),I(""),Ue.state==="succeeded"&&!H.current){H.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}z.current()}if(Ue.state!=="running"&&Ue.state!=="cancelling")return}catch{if(ie.signal.aborted)return;I(r(s("pollFailed")))}we=setTimeout(Re,2e3)}return Re(),()=>{ie.abort(),clearTimeout(we)}},[y,e,D,r]);function De(ie){return ie instanceof Z7&&(ie.code==="runtimeNameTaken"||ie.code==="runtimeNameCheckFailed")?r(s(ie.code)):ie instanceof Error?ie.message:r(s("creationFailed"))}function se(ie){var we;return((we=ie.latestDiagnostic)==null?void 0:we.category)==="configuration_changed"?"configurationChanged":ie.error||"creationFailed"}async function ce(){var we;if(M.current||!X||!V)return;if(b!==0||x||u.businessDatabaseName!=="aidb"){v(Re=>Re+1);return}if(T||!(E!=null&&E.configured))return;M.current=!0,N(!0),I("");const ie=new AbortController;U.current=ie;try{const Re=await yYt({requestId:u.requestId,agentId:u.agentId,name:(we=u.name)==null?void 0:we.trim(),region:e},ie.signal);if(!q.current||ie.signal.aborted)return;if(!Re.available){I(r(s("runtimeNameTaken")));return}v(1)}catch(Re){q.current&&!ie.signal.aborted&&I(De(Re))}finally{M.current=!1,q.current&&N(!1)}}async function ye(){if(M.current||!(E!=null&&E.configured)||!X||!V||!te||!fe||!Se||b!==2||J||(O==null?void 0:O.state)==="succeeded")return;M.current=!0,N(!0);const ie=x;k(!0),I(""),He(y);const we=new AbortController;U.current=we;try{const Re=await gYt({...u,...le?{}:{maxInstance:Number(f)},...u.name===void 0?{}:{name:u.name.trim()},openvikingApiKey:m},we.signal);if(!q.current||we.signal.aborted)return;He(Re.taskId),w(Re.taskId),A(Re),_(Ue=>Ue+1)}catch(Re){q.current&&!we.signal.aborted&&(Re instanceof Z7&&(Re.status===400||Re.status===422||!ie&&(Re.code==="runtimeNameTaken"||Re.code==="runtimeNameCheckFailed"))&&k(!1),I(De(Re)))}finally{M.current=!1,q.current&&N(!1)}}async function Ae(){if(!y||M.current)return;F(!1),M.current=!0,N(!0);const ie=new AbortController;U.current=ie;try{const we=await xYt(y,ie.signal);q.current&&!ie.signal.aborted&&A(we)}catch{q.current&&!ie.signal.aborted&&I(r(s("cancelFailed")))}finally{M.current=!1,q.current&&N(!1)}}function Ee(){const ie={...D9e(e,t),...(E==null?void 0:E.businessDatabaseName)==="aidb"?{businessDatabaseName:"aidb"}:{},...(E==null?void 0:E.businessWorkspaceMode)==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...(E==null?void 0:E.openvikingMode)==="auto"?{openvikingMode:"auto"}:{},pgHost:Y?"":(E==null?void 0:E.pgHost)??"",pgPort:Y?"":(E==null?void 0:E.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ie,step:0}))}catch{}d(ie),h(String(o)),g(""),v(0),w(void 0),k(!1),A(null),I(""),F(!1),H.current=!1}return a.jsx(a.Fragment,{children:a.jsx(t0,{open:!0,onOpenChange:ie=>{!ie&&!C&&(L?F(!1):n())},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(Jv,{className:"mpa-create-popup","aria-label":r(s("title")),children:a.jsx(T9e,{className:"mpa-create-dialog",title:r(s("title")),topGlow:!1,footer:null,onClose:()=>{C||n()},closeLabel:r(s("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":r(s("stepsLabel")),children:["basics","postgres","openviking"].map((ie,we)=>a.jsx("li",{"aria-current":b===we?"step":void 0,children:a.jsxs("button",{type:"button",disabled:C||we>b&&!x&&(!X||!V||we===2&&!te),onClick:()=>v(we),children:[a.jsx("span",{children:we+1}),r(s(`steps.${ie==="postgres"&&Y?"autoPostgres":ie}`))]})},ie))}),b===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r(s("region")),":",e]}),a.jsxs("label",{children:[r(s("name")),a.jsx("input",{name:"name",placeholder:r(s("namePlaceholder")),value:u.name??u.agentId??"",maxLength:64,disabled:C||x,required:!0,autoComplete:"off","aria-invalid":!!W,"aria-describedby":"mpa-name-help",onChange:ie=>{d({...u,name:ie.target.value}),I("")}}),a.jsx("p",{id:"mpa-name-help",role:W?"alert":void 0,children:W||r(s("nameHelp"))})]}),a.jsxs("label",{children:[r(s("description")),a.jsx(_Ie,{className:"mpa-create-description",value:u.description,maxLength:512,disabled:C||x,onChange:ie=>d({...u,description:ie.target.value})})]}),!le&&a.jsxs("label",{children:[r(s("maxInstance")),a.jsx("input",{name:"maxInstance",type:"number",min:1,max:Number.MAX_SAFE_INTEGER,step:1,value:f,disabled:C||x,required:!0,"aria-invalid":!V,"aria-describedby":"mpa-maximum-help",onChange:ie=>{const we=ie.target.value;h(we),d({...u,maxInstance:Number(we)})}}),a.jsx("p",{id:"mpa-maximum-help",role:V?void 0:"alert",children:r(s(V?"maxInstanceHelp":"maxInstanceInvalid"),{maximum:o})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":r(s("plan")),children:[a.jsx("strong",{children:r(s("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:r(s("sharedResources"))}),a.jsx("li",{children:r(s("agentResources"))}),a.jsx("li",{children:r(s("readiness"))})]})]})]}),b===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Y?K?"pgAidbDescription":ue?"pgPerAgentDescription":"pgAutoDescription":(E==null?void 0:E.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/aidap/":TYt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"pgConsoleByteplus":"pgConsole"))}),!Y&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("pgHost")),a.jsx("input",{name:"pgHost",value:u.pgHost??"",maxLength:255,disabled:C||x,"aria-invalid":!te,onChange:ie=>d(we=>({...we,pgHost:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("pgPort")),a.jsx("input",{name:"pgPort",value:u.pgPort??"",inputMode:"numeric",maxLength:5,disabled:C||x,"aria-invalid":!te,onChange:ie=>d(we=>({...we,pgPort:ie.target.value}))})]}),!te&&a.jsx("p",{role:"alert",children:r(s("pgInvalid"))}),a.jsx("p",{children:r(s("pgCredentials"))})]})]}),b===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Oe?t==="byteplus"?"openvikingAutoByteplusDescription":"openvikingAutoDescription":"openvikingDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/vikingdb/":Oe?"https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/":_Yt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"openvikingConsoleByteplus":"openvikingConsole"))}),Oe?a.jsx("p",{children:r(s(t==="byteplus"?"openvikingAutoByteplusRequirements":"openvikingAutoBilling"))}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:u.openvikingUrl??"",maxLength:1024,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!fe,onChange:ie=>d(we=>({...we,openvikingUrl:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:u.openvikingResourceId??"",maxLength:128,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!fe,onChange:ie=>d(we=>({...we,openvikingResourceId:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:m,maxLength:512,disabled:C||J||(O==null?void 0:O.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:ie=>g(ie.target.value)})]}),!fe&&a.jsx("p",{role:"alert",children:r(s("openvikingInvalid"))}),a.jsx("p",{children:r(s("openvikingCredentials"))})]}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:r(s("tosTitle"))}),a.jsx("p",{children:r(s("tosDescription"))}),a.jsxs("div",{children:[a.jsx("span",{children:r(s("tosBucket"))}),a.jsx(Jf,{ariaLabel:r(s("tosBucket")),value:pe,valueLabel:pe,valueField:"name",state:Le,disabled:ve,onChange:ie=>d(we=>({...we,tosBucket:ie.name}))})]}),pe&&a.jsx(ki,{variant:"outline",disabled:ve,onClick:()=>d(ie=>({...ie,tosBucket:""})),children:r(s("tosDisable"))}),!Se&&a.jsx("p",{role:"alert",children:r(s("tosInvalid"))}),a.jsx("p",{children:r(s("tosCredentials"))})]})]}),T?a.jsx("p",{role:"status",children:r(s("checking"))}):E!=null&&E.configured?a.jsx("p",{children:r(s("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:r(s("notConfigured"))}),a.jsx("p",{children:E!=null&&E.postgresMigrationRequired?r(s("pgMigrationRequired")):E==null?void 0:E.error}),a.jsx(ki,{variant:"outline",onClick:()=>_(ie=>ie+1),children:r(s("reload"))})]}),O&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:r(s(`states.${O.state}`))}),O.state!=="succeeded"&&a.jsx("p",{children:r(s(`stages.${O.stage}`),{defaultValue:O.stage})}),O.state==="failed"||O.state==="cancelled"?O.error==="runtimeNameTaken"?a.jsx(vh,{color:"danger",variant:"soft",description:r(s(O.error))}):a.jsx("p",{children:r(s(se(O)))}):null,((Be=O.result)==null?void 0:Be.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",O.result.runtime_id]}),((he=O.result)==null?void 0:he.skill_space_id)&&a.jsxs("p",{children:[r(s("skillSpace")),":",O.result.skill_space_id]})]}),Y&&!te&&a.jsx("p",{role:"alert",children:r(s("pgModeChanged"))}),P&&a.jsx(vh,{color:"danger",variant:"soft",description:P}),J&&a.jsx("p",{children:r(s("background"))}),x&&a.jsx("p",{children:r(s("newAgentDescription"))}),L?a.jsxs("section",{role:"alertdialog","aria-label":r(s("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:r(s("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{autoFocus:!0,variant:"outline",onClick:()=>F(!1),children:r(s("back"))}),a.jsx(ki,{onClick:()=>void Ae(),children:r(s("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{variant:"outline",disabled:C,onClick:n,children:r(s("close"))}),x&&a.jsx(ki,{variant:"outline",disabled:C||T,onClick:Ee,children:r(s("newAgent"))}),b>0&&a.jsx(ki,{variant:"outline",disabled:C,onClick:()=>v(ie=>ie-1),children:r(s("previousStep"))}),J?a.jsx(ki,{variant:"outline",disabled:C||(O==null?void 0:O.state)==="cancelling",onClick:()=>F(!0),children:r(s("cancel"))}):(O==null?void 0:O.state)!=="succeeded"&&b<2?a.jsx(ki,{disabled:C||b===0&&(!X||!V)||b===1&&!te,onClick:()=>void ce(),loading:C,children:r(s("next"))}):(O==null?void 0:O.state)!=="succeeded"?a.jsx(ki,{loading:C,disabled:T||!(E!=null&&E.configured)||!X||!V||!te||!fe||!Se,onClick:()=>void ye(),children:r(s(O||x?"retry":"submit"))}):null]})]})})})]})})})}const IYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function PYt(e){return e!=="general"&&e!=="mpa"}const DYt=24,MYt=3e4,LYt=7e3,$Yt=2e4,FYt=6,BYt=2,UYt=250,wg=new Map,jw=new Map,QYt=new Set;function Yb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function tle(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ea&&e.unsupported?"unsupported":"error",message:n}}function Ym(e){if(!e){wg.clear(),jw.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of jw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&jw.delete(n);for(const n of t)W8(n);wg.clear()}}function zYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function VYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 HYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 qYt({type:e}){return e==="general"||e==="mpa"?a.jsx(_p,{}):a.jsx(gA,{kind:e})}function WYt(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),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function nle(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:JMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function KYt(e,t){const n=PD(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:JMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function GYt(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,agentCategory:_w(e.deploymentTarget),draft:e}}function XYt(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,agentCategory:_w(i),mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function YYt(e,t){return e.trim()||nr(t)}async function ZYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=jw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>nle(f,s,e))),c.page.nextToken;c&&jw.delete(l);let u=wg.get(l);u||(u=QXt({agentCategory:e,scope:t,region:n,pageSize:DYt,nextToken:i,signal:o}),wg.set(l,u),u.then(()=>wg.delete(l),()=>wg.delete(l)));const d=await u;return jw.set(l,{page:d,expiresAt:Date.now()+MYt}),r(d.runtimes.map(f=>nle(f,s,e))),d.nextToken}function JYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,C,N,P;const{t:b,i18n:v}=_e("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((C=e.sandbox)==null?void 0:C.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),k=(s==null?void 0:s.status)==="checking",S=(s==null?void 0:s.status)==="unsupported",O=(s==null?void 0:s.status)==="error",A=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.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))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=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 a.jsxs(xH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(tPe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:zT(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"):WYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(CN,{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?a.jsxs(a.Fragment,{children:[a.jsx(CN,{"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")}),a.jsx(CN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):O||S?a.jsxs(At,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(YD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||k||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?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(VYt,{})}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:A,children:A}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":PD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):k?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Za,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):S?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):O?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(Ca,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(on,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(kH,{children:e.description})]})}function eZt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=QYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:k={},onViewDeploymentTask:S,onEditDraft:O,onDeleteDraft:A}){const{t:E}=_e("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),C=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=YYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[H,q]=p.useState(s==="mine"?"mine":"all"),[U,Z]=p.useState(D),[z,J]=p.useState(null),[ne,W]=p.useState([]),[X,le]=p.useState(""),[V,Y]=p.useState(!0),[K,ue]=p.useState(""),[te,Oe]=p.useState([]),[fe,pe]=p.useState(!1),[Se,ve]=p.useState(""),[Le,He]=p.useState(""),[Ge,De]=p.useState({}),[se,ce]=p.useState({}),[ye,Ae]=p.useState(null),[Ee,Ce]=p.useState(()=>Date.now()),Be=p.useMemo(()=>IYt.map(Ke=>({value:Ke,label:E(`myAgents.agentTypes.${Ke}`)})),[E]),he=p.useMemo(()=>{const Ke=Pu(e);return Ke.some(ot=>ot.value===D)?Ke:[{value:D,label:D},...Ke]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{Z(D)},[D]),p.useEffect(()=>{Ce(Date.now());const Ke=window.setInterval(()=>Ce(Date.now()),1e3);return()=>window.clearInterval(Ke)},[]);const ie=p.useMemo(()=>w.filter(Ke=>_w(Ke.deploymentTarget)===m).map(Ke=>GYt(Ke,E)),[w,m,E]),we=p.useMemo(()=>{const Ke=new Map,ot=new Map,it=new Map;for(const tt of x){if(tt.status!=="running")continue;if(Ke.set(tt.id,tt),tt.draftId){const Ot=ot.get(tt.draftId);(!Ot||tt.startedAt>Ot.startedAt)&&ot.set(tt.draftId,tt)}if(!tt.runtimeId)continue;const Ct=it.get(tt.runtimeId);(!Ct||tt.startedAt>Ct.startedAt)&&it.set(tt.runtimeId,tt)}return{byId:Ke,byDraftId:ot,byRuntimeId:it}},[x]),Re=p.useCallback(Ke=>{var it;if(Ke.draft){const tt=k[Ke.draft.id];return we.byDraftId.get(Ke.draft.id)??(tt?we.byId.get(tt):void 0)}const ot=(it=Ke.runtime)==null?void 0:it.runtimeId;return ot?we.byRuntimeId.get(ot):void 0},[we,k]),Ue=p.useCallback((Ke,ot)=>{var Ot;(Ot=C.current)==null||Ot.abort(),wg.clear();const it=new AbortController;C.current=it;const tt=++R.current;return Y(!0),ue(""),ZYt(m==="mpa"?"mpa":"general",H,U,Ke,Bt=>{R.current===tt&&W(Dt=>ot?Bt:[...Dt,...Bt])},E,it.signal).then(Bt=>{R.current===tt&&le(Bt)}).catch(Bt=>{R.current===tt&&(Goe(Bt)||ue(wy(Bt,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===tt&&Y(!1),C.current===it&&(C.current=null)})},[m,H,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),le(""),Ue("",!0),()=>{var Ke;(Ke=C.current)==null||Ke.abort(),C.current=null,wg.clear(),R.current+=1}},[m,Ue]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const it of I.current.values())it.abort();I.current.clear();return}const Ke=new Set(ne.filter(it=>{var tt,Ct;return((tt=it.runtime)==null?void 0:tt.runtimeId)!==v&&((Ct=it.runtime)==null?void 0:Ct.region)===U}).map(Yb).filter(Boolean));for(const[it,tt]of I.current)Ke.has(it)||(tt.abort(),I.current.delete(it));const ot=ne.filter(it=>{var Bt,Dt,Ze;const tt=(Bt=it.runtime)==null?void 0:Bt.runtimeId;if(!tt||tt===v||((Dt=it.runtime)==null?void 0:Dt.region)!==U)return!1;const Ct=Yb(it),Ot=(Ze=se[Ct])==null?void 0:Ze.status;return!I.current.has(Ct)&&(!Ot||Ot==="checking")});for(const it of ot)I.current.set(Yb(it),new AbortController);ce(it=>{var Ot,Bt;let tt=!1;const Ct={...it};for(const Dt of ne){const Ze=Yb(Dt);if(!Ze)continue;const bt=((Ot=Dt.runtime)==null?void 0:Ot.runtimeId)===v;bt&&((Bt=Ct[Ze])==null?void 0:Bt.status)!=="compatible"?(Ct[Ze]={status:"compatible",message:E("myAgents.compatibility.supported")},tt=!0):!bt&&!Ct[Ze]&&(Ct[Ze]={status:"checking",message:E("myAgents.compatibility.checking")},tt=!0)}return tt?Ct:it}),zXt(ot,async it=>{const tt=it.runtime;if(!tt)return;const Ct=Yb(it),Ot=I.current.get(Ct);if(Ot)try{const Bt=await Xw(tt.runtimeId,tt.region,{signal:Ot.signal,preferCached:!0,timeoutMs:LYt,currentVersion:tt.currentVersion});if(Ot.signal.aborted)return;ce(Dt=>({...Dt,[Ct]:Bt&&Bt.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Bt){if(Ot.signal.aborted||(Bt==null?void 0:Bt.name)==="AbortError")return;ce(Dt=>({...Dt,[Ct]:tle(Bt,E)}))}finally{I.current.get(Ct)===Ot&&I.current.delete(Ct)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var Ke;(Ke=C.current)==null||Ke.abort();for(const ot of I.current.values())ot.abort();I.current.clear()},[]);const _t=p.useCallback(async Ke=>{var tt;(tt=P.current)==null||tt.abort();const ot=new AbortController;P.current=ot;const it=++N.current;pe(!0),ve(""),Oe([]);try{const Ct=Ke==="codex"?await Hr.listSessions({signal:ot.signal,autoResumeSnapshots:!1}):await Hr.listAgentSessions(Ke,{signal:ot.signal,autoResumeSnapshots:!1});if(N.current!==it)return;Oe(Ct.map(Ot=>KYt(Ot,E)))}catch(Ct){if((Ct==null?void 0:Ct.name)==="AbortError"||N.current!==it)return;ve(wy(Ct,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${Ke}`)}),`GET /web/${Ke==="codex"?"sandbox":Ke}/sessions`))}finally{P.current===ot&&(P.current=null),N.current===it&&pe(!1)}},[E]);function Pt(Ke){var ot;Ke!==m&&(Ke==="general"||Ke==="mpa"?(R.current+=1,W([]),le(""),ue(""),Y(!0)):((ot=P.current)==null||ot.abort(),P.current=null,N.current+=1,Oe([]),ve(""),pe(!0)),g(Ke))}function Gt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),le(""),ue(""),Y(!0))}function St(Ke){Ke!==H&&(Gt(),q(Ke))}function Lt(Ke){Ke!==U&&(Gt(),Z(Ke))}p.useEffect(()=>{var Ke;if(m==="general"||m==="mpa"){(Ke=P.current)==null||Ke.abort(),P.current=null,N.current+=1;return}return _t(m),()=>{var ot;(ot=P.current)==null||ot.abort(),P.current=null,N.current+=1}},[m,_t,b]),p.useEffect(()=>{const Ke=T.current,ot=j.current;if(!Ke||!ot||m!=="general"&&m!=="mpa"||!X||V)return;const it=new IntersectionObserver(([tt])=>{tt.isIntersecting&&Ue(X,!1)},{root:ot,rootMargin:"240px 0px",threshold:.01});return it.observe(Ke),()=>it.disconnect()},[m,Ue,V,X]);const qe=p.useCallback(async Ke=>{if(!Le){He(Ke.id),De(ot=>({...ot,[Ke.id]:""}));try{await new Promise(ot=>requestAnimationFrame(()=>ot())),Ke.sandbox?await f(Ke.sandbox):await c(Ke)}catch(ot){De(it=>({...it,[Ke.id]:ot instanceof Error?ot.message:String(ot)}))}finally{He("")}}},[Le,c,f]),yt=p.useCallback(async Ke=>{var Ct;const ot=Ke.runtime;if(!ot)return;const it=Yb(Ke);ce(Ot=>({...Ot,[it]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(Ct=I.current.get(it))==null||Ct.abort();const tt=new AbortController;I.current.set(it,tt);try{const Ot=await h9e(()=>Xw(ot.runtimeId,ot.region,{retryProbe:!0,signal:tt.signal,timeoutMs:$Yt,currentVersion:ot.currentVersion}));if(tt.signal.aborted)return;ce(Bt=>({...Bt,[it]:Ot&&Ot.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Ot){if(tt.signal.aborted||Goe(Ot))return;ce(Bt=>({...Bt,[it]:tle(Ot,E)}))}finally{I.current.get(it)===tt&&I.current.delete(it)}},[E]),je=p.useCallback(Ke=>{const ot=Ke.runtime;!r||!ot||Re(Ke)||q8({runtimeId:ot.runtimeId,region:ot.region,appName:Ke.appName,currentVersion:ot.currentVersion})},[r,Re]),kt=p.useMemo(()=>{const Ke=F.trim().toLocaleLowerCase(),ot=m==="general"||m==="mpa"?[...ie,...ne]:te,tt=(H==="mine"?ot.filter(Dt=>Dt.isMine):ot).filter(Dt=>{var bt;const Ze=((bt=Dt.runtime)==null?void 0:bt.region)??Dt.region;return!Ze||Ze===U}),Ct=Ke?tt.filter(Dt=>Dt.name.toLocaleLowerCase().includes(Ke)):tt;if(m!=="general"&&m!=="mpa")return Ct;const Ot=y.size>0?Ct.filter(Dt=>!Dt.runtime||!y.has(Dt.runtime.runtimeId)):Ct,Bt=Ot.findIndex(Dt=>{var Ze;return((Ze=Dt.runtime)==null?void 0:Ze.runtimeId)===v});return Bt<=0?Ot:[Ot[Bt],...Ot.slice(0,Bt),...Ot.slice(Bt+1)]},[m,v,ie,y,F,H,U,ne,te]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const Ke=kt.filter(Ot=>!!Ot.runtime).filter(Ot=>!Re(Ot)).slice(0,FYt);if(Ke.length===0)return;let ot=!1,it=0;const tt=async()=>{for(;!ot;){const Ot=Ke[it];if(it+=1,!(Ot!=null&&Ot.runtime)||(await q8({runtimeId:Ot.runtime.runtimeId,region:Ot.runtime.region,appName:Ot.appName,currentVersion:Ot.runtime.currentVersion}),ot))return}},Ct=window.setTimeout(()=>{for(let Ot=0;Ot{ot=!0,window.clearTimeout(Ct)}},[m,r,Re,kt]);const Tt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),fn=m==="general"||m==="mpa"?V&&ne.length===0&&ie.length===0:fe&&te.length===0,tn=!fn&&kt.length===0;let We;m==="general"&&n?We=()=>o(U,"general"):m==="mpa"&&n?We=()=>J(U):PYt(m)&&i&&(We=()=>d(m));const vt=m==="codex"&&i&&!!l;return a.jsxs(Ch,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(Qv,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ib,{className:"my-agent-toolbar",children:[a.jsx(rb,{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:St}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(sb,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Be,onChange:Pt}),a.jsx(sb,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:he,onChange:Lt}),a.jsx(em,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:Ke=>M(Ke.target.value),placeholder:E("common.search")}),vt?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(HYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(tm,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:Tt}),children:[fn?a.jsx(fl,{}):(m==="general"||m==="mpa"?K:Se)&&kt.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?K:Se}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Ue("",!0):_t(m)},children:E("common.reload")})]}):tn&&!We?F.trim()||H==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(oat,{})}),a.jsx(qn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(qn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(qYt,{type:m})}),a.jsx(qn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Tt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(_p,{})}),a.jsx(qn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(qn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&K?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>void Ue("",!0),children:E("common.reload")})]}):null,a.jsxs(zv,{className:"my-agent-grid",children:[We?a.jsx(ab,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Tt}),onClick:We,icon:a.jsx(zYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,kt.map(Ke=>{var it,tt,Ct,Ot,Bt;const ot=XYt(Ke,ne,E);return a.jsx(JYt,{agent:Ke,onReview:L,deploymentTask:Re(Ke),nowMs:Ee,onViewDeploymentTask:S,onUse:qe,compatibility:Ke.runtime?se[Yb(Ke)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:yt,onPrepareUpdate:((it=Ke.runtime)==null?void 0:it.canManage)===!1||((tt=Ke.runtime)==null?void 0:tt.visibility)==="enterprise"||((Ct=Ke.runtime)==null?void 0:Ct.reviewStatus)==="pending"?void 0:je,onViewDetails:ot&&((Ot=Ke.runtime)==null?void 0:Ot.canManage)!==!1?()=>{ot.sandbox?h(ot.sandbox):u(ot)}:void 0,connecting:Ke.id===Le,connectError:Ge[Ke.id],connected:((Bt=Ke.runtime)==null?void 0:Bt.runtimeId)===v,onEditDraft:O,onDeleteDraft:Ae},Ke.id)})]})]}),(m==="general"||m==="mpa")&&!K&&!fn&&(kt.length>0||!!X)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:V?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):X?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(RYt,{region:z,cloudProvider:e,onClose:()=>J(null),onCreated:()=>{Ym(),U===z&&m==="mpa"&&Ue("",!0)}},z),_!=null&&_.runtime?a.jsx(f9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Ym(),Ue("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ye?a.jsx(_d,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ye.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Ae(null),onConfirm:()=>{A==null||A(ye),Ae(null)}}):null]})}function xK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=_e("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Ch,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(Qv,{title:c}),a.jsxs(ib,{children:[(t||n)&&a.jsx(rb,{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"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const tZt="_Container_13560_1",nZt="_Textarea_13560_174",ile={Container:tZt,Textarea:nZt},bb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="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:k=3,maxRows:S,autoResize:O,ref:A,onChange:E,...j}=e,[T,R]=p.useState(!1),C=O?Math.max(S??10,k):k;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!O||!t.current||C===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[O,C]);return p.useEffect(()=>{P()},[e.value,k,P]),a.jsx("div",{className:qi(ile.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Fv({"textarea-min-rows":`${k}`,"textarea-max-rows":`${C}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:rT([t,A]),id:r||(g?void 0:i),className:ile.Textarea,name:s,readOnly:h,disabled:f,rows:k,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="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",iZt="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",rZt="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",sZt="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",aZt="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",oZt="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",lZt="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",cZt="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",uZt="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",dZt="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 wK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.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"})})}cl.registerLanguage("bash",OM);const fZt=48;function hZt(e,t=fZt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function pZt(e){return cl.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function mZt({status:e}){return e==="succeeded"?a.jsx(Of,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Vi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(jat,{"aria-hidden":!0})}function rle(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 gZt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=_e("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>pZt(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 a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(mZt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",rle(r,l.resolvedLanguage??l.language)?` · ${rle(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=hZt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function sle({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(uat,{}):a.jsx(hat,{})})]})}function Zb(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 bZt(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 M9e(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(Yt("helpers.zip.invalid"));const r=Zb(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Yt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=X0(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Yt("helpers.zip.tooLarge"));const w=Zb(e,v+26),x=Zb(e,v+28),k=v+30+w+x,S=e.subarray(k,k+f);let O;if(d===0)O=S;else if(d===8)O=await bZt(S);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(O)}),s+=46+m+g+b}return l}const J7=/(^|\/)skill\.md$/i;function yZt(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 KYt(...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 GYt(e,t){return t.trim()||e}function b9e(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 XYt(e){const t=new Map,n=new Set;for(const i of e)if(X7.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 o=X7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)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 YYt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>X7.test("/"+c.path));if(!r)return{hit:null,error:Xt("helpers.skills.missingManifest",{location:i})};const s=qYt(r.text),o=KYt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Xt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Xt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:GYt(o,s.name),description:s.description||Xt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function ZYt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await g9e(t)).map(r=>({path:r.name,text:r.text}));return y9e(b9e(i),e.name)}async function JYt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function tZt(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 v9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await eZt(e),path:n}];if(!e.isDirectory)return[];const i=await tZt(e);return(await Promise.all(i.map(r=>v9e(r,n)))).flat()}function nZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(k=>k.source==="local"&&k.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(k=>!(k.source==="local"&&k.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 k=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),S=[],E=[];for(const j of O.hits){const T=j.folder||j.name;if(k.has(T)){S.push(j.name);continue}k.add(T),E.push(j)}o(j=>[...j,...E]);const C=[...O.errors];if(S.length>0&&C.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(C),E.length===1&&O.errors.length===0&&S.length===0){const j=E[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.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 k=Array.from(O.dataTransfer.items).map(S=>{var E;return(E=S.webkitGetAsEntry)==null?void 0:E.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(j=>v9e(j)))).flat(),E=k.some(j=>j.isDirectory);if(!E&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await ZYt(S[0].file));return}if(!E){r([n("skills.local.invalidDrop")]);return}const C=new Map(S.map(({file:j,path:T})=>[j,T]));v(await JYt(S.map(({file:j})=>j),C))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.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:[a.jsx(bV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var S;const k=h(O.folder||O.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(O),"aria-pressed":k,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(O.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=O.localFiles)==null?void 0:S.length)??0})})]})]},O.id)})})]})}const iZt="/harness/skills/findskill";async function rZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${iZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(!s.ok)throw new Error(Xt("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 sZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,o]=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 rZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(fI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.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))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Bi,{className:"cw-i cw-spin"}):a.jsx(fI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function x9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.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"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function p6(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 aZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function oZt({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=pC;e.source==="local"||e.source==="runtime"?r=bV:e.source==="skillspace"&&(r=x9e);const s=`${i(aZt(e))}${e.description?` · ${xC(e.description)}`:""}`;return a.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:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.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:a.jsx(Do,{className:"cw-i cw-i-sm"})})]})}const m6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:x9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:nM}];function vK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=m6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const O=S=>{S.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(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>p6(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 a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ic,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(hf,{initial:!1,children:e.map(w=>a.jsx(oZt,{skill:w,disabled:i,onRemove:()=>v(p6(w),w)},p6(w)))})})]}),yi.createPortal(a.jsx(hf,{children:u&&a.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:a.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:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Do,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${m6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),m6.map(({id:w,labelKey:x,shortLabelKey:O,icon:k})=>a.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:[a.jsx(k,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(O)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(sZt,{selected:e,onChange:y}),l==="local"&&a.jsx(nZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(TIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const w9e=128*1024,lZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function _w(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??lZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function O9e(e){return new TextEncoder().encode(e).byteLength}function cZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function uZt(e){const t=DL(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 xZt(...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 wZt(e,t){return t.trim()||e}function L9e(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 kZt(e){const t=new Map,n=new Set;for(const i of e)if(J7.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 o=J7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)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 OZt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>J7.test("/"+c.path));if(!r)return{hit:null,error:Yt("helpers.skills.missingManifest",{location:i})};const s=yZt(r.text),o=xZt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Yt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Yt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:wZt(o,s.name),description:s.description||Yt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function SZt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await M9e(t)).map(r=>({path:r.name,text:r.text}));return $9e(L9e(i),e.name)}async function EZt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function AZt(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 F9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await CZt(e),path:n}];if(!e.isDirectory)return[];const i=await AZt(e);return(await Promise.all(i.map(r=>F9e(r,n)))).flat()}function TZt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=k=>e.some(S=>S.source==="local"&&S.folder===k),m=k=>{k.localFiles&&(h(k.folder||k.name)?t(e.filter(S=>!(S.source==="local"&&S.folder===(k.folder||k.name)))):t([...e,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=k=>{const S=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),O=[],A=[];for(const j of k.hits){const T=j.folder||j.name;if(S.has(T)){O.push(j.name);continue}S.add(T),A.push(j)}o(j=>[...j,...A]);const E=[...k.errors];if(O.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:O.join(", ")})),r(E),A.length===1&&k.errors.length===0&&O.length===0){const j=A[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=k=>{k.preventDefault(),f.current+=1,d(!0)},w=k=>{k.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async k=>{if(k.preventDefault(),f.current=0,d(!1),l)return;const S=Array.from(k.dataTransfer.items).map(O=>{var A;return(A=O.webkitGetAsEntry)==null?void 0:A.call(O)}).filter(O=>O!==null);if(S.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const O=(await Promise.all(S.map(j=>F9e(j)))).flat(),A=S.some(j=>j.isDirectory);if(!A&&O.length===1&&O[0].file.name.toLowerCase().endsWith(".zip")){v(await SZt(O[0].file));return}if(!A){r([n("skills.local.invalidDrop")]);return}const E=new Map(O.map(({file:j,path:T})=>[j,T]));v(await EZt(O.map(({file:j})=>j),E))}catch(O){r([n("skills.local.readError",{detail:O instanceof Error?O.message:String(O)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:k=>k.preventDefault(),onDragLeave:w,onDrop:k=>void x(k),children:[a.jsx(bV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(k=>{var O;const S=h(k.folder||k.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>m(k),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:k.name}),k.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((O=k.localFiles)==null?void 0:O.length)??0})})]})]},k.id)})})]})}const _Zt="/harness/skills/findskill";async function jZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${_Zt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,eo)});if(!s.ok)throw new Error(Yt("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 NZt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState(""),[s,o]=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 jZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(dI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.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))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Vi,{className:"cw-i cw-spin"}):a.jsx(dI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function B9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.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"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function b6(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 RZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function IZt({skill:e,onRemove:t,disabled:n}){const{t:i}=_e("ui");let r=gC;e.source==="local"||e.source==="runtime"?r=bV:e.source==="skillspace"&&(r=B9e);const s=`${i(RZt(e))}${e.description?` · ${kC(e.description)}`:""}`;return a.jsxs(_r.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:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.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:a.jsx(Bo,{className:"cw-i cw-i-sm"})})]})}const y6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:B9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:eM}];function kK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=_e("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=y6.findIndex(w=>w.id===l),b=r??o("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 k=O=>{O.key==="Escape"&&d(!1)};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",k),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(k=>b6(k)!==w))},y=w=>{const x=new Set(w.filter(k=>k.source!=="runtime").map(k=>k.folder));t(w.filter(k=>k.source!=="runtime"||!x.has(k.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ec,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(uf,{initial:!1,children:e.map(w=>a.jsx(IZt,{skill:w,disabled:i,onRemove:()=>v(b6(w),w)},b6(w)))})})]}),vi.createPortal(a.jsx(uf,{children:u&&a.jsx(_r.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:a.jsxs(_r.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:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Bo,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${y6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),y6.map(({id:w,labelKey:x,shortLabelKey:k,icon:S})=>a.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:[a.jsx(S,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(k)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(NZt,{selected:e,onChange:y}),l==="local"&&a.jsx(TZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(NIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const U9e=128*1024,PZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Nw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??PZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function Q9e(e){return new TextEncoder().encode(e).byteLength}function DZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function MZt(e){const t=DL(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` -`).replace(/^\n+/,"")}function iR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function dZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?_w("duplicateFrom",n):xK(iR(t,e),void 0,n):_w("baseImageRequired",n)}function xK(e,t=O9e(e),n){return t>w9e?_w("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":_w("missingFrom",n):_w("empty",n)}async function fZt(e,t){if(e.size>w9e)return{content:"",error:_w("tooLarge",t)};const n=DL(await e.text());return{content:n,error:xK(n,e.size,t)}}function hZt(e){return qM(e,{lineWidth:0})}function pZt(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 k9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function gp(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=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(""),[k,S]=p.useState(0),E=p.useRef(!1),C=p.useRef(null),j=e?JSON.stringify(e):"",T=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("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=C.current)==null||F.abort();const _=new AbortController;C.current=_;const L=JSON.parse(T);D&&n([]),E.current=!0,h(!0),g(null),NTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(H=>{if(D)return M.items;const q=new Set(H.map(U=>`${U.id}\0${U.name}`));return[...H,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),O(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{C.current===_&&(C.current=null,E.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=C.current)==null||I.abort(),C.current=null,E.current=!1,n([]),r(""),o(1),c(0),d(!1),O(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=C.current)==null?void 0:D.abort()}},[R,T,k]);const A=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{O(""),S(I=>I+1)},[]),P=p.useCallback(()=>{!A||E.current||!u||R(s+1,!1)},[u,R,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!T&&(!A||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function mZt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function bp({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>mZt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(xf,{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[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.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 S9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=gp(e?{kind:"cr-registry",region:e}:null),o=gp(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=gp(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 a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(bp,{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:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(bp,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(bp,{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 g6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(xf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:pZt(r),disabled:n,onChange:s=>i(s)})]})}function Kv({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function b6({items:e,note:t}){const{t:n}=Te("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function E9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.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()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function C9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=Te("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=gp(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=gp(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=gp(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=gp(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=gp(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=gp(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(Kv,{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"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(bp,{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"&&a.jsx(b6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(Kv,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(Kv,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(Kv,{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"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(bp,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(bp,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(bp,{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"&&a.jsx(b6,{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")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(Kv,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(Kv,{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"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(bp,{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}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(bp,{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"&&a.jsx(b6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function gZt(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 bZt=MIe.map(e=>({value:e.id,label:e.label,description:e.description}));function yZt(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 vZt(e){const t=cZt(e,"");return t===pH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const xZt=vI.map(e=>({value:e.id,label:e.label})),Joe=$Ie.map(e=>({value:e.id,label:e.label}));function wZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const Y7=20,ele=new Set;function OZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function kZt(){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 SZt={opencli:RYt,uv:IYt,playwright:PYt,chromium:DYt,git:MYt,curl:LYt,ffmpeg:$Yt,imagemagick:FYt};function EZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function of(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function CZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.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 Z7(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 tle(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function A9e(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 AZt(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function TZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function _Zt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function jZt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:NYt,alt:""});if(e.id==="github-cli")return a.jsx(yK,{});const t=SZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(_Zt,{label:e.label})}function NZt(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===gH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...o4,optionIds:[...o4.optionIds],selectedSkills:[...o4.selectedSkills]}}const Fy=new Set(["preparing","queued","building","scanning"]),nle=3e3,y6={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 T9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(y6[n]),color:"success"}:n==="failed"?{label:t(y6[n]),color:"danger"}:{label:t(y6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function RZt(e,t){return BT(e,Date.now(),t)}function IZt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function PZt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Fy.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%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 DZt({environment:e,onClose:t}){var x;const{t:n}=Te("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=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?hZt(l):"",[l]);o.current=t,p.useEffect(()=>{var E;const O=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(E=s.current)==null||E.focus();const S=C=>{if(C.key==="Escape"){C.preventDefault(),o.current();return}if(C.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];C.shiftKey&&document.activeElement===T?(C.preventDefault(),R.focus()):!C.shiftKey&&document.activeElement===R&&(C.preventDefault(),T.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),JTe(e.id,i,O.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).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 yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.currentTarget&&t()},children:a.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:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(cn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(LT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function MZt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,E;const{t:r}=Te("ui"),s=e.latestVersion,[o,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 R;const C=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=A=>{var D;if(A.key==="Escape"&&w.current(),A.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];A.shiftKey&&document.activeElement===P?(A.preventDefault(),I.focus()):!A.shiftKey&&document.activeElement===I&&(A.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let C=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await ZTe(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Fy.has(R.status)&&(C=window.setTimeout(T,nle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),C=window.setTimeout(T,nle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(C)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Fy.has(o.status))return;const C=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(C)},[o==null?void 0:o.status]);const O=o?T9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(E=(S=o==null?void 0:o.resources)==null?void 0:S.codePipeline)==null?void 0:E.consoleUrl;return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:C=>{C.target===C.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Ya,{color:O.color,size:"sm",children:O.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?PZt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,k?a.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(m0,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(VYt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Fy.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Fy.has(o.status)?a.jsx(_t,{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 _9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=ju(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(of,{})]}),a.jsx(ha,{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:o=>i(o.value)})]})}function LZt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("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 E=v.current;v.current=null,E==null||E.abort()},[]);const O=()=>{var E;(E=v.current)==null||E.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var j;const E=Z7(e,f);if(E){b(E);return}y.current=w,(j=v.current)==null||j.abort();const C=new AbortController;v.current=C,m(!0),b("");try{const T=await VTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},C.signal);if(v.current!==C)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(AZt(T)),u(null),d(""),c("")}finally{v.current===C&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||Z7(e,f))return;const E=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(E)},[w,s,k,x,e,f]);const S=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(of,{})]}),a.jsx(_s,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:E=>{O(),o(E.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(_s,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:E=>{O(),l(E.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(cn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[a.jsx(JD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?S.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(of,{})]}),a.jsx(xf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(E=>({value:E,label:E})),disabled:s||h,onChange:c})]}):null]})}function $Zt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=Te("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-repository-mode",value:t,options:wZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(_9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(S9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function FZt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=Te("ui"),u=A9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(_9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(S9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(of,{})]}),a.jsx(_s,{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?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function j9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=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=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function BZt({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";j9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await HTe(e.id,v)).shareCode;c(y),await PTe(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]),yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.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:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(_t,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(cn,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(xb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function UZt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),o=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([]),k=p.useMemo(()=>Pz(f),[f]),S=k.length>Y7,E=m==="inspecting"||m==="importing",C=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&C.length>0;j9e(c,u,n,E);const R=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),w(""),O([]);try{const P=await qTe(k);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const A=async()=>{if(T){g("importing"),w(""),O([]);try{const P=C.map(U=>({code:k[U.index],name:U.name})).filter(U=>!!U.code),I=await WTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:Z},z)=>{const J=L.get(z);return!J||J.status==="failed"?[{code:U,name:Z,status:"valid",error:(J==null?void 0:J.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...j.flatMap(U=>{const Z=k[U.index];return Z?[{code:Z,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,H.length),!H.length){n();return}h(H.map(U=>U.code).join(` -`)),O(F),v(H.map((U,Z)=>({index:Z,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:H.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!E&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":E||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:E,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(xb,{ref:u,size:"lg",rows:6,value:f,disabled:E,"aria-invalid":S||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:Y7,count:k.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(cn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):C.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:C.length,names:C.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:E,onClick:n,children:r("common.cancel")}),a.jsx(_t,{type:"button",color:"info",size:"sm",loading:E,disabled:E||!k.length||S||m==="ready"&&!T,onClick:()=>T?void A():void R(),children:N})]})]})}),document.body)}function QZt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var He,Qe,jt,Pt,Kt,Ct,xt;const{t:o,i18n:l}=Te("ui"),c=gZt(o),u=NZt(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,k]=p.useState(()=>d?vZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,E]=p.useState(((He=u.gitSource)==null?void 0:He.repositoryUrl)??""),[C,j]=p.useState(((Qe=u.gitSource)==null?void 0:Qe.ref)??""),[T,R]=p.useState(((jt=u.gitSource)==null?void 0:jt.dockerfilePath)??""),[A,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??Zi(t)),[M,H]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Kt=u.imageSource)==null?void 0:Kt.region)??Zi(t)),[Z,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[J,ne]=p.useState(((Ct=u.imageSource)==null?void 0:Ct.reference)??""),[W,X]=p.useState(!1),V=p.useMemo(()=>gH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),ae=f.dockerfile??V,Y=O!=="none",K=O==="aio-sandbox"?pH:O==="codex-sandbox"?LIe[t]:"",te=Y?uZt(b):b,ue=Y?iR(K,""):"",fe=Y?iR(K,te):b,se=y||(Y?dZt(te,K,o):xK(b,void 0,o)),me=!!e,Ee="environment-editor-form",[xe,Ne]=p.useState(!1),[We,Xe]=p.useState(""),Re=!!fe.trim()&&!se,re=`${S.trim()}\0${C.trim()}`,ce=!Z7(S,o)&&P===re&&!!T&&(D==="managed"||tle(M)),ve=tle(Z)&&!!J.trim()&&!A9e(J,o),Se=!!f.name.trim()&&!xe&&(m==="custom"||m==="dockerfile"&&Re||m==="git"&&ce||m==="image"&&ve),oe=(tt,mt)=>{h(_e=>({..._e,optionIds:mt?[..._e.optionIds,tt]:_e.optionIds.filter(Ot=>Ot!==tt)}))},$e=tt=>{w(""),v(Y?iR(K,tt):tt)},Ue=async tt=>{if(!tt)return;const mt=await fZt(tt,o);w(mt.error),mt.content&&v(mt.content)},be=()=>{w(""),v(ue)},ke=async tt=>{if(tt.preventDefault(),!!Se){Ne(!0),Xe("");try{const mt=Tmt(fe);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?fe:m==="custom"?ae:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...C.trim()?{ref:C.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&Z?{...Z,reference:J.trim()}:null,...m==="dockerfile"?mt:{}})}catch(mt){Xe(mt instanceof Error?mt.message:String(mt)),Ne(!1)}}},Ae=f.name.trim()||(me?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Sh,{className:"environment-editor","aria-label":o(me?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(lT,{title:Ae,description:o("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(_t,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:xe,children:o("common.delete")}):null,r?a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:xe,children:o("environmentCenter.share.action")}):null,a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:xe,children:o("common.cancel")}),a.jsx(_t,{color:"info",size:"sm",type:"submit",form:Ee,disabled:!Se,children:o(xe?"common.saving":m==="image"?me?"environmentCenter.save":"environmentCenter.create":me?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:Ee,className:"environment-form",onSubmit:ke,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(of,{})]}),a.jsx(_s,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:tt=>h(mt=>({...mt,name:tt.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(xb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:tt=>h(mt=>({...mt,description:tt.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(of,{})]}),a.jsx(ha,{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:tt=>{const mt=tt.value;g(mt),mt==="dockerfile"&&!b.trim()&&v(ue),Xe("")}}),a.jsx("small",{children:(xt=c.find(tt=>tt.value===m))==null?void 0:xt.description})]}),We?a.jsx("p",{className:"environment-form-error",role:"alert",children:We}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-base-environment",value:f.baseEnvironment,options:bZt.map(tt=>({...tt,description:o(`environmentCenter.baseDescriptions.${tt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value,_e=mt==="aio-sandbox"||mt==="codex-sandbox";h(Ot=>({...Ot,baseEnvironment:mt,operatingSystem:_e?"ubuntu-22.04":Ot.operatingSystem,language:_e?"python-3.12":Ot.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-operating-system",value:f.operatingSystem,options:xZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,operatingSystem:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:PB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Joe.filter(tt=>tt.value==="python-3.12"):Joe,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,language:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:PB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(Zoe,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:xe,onChange:X,icon:a.jsx("img",{src:pM,alt:""})}),a.jsx(vK,{selected:f.selectedSkills,onChange:tt=>h(mt=>({...mt,selectedSkills:tt})),cloudProvider:t,disabled:xe,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),mH.map(tt=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${tt.id}-title`,children:[a.jsx("h2",{id:`environment-${tt.id}-title`,children:o(`environmentCenter.categories.${tt.id}`)}),a.jsx("div",{className:"environment-option-grid",children:tt.options.map(mt=>{const _e=f.optionIds.includes(mt.id);return a.jsx(Zoe,{name:mt.label,description:o(`environmentCenter.options.${mt.id}`,{defaultValue:mt.description}),selected:_e,onChange:Ot=>oe(mt.id,Ot),icon:a.jsx(jZt,{option:mt})},mt.id)})})]},tt.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ha,{id:"environment-dockerfile-base-environment",value:O,options:yZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{w(""),k(tt.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(of,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:O9e(fe).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:tt=>{var _e;const mt=tt.currentTarget;Ue((_e=mt.files)==null?void 0:_e[0]).finally(()=>{mt.value=""})}}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:xe,onClick:()=>{var tt;return(tt=x.current)==null?void 0:tt.click()},children:o("environmentCenter.upload")}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:xe||!te,onClick:be,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${se?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:K,children:K})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(LT,{value:te,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:$e})})]})]}),se?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:se}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(LZt,{repositoryUrl:S,gitRef:C,dockerfilePath:T,inspection:A,inspectedKey:P,disabled:xe,onRepositoryUrlChange:E,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx($Zt,{cloudProvider:t,mode:D,region:L,value:M,disabled:xe,onModeChange:tt=>{_(tt),Xe("")},onRegionChange:tt=>{F(tt),H(void 0),Xe("")},onChange:H})]}):a.jsx(FZt,{cloudProvider:t,region:q,repository:Z,reference:J,disabled:xe,onRegionChange:tt=>{U(tt),z(void 0),Xe("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function N9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=Te("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),[k,S]=p.useState(null),E=p.useRef(0),[C,j]=p.useState(""),[T,R]=p.useState(!1),[A,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,H]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(K=>`${K.name} ${K.description} ${IB(K.operatingSystem)} ${$p(K.language)} ${PB(K.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),Z=p.useCallback((Y="",K=!1)=>{E.current+=1,S({key:E.current,initialValue:Y,autoInspect:K})},[]),z=p.useCallback((Y,K=!1)=>{const te=Y.trim();if(!te.startsWith("akenv://")||!K&&ele.has(te))return!1;const ue=Pz(te);return!ue.length||ue.length>Y7?!1:(ele.add(te),N(""),Z(te,!0),!0)},[Z]),J=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||k)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const K=await navigator.clipboard.readText();!z(K)&&!K.trim()&&await kZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[k,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),UA(Y.signal).then(K=>{c(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&(OZt(K)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(K instanceof Error?K.message:String(K)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(K=>K.latestVersion&&Fy.has(K.latestVersion.status)))return;const Y=window.setTimeout(()=>F(K=>K+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!C||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,C]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void J(),K=()=>{document.visibilityState==="visible"&&J()},te=ue=>{var me;const fe=ue.target;if(fe instanceof HTMLInputElement||fe instanceof HTMLTextAreaElement||fe instanceof HTMLElement&&fe.isContentEditable)return;const se=((me=ue.clipboardData)==null?void 0:me.getData("text/plain"))??"";z(se,!0)&&ue.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",K),window.addEventListener("paste",te),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",te)}},[z,J,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const K={...Y,dockerfile:Y.dockerfile??gH(Y,e)},te=ne?await XTe(ne.id,K):await GTe(K);if(c(ue=>[te,...ue.filter(fe=>fe.id!==te.id)]),d({kind:"list"}),R(!1),K.imageSource){j(s("environmentCenter.status.boundImage",{name:te.name}));return}try{const ue=await Q8(te.id);c(fe=>fe.map(se=>se.id===te.id?{...se,latestVersion:ue}:se)),j(s("environmentCenter.status.queued",{name:te.name}))}catch(ue){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},X=async Y=>{if(!M.has(Y.id)){H(K=>new Set(K).add(Y.id)),R(!1);try{const K=await Q8(Y.id);c(te=>te.map(ue=>ue.id===Y.id?{...ue,latestVersion:K}:ue)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(K){R(!0),j(K instanceof Error?K.message:String(K))}finally{H(K=>{const te=new Set(K);return te.delete(Y.id),te})}}},V=(Y,K,te,ue)=>{Y.length&&c(fe=>{const se=new Set(Y.map(me=>me.id));return[...Y,...fe.filter(me=>!se.has(me.id))]}),R(ue>0),j(ue>0?s("environmentCenter.status.importedFailed",{created:K,failed:ue}):te>0?s("environmentCenter.status.importedDuplicate",{created:K,duplicate:te}):s("environmentCenter.status.imported",{count:K}))},ae=m?a.jsx(Td,{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"}),YTe(Y.id).then(()=>{c(K=>K.filter(te=>te.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(K=>{R(!0),j(K instanceof Error?K.message:String(K))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(QZt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx(BZt,{environment:x,onClose:()=>O(null)}):null,ae]}):a.jsxs(bK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[C?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:C}):null,a.jsx(Jp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[A?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:A}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),Z()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(em,{"aria-live":"polite",children:P?a.jsx(cl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:So(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(TZt,{})}),a.jsx(Wn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(Wn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(K0,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(cb,{"aria-label":s("environmentCenter.create"),icon:a.jsx(EZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(cb,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(CZt,{}),onClick:()=>Z(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var fe,se;const K=T9e(Y,s),te=!!(Y.latestVersion&&Fy.has(Y.latestVersion.status)),ue=M.has(Y.id);return a.jsx(X0,{className:"environment-card",title:Y.name,status:a.jsx(Ya,{color:K.color,size:"sm",children:K.label}),description:((fe=Y.latestVersion)==null?void 0:fe.error)||(te?(se=Y.latestVersion)==null?void 0:se.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:RZt(Y.updatedAt,o.resolvedLanguage??o.language),title:IZt(Y.updatedAt,o.resolvedLanguage??o.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 X(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(oat,{}),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(K=>K.id===b);return Y?a.jsx(MZt,{environment:Y,onClose:()=>v(null),onBuildUpdate:K=>{c(te=>te.map(ue=>ue.id===Y.id?{...ue,latestVersion:K}:ue))},onRebuild:()=>X(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(DZt,{environment:y,onClose:()=>w(null)}):null,ae,k?a.jsx(UZt,{initialValue:k.initialValue,autoInspect:k.autoInspect,onClose:()=>S(null),onImported:V},k.key):null]})}function zZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function VZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function HZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.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 J7(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 qZt(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 WZt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=Te("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(S=>`${S.name} ${S.description} ${$p(S.language)}`.toLocaleLowerCase().includes(x)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(E){w(E instanceof Error?E.message:String(E)),v(!1)}}};return a.jsx(Sh,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(lT,{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:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(yH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:J7(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:J7(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(_s,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(xb,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(YIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(Jp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):O.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:O.map(S=>{var j;const E=f.includes(S.id),C=((j=S.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${E?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:E,onChange:()=>h(T=>E?T.filter(R=>R!==S.id):[...T,S.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:S.name,children:S.name}),a.jsxs("span",{children:[$p(S.language)," · ",C]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(E?"workspace.added":"common.add")})]},S.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function KZt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=Te("ui"),[r,s]=p.useState([]),[o,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,k]=p.useState(null),[S,E]=p.useState(0),C=p.useDeferredValue(d);p.useEffect(()=>{const A=new AbortController;return m(!0),b(""),Promise.all([Lz(A.signal),UA(A.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(zZt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{A.signal.aborted||m(!1)}),()=>A.abort()},[S,n]),p.useEffect(()=>{if(!v||w)return;const A=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(A)},[w,v]);const j=p.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),T=p.useMemo(()=>{const A=C.trim().toLocaleLowerCase();return A?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):r},[C,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(A=>A.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(WZt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>k(R):null,onSave:async A=>{const N=R?await QTe(R.id,A):await UTe(A);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(bK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(Jp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:A=>f(A.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(em,{"aria-live":"polite",children:h?a.jsx(cl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>E(A=>A+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(HZt,{})}),a.jsx(Wn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(Wn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(K0,{children:[d.trim()?null:a.jsx(cb,{"aria-label":n("workspace.create"),icon:a.jsx(VZt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(A=>{const N=qZt(A,j),P=A.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(X0,{className:"workspace-card",title:A.name,status:a.jsx(Ya,{color:P?"danger":N===A.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:A.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:A.environmentIds.length})}),description:A.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:A.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:J7(A.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:A.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:A.id})}},A.id)})]})}),O?a.jsx(Td,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>k(null),onConfirm:()=>{const A=O;k(null),zTe(A.id).then(()=>{s(N=>N.filter(P=>P.id!==A.id)),x(!1),y(n("workspace.deleted",{name:A.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function GZt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=Te("ui"),[o,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"?a.jsx(N9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(KZt,{onEnvironment:f,onProjects:t})}const XZt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function YZt(e){return e==="127.0.0.1"}const ZZt={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."},JZt={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."},eJt={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."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",wfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",A0e,!0,!0);function Ah(e,t={}){return bn.t(e,{...t,ns:"automations"})}const R9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},I9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},P9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},D9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},tJt="https://ark.cn-beijing.volces.com/api/coding/v3";function nJt(e){return e==="byteplus"?Po(e):tJt}function wK(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 M9e(e){const t=wK(e);return[Ah("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Ah("github.sessionToken",{sessionToken:t.sessionToken})]}function OK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function kK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:nJt(e),region:Zi(e),token:"",...t}}function L9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const iJt={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})=>kK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},rJt="https://api.github.com",sJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ile=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,aJt=/^[A-Za-z0-9._/-]+$/;function oJt(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?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function ry(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(`${rJt}${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(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(oJt(i.status,r,t.token));return{status:i.status,payload:r}}function v6(e){return e.split("/").map(encodeURIComponent).join("/")}function lJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:EK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await ry(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ry(`${o}/git/ref/heads/${v6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=cJt(e.branchPrefix);await ry(`${o}/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=v6(m.path),b=await ry(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await ry(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:lJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ry(`${o}/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(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ry(`${o}/git/refs/heads/${v6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function uJt(e,t){const n=await yn("/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 KT(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 dJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await KT(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 fJt(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 yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await KT(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(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function hJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await KT(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 pJt(e,t){const n=await yn("/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 KT(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 KT(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 mJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,gJt="cn-hongkong";function bJt(e){const t=lv(e.runtimeName,n=>Ah(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!mJt.test(e.runtimeId))throw new Error(Ah("github.validation.runtimeId"))}function F9e(e){bJt(e);const t=e.cloudProvider??"volcengine",n=wK(t),i=t==="byteplus"?` +`).replace(/^\n+/,"")}function nR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} +${i}`:n}function LZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Nw("duplicateFrom",n):OK(nR(t,e),void 0,n):Nw("baseImageRequired",n)}function OK(e,t=Q9e(e),n){return t>U9e?Nw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Nw("missingFrom",n):Nw("empty",n)}async function $Zt(e,t){if(e.size>U9e)return{content:"",error:Nw("tooLarge",t)};const n=DL(await e.text());return{content:n,error:OK(n,e.size,t)}}function FZt(e){return VM(e,{lineWidth:0})}function BZt(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 UZt=FIe.map(e=>({value:e.id,label:e.label,description:e.description}));function QZt(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 zZt(e){const t=DZt(e,"");return t===pH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const VZt=yI.map(e=>({value:e.id,label:e.label})),ale=UIe.map(e=>({value:e.id,label:e.label}));function HZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const eU=20,ole=new Set;function qZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function WZt(){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 KZt={opencli:rZt,uv:sZt,playwright:aZt,chromium:oZt,git:lZt,curl:cZt,ffmpeg:uZt,imagemagick:dZt};function GZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function rf(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function XZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.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 tU(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 lle(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function z9e(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 YZt(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function ZZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function JZt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function eJt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:iZt,alt:""});if(e.id==="github-cli")return a.jsx(wK,{});const t=KZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(JZt,{label:e.label})}function tJt(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===gH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const Py=new Set(["preparing","queued","building","scanning"]),cle=3e3,v6={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 V9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(v6[n]),color:"success"}:n==="failed"?{label:t(v6[n]),color:"danger"}:{label:t(v6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function nJt(e,t){return zT(e,Date.now(),t)}function iJt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function rJt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Py.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%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 sJt({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),o=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?FZt(l):"",[l]);o.current=t,p.useEffect(()=>{var A;const k=document.body.style.overflow,S=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(A=s.current)==null||A.focus();const O=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(C=>C.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=k,window.removeEventListener("keydown",O),S!=null&&S.isConnected&&S.focus()}},[]),p.useEffect(()=>{const k=new AbortController;return d(!0),h(""),n2e(e.id,i,k.signal).then(c).catch(S=>{(S==null?void 0:S.name)!=="AbortError"&&h(S instanceof Error?S.message:String(S))}).finally(()=>{k.signal.aborted||d(!1)}),()=>k.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const k=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(k)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:k=>{k.target===k.currentTarget&&t()},children:a.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:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(on,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(At,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(k=>k+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(BT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(At,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function aJt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var O,A;const{t:r}=_e("ui"),s=e.latestVersion,[o,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 R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=C=>{var D;if(C.key==="Escape"&&w.current(),C.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];C.shiftKey&&document.activeElement===P?(C.preventDefault(),I.focus()):!C.shiftKey&&document.activeElement===I&&(C.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await t2e(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Py.has(R.status)&&(E=window.setTimeout(T,cle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,cle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Py.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const k=o?V9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},S=e.imageSource||(A=(O=o==null?void 0:o.resources)==null?void 0:O.codePipeline)==null?void 0:A.consoleUrl;return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Za,{color:k.color,size:"sm",children:k.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?rJt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,S?a.jsxs("a",{href:S,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(uv,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(gZt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Py.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Py.has(o.status)?a.jsx(At,{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 H9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui"),s=Pu(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(rf,{})]}),a.jsx(ma,{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:o=>i(o.value)})]})}function oJt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,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 A=v.current;v.current=null,A==null||A.abort()},[]);const k=()=>{var A;(A=v.current)==null||A.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},S=p.useCallback(async()=>{var j;const A=tU(e,f);if(A){b(A);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await WTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(YZt(T)),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||tU(e,f))return;const A=window.setTimeout(()=>void S(),600);return()=>window.clearTimeout(A)},[w,s,S,x,e,f]);const O=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(rf,{})]}),a.jsx(js,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:A=>{k(),o(A.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(js,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:A=>{k(),l(A.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(on,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(At,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void S(),children:[a.jsx(YD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?O.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:O.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void S(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),O.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsx(bf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:O.map(A=>({value:A,label:A})),disabled:s||h,onChange:c})]}):null]})}function lJt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=_e("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-repository-mode",value:t,options:HZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(H9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(R9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function cJt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=_e("ui"),u=z9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(H9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(R9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(rf,{})]}),a.jsx(js,{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?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function q9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=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=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function uJt({environment:e,onClose:t}){const{t:n}=_e("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";q9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await KTe(e.id,v)).shareCode;c(y),await LTe(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]),vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.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:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(At,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(on,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(bb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(At,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(At,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function dJt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=_e("ui"),s=p.useId(),o=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,k]=p.useState([]),S=p.useMemo(()=>Pz(f),[f]),O=S.length>eU,A=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;q9e(c,u,n,A);const R=p.useCallback(async()=>{if(!(!S.length||O)){g("inspecting"),w(""),k([]);try{const P=await GTe(S);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[S,O]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const C=async()=>{if(T){g("importing"),w(""),k([]);try{const P=E.map(U=>({code:S[U.index],name:U.name})).filter(U=>!!U.code),I=await XTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:Z},z)=>{const J=L.get(z);return!J||J.status==="failed"?[{code:U,name:Z,status:"valid",error:(J==null?void 0:J.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...j.flatMap(U=>{const Z=S[U.index];return Z?[{code:Z,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,H.length),!H.length){n();return}h(H.map(U=>U.code).join(` +`)),k(F),v(H.map((U,Z)=>({index:Z,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:H.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!A&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":A||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:A,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(bb,{ref:u,size:"lg",rows:6,value:f,disabled:A,"aria-invalid":O||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),k([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${O?" is-error":""}`,children:O?r("environmentCenter.import.tooMany",{max:eU,count:S.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(on,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:A,onClick:n,children:r("common.cancel")}),a.jsx(At,{type:"button",color:"info",size:"sm",loading:A,disabled:A||!S.length||O||m==="ready"&&!T,onClick:()=>T?void C():void R(),children:N})]})]})}),document.body)}function fJt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Re,Ue,_t,Pt,Gt,St,Lt;const{t:o,i18n:l}=_e("ui"),c=BZt(o),u=tJt(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),[k,S]=p.useState(()=>d?zZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[O,A]=p.useState(((Re=u.gitSource)==null?void 0:Re.repositoryUrl)??""),[E,j]=p.useState(((Ue=u.gitSource)==null?void 0:Ue.ref)??""),[T,R]=p.useState(((_t=u.gitSource)==null?void 0:_t.dockerfilePath)??""),[C,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??nr(t)),[M,H]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Gt=u.imageSource)==null?void 0:Gt.region)??nr(t)),[Z,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[J,ne]=p.useState(((St=u.imageSource)==null?void 0:St.reference)??""),[W,X]=p.useState(!1),le=p.useMemo(()=>gH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),V=f.dockerfile??le,Y=k!=="none",K=k==="aio-sandbox"?pH:k==="codex-sandbox"?BIe[t]:"",ue=Y?MZt(b):b,te=Y?nR(K,""):"",Oe=Y?nR(K,ue):b,fe=y||(Y?LZt(ue,K,o):OK(b,void 0,o)),pe=!!e,Se="environment-editor-form",[ve,Le]=p.useState(!1),[He,Ge]=p.useState(""),De=!!Oe.trim()&&!fe,se=`${O.trim()}\0${E.trim()}`,ce=!tU(O,o)&&P===se&&!!T&&(D==="managed"||lle(M)),ye=lle(Z)&&!!J.trim()&&!z9e(J,o),Ae=!!f.name.trim()&&!ve&&(m==="custom"||m==="dockerfile"&&De||m==="git"&&ce||m==="image"&&ye),Ee=(qe,yt)=>{h(je=>({...je,optionIds:yt?[...je.optionIds,qe]:je.optionIds.filter(kt=>kt!==qe)}))},Ce=qe=>{w(""),v(Y?nR(K,qe):qe)},Be=async qe=>{if(!qe)return;const yt=await $Zt(qe,o);w(yt.error),yt.content&&v(yt.content)},he=()=>{w(""),v(te)},ie=async qe=>{if(qe.preventDefault(),!!Ae){Le(!0),Ge("");try{const yt=_mt(Oe);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?Oe:m==="custom"?V:"",gitSource:m==="git"?{repositoryUrl:O.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&Z?{...Z,reference:J.trim()}:null,...m==="dockerfile"?yt:{}})}catch(yt){Ge(yt instanceof Error?yt.message:String(yt)),Le(!1)}}},we=f.name.trim()||(pe?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Ch,{className:"environment-editor","aria-label":o(pe?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(dT,{title:we,description:o("environmentCenter.editorDescription"),identitySeed:we,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(At,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:ve,children:o("common.delete")}):null,r?a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:ve,children:o("environmentCenter.share.action")}):null,a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:ve,children:o("common.cancel")}),a.jsx(At,{color:"info",size:"sm",type:"submit",form:Se,disabled:!Ae,children:o(ve?"common.saving":m==="image"?pe?"environmentCenter.save":"environmentCenter.create":pe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:Se,className:"environment-form",onSubmit:ie,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(rf,{})]}),a.jsx(js,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:qe=>h(yt=>({...yt,name:qe.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(bb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:qe=>h(yt=>({...yt,description:qe.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(rf,{})]}),a.jsx(ma,{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:qe=>{const yt=qe.value;g(yt),yt==="dockerfile"&&!b.trim()&&v(te),Ge("")}}),a.jsx("small",{children:(Lt=c.find(qe=>qe.value===m))==null?void 0:Lt.description})]}),He?a.jsx("p",{className:"environment-form-error",role:"alert",children:He}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-base-environment",value:f.baseEnvironment,options:UZt.map(qe=>({...qe,description:o(`environmentCenter.baseDescriptions.${qe.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:qe=>{const yt=qe.value,je=yt==="aio-sandbox"||yt==="codex-sandbox";h(kt=>({...kt,baseEnvironment:yt,operatingSystem:je?"ubuntu-22.04":kt.operatingSystem,language:je?"python-3.12":kt.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-operating-system",value:f.operatingSystem,options:VZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:qe=>h(yt=>({...yt,operatingSystem:qe.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?ale.filter(qe=>qe.value==="python-3.12"):ale,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:qe=>h(yt=>({...yt,language:qe.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(sle,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:ve,onChange:X,icon:a.jsx("img",{src:fM,alt:""})}),a.jsx(kK,{selected:f.selectedSkills,onChange:qe=>h(yt=>({...yt,selectedSkills:qe})),cloudProvider:t,disabled:ve,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),mH.map(qe=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${qe.id}-title`,children:[a.jsx("h2",{id:`environment-${qe.id}-title`,children:o(`environmentCenter.categories.${qe.id}`)}),a.jsx("div",{className:"environment-option-grid",children:qe.options.map(yt=>{const je=f.optionIds.includes(yt.id);return a.jsx(sle,{name:yt.label,description:o(`environmentCenter.options.${yt.id}`,{defaultValue:yt.description}),selected:je,onChange:kt=>Ee(yt.id,kt),icon:a.jsx(eJt,{option:yt})},yt.id)})})]},qe.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ma,{id:"environment-dockerfile-base-environment",value:k,options:QZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:qe=>{w(""),S(qe.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:Q9e(Oe).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:qe=>{var je;const yt=qe.currentTarget;Be((je=yt.files)==null?void 0:je[0]).finally(()=>{yt.value=""})}}),a.jsx(At,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:ve,onClick:()=>{var qe;return(qe=x.current)==null?void 0:qe.click()},children:o("environmentCenter.upload")}),a.jsx(At,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:ve||!ue,onClick:he,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${fe?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:K,children:K})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(BT,{value:ue,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:Ce})})]})]}),fe?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:fe}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(oJt,{repositoryUrl:O,gitRef:E,dockerfilePath:T,inspection:C,inspectedKey:P,disabled:ve,onRepositoryUrlChange:A,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(lJt,{cloudProvider:t,mode:D,region:L,value:M,disabled:ve,onModeChange:qe=>{_(qe),Ge("")},onRegionChange:qe=>{F(qe),H(void 0),Ge("")},onChange:H})]}):a.jsx(cJt,{cloudProvider:t,region:q,repository:Z,reference:J,disabled:ve,onRegionChange:qe=>{U(qe),z(void 0),Ge("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function W9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=_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,k]=p.useState(null),[S,O]=p.useState(null),A=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[C,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,H]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(K=>`${K.name} ${K.description} ${RB(K.operatingSystem)} ${Fp(K.language)} ${IB(K.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),Z=p.useCallback((Y="",K=!1)=>{A.current+=1,O({key:A.current,initialValue:Y,autoInspect:K})},[]),z=p.useCallback((Y,K=!1)=>{const ue=Y.trim();if(!ue.startsWith("akenv://")||!K&&ole.has(ue))return!1;const te=Pz(ue);return!te.length||te.length>eU?!1:(ole.add(ue),N(""),Z(ue,!0),!0)},[Z]),J=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 K=await navigator.clipboard.readText();!z(K)&&!K.trim()&&await WZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[S,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),VA(Y.signal).then(K=>{c(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&(qZt(K)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(K instanceof Error?K.message:String(K)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(K=>K.latestVersion&&Py.has(K.latestVersion.status)))return;const Y=window.setTimeout(()=>F(K=>K+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void J(),K=()=>{document.visibilityState==="visible"&&J()},ue=te=>{var pe;const Oe=te.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const fe=((pe=te.clipboardData)==null?void 0:pe.getData("text/plain"))??"";z(fe,!0)&&te.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",K),window.addEventListener("paste",ue),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",ue)}},[z,J,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const K={...Y,dockerfile:Y.dockerfile??gH(Y,e)},ue=ne?await JTe(ne.id,K):await ZTe(K);if(c(te=>[ue,...te.filter(Oe=>Oe.id!==ue.id)]),d({kind:"list"}),R(!1),K.imageSource){j(s("environmentCenter.status.boundImage",{name:ue.name}));return}try{const te=await U8(ue.id);c(Oe=>Oe.map(fe=>fe.id===ue.id?{...fe,latestVersion:te}:fe)),j(s("environmentCenter.status.queued",{name:ue.name}))}catch(te){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:te instanceof Error?te.message:String(te)}))}},X=async Y=>{if(!M.has(Y.id)){H(K=>new Set(K).add(Y.id)),R(!1);try{const K=await U8(Y.id);c(ue=>ue.map(te=>te.id===Y.id?{...te,latestVersion:K}:te)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(K){R(!0),j(K instanceof Error?K.message:String(K))}finally{H(K=>{const ue=new Set(K);return ue.delete(Y.id),ue})}}},le=(Y,K,ue,te)=>{Y.length&&c(Oe=>{const fe=new Set(Y.map(pe=>pe.id));return[...Y,...Oe.filter(pe=>!fe.has(pe.id))]}),R(te>0),j(te>0?s("environmentCenter.status.importedFailed",{created:K,failed:te}):ue>0?s("environmentCenter.status.importedDuplicate",{created:K,duplicate:ue}):s("environmentCenter.status.imported",{count:K}))},V=m?a.jsx(_d,{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"}),e2e(Y.id).then(()=>{c(K=>K.filter(ue=>ue.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(K=>{R(!0),j(K instanceof Error?K.message:String(K))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(fJt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>k(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx(uJt,{environment:x,onClose:()=>k(null)}):null,V]}):a.jsxs(xK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(em,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[C?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:C}),a.jsx(At,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),Z()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(tm,{"aria-live":"polite",children:P?a.jsx(fl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:_o(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(ZZt,{})}),a.jsx(qn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(qn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(zv,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(ab,{"aria-label":s("environmentCenter.create"),icon:a.jsx(GZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(ab,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(XZt,{}),onClick:()=>Z(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var Oe,fe;const K=V9e(Y,s),ue=!!(Y.latestVersion&&Py.has(Y.latestVersion.status)),te=M.has(Y.id);return a.jsx(Hv,{className:"environment-card",title:Y.name,status:a.jsx(Za,{color:K.color,size:"sm",children:K.label}),description:((Oe=Y.latestVersion)==null?void 0:Oe.error)||(ue?(fe=Y.latestVersion)==null?void 0:fe.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:nJt(Y.updatedAt,o.resolvedLanguage??o.language),title:iJt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(te?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:te,onClick:()=>Y.latestVersion?v(Y.id):void X(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(lat,{}),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(K=>K.id===b);return Y?a.jsx(aJt,{environment:Y,onClose:()=>v(null),onBuildUpdate:K=>{c(ue=>ue.map(te=>te.id===Y.id?{...te,latestVersion:K}:te))},onRebuild:()=>X(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(sJt,{environment:y,onClose:()=>w(null)}):null,V,S?a.jsx(dJt,{initialValue:S.initialValue,autoInspect:S.autoInspect,onClose:()=>O(null),onImported:le},S.key):null]})}function hJt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function pJt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function mJt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.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 nU(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 gJt(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 bJt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=_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(),k=t.filter(O=>`${O.name} ${O.description} ${Fp(O.language)}`.toLocaleLowerCase().includes(x)),S=async O=>{if(O.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(A){w(A instanceof Error?A.message:String(A)),v(!1)}}};return a.jsx(Ch,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(dT,{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:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(yH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:nU(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:nU(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:S,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(js,{value:l,maxLength:128,autoFocus:!0,onChange:O=>c(O.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(bb,{value:u,maxLength:2e3,onChange:O=>d(O.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(ePe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(em,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:O=>g(O.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):k.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:k.map(O=>{var j;const A=f.includes(O.id),E=((j=O.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):O.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${A?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:A,onChange:()=>h(T=>A?T.filter(R=>R!==O.id):[...T,O.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:O.name,children:O.name}),a.jsxs("span",{children:[Fp(O.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(A?"workspace.added":"common.add")})]},O.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function yJt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=_e("ui"),[r,s]=p.useState([]),[o,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),[k,S]=p.useState(null),[O,A]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const C=new AbortController;return m(!0),b(""),Promise.all([Lz(C.signal),VA(C.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(hJt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{C.signal.aborted||m(!1)}),()=>C.abort()},[O,n]),p.useEffect(()=>{if(!v||w)return;const C=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(C)},[w,v]);const j=p.useMemo(()=>new Map(o.map(C=>[C.id,C])),[o]),T=p.useMemo(()=>{const C=E.trim().toLocaleLowerCase();return C?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(C)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(C=>C.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(bJt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>S(R):null,onSave:async C=>{const N=R?await HTe(R.id,C):await VTe(C);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(xK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(em,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:C=>f(C.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(tm,{"aria-live":"polite",children:h?a.jsx(fl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:()=>A(C=>C+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(mJt,{})}),a.jsx(qn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(qn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(zv,{children:[d.trim()?null:a.jsx(ab,{"aria-label":n("workspace.create"),icon:a.jsx(pJt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(C=>{const N=gJt(C,j),P=C.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(Hv,{className:"workspace-card",title:C.name,status:a.jsx(Za,{color:P?"danger":N===C.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:C.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:C.environmentIds.length})}),description:C.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:C.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:nU(C.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:C.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:C.id})}},C.id)})]})}),k?a.jsx(_d,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:k.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>S(null),onConfirm:()=>{const C=k;S(null),qTe(C.id).then(()=>{s(N=>N.filter(P=>P.id!==C.id)),x(!1),y(n("workspace.deleted",{name:C.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function vJt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=_e("ui"),[o,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"?a.jsx(W9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(yJt,{onEnvironment:f,onProjects:t})}const xJt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function wJt(e){return e==="127.0.0.1"}const kJt={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."},OJt={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."},SJt={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."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",Sfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",jve,!0,!0);function _h(e,t={}){return bn.t(e,{...t,ns:"automations"})}const K9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},G9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},X9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},Y9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},EJt="https://ark.cn-beijing.volces.com/api/coding/v3";function CJt(e){return e==="byteplus"?Fo(e):EJt}function SK(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 Z9e(e){const t=SK(e);return[_h("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),_h("github.sessionToken",{sessionToken:t.sessionToken})]}function EK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function CK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:CJt(e),region:nr(e),token:"",...t}}function J9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const AJt={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})=>CK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},TJt="https://api.github.com",_Jt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ule=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,jJt=/^[A-Za-z0-9._/-]+$/;function NJt(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?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function Jb(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(`${TJt}${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(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(NJt(i.status,r,t.token));return{status:i.status,payload:r}}function x6(e){return e.split("/").map(encodeURIComponent).join("/")}function RJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:TK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await Jb(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await Jb(`${o}/git/ref/heads/${x6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=IJt(e.branchPrefix);await Jb(`${o}/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=x6(m.path),b=await Jb(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await Jb(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:RJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await Jb(`${o}/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(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await Jb(`${o}/git/refs/heads/${x6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function PJt(e,t){const n=await yn("/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 YT(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 DJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await YT(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 MJt(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 yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(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(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function LJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(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 $Jt(e,t){const n=await yn("/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 YT(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 YT(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 FJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,BJt="cn-hongkong";function UJt(e){const t=i0(e.runtimeName,n=>_h(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!FJt.test(e.runtimeId))throw new Error(_h("github.validation.runtimeId"))}function t7e(e){UJt(e);const t=e.cloudProvider??"volcengine",n=SK(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(gJt)},`:"",s=`name: Publish to AgentKit Runtime + "DATABASE_VIKING_REGION": ${JSON.stringify(BJt)},`:"",s=`name: Publish to AgentKit Runtime on: push: @@ -969,25 +969,25 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,o={__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(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const yJt={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:[R9e,I9e,{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},P9e,D9e],initialValues:({cloudProvider:e})=>kK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>M9e(e),submit(e,t,n){const i=L9e(e),r=EK(e.projectPath,"."),s=OK(t.cloudProvider);return $9e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:F9e({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:Ah("cards.delivery.pullRequest.title"),description:Ah("cards.delivery.pullRequest.description",{provider:s})},n)}};function vJt(e,t){return e==="."?t:`${e}/${t}`}function xJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const wJt={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"},OJt="1.1.13",kJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function SJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${kJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ - `)}`}function EJt(e){const t=wK(e);return`# Local ${OK(e)} credentials. Never commit real values. +`,o={__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(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const QJt={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:[K9e,G9e,{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},X9e,Y9e],initialValues:({cloudProvider:e})=>CK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Z9e(e),submit(e,t,n){const i=J9e(e),r=TK(e.projectPath,"."),s=EK(t.cloudProvider);return e7e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:t7e({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:_h("cards.delivery.pullRequest.title"),description:_h("cards.delivery.pullRequest.description",{provider:s})},n)}};function zJt(e,t){return e==="."?t:`${e}/${t}`}function VJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const HJt={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"},qJt="1.1.13",WJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function KJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${WJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ + `)}`}function GJt(e){const t=SK(e);return`# Local ${EK(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= # ${t.sessionToken}= -${e==="byteplus"?"BYTEPLUS_REGION":"VOLCENGINE_REGION"}=${Zi(e)} +${e==="byteplus"?"BYTEPLUS_REGION":"VOLCENGINE_REGION"}=${nr(e)} CLOUD_PROVIDER=${e} AGENTKIT_CLOUD_PROVIDER=${e} # Optional model overrides. # MODEL_AGENT_PROVIDER=openai -# MODEL_AGENT_NAME=${Gp(e)} -# MODEL_AGENT_API_BASE=${Po(e)} +# MODEL_AGENT_NAME=${Xp(e)} +# MODEL_AGENT_API_BASE=${Fo(e)} # MODEL_AGENT_API_KEY= # Optional Feishu Channel credentials. Studio can create and bind these. FEISHU_APP_ID= FEISHU_APP_SECRET= -`}function CJt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`}function XJt(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 @@ -1031,19 +1031,19 @@ root_agent = Agent( instruction="You are a helpful assistant. Use your tools when relevant.", tools=[get_city_weather], ) -`,"requirements.txt":`veadk-python==${OJt} +`,"requirements.txt":`veadk-python==${qJt} 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 ${wJt[t]} +`,Dockerfile:`FROM ${HJt[t]} ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1 PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt ./ -${SJt(t)} +${KJt(t)} COPY . . @@ -1068,7 +1068,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":EJt(t),".gitignore":`__pycache__/ +`,".env.example":GJt(t),".gitignore":`__pycache__/ *.pyc .venv/ .env @@ -1082,34 +1082,34 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const AJt={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:[R9e,I9e,{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},P9e,D9e],initialValues:({cloudProvider:e})=>kK(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>M9e(e),submit(e,t,n){const i=L9e(e),r=SK(i.repository),s=EK(e.projectPath,"agentkit-basic-agent"),o=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(CJt(o,t.cloudProvider)).map(([c,u])=>({path:vJt(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:xJt(s),content:F9e({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}),$9e({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Ah("cards.template.pullRequest.title"),description:Ah("cards.template.pullRequest.description",{provider:OK(t.cloudProvider)})},n)}},TJt={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."},sle=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],B9e=[ZZt,AJt,yJt,iJt,eJt,JZt,XZt,TJt],_Jt=new Map(B9e.map(e=>[e.id,e]));function jJt(e){const t=_Jt.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function NJt(e){const t=jJt(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function U9e(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"3",width:"8",height:"6",rx:"2"}),a.jsx("path",{d:"M12 9v4M5 16v-1a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1M12 13v3"}),a.jsx("rect",{x:"2",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"9",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"16",y:"16",width:"6",height:"5",rx:"1.5"})]})}function ale(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function RJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),a.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"}),a.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function IJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),a.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"}),a.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function PJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.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"}),a.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"}),a.jsx("path",{d:"m14 17.1 4 13.9 4-13.9M5.5 21.8h25",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function DJt({onOpen:e,initialCategory:t="development",onCategoryChange:n}){var h;const{t:i}=Te("automations"),[r,s]=p.useState(t),[o,l]=p.useState(""),c=p.useDeferredValue(o),u=p.useMemo(()=>{const m=c.trim().toLocaleLowerCase();return B9e.filter(g=>g.category===r).filter(g=>!m||`${i(`cards.${g.id}.name`)} ${i(`cards.${g.id}.description`)}`.toLocaleLowerCase().includes(m))},[r,c,i]),d=(h=sle.find(m=>m.id===r))==null?void 0:h.id,f=YZt(window.location.hostname);return a.jsxs("div",{className:"applications-page",children:[a.jsxs("header",{className:"applications-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:i("title")}),a.jsx("p",{children:i("description")})]}),a.jsxs("label",{className:"applications-search",children:[a.jsx(ale,{}),a.jsx("input",{type:"search","aria-label":i("search"),value:o,onChange:m=>l(m.target.value),placeholder:i("search")})]})]}),a.jsx("nav",{className:"applications-categories","aria-label":i("categoriesLabel"),children:sle.map(m=>a.jsx("button",{type:"button",className:r===m.id?"is-active":"","aria-pressed":r===m.id,onClick:()=>{s(m.id),n==null||n(m.id)},children:i(`categories.${m.id}`)},m.id))}),a.jsx("section",{className:"applications-results","aria-label":i("resultsLabel",{category:i(`categories.${d}`)}),children:u.length?a.jsx("div",{className:"applications-grid",children:u.map(m=>{const g=m.id==="coding-agents"&&!f,b=g?"coding-agents-local-only-tooltip":void 0;return a.jsxs("div",{className:`application-card-wrap${g?" is-disabled":""}`,tabIndex:g?0:void 0,"aria-describedby":b,children:[a.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(m.id),"aria-label":i("open",{name:i(`cards.${m.id}.name`)}),disabled:g,children:[m.icon==="feishu"?a.jsx("img",{className:"application-card-icon application-card-brand-icon",src:PL,alt:"","aria-hidden":"true"}):m.icon==="mpa-channels"?a.jsx(U9e,{className:"application-card-icon"}):m.icon==="coding-agents"?a.jsx(RJt,{className:"application-card-icon"}):m.icon==="website-integration"?a.jsx(IJt,{className:"application-card-icon"}):m.icon==="gitlab"?a.jsx(PJt,{className:"application-card-icon"}):a.jsx(yK,{className:"application-card-icon"}),a.jsxs("div",{className:"application-card-copy",children:[a.jsxs("div",{className:"application-card-title",children:[a.jsx("h2",{children:i(`cards.${m.id}.name`)}),m.badge?a.jsx("span",{className:`application-card-badge is-${m.badgeTone||"default"}`,children:i(`cards.${m.id}.badge`,{defaultValue:m.badge})}):null]}),a.jsx("p",{children:i(`cards.${m.id}.description`)})]})]}),g?a.jsx("span",{id:b,className:"application-card-tooltip",role:"tooltip",children:i("localOnly")}):null]},m.id)})}):a.jsxs("div",{className:"applications-empty",role:"status",children:[a.jsx(ale,{}),a.jsx("h2",{children:i("emptyTitle")}),a.jsx("p",{children:i("emptyDescription")})]})})]})}function Mh({open:e,keepMounted:t=!1,title:n,subtitle:i,icon:r,className:s="",busy:o=!1,initialFocusRef:l,onClose:c,children:u}){const{t:d}=Te("sandbox"),f=p.useId(),h=p.useRef(null),m=p.useRef(null),g=p.useRef(c);g.current=c;const b=p.useRef(o);return b.current=o,p.useEffect(()=>{var w;if(!e)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const v=document.body.style.overflow;document.body.style.overflow="hidden",(w=(l==null?void 0:l.current)??h.current)==null||w.focus();const y=x=>{var C;if(x.key==="Escape"){x.preventDefault(),b.current||g.current();return}if(x.key!=="Tab")return;const O=(C=h.current)==null?void 0:C.closest("[role=dialog]"),k=Array.from((O==null?void 0:O.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(k.length===0){x.preventDefault();return}const S=k[0],E=k[k.length-1];x.shiftKey&&document.activeElement===S?(x.preventDefault(),E.focus()):!x.shiftKey&&document.activeElement===E&&(x.preventDefault(),S.focus())};return window.addEventListener("keydown",y),()=>{var x;document.body.style.overflow=v,window.removeEventListener("keydown",y),(x=m.current)==null||x.focus()}},[e,l]),!e&&!t?null:yi.createPortal(a.jsx("div",{className:"sandbox-control-backdrop",hidden:!e,onMouseDown:v=>{v.target===v.currentTarget&&!o&&c()},children:a.jsxs("section",{className:`sandbox-control-dialog ${s}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-busy":o||void 0,children:[a.jsxs("header",{className:"sandbox-control-head",children:[a.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:r}),a.jsxs("div",{children:[a.jsx("h2",{id:f,children:n}),i?a.jsx("p",{children:i}):null]}),a.jsx("button",{ref:h,type:"button",className:"sandbox-control-close","aria-label":d("common.closeDialog",{title:n}),title:d("common.closeDialog",{title:n}),disabled:o,onClick:c,children:a.jsx(FAe,{})})]}),u]})}),document.body)}function MJt({open:e,kind:t,launch:n,loading:i,error:r,onReload:s,onClose:o}){const{t:l}=Te("sandbox"),c=t==="terminal",u=l(c?"tool.terminalTitle":"tool.browserTitle");return a.jsxs(Mh,{open:e,title:u,subtitle:l(c?"tool.terminalSubtitle":"tool.browserSubtitle"),icon:c?a.jsx(u0,{}):a.jsx($Ae,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:o,children:[a.jsx("div",{className:"sandbox-tool-toolbar",children:a.jsxs("span",{children:[a.jsx("i",{className:i?"is-loading":n?"is-ready":""}),l(i?"tool.connecting":n?"tool.connected":"tool.notConnected")]})}),a.jsx("div",{className:"sandbox-tool-surface",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Ic,{className:"spin"}),a.jsx("strong",{children:l("tool.opening",{title:u})}),a.jsx("span",{children:l("tool.connectingSession")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("tool.openFailed",{title:u})}),a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,children:l("common.retry")})]}):n?a.jsx("iframe",{src:n.url,title:u,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function LJt({open:e,threads:t,currentThreadId:n,loading:i,error:r,onSelect:s,onClose:o}){const{t:l,i18n:c}=Te("sandbox");return a.jsx(Mh,{open:e,title:l("threads.title"),subtitle:l("threads.subtitle"),icon:a.jsx(iet,{}),className:"sandbox-threads-dialog",onClose:o,children:a.jsx("div",{className:"sandbox-thread-list",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Ic,{className:"spin"}),a.jsx("strong",{children:l("threads.loading")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("threads.loadFailed")}),a.jsx("span",{children:r})]}):t.length===0?a.jsx("div",{className:"sandbox-control-state",children:a.jsx("strong",{children:l("threads.empty")})}):t.map(u=>{const d=u.id===n,f=u.name||u.preview||`Thread ${u.id.slice(0,8)}`;return a.jsxs("button",{type:"button",className:d?"is-active":"",disabled:d,onClick:()=>s(u.id),children:[a.jsxs("span",{children:[a.jsx("strong",{children:f}),a.jsx("small",{children:u.preview||u.cwd||u.id})]}),a.jsx("time",{children:u.updatedAt?new Date(u.updatedAt*1e3).toLocaleString(c.resolvedLanguage??c.language):""}),a.jsx(j8,{})]},u.id)})})})}const $Jt=[{value:"read-only",labelKey:"permissions.sandboxChoices.readOnly.label",detailKey:"permissions.sandboxChoices.readOnly.detail"},{value:"workspace-write",labelKey:"permissions.sandboxChoices.workspaceWrite.label",detailKey:"permissions.sandboxChoices.workspaceWrite.detail"},{value:"danger-full-access",labelKey:"permissions.sandboxChoices.fullAccess.label",detailKey:"permissions.sandboxChoices.fullAccess.detail",danger:!0}],FJt=[{value:"untrusted",labelKey:"permissions.approvalChoices.untrusted.label",detailKey:"permissions.approvalChoices.untrusted.detail"},{value:"on-request",labelKey:"permissions.approvalChoices.onRequest.label",detailKey:"permissions.approvalChoices.onRequest.detail"},{value:"never",labelKey:"permissions.approvalChoices.never.label",detailKey:"permissions.approvalChoices.never.detail",danger:!0}],BJt=[{value:"user",labelKey:"permissions.reviewerChoices.user.label",detailKey:"permissions.reviewerChoices.user.detail"},{value:"auto_review",labelKey:"permissions.reviewerChoices.autoReview.label",detailKey:"permissions.reviewerChoices.autoReview.detail"}];function UJt({open:e,value:t,busy:n,error:i,onSave:r,onClose:s}){const{t:o}=Te("sandbox"),[l,c]=p.useState(t);return p.useEffect(()=>{e&&c(t)},[e,t]),a.jsxs(Mh,{open:e,title:o("permissions.title"),subtitle:o("permissions.subtitle"),icon:a.jsx(pz,{}),className:"sandbox-settings-dialog",onClose:s,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx(x6,{label:o("permissions.sandboxMode"),choices:$Jt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.sandboxMode,disabled:n,onChange:u=>c(d=>({...d,sandboxMode:u,networkAccess:u==="danger-full-access"?!0:d.networkAccess}))}),a.jsx(x6,{label:o("permissions.approvalPolicy"),choices:FJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalPolicy,disabled:n,onChange:u=>c(d=>({...d,approvalPolicy:u}))}),a.jsx(x6,{label:o("permissions.approvalMethod"),choices:BJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalsReviewer,disabled:n,onChange:u=>c(d=>({...d,approvalsReviewer:u}))}),a.jsxs("label",{className:`sandbox-network-toggle${l.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[a.jsxs("span",{children:[a.jsx("strong",{children:o("permissions.networkAccess")}),a.jsx("small",{children:o("permissions.networkAccessHelp")})]}),a.jsx("input",{type:"checkbox",checked:l.networkAccess,disabled:n||l.sandboxMode==="danger-full-access",onChange:u=>c(d=>({...d,networkAccess:u.target.checked}))})]}),l.sandboxMode==="danger-full-access"?a.jsx("div",{className:"sandbox-control-note is-danger",children:o("permissions.fullAccessWarning")}):null,i?a.jsx("div",{className:"sandbox-control-error",children:i}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:s,disabled:n,children:o("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>r(l),children:[n?a.jsx(Ic,{className:"spin"}):null,o("permissions.save")]})]})]})}function x6({label:e,choices:t,value:n,disabled:i,onChange:r}){return a.jsxs("fieldset",{className:"sandbox-choice-group",disabled:i,role:"radiogroup","aria-label":e,children:[a.jsx("legend",{children:e}),a.jsx("div",{className:"sandbox-choice-list",children:t.map(s=>a.jsxs("button",{type:"button",role:"radio",className:`${n===s.value?"is-active":""}${s.danger?" is-danger":""}`.trim(),"aria-checked":n===s.value,onClick:()=>r(s.value),onKeyDown:o=>{var d,f;const l=t.findIndex(h=>h.value===s.value);let c=l;if(o.key==="ArrowRight"||o.key==="ArrowDown")c=(l+1)%t.length;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(o.key==="Home")c=0;else if(o.key==="End")c=t.length-1;else return;o.preventDefault(),r(t[c].value);const u=(d=o.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[a.jsx("i",{}),a.jsxs("span",{children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.detail})]})]},s.value))})]})}function QJt({open:e,cwd:t,locked:n,busy:i,error:r,browse:s,onSave:o,onClose:l}){const{t:c}=Te("sandbox"),[u,d]=p.useState(t||"/"),[f,h]=p.useState(null),[m,g]=p.useState(!1),[b,v]=p.useState("");p.useEffect(()=>{if(!e)return;const w=t||"/";d(w),y(w)},[t,e]);async function y(w){g(!0),v("");try{const x=await s(w);h(x),d(x.path)}catch(x){v(x instanceof Error?x.message:String(x))}finally{g(!1)}}return a.jsxs(Mh,{open:e,title:c("workspace.title"),subtitle:c("workspace.subtitle"),icon:a.jsx(oN,{}),className:"sandbox-workspace-dialog",onClose:l,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("label",{className:"sandbox-workspace-input",children:[a.jsx("span",{children:c("workspace.absolutePath")}),a.jsxs("div",{children:[a.jsx("input",{value:u,disabled:i||n,spellCheck:!1,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&u.startsWith("/")&&(w.preventDefault(),y(u))}}),a.jsx("button",{type:"button",disabled:i||m||!u.startsWith("/"),onClick:()=>void y(u),children:c("workspace.browse")})]})]}),a.jsxs("div",{className:"sandbox-directory-browser",children:[a.jsxs("div",{className:"sandbox-directory-head",children:[a.jsx("span",{title:f==null?void 0:f.path,children:(f==null?void 0:f.path)??u}),m?a.jsx(Ic,{className:"spin"}):null]}),a.jsxs("div",{className:"sandbox-directory-list",children:[f!=null&&f.parent?a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(f.parent??"/"),children:[a.jsx(oN,{}),a.jsx("span",{children:c("workspace.parent")}),a.jsx("small",{children:f.parent}),a.jsx(j8,{})]}):null,f==null?void 0:f.directories.map(w=>a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(w.path),children:[a.jsx(oN,{}),a.jsx("span",{children:w.name}),a.jsx(j8,{})]},w.path)),!m&&(f==null?void 0:f.directories.length)===0?a.jsx("div",{className:"sandbox-directory-empty",children:c("workspace.empty")}):null]})]}),n?a.jsx("div",{className:"sandbox-control-note",children:c("workspace.locked")}):null,b||r?a.jsx("div",{className:"sandbox-control-error",children:b||r}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:l,disabled:i,children:c("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:i||n||!u.startsWith("/"),onClick:()=>o(u),children:[i?a.jsx(Ic,{className:"spin"}):null,c("workspace.useDirectory")]})]})]})}function zJt({approval:e,busy:t,error:n,onDecision:i}){var l;const{t:r}=Te("sandbox"),s=(l=e==null?void 0:e.command)==null?void 0:l.trim(),o=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return a.jsxs(Mh,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?r("approval.fileTitle"):r("approval.commandTitle"),subtitle:r("approval.subtitle"),icon:a.jsx(pz,{}),className:"sandbox-approval-dialog",onClose:()=>{t||i("cancel")},children:[a.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?a.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,s?a.jsx("pre",{children:s}):null,o?a.jsx("pre",{children:o}):null,e!=null&&e.cwd?a.jsxs("div",{className:"sandbox-approval-meta",children:[r("approval.workingDirectory")," ",a.jsx("code",{children:e.cwd})]}):null,n?a.jsx("div",{className:"sandbox-control-error",children:n}):null]}),a.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[a.jsx("button",{type:"button",disabled:t,onClick:()=>i("decline"),children:r("approval.decline")}),a.jsx("button",{type:"button",disabled:t,onClick:()=>i("accept"),children:r("approval.acceptOnce")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>i("acceptForSession"),children:[t?a.jsx(Ic,{className:"spin"}):null,r("approval.acceptSession")]})]})]})}const VJt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='down'%3e%3cpath%20id='&%23229;&%23189;&%23162;&%23231;&%23138;&%23182;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.46129%203.67509C3.22783%203.44164%202.84933%203.44164%202.61587%203.67509L2.19316%204.0978C1.9597%204.33126%201.9597%204.70977%202.19316%204.94322L5.57484%208.32491C5.6922%208.44226%205.8462%208.50062%206.00001%208.49999C6.15382%208.50062%206.30782%208.44226%206.42518%208.32491L9.80686%204.94322C10.0403%204.70977%2010.0403%204.33126%209.80686%204.0978L9.38415%203.67509C9.15069%203.44164%208.77219%203.44164%208.53873%203.67509L6.00001%206.21381L3.46129%203.67509Z'%20fill='%23737A87'/%3e%3c/g%3e%3c/svg%3e";function ML({options:e,value:t,defaultValue:n,onChange:i,className:r="",style:s,disabled:o,id:l,ref:c,tabIndex:u,"aria-label":d,"aria-labelledby":f,...h}){var D;const m=p.useId(),g=`${m}-list`,b=p.useRef(null),v=p.useRef(null),y=p.useRef(null);p.useImperativeHandle(c,()=>v.current);const[w,x]=p.useState(n??((D=e.find(_=>!_.disabled))==null?void 0:D.value)??""),O=t??w,k=e.find(_=>_.value===O),[S,E]=p.useState(!1),[C,j]=p.useState(0),[T,R]=p.useState({left:0,top:0,width:0,maxHeight:240}),A=p.useRef({text:"",time:0});function N(){if(o)return;const _=e.findIndex(L=>L.value===O&&!L.disabled);j(_>=0?_:e.findIndex(L=>!L.disabled)),E(!0)}function P(_){var F;const L=e[_];!L||L.disabled||(v.current&&O!==L.value&&(v.current.value=L.value,v.current.dispatchEvent(new Event("change",{bubbles:!0}))),E(!1),(F=b.current)==null||F.focus())}function I(_){if(["ArrowDown","ArrowUp","Home","End"].includes(_.key)){if(_.preventDefault(),!S){N();return}const L=e.map((M,H)=>M.disabled?-1:H).filter(M=>M>=0);if(!L.length)return;const F=L.indexOf(C);j(_.key==="Home"?L[0]:_.key==="End"?L[L.length-1]:L[(F+(_.key==="ArrowDown"?1:-1)+L.length)%L.length])}else if(_.key==="Enter"||_.key===" ")_.preventDefault(),S?P(C):N();else if(_.key==="Escape")S&&_.preventDefault(),E(!1);else if(_.key==="Tab")E(!1);else if(_.key.length===1&&!_.ctrlKey&&!_.metaKey&&!_.altKey){const L=Date.now();A.current={text:(L-A.current.time<600?A.current.text:"")+_.key.toLowerCase(),time:L};const F=e.findIndex(M=>!M.disabled&&M.label.toLowerCase().startsWith(A.current.text));F>=0&&(j(F),E(!0))}}return p.useLayoutEffect(()=>{if(!S)return;function _(){var z;const L=(z=b.current)==null?void 0:z.getBoundingClientRect();if(!L)return;const F=window.innerHeight-L.bottom-12,M=L.top-12,H=e.reduce((J,ne)=>J+(ne.description?48:28),0),q=Math.min(240,H+Math.max(0,e.length-1)*4+10),U=FF,Z=Math.max(28,Math.min(240,U?M:F));R({left:Math.max(8,Math.min(L.left,window.innerWidth-L.width-8)),top:U?L.top-Math.min(q,Z)-6:L.bottom+6,width:L.width,maxHeight:Z})}return _(),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[S,e]),p.useEffect(()=>{if(!S)return;function _(L){var F,M;L.target instanceof Node&&!((F=b.current)!=null&&F.contains(L.target))&&!((M=y.current)!=null&&M.contains(L.target))&&E(!1)}return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[S]),p.useEffect(()=>{o&&E(!1)},[o]),p.useEffect(()=>{var _,L,F;S&&((F=(L=(_=y.current)==null?void 0:_.querySelector(`[data-index="${C}"]`))==null?void 0:L.scrollIntoView)==null||F.call(L,{block:"nearest"}))},[C,S]),a.jsxs("span",{className:`studio-select ${r}`.trim(),style:s,"data-disabled":o||void 0,children:[a.jsxs("button",{ref:b,id:l,type:"button",role:"combobox",className:"studio-select__display",disabled:o,tabIndex:u,"aria-label":d,"aria-labelledby":f,"aria-expanded":S,"aria-haspopup":"listbox","aria-controls":S?g:void 0,"aria-activedescendant":S&&C>=0?`${m}-option-${C}`:void 0,"aria-required":h.required,onClick:()=>S?E(!1):N(),onKeyDown:I,children:[a.jsxs("span",{className:"studio-select__content",children:[(k==null?void 0:k.icon)&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:k.icon}),a.jsx("span",{className:"studio-select__label",children:k==null?void 0:k.label})]}),a.jsx("img",{className:"studio-select__arrow","data-open":S,src:VJt,alt:""})]}),a.jsx("select",{...h,ref:v,className:"studio-select__native","aria-hidden":"true",tabIndex:-1,disabled:o,value:O,onChange:_=>{t===void 0&&x(_.target.value),i==null||i(_)},children:e.map(_=>a.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))}),S&&yi.createPortal(a.jsx(vf,{ref:y,id:g,role:"listbox","aria-label":d??"选项","aria-labelledby":f,className:"studio-select-menu",contentClassName:"studio-select-menu__items",style:T,children:e.map((_,L)=>a.jsxs("div",{id:`${m}-option-${L}`,role:"option","aria-label":_.label,"aria-describedby":_.description?`${m}-description-${L}`:void 0,"aria-selected":_.value===O,"aria-disabled":_.disabled||void 0,"data-active":L===C,"data-index":L,"data-description":!!_.description||void 0,className:"studio-select-menu__option",onPointerMove:()=>!_.disabled&&j(L),onMouseDown:F=>F.preventDefault(),onClick:()=>P(L),children:[_.icon&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:_.icon}),_.description?a.jsxs("span",{className:"studio-select-menu__text",children:[a.jsx("span",{className:"studio-select__label",children:_.label}),a.jsx("span",{id:`${m}-description-${L}`,className:"studio-select-menu__description",title:_.description,children:_.description})]}):a.jsx("span",{className:"studio-select__label",children:_.label}),_.value===O&&a.jsx("svg",{className:"studio-select-menu__check",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3 8 3 3 7-7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]},_.value))}),document.body)]})}async function Q9e(e,t){const n=await Ec(e,"",{signal:t});if(!n||!Array.isArray(n.channels))throw new fd(502);const i=[],r=new Set;for(const s of n.channels){if(!s||typeof s!="object"||!("channel"in s))throw new fd(502);if(s.channel==="feishu"){if(!("appId"in s)||typeof s.appId!="string"||!s.appId.trim()||r.has(s.appId))throw new fd(502);if(!("enabled"in s)||typeof s.enabled!="boolean")throw new fd(502);r.add(s.appId),i.push({channel:"feishu",appId:s.appId,enabled:s.enabled,..."appName"in s&&typeof s.appName=="string"?{appName:s.appName}:{}})}}return i}const HJt=["Once","Interval","Daily","Weekly","Monthly","Cron"],qJt=["Queued","Running","Succeeded","Failed","TimedOut","Cancelled","Skipped"];function Mk(e){return e.runningAt?"Running":e.lastRunStatus||"Pending"}function $P(e,t,n){return typeof e!="string"||!Number.isFinite(Date.parse(e))?"—":new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:n}).format(new Date(e))}function eU(e,t,n){const i=e.schedule,r=typeof i.timezone=="string"?i.timezone:"Asia/Shanghai",s=i.type,o=s==="Once"?$P(i.runAt,n,r):s==="Interval"?`${i.intervalSeconds} ${t("seconds")}`:s==="Cron"?String(i.cronExpression):`${i.time}${s==="Weekly"?` · ${String(i.weekdays)}`:s==="Monthly"?` · ${String(i.monthDays)}`:""}`;return`${t(s)} · ${o} (${r})`}function WJt(e){const t=new Date(e.getFullYear(),e.getMonth(),1);return t.setDate(t.getDate()-(t.getDay()+6)%7),Array.from({length:42},(n,i)=>new Date(t.getFullYear(),t.getMonth(),t.getDate()+i))}const tU=(e,t)=>Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(e).map(n=>[n.type,n.value]));function KJt(e,t,n,i,r,s){const o=Date.UTC(e,t-1,n,i,r),l=new Set;for(const c of[-864e5,0,864e5]){const u=o+c,d=tU(new Date(u),s),f=Date.UTC(+d.year,+d.month-1,+d.day,+d.hour,+d.minute)-u,h=o-f,m=tU(new Date(h),s);+m.year===e&&+m.month===t&&+m.day===n&&+m.hour===i&&+m.minute===r&&l.add(h)}return[...l]}function GJt(e,t){const n=t.getTime(),i=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1).getTime(),r=e.schedule,s=String(r.timezone||"Asia/Shanghai"),o=Date.parse(e.createdAt||"")||-1/0,l=b=>b>=Math.max(n,o)&&b59||!/^\d+$/.test(b[1])||+b[1]>23||b[3]!=="*"||!/^(\*|\d+(,\d+)*)$/.test(b[2])||!/^(\*|\d+(,\d+)*)$/.test(b[4])||b[2]!=="*"&&b[4]!=="*"){const v=Date.parse(e.nextRunAt||"");return l(v)?{at:v,count:1,nextOnly:!0}:null}c=`${b[1]}:${b[0]}`,d=b[2]==="*"?void 0:b[2].split(",").map(Number),u=b[4]==="*"?void 0:b[4].split(",").map(v=>+v==0?7:+v)}const[f,h]=c.split(":").map(Number);if(!Number.isFinite(f)||!Number.isFinite(h))return null;const m=[];for(let b=-1;b<=1;b++){const v=tU(new Date(n+b*864e5),s),y=+v.year,w=+v.month,x=+v.day,O=new Date(Date.UTC(y,w-1,x)).getUTCDay()||7;u&&!u.includes(O)||d&&!d.includes(x)||m.push(...KJt(y,w,x,f,h,s).filter(l))}const g=[...new Set(m)].sort((b,v)=>b-v);return g.length?{at:g[0],count:g.length,nextOnly:!1}:null}function eg({kind:e}){const t={filter:"M4 5h16l-6 7v7l-4-2v-5Z",plus:"M12 5v14M5 12h14",play:"M8 5l11 7-11 7Z",edit:"m15 4 5 5-11 11H4v-5ZM13 6l5 5",more:"M5 12h.01M12 12h.01M19 12h.01",detail:"M7 3h10l3 3v15H4V3ZM8 9h8M8 13h8M8 17h5",copy:"M9 8V3h12v13h-5M3 8h13v13H3Z",delete:"M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7"};return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"icon","aria-hidden":"true",children:a.jsx("path",{d:t[e]})})}function XJt({task:e,runtime:t,copy:n,busy:i,error:r,onClose:s,onSave:o}){var se,me,Ee;const{t:l}=Te("cronjobs"),c=xe=>l(`mpa.manage.${xe}`),u=e==null?void 0:e.schedule,[d,f]=p.useState(e?e.name+(n?` (${c("copy")})`:""):""),[h,m]=p.useState((e==null?void 0:e.prompt)||""),[g,b]=p.useState((u==null?void 0:u.type)||"Daily"),[v,y]=p.useState(String((u==null?void 0:u.timezone)||"Asia/Shanghai")),[w,x]=p.useState(String((u==null?void 0:u.time)||"09:00")),[O,k]=p.useState(()=>{if(!(u!=null&&u.runAt))return"";const xe=new Date(String(u.runAt));return new Date(xe.getTime()-xe.getTimezoneOffset()*6e4).toISOString().slice(0,16)}),[S,E]=p.useState(String((u==null?void 0:u.intervalSeconds)||3600)),[C,j]=p.useState(String((u==null?void 0:u.weekdays)||"1,2,3,4,5")),[T,R]=p.useState(String((u==null?void 0:u.monthDays)||"1")),[A,N]=p.useState(String((u==null?void 0:u.cronExpression)||"0 9 * * *")),[P,I]=p.useState((e==null?void 0:e.enabled)??!0),[D,_]=p.useState(String(((se=e==null?void 0:e.delivery)==null?void 0:se.channel)||"Web")),[L,F]=p.useState(String(((me=e==null?void 0:e.delivery)==null?void 0:me.targetId)||"")),[M,H]=p.useState(String(((Ee=e==null?void 0:e.delivery)==null?void 0:Ee.appId)||"")),[q,U]=p.useState([]),[Z,z]=p.useState(!1),[J,ne]=p.useState(!1),[W,X]=p.useState(""),[V,ae]=p.useState(0);p.useEffect(()=>{if(!t||D!=="Feishu"){ne(!1);return}const xe=new AbortController,Ne={runtimeId:t.runtimeId,region:t.region};return ne(!0),X(""),(async()=>{var re;let We;try{We=await Ec(Ne,"/capabilities",{signal:xe.signal})}catch(ce){if(ce instanceof fd&&ce.status===404){xe.signal.aborted||z(!1);return}throw ce}if(xe.signal.aborted)return;const Xe=!!((re=We.multiBotChannels)!=null&&re.includes("feishu"));if(z(Xe),!Xe)return;const Re=await Q9e(Ne,xe.signal);xe.signal.aborted||(U(Re),H(ce=>ce||(Re.length===1&&Re[0].enabled?Re[0].appId:"")))})().catch(We=>{xe.signal.aborted||X(We instanceof fd&&[401,403].includes(We.status)?"botsUnauthorized":"botsFailed")}).finally(()=>{xe.signal.aborted||ne(!1)}),()=>xe.abort()},[t==null?void 0:t.runtimeId,t==null?void 0:t.region,D,V]);const[Y,K]=p.useState(""),te=p.useRef(!1),ue=p.useRef(null);function fe(){var We;if(i||te.current)return;if(D==="Feishu"&&t){if(J||W)return;if(Z&&!q.some(Xe=>Xe.appId===M&&Xe.enabled)){K(c("selectBot"));return}}try{new Intl.DateTimeFormat("en-US",{timeZone:v})}catch{K(c("timezoneInvalid"));return}const xe={type:g,timezone:v};if(g==="Once"){const Xe=Date.parse(O);if(!Number.isFinite(Xe)||Xe<=Date.now()){K(c("futureTime"));return}xe.runAt=new Date(Xe).toISOString()}else if(g==="Interval"){const Xe=Number(S);if(!Number.isInteger(Xe)||Xe<30||Xe>31536e3){K(c("intervalInvalid"));return}xe.intervalSeconds=Xe,(u==null?void 0:u.type)===g&&u.anchorAt&&(xe.anchorAt=u.anchorAt)}else if(g==="Cron"){if(A.trim().split(/\s+/).length!==5){K(l("validation.cronFields"));return}xe.cronExpression=A.trim()}else if(xe.time=w,g==="Weekly"||g==="Monthly"){const Xe=(g==="Weekly"?C:T).split(",").map(Number),Re=g==="Weekly"?7:31;if(!Xe.length||Xe.some(re=>!Number.isInteger(re)||re<1||re>Re)||new Set(Xe).size!==Xe.length){K(c("daysInvalid"));return}xe[g==="Weekly"?"weekdays":"monthDays"]=Xe}if(!d.trim()||!h.trim()||D==="Feishu"&&!L.trim()){K(c("required"));return}const Ne=((We=e==null?void 0:e.delivery)==null?void 0:We.channel)===D&&String(e.delivery.targetId||"")===L&&(D!=="Feishu"||!Z||String(e.delivery.appId||"")===M)&&!(D==="Web"&&e.delivery.appId)?e.delivery:{channel:D,...D==="Feishu"&&Z?{appId:M}:{},targetId:D==="Web"?null:L.trim(),receiveIdType:"chat_id",bestEffort:!0};K(""),o({name:d.trim(),...e!=null&&e.agentId?{agentId:e.agentId}:{},prompt:h.trim(),enabled:P,schedule:xe,delivery:Ne,jitterSeconds:(e==null?void 0:e.jitterSeconds)??0,timeoutSeconds:(e==null?void 0:e.timeoutSeconds)??3600})}return a.jsx(Mh,{open:!0,title:c(e&&!n?"edit":"create"),icon:a.jsx(eg,{kind:"edit"}),className:"mpa-dialog",initialFocusRef:ue,busy:i,onClose:s,children:a.jsxs("form",{onSubmit:xe=>{xe.preventDefault(),fe()},onCompositionStart:()=>{te.current=!0},onCompositionEnd:()=>{te.current=!1},onKeyDown:xe=>{xe.key==="Enter"&&(te.current||xe.nativeEvent.isComposing||xe.keyCode===229)&&xe.preventDefault()},children:[a.jsxs("div",{className:"sandbox-control-body mpa-editor",children:[a.jsxs("fieldset",{disabled:i,children:[a.jsxs("label",{children:[c("name"),a.jsx("input",{ref:ue,className:"cw-input",required:!0,maxLength:128,value:d,onChange:xe=>f(xe.target.value)})]}),a.jsxs("label",{children:[c("prompt"),a.jsx("textarea",{className:"cw-input",required:!0,maxLength:4e3,rows:5,value:h,onChange:xe=>m(xe.target.value)})]}),a.jsxs("div",{className:"mpa-fields",children:[a.jsxs("div",{children:[a.jsx("span",{children:c("schedule")}),a.jsx(xf,{ariaLabel:c("schedule"),placeholder:"",value:g,options:HJt.map(xe=>({value:xe,label:c(xe)})),onChange:b})]}),a.jsxs("label",{children:[c("timezone"),a.jsx("input",{className:"cw-input",required:!0,value:v,onChange:xe=>y(xe.target.value)})]})]}),g==="Once"?a.jsxs("label",{children:[c("localTime"),a.jsx("input",{className:"cw-input",required:!0,type:"datetime-local",value:O,onChange:xe=>k(xe.target.value)})]}):g==="Interval"?a.jsxs("label",{children:[c("interval"),a.jsx("input",{className:"cw-input",required:!0,type:"number",min:30,max:31536e3,value:S,onChange:xe=>E(xe.target.value)})]}):g==="Cron"?a.jsxs("label",{children:[c("Cron"),a.jsx("input",{className:"cw-input",required:!0,value:A,maxLength:128,onChange:xe=>N(xe.target.value)})]}):a.jsxs("label",{children:[c("time"),a.jsx("input",{className:"cw-input",type:"time",required:!0,value:w,onChange:xe=>x(xe.target.value)})]}),g==="Weekly"&&a.jsxs("label",{children:[c("weekdays"),a.jsx("input",{className:"cw-input",required:!0,value:C,onChange:xe=>j(xe.target.value)})]}),g==="Monthly"&&a.jsxs("label",{children:[c("monthDays"),a.jsx("input",{className:"cw-input",required:!0,value:T,onChange:xe=>R(xe.target.value)})]}),a.jsxs("div",{children:[a.jsx("span",{children:c("delivery")}),a.jsx(xf,{ariaLabel:c("delivery"),placeholder:"",value:D,options:["Web","Feishu"].map(xe=>({value:xe,label:c(xe)})),onChange:_})]}),D==="Feishu"&&t&&a.jsxs(a.Fragment,{children:[J&&a.jsx("p",{role:"status",children:c("botsLoading")}),W&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:c(W)}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:i||J,onClick:()=>ae(xe=>xe+1),children:c("retryBots")})]}),Z&&a.jsxs("div",{children:[a.jsx("span",{children:c("botAccount")}),a.jsx(ML,{"aria-label":c("botAccount"),value:M,disabled:i||J||!!W,options:[{value:"",label:c("selectBot")},...q.map(xe=>({value:xe.appId,label:`${xe.appName||xe.appId} | ${xe.appId}${xe.enabled?"":` | ${c("botDisabled")}`}`,disabled:!xe.enabled}))],onChange:xe=>H(xe.target.value)}),!J&&!W&&!q.some(xe=>xe.appId===M&&xe.enabled)&&a.jsx("p",{role:"status",children:c("selectBot")})]})]}),D==="Feishu"&&a.jsxs("label",{children:[c("target"),a.jsx("input",{className:"cw-input",required:!0,maxLength:512,value:L,onChange:xe=>F(xe.target.value)})]}),a.jsxs("label",{className:"mpa-checkbox",children:[a.jsx("input",{type:"checkbox",checked:P,onChange:xe=>I(xe.target.checked)}),c("enabled")]})]}),(Y||r)&&a.jsx("p",{role:"alert",className:"cw-error-text",children:Y||r})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:i,onClick:s,children:c("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary is-primary",disabled:i||D==="Feishu"&&!!t&&(J||!!W),type:"submit",children:c(i?"saving":"save")})]})]})})}function nU(e){const t=e instanceof Error?e.message:"";return{MPA_HTTP_401:"mpa.authRequired",MPA_HTTP_403:"mpa.forbidden",MPA_HTTP_404:"mpa.unsupported",MPA_HTTP_409:"mpa.manage.conflict",MPA_HTTP_422:"mpa.manage.invalid",MPA_INVALID_RESPONSE:"mpa.invalidResponse"}[t]||"mpa.loadFailed"}function YJt({task:e,runtime:t,onClose:n}){const{t:i,i18n:r}=Te("cronjobs"),s=v=>i(`mpa.manage.${v}`),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!0);return p.useEffect(()=>{const v=new AbortController;return b(!0),m(""),f(null),$2e(t,e.id,o,v.signal).then(y=>{v.signal.aborted||f(y)}).catch(y=>{v.signal.aborted||m(nU(y))}).finally(()=>{v.signal.aborted||b(!1)}),()=>v.abort()},[t.runtimeId,t.region,e.id,o,c]),a.jsx(Mh,{open:!0,title:e.name,icon:a.jsx(eg,{kind:"detail"}),className:"mpa-dialog mpa-detail",onClose:n,children:a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("dl",{className:"mpa-details",children:[a.jsx("dt",{children:s("agent")}),a.jsx("dd",{children:e.agentId||"—"}),a.jsx("dt",{children:s("schedule")}),a.jsx("dd",{children:eU(e,s,r.language)}),a.jsx("dt",{children:i("mpa.columns.next")}),a.jsx("dd",{children:$P(e.nextRunAt,r.language)}),a.jsx("dt",{children:s("prompt")}),a.jsx("dd",{className:"mpa-prompt",children:e.prompt})]}),a.jsxs("div",{className:"mpa-history-title",children:[a.jsx("h3",{children:s("history")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,onClick:()=>u(v=>v+1),children:i("mpa.refresh")})]}),h&&a.jsx("p",{className:"cw-error-text",role:"alert",children:i(h)}),g&&a.jsx(cn,{children:i("mpa.loading")}),d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mpa-cron-table",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:["lastRun","lastStatus","duration","result"].map(v=>a.jsx("th",{children:s(v)},v))})}),a.jsx("tbody",{children:d.items.map(v=>a.jsxs("tr",{children:[a.jsx("td",{children:$P(v.startedAt||v.scheduledAt,r.language)}),a.jsx("td",{children:s(v.status)}),a.jsx("td",{children:v.durationMs==null?"—":`${v.durationMs} ms`}),a.jsx("td",{children:v.errorMessage||v.sessionId||"—"})]},v.id))})]})}),d.items.length===0&&a.jsx("p",{children:s("noRuns")}),a.jsxs("nav",{className:"mpa-cron-pages",children:[a.jsx("span",{children:i("mpa.total",{total:d.total})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:o===0,onClick:()=>l(Math.max(0,o-20)),children:i("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:!d.hasMore,onClick:()=>l(d.nextOffset),children:i("mpa.next")})]})]})]})})}function ZJt({runtime:e}){const{t}=Te("cronjobs");return e?a.jsx(JJt,{runtime:e},`${e.region}:${e.runtimeId}`):a.jsx("p",{role:"status",children:t("mpa.selectRuntime")})}function JJt({runtime:e}){const{t,i18n:n}=Te("cronjobs"),i=ae=>t(`mpa.manage.${ae}`),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(0),[h,m]=p.useState(null),[g,b]=p.useState(!0),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState("list"),[S,E]=p.useState("all"),[C,j]=p.useState(()=>new Date),[T,R]=p.useState(null),[A,N]=p.useState(null),[P,I]=p.useState(null),[D,_]=p.useState(!1),[L,F]=p.useState(""),M=p.useRef(!1),H=p.useRef(!1),q=p.useRef(new AbortController),U=p.useRef(new Map);p.useEffect(()=>{const ae=new AbortController;return q.current=ae,()=>ae.abort()},[]),p.useEffect(()=>{const ae=new AbortController;return b(!0),y(""),m(null),(async()=>{const Y=await G8(e,0,o,ae.signal),K=[...Y.items];let te=Y,ue=0;for(;te.hasMore;){if(ae.signal.aborted)return;if(te.nextOffset===null||te.nextOffset<=ue||K.length>1e5)throw new Error("MPA_INVALID_RESPONSE");ue=te.nextOffset,te=await G8(e,ue,o,ae.signal),K.push(...te.items)}ae.signal.aborted||m({...Y,items:[...new Map(K.map(fe=>[fe.id,fe])).values()],hasMore:!1,nextOffset:null})})().catch(Y=>{ae.signal.aborted||y(nU(Y))}).finally(()=>{ae.signal.aborted||b(!1)}),()=>ae.abort()},[e.runtimeId,e.region,o,d]);const Z=p.useMemo(()=>(h==null?void 0:h.items.filter(ae=>S==="all"||Mk(ae)===S))||[],[h,S]),z=p.useMemo(()=>WJt(C),[C]),J=p.useMemo(()=>z.map(ae=>({day:ae,tasks:Z.flatMap(Y=>{const K=GJt(Y,ae);return K?[{task:Y,...K}]:[]})})),[z,Z]),ne=Z.slice(c,c+10);function W(ae){let Y=U.current.get(ae);return Y||(Y=crypto.randomUUID(),U.current.set(ae,Y)),Y}async function X(ae,Y,K){if(M.current)return;M.current=!0,_(!0),F(""),x("");const te=q.current,ue=ae==="create"?JSON.stringify(K):`${ae}:${Y==null?void 0:Y.id}`;try{const fe=Y?`/${encodeURIComponent(Y.id)}${ae==="run"?"/run":""}`:"";if((ae==="edit"||ae==="toggle")&&(!Number.isInteger(Y==null?void 0:Y.version)||Number(Y==null?void 0:Y.version)<1))throw new Error("MPA_INVALID_RESPONSE");const se=ae==="delete"?void 0:ae==="run"?{clientToken:W(ue),mode:"Force"}:ae==="create"?{...K,clientToken:W(ue)}:{...ae==="toggle"?{enabled:!Y.enabled}:K,expectedVersion:Y.version},me=await L2e(e,ae==="delete"?"DELETE":"POST",fe,se,te.signal);if(ae==="delete"?me.removed!==!0:ae==="run"?!me.run:!me.task)throw new Error("MPA_INVALID_RESPONSE");U.current.delete(ue),te.signal.aborted||(R(null),I(null),N(null),x(i(ae==="run"?"queued":"saved")),u(0),f(Ee=>Ee+1))}catch(fe){te.signal.aborted||F(t(nU(fe)))}finally{M.current=!1,te.signal.aborted||_(!1)}}function V(ae,Y=!1){F(""),R({task:ae,copy:Y})}return a.jsxs("section",{className:"mpa-cron","aria-label":t("mpa.title"),children:[a.jsxs("div",{className:"mpa-cron-target",children:[a.jsx("strong",{children:e.name}),a.jsxs("span",{children:[e.runtimeId," · ",e.region]})]}),a.jsxs("div",{className:"mpa-cron-heading",children:[a.jsx("div",{className:"mpa-segment",role:"group","aria-label":i("view"),children:["list","calendar"].map(ae=>a.jsx("button",{"aria-pressed":O===ae,onClick:()=>k(ae),children:i(ae)},ae))}),a.jsxs("button",{className:"cw-btn cw-btn-primary mpa-create",disabled:D,onClick:()=>V(),children:[a.jsx(eg,{kind:"plus"}),i("create")]})]}),a.jsxs("div",{className:"mpa-toolbar",children:[a.jsxs("form",{className:"mpa-cron-search",onSubmit:ae=>{ae.preventDefault(),!H.current&&(u(0),l(r),f(Y=>Y+1))},children:[a.jsx("input",{"aria-label":t("mpa.search"),placeholder:t("mpa.search"),type:"search",maxLength:200,value:r,onChange:ae=>s(ae.target.value),onCompositionStart:()=>{H.current=!0},onCompositionEnd:()=>{H.current=!1},onKeyDown:ae=>{ae.key==="Enter"&&(H.current||ae.nativeEvent.isComposing||ae.keyCode===229)&&ae.preventDefault()}}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"submit",children:t("mpa.search")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"button",onClick:()=>f(ae=>ae+1),children:t("mpa.refresh")})]}),(h==null?void 0:h.overview)&&a.jsxs("div",{className:"mpa-cron-overview",children:[a.jsx("span",{children:i("overview")}),a.jsxs("span",{children:[t("mpa.successRate")," ",a.jsxs("strong",{children:[Math.round(h.overview.successRate*100),"%"]})]}),a.jsxs("span",{children:[t("mpa.executionCount")," ",a.jsx("strong",{children:h.overview.executionCount})]})]})]}),v&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:t(v)}),L&&!T&&!P&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:L}),w&&a.jsx("p",{role:"status",children:w}),g&&a.jsx("div",{className:"mpa-state",role:"status",children:a.jsx(cn,{children:t("mpa.loading")})}),!g&&!v&&h&&a.jsx(a.Fragment,{children:O==="list"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-cron-table",tabIndex:0,role:"region","aria-label":t("mpa.title"),children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:i("name")}),a.jsx("th",{children:i("lastRun")}),a.jsx("th",{children:i("schedule")}),a.jsx("th",{children:a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsxs("button",{className:"mpa-status-filter","aria-label":i("lastStatus"),children:[i(S==="all"?"lastStatus":S),a.jsx(eg,{kind:"filter"})]})}),a.jsx(er.Content,{side:"bottom",align:"start",children:["all","Pending",...qJt].map(ae=>a.jsx(er.Item,{onSelect:()=>{E(ae),u(0)},children:i(ae)},ae))})]})}),a.jsx("th",{children:i("agent")}),a.jsx("th",{children:i("actions")})]})}),a.jsx("tbody",{children:ne.map(ae=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("button",{className:"mpa-task-link",title:ae.name,onClick:()=>N(ae),children:ae.name})}),a.jsx("td",{children:$P(ae.lastRunAt,n.language)}),a.jsx("td",{children:eU(ae,i,n.language)}),a.jsx("td",{children:a.jsx("span",{className:`mpa-status mpa-status-${Mk(ae)}`,children:i(Mk(ae))})}),a.jsx("td",{children:ae.agentId||"—"}),a.jsx("td",{children:a.jsxs("div",{className:"mpa-actions",children:[a.jsx("button",{role:"switch","aria-checked":ae.enabled,"aria-label":`${i("enabled")} ${ae.name}`,disabled:D,className:"mpa-switch",onClick:()=>void X("toggle",ae),children:a.jsx("span",{})}),a.jsx("button",{className:"mpa-icon-button",title:i("run"),"aria-label":`${i("run")} ${ae.name}`,disabled:D||Mk(ae)==="Running"||Mk(ae)==="Queued",onClick:()=>void X("run",ae),children:a.jsx(eg,{kind:"play"})}),a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx("button",{className:"mpa-icon-button",disabled:D,"aria-label":`${i("actions")} ${ae.name}`,children:a.jsx(eg,{kind:"more"})})}),a.jsx(er.Content,{side:"bottom",align:"end",minWidth:148,children:["detail","edit","copy","delete"].map(Y=>a.jsxs(er.Item,{onSelect:()=>{Y==="detail"?N(ae):Y==="delete"?(F(""),I(ae)):V(ae,Y==="copy")},children:[a.jsx(eg,{kind:Y}),a.jsx("span",{children:i(Y)})]},Y))})]})]})})]},ae.id))})]}),Z.length===0&&a.jsx("div",{className:"mpa-state",role:"status",children:t("mpa.empty")})]}),a.jsxs("nav",{className:"mpa-cron-pages","aria-label":t("mpa.pagination"),children:[a.jsx("span",{children:t("mpa.total",{total:Z.length})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c===0,onClick:()=>u(Math.max(0,c-10)),children:t("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c+10>=Z.length,onClick:()=>u(c+10),children:t("mpa.next")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-calendar-bar",children:[a.jsx("strong",{children:new Intl.DateTimeFormat(n.language,{year:"numeric",month:"long"}).format(C)}),a.jsxs("span",{children:[i("calendarZone")," ",Intl.DateTimeFormat().resolvedOptions().timeZone]}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(C.getFullYear(),C.getMonth()-1,1)),children:i("prevMonth")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date),children:i("today")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(C.getFullYear(),C.getMonth()+1,1)),children:i("nextMonth")})]}),a.jsxs("div",{className:"mpa-calendar",children:[z.slice(0,7).map(ae=>a.jsx("div",{className:"mpa-calendar-weekday",children:new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(ae)},ae.toISOString())),J.map(({day:ae,tasks:Y})=>a.jsxs("div",{className:`mpa-calendar-day ${ae.getMonth()!==C.getMonth()?"is-outside":""}`,children:[a.jsx("time",{dateTime:ae.toISOString(),children:ae.getDate()}),Y.map(({task:K,at:te,count:ue,nextOnly:fe})=>a.jsxs("button",{className:"mpa-calendar-task",onClick:()=>N(K),title:`${K.name} · ${eU(K,i,n.language)}`,children:[a.jsxs("span",{children:[new Intl.DateTimeFormat(n.language,{hour:"2-digit",minute:"2-digit"}).format(te)," ",K.name]}),ue>1&&a.jsxs("small",{children:[" × ",ue]}),fe&&a.jsx("small",{children:i("nextOnly")})]},K.id))]},ae.toISOString()))]}),a.jsx("p",{children:i("calendarHint")})]})}),T&&a.jsx(XJt,{runtime:e,task:T.task,copy:T.copy,busy:D,error:L,onClose:()=>R(null),onSave:ae=>void X(T.task&&!T.copy?"edit":"create",T.copy?void 0:T.task,ae)}),A&&a.jsx(YJt,{runtime:e,task:A,onClose:()=>N(null)},A.id),P&&a.jsxs(Mh,{open:!0,title:i("delete"),icon:a.jsx(eg,{kind:"delete"}),busy:D,onClose:()=>I(null),children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx("p",{children:t("mpa.manage.deleteConfirm",{name:P.name})}),L&&a.jsx("p",{role:"alert",className:"cw-error-text",children:L})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:D,onClick:()=>I(null),children:i("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary",disabled:D,onClick:()=>void X("delete",P),children:i("delete")})]})]})]})}const een="_Container_1bl61_1",ten="_Track_1bl61_16",nen="_Thumb_1bl61_56",ien="_Label_1bl61_78",wj={Container:een,Track:ten,Thumb:nen,Label:ien},iU=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const o=p.useId(),l=n??o;return a.jsxs("div",{className:Qi(wj.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[a.jsx(fft,{id:l,className:wj.Track,disabled:i,...s,children:a.jsx(pft,{className:wj.Thumb})}),t&&a.jsx("label",{htmlFor:l,className:wj.Label,children:t})]})};function wb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=Te("ui"),o=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 a.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[a.jsx("p",{className:"deploy-error-message-text",children:e}),a.jsxs("div",{className:"deploy-error-message-actions",children:[n&&a.jsxs(_t,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&a.jsx(Gst,{}),u?s("deploymentError.retrying"):o]}),a.jsx(_t,{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?a.jsx(eat,{}):a.jsx(sat,{})}),a.jsx(aH,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy")})]})]})}const ren={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},z9e=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function rU(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(bn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function sen(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]),a.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[a.jsx("p",{id:n,ref:i,children:e}),l?a.jsx(_t,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>o(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const aU="Asia/Shanghai",oen=3e3,len=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function Dt(e,t){return bn.t(e,{ns:"cronjobs",...t})}function cen(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||aU}catch{return aU}}function uen(){const e=cen(),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 den(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||aU,enabled:e.enabled}}function fen({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return a.jsx(Ya,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:Dt(e?ren[e.status]:"status.notRun")})}function ole({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[o,l]=p.useState(()=>e?den(e):uen()),[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([o.timezone,...len])),[o.timezone]),x=p.useMemo(()=>t.map(E=>({value:E.runtimeId,label:E.name,description:Oh(E.region,n)})),[n,t]),O=p.useMemo(()=>z9e.map((E,C)=>({value:String(C),label:Dt(E)})),[]),k=p.useMemo(()=>w.map(E=>({value:E,label:E})),[w]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var T;const E=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(T=m.current)==null||T.focus();const j=R=>{var D,_;if(R.key==="Escape"&&!v.current){y.current();return}if(R.key!=="Tab")return;const A=Array.from(((D=h.current)==null?void 0:D.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(A.length===0){R.preventDefault();return}const N=A[0],P=A[A.length-1],I=document.activeElement;R.shiftKey&&(I===N||!((_=h.current)!=null&&_.contains(I)))?(R.preventDefault(),P.focus()):!R.shiftKey&&I===P&&(R.preventDefault(),N.focus())};return window.addEventListener("keydown",j),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",j),C!=null&&C.isConnected&&C.focus()}},[]);const S=async E=>{E.preventDefault();const C=o.name.trim(),j=o.prompt.trim(),T=t.find(A=>A.runtimeId===o.runtimeId);if(!C)return u(Dt("validation.nameRequired"));if(!T)return u(Dt("validation.runtimeRequired"));if(!j)return u(Dt("validation.promptRequired"));if(o.scheduleType==="once"&&!o.onceAt||(o.scheduleType==="daily"||o.scheduleType==="weekly")&&!o.time)return u(Dt("validation.timeRequired"));const R=o.cron.trim().split(/\s+/);if(o.scheduleType==="cron"&&R.length!==5)return u(Dt("validation.cronFields"));u(""),f(!0);try{let A=(e==null?void 0:e.runtimeId)===T.runtimeId?e.agentName.trim():"";if(!A){const[N]=await FA("","",{runtimeId:T.runtimeId,region:T.region});A=(N==null?void 0:N.trim())??""}if(!A)throw new Error(Dt("validation.runtimeAppMissing"));await s({name:C,runtimeId:T.runtimeId,runtimeName:T.name,agentName:A,region:T.region,prompt:j,enabled:o.enabled,schedule:{type:o.scheduleType,timezone:o.timezone,...o.scheduleType==="once"?{onceAt:o.onceAt}:{},...o.scheduleType==="daily"?{time:o.time}:{},...o.scheduleType==="weekly"?{time:o.time,weekday:o.weekday}:{},...o.scheduleType==="cron"?{cron:o.cron.trim()}:{}}})}catch(A){u(A instanceof Error?A.message:String(A)),window.requestAnimationFrame(()=>{var N;return(N=g.current)==null?void 0:N.focus()})}finally{f(!1)}};return a.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:E=>{E.target===E.currentTarget&&!b&&r()},children:a.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[a.jsxs("header",{className:"cronjobs-drawer-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cronjobs-drawer-title",children:Dt(e?"drawer.editTitle":"drawer.createTitle")}),a.jsx("p",{children:Dt("drawer.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":Dt("actions.closeDrawer"),children:a.jsx(mV,{})})]}),a.jsxs("form",{className:"cronjobs-form",onSubmit:E=>void S(E),children:[a.jsxs("div",{className:"cronjobs-form-scroll",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.name")}),a.jsx(_s,{ref:m,size:"lg",value:o.name,maxLength:80,invalid:!!c&&!o.name.trim(),onChange:E=>l({...o,name:E.target.value}),placeholder:Dt("fields.namePlaceholder")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runtimeAgent")}),a.jsx(ha,{value:o.runtimeId,options:x,size:"lg",disabled:t.length===0,placeholder:Dt(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:E=>l({...o,runtimeId:E.value})}),a.jsx("small",{children:Dt("fields.runtimeHelp")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx(xb,{value:o.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!o.prompt.trim(),onChange:E=>l({...o,prompt:E.target.value}),placeholder:Dt("fields.promptPlaceholder")}),a.jsxs("small",{className:"cronjobs-character-count",children:[o.prompt.length.toLocaleString()," / 20,000"]})]}),a.jsxs("fieldset",{className:"cronjobs-fieldset",children:[a.jsx("legend",{children:Dt("fields.schedule")}),a.jsxs(cd,{className:"cronjobs-schedule-types",value:o.scheduleType,size:"lg",block:!0,"aria-label":Dt("fields.scheduleType"),onChange:E=>l({...o,scheduleType:E}),children:[a.jsx(cd.Option,{value:"once",children:Dt("scheduleTypes.once")}),a.jsx(cd.Option,{value:"daily",children:Dt("scheduleTypes.daily")}),a.jsx(cd.Option,{value:"weekly",children:Dt("scheduleTypes.weekly")}),a.jsx(cd.Option,{value:"cron",children:"Cron"})]}),o.scheduleType==="once"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"datetime-local",value:o.onceAt,onChange:E=>l({...o,onceAt:E.target.value})})]}):null,o.scheduleType==="daily"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.dailyTime")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:E=>l({...o,time:E.target.value})})]}):null,o.scheduleType==="weekly"?a.jsxs("div",{className:"cronjobs-inline-fields",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.weekday")}),a.jsx(ha,{value:String(o.weekday),options:O,size:"lg",onChange:E=>l({...o,weekday:Number(E.value)})})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:E=>l({...o,time:E.target.value})})]})]}):null,o.scheduleType==="cron"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.cronExpression")}),a.jsx(_s,{size:"lg",value:o.cron,onChange:E=>l({...o,cron:E.target.value}),placeholder:"0 9 * * *"}),a.jsx("small",{children:Dt("fields.cronHelp")})]}):null,a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.timezone")}),a.jsx(ha,{value:o.timezone,options:k,size:"lg",onChange:E=>l({...o,timezone:E.value})})]})]}),a.jsxs("div",{className:"cronjobs-switch-row",children:[a.jsxs("span",{children:[a.jsx("strong",{children:Dt("fields.enableAfterCreate")}),a.jsx("small",{children:Dt("fields.enableHelp")})]}),a.jsx(iU,{checked:o.enabled,onCheckedChange:E=>l({...o,enabled:E}),"aria-label":Dt("fields.enableAfterCreate")})]}),c?a.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:a.jsx(Lg,{color:"danger",variant:"soft",description:c})}):null]}),a.jsxs("footer",{className:"cronjobs-drawer-actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:Dt("actions.cancel")}),a.jsx(_t,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:Dt(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function hen({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return a.jsxs(K0,{children:[a.jsx(cb,{icon:a.jsx(Rje,{}),onClick:n,disabled:!t,title:Dt(t?"actions.createScheduledTask":"fields.noRuntime"),children:Dt("actions.createScheduledTask")}),e.map(r=>{const s=V9e(r.schedule);return a.jsx(X0,{className:"cronjobs-card",title:r.name,status:a.jsx(Ya,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:Dt(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:Dt("fields.schedule"),value:s,title:s}],detailAction:{label:Dt("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function pen({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:o,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")??(sU(e)?e.latestRun:void 0),g=r.includes(e.jobId);return a.jsxs("div",{className:"cronjobs-detail",children:[a.jsxs("header",{className:"cronjobs-detail-head",children:[a.jsxs("div",{className:"cronjobs-detail-title",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":Dt("actions.backToList"),children:a.jsx(Wst,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:e.name}),a.jsxs("p",{children:[e.runtimeName||e.agentName," · ",V9e(e.schedule)]})]})]}),a.jsxs("div",{className:"cronjobs-detail-actions",children:[a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:o,disabled:g,children:[a.jsx(rat,{}),Dt("actions.edit")]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?a.jsx(uat,{}):a.jsx(KJ,{}),Dt(e.enabled?"actions.pause":"actions.enable")]}),m?a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[a.jsx(mat,{}),Dt(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[a.jsx(KJ,{}),Dt("actions.runNow")]}),a.jsx(ka,{compact:!0,content:Dt(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:a.jsxs(_t,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":Dt("actions.deleteTask"),children:[a.jsx(tat,{}),Dt("actions.delete")]})})]})]}),a.jsxs("div",{className:"cronjobs-detail-scroll",children:[a.jsxs("section",{className:"cronjobs-summary-grid","aria-label":Dt("detail.configuration"),children:[a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.status")}),a.jsx("dd",{children:Dt(e.enabled?"status.enabled":"status.paused")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.nextRun")}),a.jsx("dd",{children:e.enabled?rU(e.nextRunAt):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.runtime")}),a.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.region")}),a.jsx("dd",{children:e.region})]})]}),a.jsxs("div",{className:"cronjobs-prompt",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx("p",{children:e.prompt})]})]}),a.jsxs("section",{className:"cronjobs-history",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{children:Dt("history.title")}),a.jsx("p",{children:Dt("history.description")})]}),a.jsx(ka,{compact:!0,content:Dt("actions.refresh"),children:a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":Dt("actions.refreshHistory"),children:a.jsx(JD,{})})})]}),n&&t.length===0?a.jsx(cl,{}):i?a.jsx(Lg,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:Dt("history.loadFailed"),description:i,actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:Dt("actions.retry")})}):t.length===0?a.jsxs(Wn,{className:"cronjobs-history-state",fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(pV,{})}),a.jsx(Wn.Title,{children:Dt("history.emptyTitle")}),a.jsx(Wn.Description,{children:Dt("history.emptyDescription")})]}):a.jsx("div",{className:"cronjobs-runs",children:t.map(b=>a.jsxs("article",{className:"cronjobs-run",children:[a.jsxs("div",{className:"cronjobs-run-main",children:[a.jsx(fen,{run:b}),a.jsxs("div",{children:[a.jsx("strong",{children:rU(b.startedAt||b.scheduledAt)}),a.jsxs("span",{children:[Dt("history.duration",{duration:sen(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?a.jsxs("div",{className:"cronjobs-run-meta",children:[a.jsx("span",{children:Dt("history.session")}),a.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?a.jsxs("div",{className:"cronjobs-run-output",children:[a.jsx("span",{children:Dt("history.finalAnswer")}),a.jsx(aen,{output:b.output})]}):null,b.error?a.jsxs("div",{className:"cronjobs-run-output is-error",children:[a.jsx("span",{children:Dt("history.errorDetails")}),a.jsx(wb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:Dt("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?a.jsx(_t,{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:Dt(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function men({cloudProvider:e,selectedRuntime:t}){const[n,i]=p.useState("studio");Te("cronjobs");const[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(!0),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState(void 0),[v,y]=p.useState([]),[w,x]=p.useState(!1),[O,k]=p.useState(""),[S,E]=p.useState(""),[C,j]=p.useState("all"),[T,R]=p.useState(""),[A,N]=p.useState(null),[P,I]=p.useState(""),D=r.find(W=>W.jobId===h),_=C==="all"?r:r.filter(W=>C==="enabled"?W.enabled:!W.enabled),L=p.useCallback(async W=>{u(!0),f("");try{const[X,V]=await Promise.all([V8(W),z0({scope:"all",region:"all",pageSize:100})]);if(W!=null&&W.aborted)return;s(X),l(V.runtimes.filter(ae=>ae.status.toLowerCase()==="ready"))}catch(X){if(W!=null&&W.aborted)return;console.warn("Unable to load scheduled tasks",X),f(Dt("page.loadFailedDescription"))}finally{W!=null&&W.aborted||u(!1)}},[]);p.useEffect(()=>{const W=new AbortController;return L(W.signal),()=>W.abort()},[L]);const F=p.useCallback(async(W,X)=>{x(!0),k("");try{const V=await H8(W,X);X!=null&&X.aborted||y(V)}catch(V){X!=null&&X.aborted||(console.warn("Unable to load scheduled-task history",V),k(Dt("history.loadFailedDescription")))}finally{X!=null&&X.aborted||x(!1)}},[]);p.useEffect(()=>{if(!h){y([]),k("");return}const W=new AbortController;return F(h,W.signal),()=>W.abort()},[F,h]);const M=r.some(sU);p.useEffect(()=>{!M&&T===Dt("notices.queued")&&R("")},[M,T]),p.useEffect(()=>{if(!M)return;const W=new AbortController,X=async()=>{try{const[ae,Y]=await Promise.all([V8(W.signal),h?H8(h,W.signal):Promise.resolve(null)]);if(W.signal.aborted)return;s(ae),Y&&y(Y),ae.some(sU)||R("")}catch(ae){W.signal.aborted||R(ae instanceof Error?ae.message:String(ae))}},V=window.setInterval(()=>void X(),oen);return()=>{window.clearInterval(V),W.abort()}},[M,h]);const H=W=>s(X=>X.some(V=>V.jobId===W.jobId)?X.map(V=>V.jobId===W.jobId?W:V):[W,...X]),q=async(W,X,V,ae=!1)=>{E(W),R("");try{await X(),R(V)}catch(Y){const K=Y instanceof Error?Y.message:String(Y);if(ae)throw new Error(K);R(K)}finally{E("")}},U=async W=>{const X=g??null;await q(`${(X==null?void 0:X.jobId)??"new"}:save`,async()=>{const V=X?await g2e(X.jobId,W):await m2e(W);H(V),b(void 0),X&&m(V.jobId)},Dt(X?"notices.updated":"notices.created"),!0)},Z=W=>void q(`${W.jobId}:toggle`,async()=>H(await b2e(W.jobId,!W.enabled)),Dt(W.enabled?"notices.paused":"notices.enabled")),z=(W,X)=>q(`${W.jobId}:run`,async()=>{const V=await y2e(W.jobId);H({...W,latestRun:V}),h===W.jobId&&y(ae=>[V,...ae.filter(Y=>Y.runId!==V.runId)])},X),J=W=>void z(W,Dt("notices.queued")),ne=()=>{if(!A)return;I("");const W=A;W.kind==="delete"?q(`${W.job.jobId}:delete`,async()=>{await x2e(W.job.jobId),s(X=>X.filter(V=>V.jobId!==W.job.jobId)),m(""),N(null)},Dt("notices.deleted"),!0).catch(X=>{I(X instanceof Error?X.message:String(X))}):q(`${W.job.jobId}:cancel`,async()=>{var V;const X=await v2e(W.job.jobId,W.run.runId);y(ae=>ae.map(Y=>Y.runId===X.runId?X:Y)),H({...W.job,latestRun:((V=W.job.latestRun)==null?void 0:V.runId)===X.runId?X:W.job.latestRun}),N(null)},Dt("notices.cancelRequested"),!0).catch(X=>{I(X instanceof Error?X.message:String(X))})};return D?a.jsxs(Sh,{className:"cronjobs-page","aria-label":Dt("detail.pageLabel"),children:[a.jsx(pen,{job:D,runs:v,runsLoading:w,runsError:O,busyAction:S,onBack:()=>m(""),onEdit:()=>b(D),onToggle:()=>Z(D),onRun:()=>J(D),onDelete:()=>{I(""),N({kind:"delete",job:D})},onCancel:W=>{I(""),N({kind:"cancel",job:D,run:W})},onRetryRun:()=>z(D,Dt("notices.requeued")),onRetryRuns:()=>void F(D.jobId)}),T?a.jsx("div",{className:"cronjobs-notice",role:"status",children:a.jsx(Lg,{color:"info",variant:"soft",description:T})}):null,g!==void 0?a.jsx(ole,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null,A?a.jsx(Td,{title:Dt(A.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:A.kind==="delete"?Dt("confirm.deleteDescription",{name:A.job.name}):Dt("confirm.cancelDescription"),error:P,confirmLabel:Dt(A.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:S.endsWith(A.kind),onCancel:()=>{I(""),N(null)},onConfirm:ne}):null]}):a.jsxs(Sh,{className:"cronjobs-page","aria-label":Dt("page.title"),children:[a.jsx(W0,{className:"cronjobs-page-head",title:Dt("page.title")}),a.jsx(ab,{children:a.jsx(ob,{idPrefix:"cronjobs-source",ariaLabel:Dt("mpa.source"),value:n,items:[{id:"studio",label:Dt("mpa.studio")},{id:"runtime",label:Dt("mpa.title")}],onChange:i})}),n==="runtime"?a.jsx(em,{children:a.jsx(ZJt,{runtime:t})}):a.jsxs(a.Fragment,{children:[a.jsx(ab,{children:a.jsx(ob,{idPrefix:"cronjobs-filter",ariaLabel:Dt("page.filterLabel"),value:C,items:[{id:"all",label:Dt("filters.all")},{id:"enabled",label:Dt("status.enabled")},{id:"paused",label:Dt("status.paused")}],onChange:j})}),T?a.jsx("div",{className:"cronjobs-banner",role:"status",children:a.jsx(Lg,{color:"info",variant:"soft",description:T})}):null,a.jsx(em,{"aria-label":Dt("page.listLabel"),children:c&&r.length===0?a.jsx(cl,{}):d?a.jsxs(Wn,{className:"cronjobs-state",fill:"none",children:[a.jsx(Wn.Icon,{color:"danger",children:a.jsx(pV,{})}),a.jsx(Wn.Title,{color:"danger",children:Dt("page.loadFailed")}),a.jsx(Wn.Description,{children:d}),a.jsx(Wn.ActionRow,{children:a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void L(),children:[a.jsx(JD,{}),Dt("actions.retry")]})})]}):a.jsx(hen,{jobs:_,canCreate:!c&&o.length>0,onCreate:()=>b(null),onSelect:W=>m(W.jobId)})})]}),g!==void 0?a.jsx(ole,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null]})}const gen={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function mA(e){return e.trim()}function CK(e){return gen[e]}function ben(e){const t=mA(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 yen(e,t){const n=ben(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${CK(e)}/tos/bucket/setting?${i.toString()}`}function ven(e,t,n){const i=mA(t),r=mA(n);return!i||!r?null:`${CK(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function xen(e,t,n){const i=mA(t),r=mA(n);return!i||!r?null:`${CK(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function Lk({href:e,label:t,children:n}){return e?a.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[a.jsx("span",{children:n}),a.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):a.jsx("span",{children:n})}function wen(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function Oen({spinning:e}){return a.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:a.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 ken(){return{busy:!1,error:"",message:""}}function Sen({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:o}=Te("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,k]=p.useState(!0),[S,E]=p.useState(""),[C,j]=p.useState(!0),[T,R]=p.useState(""),[A,N]=p.useState(0),[P,I]=p.useState(0),[D,_]=p.useState(0),L=p.useRef(!1),[F,M]=p.useState({}),[H,q]=p.useState({}),[U,Z]=p.useState(""),[z,J]=p.useState(!0),ne=p.useRef(new Set),W=p.useRef(0),X=`${i}:${r}`,V=p.useRef(X);V.current=X,p.useEffect(()=>{q({}),M({})},[X]),p.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);function ae(K,te){M(ue=>({...ue,[K]:{...ken(),...ue[K],...te}}))}async function Y(K){if(!K.toolId||ne.current.has(K.toolId))return;const te=X;ne.current.add(K.toolId),W.current+=1,ae(K.toolId,{busy:!0,error:"",message:""});try{const ue=await M2e(K.kind);if(!L.current||V.current!==te)return;W.current+=1,q(fe=>({...fe,[K.toolId]:ue.state})),ae(K.toolId,{busy:!1,error:"",message:ue.updated?o("systemInfo.modelEnvUpdated"):o("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!L.current||V.current!==te)return;W.current+=1,ae(K.toolId,{busy:!1,error:o("systemInfo.sandboxUpdateError"),message:""})}finally{ne.current.delete(K.toolId)}}return p.useEffect(()=>{if(!l)return;const K=new AbortController,te=++W.current;return Z(""),J(!0),D2e(K.signal).then(ue=>{K.signal.aborted||te!==W.current||q(Object.fromEntries(ue.map(fe=>[fe.toolId,fe])))}).catch(()=>{!K.signal.aborted&&te===W.current&&Z(o("systemInfo.versionCheckError"))}).finally(()=>{K.signal.aborted||J(!1)}),()=>K.abort()},[l,i,r,A]),p.useEffect(()=>{if(!Object.values(H).some(te=>te.status==="Updating"||te.status==="Creating"))return;const K=window.setTimeout(()=>N(te=>te+1),5e3);return()=>window.clearTimeout(K)},[H]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),x("");return}const K=new AbortController;return y(!0),x(""),DTe(K.signal).then(te=>{K.signal.aborted||(u(te.storage.tosAddress),f(te.sandboxTools))}).catch(te=>{(te==null?void 0:te.name)!=="AbortError"&&x(o("systemInfo.sandboxInfoError"))}).finally(()=>{K.signal.aborted||y(!1)}),()=>K.abort()},[l,i,r,A]),p.useEffect(()=>{if(!l){m([]),k(!1),E("");return}const K=new AbortController;return k(!0),E(""),RD(K.signal).then(te=>{m(te.filter(ue=>ue.isCurrent))}).catch(te=>{if((te==null?void 0:te.name)!=="AbortError"){if(t&&wen(te)){m([]);return}E(o("systemInfo.userPoolError"))}}).finally(()=>{K.signal.aborted||k(!1)}),()=>K.abort()},[l,t,P]),p.useEffect(()=>{if(!l){b(null),j(!1),R("");return}const K=new AbortController;return j(!0),R(""),e2e(K.signal).then(b).catch(te=>{(te==null?void 0:te.name)!=="AbortError"&&R(o("systemInfo.environmentResourcesError"))}).finally(()=>{K.signal.aborted||j(!1)}),()=>K.abort()},[l,D]),a.jsxs("div",{className:"system-info-page",children:[a.jsxs("header",{className:"system-info-page-header",children:[a.jsx(ZD,{label:o("common.back"),onClick:s}),a.jsxs("div",{children:[a.jsx("h1",{children:o("systemInfo.title")}),a.jsx("p",{children:o("systemInfo.description")})]})]}),a.jsxs("div",{className:"system-info-scroll",children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[a.jsx("h2",{id:"studio-info-title",children:o("systemInfo.general")}),a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.currentVersion")}),a.jsx("dd",{children:e||"—"})]})})]}),l?a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[a.jsx("h2",{id:"storage-info-title",children:o("systemInfo.storage")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:o("systemInfo.loadingStorage")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(K=>K+1),children:o("common.reload")})]}):a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.tosAddress")}),a.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:a.jsx(Lk,{href:yen(i,c),label:o("systemInfo.openTosConsole"),children:c||o("common.notConfigured")})})]})})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[a.jsx("h2",{id:"environment-build-info-title",children:o("systemInfo.environmentBuild")}),C?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:o("systemInfo.loadingEnvironmentResources")})}):T?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:T}),a.jsx("button",{type:"button",onClick:()=>_(K=>K+1),children:o("common.reload")})]}):g?a.jsxs("dl",{className:"system-info-summary",children:[a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelineWorkspace")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Lk,{href:g.codePipeline.consoleUrl||null,label:o("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||o("systemInfo.createdOnFirstBuild")})})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelinePipeline")}),a.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||o("systemInfo.createdOnFirstBuild")})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.containerRegistryRepository")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Lk,{href:g.containerRegistry.consoleUrl||null,label:o("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||o("systemInfo.createdOnFirstBuild")})})]})]}):null]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[a.jsx("h2",{id:"sandbox-tool-title",children:o("systemInfo.sandboxInfo")}),a.jsx("button",{type:"button",className:"system-info-refresh",disabled:z,onClick:()=>N(K=>K+1),children:o(z?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:o("systemInfo.loadingSandboxInfo")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(K=>K+1),children:o("common.reload")})]}):a.jsxs("div",{className:"system-info-tool-list",children:[U?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:U}):null,d.map(K=>{var me;const te=H[K.toolId],ue=F[K.toolId],fe=!!K.toolId&&!!(te!=null&&te.canUpdate),se=(ue==null?void 0:ue.error)||(te!=null&&te.error?o("systemInfo.versionCheckError"):te!=null&&te.modelEnvError?o("systemInfo.modelEnvRepairUnavailable"):"");return a.jsx("dl",{className:"system-info-tool",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsxs("dt",{className:"system-info-tool-label",children:[a.jsx("span",{children:K.label}),K.snapshot?a.jsx("span",{className:"system-info-tool-badge",children:o("systemInfo.snapshot")}):null]}),a.jsxs("dd",{className:`system-info-resource-value${K.toolId?"":" is-empty"}`,children:[a.jsx(Lk,{href:ven(i,(te==null?void 0:te.region)||r,K.toolId),label:o("systemInfo.openToolConsole",{name:K.label}),children:K.toolId||o("common.notConfigured")}),fe?a.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":o("systemInfo.updateSandbox",{name:K.label,variant:K.snapshot?o("systemInfo.snapshotWithSpace"):""}),title:o("systemInfo.updateSandbox",{name:K.label,variant:K.snapshot?o("systemInfo.snapshotWithSpace"):""}),onClick:()=>void Y(K),children:a.jsx(Oen,{spinning:(ue==null?void 0:ue.busy)||!1})}):null,te!=null&&te.currentImage?a.jsxs("span",{className:"system-info-inline-status",title:`${te.currentImage} → ${te.latestImage}`,children:[te.currentImage.split(":").pop(),te.needsImageUpdate?` → ${(me=te.latestImage)==null?void 0:me.split(":").pop()}`:"",te.status==="Updating"?` · ${o("systemInfo.updatingSandbox")}`:""]}):null,ue!=null&&ue.message?a.jsx("span",{className:"system-info-inline-status",role:"status",children:ue.message}):null,se?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:se}):null]})]})},K.kind)})]})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[a.jsx("h2",{id:"user-pool-title",children:o("systemInfo.userPool")}),O?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:o("systemInfo.loadingUserPool")})}):S?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:S}),a.jsx("button",{type:"button",onClick:()=>I(K=>K+1),children:o("common.reload")})]}):h.length>0?a.jsx("div",{className:"system-info-pool-list",children:h.map(K=>a.jsxs("dl",{className:"system-info-pool",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("common.name")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Lk,{href:xen(i,K.region||r,K.uid),label:o("systemInfo.openUserPoolConsole",{name:K.name||""}),children:K.name||o("systemInfo.unnamedUserPool")})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.id")}),a.jsx("dd",{children:K.uid||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.domain")}),a.jsx("dd",{children:K.domain||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.region")}),a.jsx("dd",{children:K.region||"—"})]})]},K.uid))}):a.jsx("p",{className:"system-info-empty",children:o(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const Een="_TextLink_16uec_1",Cen={TextLink:Een},Oj=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:o,as:l,href:c,to:u,...d}=e,f=o??/^https?:\/\//.test(c??u??""),h=oIe(),m=l||(f?"a":h),g={...d,className:Qi(Cen.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return a.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return a.jsx(m,{...b,children:t})},Aen="/assets/media/article-agent-workflow-GXPkXUjV.webp",Ten="/assets/media/article-tool-debugging-BxiMDz_8.webp",_en="/assets/media/showcase-a2ui-BgBnE9RT.webp",jen="/assets/media/showcase-customer-service-DNw0mUH1.webp",Nen="/assets/media/showcase-multimodal-BRTl8NLI.webp",Ren="/assets/media/showcase-research-assistant-CbfMFfhS.webp",Ien="/assets/media/showcase-web-search-D2kl1imN.webp",Pen={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 Den(e){return Pen[e]}const Men=[{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"}],Len="https://volcengine.github.io/veadk-python/",$en="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",Fen=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:Aen,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:Ten,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],Ben=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:Ren,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:Nen,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:jen,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:Ien,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:_en,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function Uen({cloudProvider:e}){const{t}=Te("workspaceTools"),n=Den(e);return a.jsxs(Sh,{className:"developer-resources","aria-label":t("developerResources.title"),children:[a.jsx(W0,{title:t("developerResources.title")}),a.jsx("div",{className:"developer-resources__content",children:Men.map(i=>a.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[a.jsxs("header",{className:"developer-resources__section-header",children:[a.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),a.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?a.jsxs("ul",{className:"developer-resources__links",children:[a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:Len,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),a.jsx(a_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:$en,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),a.jsx(a_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),a.jsx(a_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),a.jsx(a_,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?a.jsx("div",{className:"developer-resources__articles",children:Fen.map(r=>a.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),a.jsxs("span",{className:"developer-resources__article-copy",children:[a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)}),a.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?a.jsx("div",{className:"developer-resources__showcases",children:Ben.map(r=>a.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"developer-resources__showcase-media",children:a.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}function Qen({cloudProvider:e,onPendingCountChange:t,onChanged:n}){const{t:i,i18n:r}=Te("agentReviews"),[s,o]=p.useState(Zi(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(()=>{o(Zi(e))},[e]),p.useEffect(()=>{const E=new AbortController;return d(!0),h(""),RXt(s,E.signal).then(C=>{E.signal.aborted||(c(C.items),t(C.items.filter(j=>j.status==="pending").length))}).catch(C=>{E.signal.aborted||h(C instanceof Error?C.message:String(C))}).finally(()=>{E.signal.aborted||d(!1)}),()=>E.abort()},[s,y,t]);const k=p.useMemo(()=>l.filter(E=>(b==="all"||E.status===b)&&`${E.agent.name} ${E.submitter.name}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),[l,m,b]),S=[{key:"name",header:i("agent"),className:"review-column-name",render:E=>a.jsx("button",{type:"button",className:"agent-review-name",onClick:()=>O(E),children:E.agent.name})},{key:"submitter",header:i("submitter"),render:E=>a.jsx(PP,{person:E.submitter})},{key:"version",header:i("version"),render:E=>E.agent.version??"—"},{key:"submittedAt",header:i("submittedAt"),render:E=>a.jsx("time",{dateTime:E.submittedAt,children:new Date(E.submittedAt).toLocaleString(r.language)})},{key:"status",header:i("statusTitle"),render:E=>a.jsxs("div",{children:[i(`status.${E.status}`),E.reviewer?a.jsx(PP,{person:E.reviewer}):null]})},{key:"actions",header:i("actions"),render:E=>a.jsx("button",{type:"button",onClick:()=>O(E),children:i(E.status==="pending"?"review":"details")})}];return a.jsxs("div",{className:"agent-review-center","aria-label":i("title"),children:[f?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx("button",{type:"button",onClick:()=>w(E=>E+1),children:i("refresh")})]}):null,a.jsx(vH,{rows:k,rowKey:E=>`${E.region}:${E.id}`,columns:S,searchValue:m,onSearchChange:g,searchPlaceholder:i("search"),searchLabel:i("search"),toolbarActions:a.jsxs(a.Fragment,{children:[a.jsx(lb,{id:"agent-review-region",ariaLabel:i("region"),value:s,options:ju(e),onChange:E=>{o(E),c([]),O(null)}}),a.jsx(lb,{id:"agent-review-status",ariaLabel:i("statusTitle"),value:b,options:["all","pending","approved","returned","withdrawn"].map(E=>({value:E,label:i(E==="all"?"all":`status.${E}`)})),onChange:v}),a.jsx("button",{type:"button",disabled:u,onClick:()=>w(E=>E+1),children:i("refresh")})]}),emptyLabel:u?a.jsx(cl,{}):f?null:a.jsx("p",{className:"agent-review-empty",children:i(m||b!=="all"?"noMatches":"empty")})}),x?a.jsx(c9e,{runtimeId:x.runtimeId,region:x.region,name:x.agent.name,canPublish:!0,onClose:()=>O(null),onChanged:()=>{n==null||n(),w(E=>E+1)}},`${x.region}:${x.id}`):null]})}function zen({application:e,decision:t,onClose:n,onDecided:i}){const{t:r}=Te("reviews"),[s,o]=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 Mpt({id:e.id,region:e.region,decision:t,reason:s.trim(),comment:l.trim()});i(O)}catch(O){b(Pr(O,r("decision.failed")))}finally{m.current=!1,h(!1)}}};return a.jsx(av,{open:!0,onOpenChange:O=>{!O&&!m.current&&n()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"review-backdrop"}),a.jsxs(rv,{className:"confirm-box review-decision",finalFocus:()=>{var O;return(O=w.current)!=null&&O.isConnected?w.current:document.getElementById("review-skill-tab")},children:[a.jsx(vO,{className:"confirm-title",children:r(v?"decision.returnTitle":"decision.approveTitle")}),a.jsx($T,{className:"confirm-text",children:r(v?"decision.returnDescription":"decision.approveDescription",{name:e.name,version:e.version})}),v?a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-return-reason",children:r("decision.reason")}),a.jsx("textarea",{id:"review-return-reason",className:"cw-input",rows:4,maxLength:256,required:!0,disabled:f,value:s,onChange:O=>o(O.target.value),onBlur:()=>d(!0),"aria-invalid":u&&y,"aria-describedby":"review-return-help"}),a.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,a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-decision-comment",children:r("decision.comment")}),a.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"}),a.jsx("span",{id:"review-comment-help",className:"cw-help",children:r("decision.commentHelp")})]}),g?a.jsx("div",{role:"alert",className:"review-decision__error",children:a.jsx(Ns,{error:g})}):null,a.jsxs("div",{className:"confirm-actions",children:[a.jsx(_t,{color:"secondary",variant:"outline",size:"md",pill:!1,disabled:f,onClick:n,children:r("actions.cancel")}),a.jsx(_t,{color:"primary",size:"md",pill:!1,disabled:f||y,onClick:()=>void x(),children:r(f?"decision.saving":v?"actions.confirmReturn":"actions.confirmApprove")})]})]})]})})}const Ven=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>i9t),void 0).then(e=>({default:e.SkillFileTree})));function Hen({application:e,cloudProvider:t,onClose:n,onDecision:i,onScoreChanged:r}){var O;const{t:s,i18n:o}=Te("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 k=new AbortController;return h(!0),g(null),Dpt({id:e.id,region:e.region,signal:k.signal}).then(S=>{k.signal.aborted||d(S.files)}).catch(S=>{k.signal.aborted||g(Pr(S,s("detail.filesFailed")))}).finally(()=>{k.signal.aborted||h(!1)}),()=>k.abort()},[e.id,e.region,l,b,s]);const w=e.reviewedAt?new Date(e.reviewedAt).toLocaleString(o.language,{hour12:!1}):"—",x=e.submittedAt?new Date(e.submittedAt).toLocaleString(o.language,{hour12:!1}):"—";return a.jsx(av,{open:!0,onOpenChange:k=>{k||n()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"review-backdrop"}),a.jsxs(rv,{className:"review-drawer",finalFocus:()=>{var k;return(k=y.current)!=null&&k.isConnected?y.current:document.getElementById("review-skill-tab")},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(vO,{children:s("detail.title")}),a.jsx($T,{children:s("detail.versionFixed")})]}),a.jsx(hL,{className:"review-icon-button","aria-label":s("actions.close"),children:a.jsx(wT,{})})]}),a.jsxs("div",{className:"review-drawer__identity",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(bIe,{})}),a.jsxs("div",{children:[a.jsx("h2",{children:e.name}),a.jsxs("span",{children:[s("kind.skill")," · ",e.version]})]}),a.jsx(FT,{status:e.status})]}),a.jsx(ob,{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}),a.jsx("div",{className:"review-drawer__body",id:"review-detail-panel",role:"tabpanel","aria-labelledby":`review-detail-${l}-tab`,children:l==="score"?a.jsx(RFe,{application:e,canRetry:!0,onScoreChanged:r},`${e.region}:${e.id}`):l==="files"?f?a.jsx(cl,{}):m?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:m}),a.jsx("button",{type:"button",onClick:()=>v(k=>k+1),children:s("space.retry")})]}):a.jsx("div",{className:"review-files",children:a.jsx(p.Suspense,{fallback:a.jsx(cl,{}),children:a.jsx(Ven,{files:u})})}):a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submitter")}),a.jsx("dd",{children:e.author||s("detail.unknownAuthor")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submittedAt")}),a.jsx("dd",{children:x})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.version")}),a.jsx("dd",{children:e.version})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.source")}),a.jsx("dd",{children:s("detail.source_skill",{name:e.author})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.destination")}),a.jsx("dd",{children:s("detail.destination_skill")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.region")}),a.jsx("dd",{children:Oh(e.region,t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.visibility")}),a.jsx("dd",{children:s("detail.shared")})]})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.description")}),a.jsx("p",{children:e.description||"—"})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.result")}),a.jsx(zW,{application:e})]}),a.jsxs("section",{className:"review-detail-section review-history",children:[a.jsx("h3",{children:s("detail.history")}),a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s("detail.submitted",{name:e.author})}),a.jsx("span",{children:x})]})]}),e.reviewedAt?a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.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")})}),a.jsx("span",{children:w})]})]}):null]})]})}),a.jsxs("footer",{className:"review-drawer__footer",children:[e.status==="pending"?a.jsx(_t,{color:"secondary",variant:"outline",size:"md",pill:!1,onClick:()=>i("returned"),children:s("actions.return")}):null,e.status==="pending"||e.status==="approving"?a.jsx(_t,{color:"primary",size:"md",pill:!1,onClick:()=>i("approved"),children:s(e.status==="approving"?"actions.resumeApproval":"actions.approve")}):a.jsx("span",{children:s(`status.${e.status}`)})]})]})]})})}function qen({cloudProvider:e,onAgentChanged:t}){const{t:n,i18n:i}=Te("reviews"),[r,s]=p.useState([]),[o,l]=p.useState(null),[c,u]=p.useState("skill"),[d,f]=p.useState(Zi(e)),[h,m]=p.useState(!0),[g,b]=p.useState(null),[v,y]=p.useState(0),[w,x]=p.useState("all"),[O,k]=p.useState(""),[S,E]=p.useState(null),[C,j]=p.useState(null),[T,R]=p.useState(""),A=(D,_,L=!1)=>{E(null),R(""),j({application:D,value:_,fromDetails:L})};p.useEffect(()=>{if(c!=="skill")return;const D=new AbortController;let _,L=!1,F=!1;m(!0),b(null);const M=async()=>{if(!(L||D.signal.aborted)){L=!0;try{const q=await Ppt({region:d,signal:D.signal});if(D.signal.aborted)return;s(q.items),E(U=>U&&q.items.find(Z=>Z.id===U.id)||null),F=q.items.some(U=>NFe(U.aiReview)),F&&document.visibilityState!=="hidden"&&(_=setTimeout(()=>void M(),5e3))}catch(q){D.signal.aborted||b(Pr(q,n("space.failed"))),F=!1}finally{L=!1,D.signal.aborted||m(!1)}}},H=()=>{clearTimeout(_),F&&document.visibilityState!=="hidden"&&M()};return M(),document.addEventListener("visibilitychange",H),()=>{D.abort(),clearTimeout(_),document.removeEventListener("visibilitychange",H)}},[d,c,v,n]);const N=m9t(r,c,w,O),P=!!O.trim()||w!=="all",I=[{key:"name",header:n("columns.application"),className:"review-column-name",render:D=>a.jsxs("div",{className:"review-name",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(bIe,{})}),a.jsx("div",{children:a.jsx("button",{type:"button",title:D.name,onClick:()=>E(D),children:D.name})})]})},{key:"submitter",header:n("columns.submitter"),className:"review-column-submitter",render:D=>D.author||n("detail.unknownAuthor")},{key:"version",header:n("columns.version"),className:"review-column-version",render:D=>D.version},{key:"submitted",header:n("columns.submittedAt"),className:"review-column-time",render:D=>D.submittedAt?a.jsx("time",{dateTime:D.submittedAt,title:new Date(D.submittedAt).toLocaleString(i.language),children:new Date(D.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:D=>a.jsxs("div",{className:"review-table-outcome",children:[a.jsx(FT,{status:D.status}),D.reviewer||D.reviewedBy?a.jsx(QW,{compact:!0,person:D.reviewer,fallback:D.reviewedBy}):null]})},{key:"score",header:n("score.title"),className:"review-column-score",render:D=>a.jsx(UW,{score:D.aiReview})},{key:"actions",header:n("columns.actions"),className:"review-column-actions",render:D=>a.jsxs("div",{className:"review-row-actions",children:[a.jsx("button",{type:"button",onClick:()=>E(D),"aria-label":n("actions.detailsFor",{name:D.name}),children:n("actions.details")}),D.status==="pending"||D.status==="approving"?a.jsx("button",{type:"button",onClick:()=>A(D,"approved"),children:n(D.status==="approving"?"actions.resumeApproval":"actions.approve")}):null,D.status==="pending"?a.jsx("button",{type:"button",onClick:()=>A(D,"returned"),children:n("actions.return")}):null]})}];return a.jsxs(Sh,{className:"review-center","aria-label":n("title"),children:[a.jsx(W0,{title:n("title")}),a.jsx(ab,{children:a.jsx(ob,{idPrefix:"review",ariaLabel:n("category"),value:c,items:["skill","agent"].map(D=>({id:D,label:a.jsxs(a.Fragment,{children:[n(`kind.${D}`),D==="agent"?o===null?null:a.jsx("span",{className:"review-tab-count",children:o}):a.jsx("span",{className:"review-tab-count",children:r.filter(_=>_.kind===D&&(_.status==="pending"||_.status==="approving")).length})]}),panelId:"review-requests-panel"})),onChange:D=>{u(D),x("all"),k(""),E(null)}})}),a.jsx("div",{className:"review-center__panel",id:"review-requests-panel",role:"tabpanel","aria-labelledby":`review-${c}-tab`,children:c==="agent"?a.jsx(Qen,{cloudProvider:e,onPendingCountChange:l,onChanged:t}):a.jsxs(a.Fragment,{children:[c==="skill"&&g?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:g}),a.jsx("button",{type:"button",onClick:()=>y(D=>D+1),children:n("space.retry")})]}):null,T?a.jsx("p",{role:"status",className:"review-notice",children:T}):null,a.jsx(vH,{rows:N,rowKey:D=>D.id,columns:I,searchValue:O,onSearchChange:k,searchPlaceholder:n("search"),searchLabel:n("search"),toolbarActions:a.jsxs(a.Fragment,{children:[c==="skill"?a.jsxs(a.Fragment,{children:[a.jsx(lb,{id:"review-region",ariaLabel:n("detail.region"),value:d,options:ju(e),onChange:D=>{s([]),E(null),f(D)}}),a.jsx("button",{type:"button",disabled:h,onClick:()=>y(D=>D+1),children:n("actions.refresh")})]}):null,a.jsx(lb,{id:"review-status",ariaLabel:n("filterStatus"),value:w,options:["all","pending","approving","approved","returned"].map(D=>({value:D,label:n(`status.${D}`)})),onChange:x})]}),emptyLabel:c==="skill"&&h?a.jsx(cl,{}):c==="skill"&&g?null:a.jsxs("div",{className:"review-empty",children:[a.jsx("strong",{children:n(P?"empty.filteredTitle":"empty.title")}),a.jsx("span",{children:n(P?"empty.filteredDescription":"empty.description")}),P?a.jsx("button",{type:"button",onClick:()=>{k(""),x("all")},children:n("actions.clearFilters")}):null]})}),a.jsx("div",{className:"review-center__count",children:n("total",{count:N.length})})]})}),S?a.jsx(Hen,{application:S,cloudProvider:e,onClose:()=>E(null),onDecision:D=>A(S,D,!0),onScoreChanged:(D,_)=>{const L=A9t(D);s(F=>F.map(M=>M.id===S.id?{...M,aiReview:L}:M)),_&&y(F=>F+1)}},S.id):null,C?a.jsx(zen,{application:C.application,decision:C.value,onClose:()=>{C.fromDetails&&E(C.application),j(null),y(D=>D+1)},onDecided:D=>{s(_=>_.map(L=>L.id===D.id?D:L)),C.fromDetails&&E(D),R(n(D.status==="approved"?"decision.approved":"decision.returned",{name:D.name})),j(null)}},`${C.application.id}:${C.value}`):null]})}function Wen({role:e,cloudProvider:t,onAgentChanged:n}){const{t:i}=Te("reviews");return e!=="admin"&&e!=="super_admin"?a.jsxs(Sh,{className:"review-center",children:[a.jsx(W0,{title:i("title")}),a.jsx("p",{role:"status",children:i("adminOnly")})]}):a.jsx(qen,{cloudProvider:t,onAgentChanged:n},t)}const kj=10;function Ken(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 Gen({hidden:e,...t}){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.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"}),a.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?a.jsx("path",{d:"m4 4 12 12"}):null]})}function sy(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 Xen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 $k(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 lv(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 Zen(e){try{return`https://github.com/${SK(e)}`}catch{return""}}function Jen(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function etn(e){return e==="webhook"?"自动触发":"手动发起"}function ttn(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 ntn(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 lle(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 itn({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=Te("automations"),s=NJt(e),o=e==="review",l=ju(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Ye=>Ye.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[w,x]=p.useState(!1),[O,k]=p.useState(!1),[S,E]=p.useState(null),[C,j]=p.useState(""),[T,R]=p.useState(null),[A,N]=p.useState(""),[P,I]=p.useState(!1),[D,_]=p.useState(null),[L,F]=p.useState(""),[M,H]=p.useState(o),[q,U]=p.useState([]),[Z,z]=p.useState(o),[J,ne]=p.useState(""),[W,X]=p.useState(null),[V,ae]=p.useState(1),[Y,K]=p.useState(!1),[te,ue]=p.useState(""),[fe,se]=p.useState(""),[me,Ee]=p.useState(""),[xe,Ne]=p.useState([]),[We,Xe]=p.useState(o),[Re,re]=p.useState(""),[ce,ve]=p.useState(null),[Se,oe]=p.useState(1),[$e,Ue]=p.useState(!1),be=p.useRef(null),ke=p.useRef(null),Ae=p.useRef(null),He=p.useRef(null),Qe=p.useRef(null),jt=Zen(u.repository),Pt=jt.replace("https://github.com/",""),Kt=jt?`${jt}/settings/secrets/actions`:"",Ct=(D==null?void 0:D.appSlug)||"agentkit-veadk-studio",xt=(D==null?void 0:D.installUrl)||`https://github.com/apps/${Ct}/installations/new`,tt=rle(C),mt=q.filter(Ye=>Ye.reviewEnabled),_e=tt?q.find(Ye=>Ye.fullName.toLowerCase()===tt.toLowerCase()):void 0,Ot=V>1||Y,Nt=Se>1||$e;p.useEffect(()=>()=>{var Ye,wt,vt,tn,Qt;(Ye=be.current)==null||Ye.abort(),(wt=ke.current)==null||wt.abort(),(vt=Ae.current)==null||vt.abort(),(tn=He.current)==null||tn.abort(),(Qt=Qe.current)==null||Qt.abort()},[]),p.useEffect(()=>{var Ye,wt,vt;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),E(null),k(!1),(Ye=be.current)==null||Ye.abort(),(wt=ke.current)==null||wt.abort(),(vt=Qe.current)==null||vt.abort(),R(null),N(""),Ne([]),re(""),ve(null),ae(1),K(!1),ue(""),se(""),oe(1),Ue(!1)},[e,t,s]),p.useEffect(()=>{var wt;if(!o)return;(wt=Ae.current)==null||wt.abort();const Ye=new AbortController;Ae.current=Ye,H(!0),F(""),dJt(Ye.signal).then(vt=>{Ae.current===Ye&&(_(vt),vt.configured||(z(!1),Xe(!1)))}).catch(vt=>{Ye.signal.aborted||Ae.current!==Ye||(F(vt instanceof Error?vt.message:String(vt)),z(!1),Xe(!1))}).finally(()=>{Ae.current===Ye&&(Ae.current=null,H(!1))})},[o]);const Yt=(Ye=V,wt=fe)=>{var tn;(tn=He.current)==null||tn.abort();const vt=new AbortController;He.current=vt,z(!0),ne(""),fJt(vt.signal,{page:Ye,pageSize:kj,query:wt}).then(Qt=>{if(He.current===vt){if(Qt.repositories.length===0&&Qt.page>1){ae(Qt.page-1),Yt(Qt.page-1);return}U(Qt.repositories),ae(Qt.page),K(Qt.hasNextPage),X({reviewSettingsConfigured:Qt.reviewSettingsConfigured,reviewSettingsReason:Qt.reviewSettingsReason})}}).catch(Qt=>{vt.signal.aborted||He.current!==vt||ne(Qt instanceof Error?Qt.message:String(Qt))}).finally(()=>{He.current===vt&&(He.current=null,z(!1))})},xn=(Ye=Se)=>{var vt;(vt=Qe.current)==null||vt.abort();const wt=new AbortController;Qe.current=wt,Xe(!0),re(""),hJt(wt.signal,{page:Ye,pageSize:kj}).then(tn=>{if(Qe.current===wt){if(tn.records.length===0&&tn.page>1){oe(tn.page-1),xn(tn.page-1);return}Ne(tn.records),oe(tn.page),Ue(tn.hasNextPage),ve({reviewSettingsConfigured:tn.reviewSettingsConfigured,reviewSettingsReason:tn.reviewSettingsReason})}}).catch(tn=>{wt.signal.aborted||Qe.current!==wt||re(tn instanceof Error?tn.message:String(tn))}).finally(()=>{Qe.current===wt&&(Qe.current=null,Xe(!1))})};p.useEffect(()=>{!o||(D==null?void 0:D.configured)!==!0||(Yt(1),xn(1))},[D==null?void 0:D.configured,o]);const Ke=()=>{const Ye=te.trim();se(Ye),ae(1),Yt(1,Ye)},St=()=>{ue(""),se(""),ae(1),Yt(1,"")},qe=(Ye,wt)=>{if(!(wt<1)){if(Ye==="repositories"){ae(wt),Yt(wt,fe);return}oe(wt),xn(wt)}},nt=async Ye=>{if((W==null?void 0:W.reviewSettingsConfigured)!==!0||me)return;const wt=new AbortController;Ee(Ye.fullName),ne("");try{const vt=await pJt({repository:Ye.fullName,reviewEnabled:!Ye.reviewEnabled},wt.signal),tn=new Set(vt.map(Qt=>Qt.toLowerCase()));U(Qt=>Qt.map(un=>({...un,reviewEnabled:tn.has(un.fullName.toLowerCase())})))}catch(vt){ne(vt instanceof Error?vt.message:String(vt))}finally{Ee("")}},et=(Ye,wt)=>{d(vt=>({...vt,[Ye]:wt})),h[Ye]&&m(vt=>({...vt,[Ye]:""}))},ft=Ye=>{var Qt;const wt=!o&&Ye==="token"||Ye==="pullRequestUrl"||((Qt=s.fields.find(un=>un.name===Ye))==null?void 0:Qt.required)===!0,vt=Ye==="pullRequestUrl"?C:u[Ye],tn=$k(Ye,vt,wt);m(un=>({...un,[Ye]:tn}))},Et=async Ye=>{var tn;if(Ye.preventDefault(),o)return;const wt={};for(const Qt of s.fields){const un=$k(Qt.name,u[Qt.name],Qt.required);un&&(wt[Qt.name]=un)}if(!o){const Qt=$k("token",u.token,!0);Qt&&(wt.token=Qt)}if(m(wt),Object.keys(wt).length)return;(tn=be.current)==null||tn.abort();const vt=new AbortController;be.current=vt,y(!0),b(""),E(null);try{const Qt=await s.submit(u,{cloudProvider:t},vt.signal);if(be.current!==vt)return;E(Qt),d(un=>({...un,token:""}))}catch(Qt){if(vt.signal.aborted||be.current!==vt)return;b(Qt instanceof Error?Qt.message:String(Qt))}finally{be.current===vt&&(be.current=null,y(!1))}},At=Ye=>{Ye.key==="Enter"&&(Ye.nativeEvent.isComposing||Ye.nativeEvent.keyCode===229)&&Ye.preventDefault()},It=async()=>{var tn;const Ye={},wt=$k("pullRequestUrl",C,!0);if(wt&&(Ye.pullRequestUrl=wt),!wt){const Qt=rle(C),un=q.find(De=>De.fullName.toLowerCase()===Qt.toLowerCase());un?un.reviewEnabled||(Ye.pullRequestUrl=`请先在下方开启 ${un.fullName} 的评审`):Ye.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Ye),Object.keys(Ye).length)return;(tn=ke.current)==null||tn.abort();const vt=new AbortController;ke.current=vt,I(!0),N(""),R(null);try{const Qt=await uJt({pullRequestUrl:C.trim()},vt.signal);if(ke.current!==vt)return;R(Qt),d(un=>({...un,token:""})),xn(),i==null||i(Qt.sessionId)}catch(Qt){if(vt.signal.aborted||ke.current!==vt)return;N(Qt instanceof Error?Qt.message:String(Qt))}finally{ke.current===vt&&(ke.current=null,I(!1))}},Gt=Ye=>{const{name:wt,placeholder:vt,required:tn}=Ye,Qt=wt==="repository",un=`cards.${e}.fields.${wt}`;return a.jsxs("div",{className:"github-field",children:[a.jsxs("div",{className:"github-field-label-row",children:[a.jsxs("label",{htmlFor:`github-${wt}`,children:[a.jsx("span",{children:r(`${un}.label`)}),a.jsx("span",{className:`github-field-requirement${tn?" is-required":""}`,children:r(tn?"github.required":"github.optional")})]}),Qt?a.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",a.jsx(sy,{})]}):null]}),a.jsx("input",{id:`github-${wt}`,value:u[wt],onChange:De=>et(wt,De.target.value),onBlur:()=>ft(wt),placeholder:r(`${un}.placeholder`,{defaultValue:vt}),required:tn,"aria-invalid":!!h[wt],"aria-describedby":`github-${wt}-help${h[wt]?` github-${wt}-error`:""}`}),a.jsx("span",{id:`github-${wt}-help`,className:"github-field-help",children:Qt&&Pt?o?r("github.repositoryReviewHelp",{repository:Pt}):r("github.repositoryConfigHelp",{repository:Pt}):r(`${un}.help`)}),h[wt]?a.jsx("span",{id:`github-${wt}-error`,className:"github-field-error",role:"alert",children:r(h[wt])}):null]},wt)};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:a.jsx(Ken,{})}),a.jsx(yK,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:r(`cards.${e}.title`)}),a.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:r(`cards.${e}.panel`)})}),a.jsxs("form",{className:"github-release-form",onSubmit:Et,onKeyDown:At,noValidate:!0,children:[o?null:a.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Gt),a.jsxs("div",{className:"github-field",children:[a.jsxs("label",{id:"github-region-label",children:[a.jsx("span",{children:r("github.region")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Ye=>{Ye.key==="Escape"&&k(!1)},children:[a.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":O,onClick:()=>k(Ye=>!Ye),children:[a.jsx("span",{children:(f==null?void 0:f.label)??u.region}),a.jsx(Xen,{className:`pp-region-chevron${O?" is-open":""}`})]}),O?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>k(!1)}),a.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Ye=>{const wt=Ye.value===u.region;return a.jsxs("button",{type:"button",role:"option","aria-selected":wt,className:`pp-region-option${wt?" is-selected":""}`,onClick:()=>{et("region",Ye.value),k(!1)},children:[a.jsx("span",{children:Ye.label}),wt?a.jsx(Yen,{}):null]},Ye.value)})})]}):null]}),a.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),o?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`github-app-card${D!=null&&D.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitHub App 授权"}),a.jsx("span",{children:M?"正在检查中心服务配置...":D!=null&&D.configured?`安装 ${Ct} 到目标仓库后,可在下方开启自动评审。`:L||(D==null?void 0:D.reason)||"管理员未配置 GitHub App。"})]}),a.jsxs("a",{className:"github-app-install-link",href:xt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",a.jsx(sy,{})]})]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),a.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>Yt(),disabled:!(D!=null&&D.configured)||Z,children:Z?"刷新中...":"刷新"})]}),J?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:J}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!J?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:te,onChange:Ye=>ue(Ye.target.value),onKeyDown:Ye=>{Ye.key==="Enter"&&(Ye.preventDefault(),Ke())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),a.jsx("button",{type:"button",onClick:Ke,disabled:!(D!=null&&D.configured)||Z,children:"搜索"}),fe?a.jsx("button",{type:"button",onClick:St,disabled:Z,children:"清除"}):null]}),Z&&q.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!Z&&q.length===0&&!J?a.jsx("div",{className:"github-app-repository-empty",children:fe?`没有匹配 “${fe}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,q.length>0?a.jsx("div",{className:"github-app-repository-list",children:q.map(Ye=>{const wt=me===Ye.fullName,vt=(W==null?void 0:W.reviewSettingsConfigured)!==!0||!!me;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Ye.htmlUrl,target:"_blank",rel:"noreferrer",title:Ye.fullName,children:[Ye.fullName,a.jsx(sy,{})]}),a.jsxs("span",{children:[Ye.private?"Private":"Public"," · Installation ",Ye.installationId]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Ye.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Ye.reviewEnabled,disabled:vt,onClick:()=>{nt(Ye)},children:a.jsx("span",{children:wt?"保存中":Ye.reviewEnabled?"已启用":"未启用"})})]},Ye.fullName)})}):null,Ot?a.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[a.jsx("span",{children:lle(V,kj,q.length,Y)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>qe("repositories",V-1),disabled:V<=1||Z,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>qe("repositories",V+1),disabled:!Y||Z,children:"下一页"})]})]}):null]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"github-field github-token-field",children:[a.jsxs("div",{className:"github-token-label-row",children:[a.jsxs("label",{htmlFor:"github-token",children:[a.jsx("span",{children:r("github.tokenLabel")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.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"),a.jsx(sy,{})]})]}),a.jsxs("div",{className:"github-token-input",children:[a.jsx("input",{id:"github-token",type:w?"text":"password",value:u.token,onChange:Ye=>et("token",Ye.target.value),onBlur:()=>ft("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),a.jsx("button",{type:"button",onClick:()=>x(Ye=>!Ye),"aria-label":r(w?"github.hideToken":"github.showToken"),title:r(w?"github.hideToken":"github.showToken"),children:a.jsx(Gen,{hidden:w})})]}),a.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?a.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,S?a.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[a.jsxs("div",{children:[a.jsx("strong",{children:r("github.configPrCreated",{number:S.number})}),a.jsx("span",{children:r("github.configPrNextStep")})]}),a.jsxs("a",{className:"github-result-link",href:S.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),a.jsx(sy,{})]})]}):null,a.jsxs("div",{className:"github-form-actions",children:[a.jsxs("div",{className:"github-secrets-note",children:[a.jsxs("div",{className:"github-secrets-header",children:[a.jsx("strong",{children:r("github.secretsConfigHeading")}),Kt?a.jsxs("a",{className:"github-secrets-link",href:Kt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),a.jsx(sy,{})]}):null]}),a.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),a.jsx("ul",{children:c.map(Ye=>{const[wt,...vt]=Ye.split(":");return a.jsxs("li",{children:[a.jsx("code",{children:wt}),vt.length?a.jsx("span",{children:vt.join(":")}):null]},Ye)})})]}),a.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),o?a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:C,onChange:Ye=>{j(Ye.target.value),h.pullRequestUrl&&m(wt=>({...wt,pullRequestUrl:""}))},onBlur:()=>m(Ye=>({...Ye,pullRequestUrl:$k("pullRequestUrl",C,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?a.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&tt?a.jsx("span",{className:"github-field-help",children:_e!=null&&_e.reviewEnabled?`将使用 GitHub App 评审 ${_e.fullName}`:_e?`请先在下方开启 ${_e.fullName} 的评审`:`PR URL 所属仓库 ${tt} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!tt&&mt.length>0?a.jsxs("span",{className:"github-field-help",children:["已启用仓库:",mt.map(Ye=>Ye.fullName).join("、")]}):null]}),A?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:A}):null,T?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",T.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:It,disabled:P,children:P?"发起评审中…":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>xn(),disabled:!(D!=null&&D.configured)||We,children:We?"刷新中...":"刷新"})]}),Re?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Re}):null,(ce==null?void 0:ce.reviewSettingsConfigured)===!1&&!Re?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:ce.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,We&&xe.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!We&&xe.length===0&&!Re?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,xe.length>0?a.jsx("div",{className:"github-review-record-list",children:xe.map(Ye=>{const wt=ttn(Ye),vt=Ye.status==="completed"?"":Ye.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Ye.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Ye.repository,"#",Ye.pullRequestNumber,a.jsx(sy,{})]}),a.jsx("span",{className:`github-review-record-status is-${Ye.status}`,children:Jen(Ye.status)})]}),a.jsxs("span",{children:[etn(Ye.trigger),Ye.action?` · ${Ye.action}`:""," · ",ntn(Ye.createdAt),wt?` · ${wt}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:vt&&i?a.jsx("button",{type:"button",onClick:()=>i(vt),children:"打开 Session"}):null})]},Ye.id)})}):null,Nt?a.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[a.jsx("span",{children:lle(Se,kj,xe.length,$e)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>qe("records",Se-1),disabled:Se<=1||We,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>qe("records",Se+1),disabled:!$e||We,children:"下一页"})]})]}):null]})]}):null]})})]})}async function cv(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 cle(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(/\/+$/,""),o="/-/merge_requests/",l=s.indexOf(o);if(l<=0)return"";const c=s.slice(l+o.length);return/^[1-9][0-9]*$/.test(c)?s.slice(0,l):""}async function ule(e){const t=await yn("/web/gitlab/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await cv(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 rtn(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 yn(`/web/gitlab/app/projects?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await cv(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(o=>typeof o!="object"||o===null||typeof o.instanceId!="string"||typeof o.baseUrl!="string"||typeof o.projectId!="number"||typeof o.pathWithNamespace!="string"||typeof o.name!="string"||typeof o.namespace!="string"||typeof o.webUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"||typeof o.permissionsNote!="string"||typeof o.accessLevel!="number"||typeof o.canManageWebhooks!="boolean"||typeof o.reviewBindingStatus!="string"||typeof o.reviewBindingReason!="string"||typeof o.reviewCredentialOwner!="string"||typeof o.reviewCredentialType!="string"))throw new Error("GitLab 集成项目列表响应格式无效。");return r}async function stn(e,t){const n=await yn("/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 cv(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 atn(e){const t=await yn("/web/gitlab/oauth/disconnect",{method:"POST",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await cv(t)}async function otn(e){const t=await yn("/web/gitlab/oauth/start-url",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await cv(t);const n=await t.json();if(typeof n.authorizationUrl!="string"||!n.authorizationUrl)throw new Error("GitLab OAuth 授权地址响应格式无效。");return n.authorizationUrl}async function ltn(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/gitlab/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await cv(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 ctn(e,t){const n=await yn("/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 cv(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 Sj=10;function Ej(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M9 3h4v4M8.5 7.5 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function utn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 dtn(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.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 ftn(e){return e==="started"?"进行中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function htn(e){return e==="webhook"?"自动触发":"手动发起"}function ptn(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function mtn(e){return e.reason==="project-review-disabled"?"项目未启用":e.reason==="merge-request-not-reviewable"?"MR 不满足评审条件":e.reason}function dle(e,t,n,i){const r=(e-1)*t+1,s=(e-1)*t+n;return i?`${r}-${s}`:`${r}-${s} / ${s}`}function gtn({onBack:e,onOpenSandboxSession:t}){const[n,i]=p.useState(null),[r,s]=p.useState(""),[o,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,k]=p.useState(""),[S,E]=p.useState(""),[C,j]=p.useState(null),[T,R]=p.useState(""),[A,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(null),[L,F]=p.useState([]),[M,H]=p.useState(!0),[q,U]=p.useState(""),[Z,z]=p.useState(1),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[V,ae]=p.useState(!1),[Y,K]=p.useState(!1),te=p.useRef(null),ue=p.useRef(null),fe=p.useRef(null),se=n?cle(n.baseUrl,T):"",me=se?c.find(oe=>oe.pathWithNamespace.toLowerCase()===se.toLowerCase()):void 0,Ee=v>1||w,xe=Z>1||J,Ne=(n==null?void 0:n.configured)===!0&&n.oauthConnected,We=(oe=v,$e=S)=>{var be;(be=ue.current)==null||be.abort();const Ue=new AbortController;ue.current=Ue,f(!0),m(""),rtn(Ue.signal,{page:oe,pageSize:Sj,query:$e}).then(ke=>{if(ue.current===Ue){if(ke.projects.length===0&&ke.page>1){y(ke.page-1),We(ke.page-1,$e);return}u(ke.projects),y(ke.page),x(ke.hasNextPage),b({reviewSettingsConfigured:ke.reviewSettingsConfigured,reviewSettingsReason:ke.reviewSettingsReason})}}).catch(ke=>{Ue.signal.aborted||ue.current!==Ue||m(ke instanceof Error?ke.message:String(ke))}).finally(()=>{ue.current===Ue&&(ue.current=null,f(!1))})},Xe=(oe=Z)=>{var Ue;(Ue=fe.current)==null||Ue.abort();const $e=new AbortController;fe.current=$e,H(!0),U(""),ltn($e.signal,{page:oe,pageSize:Sj}).then(be=>{if(fe.current===$e){if(be.records.length===0&&be.page>1){z(be.page-1),Xe(be.page-1);return}F(be.records),z(be.page),ne(be.hasNextPage),X({reviewSettingsConfigured:be.reviewSettingsConfigured,reviewSettingsReason:be.reviewSettingsReason})}}).catch(be=>{$e.signal.aborted||fe.current!==$e||U(be instanceof Error?be.message:String(be))}).finally(()=>{fe.current===$e&&(fe.current=null,H(!1))})};p.useEffect(()=>{var $e;($e=te.current)==null||$e.abort();const oe=new AbortController;return te.current=oe,l(!0),s(""),ule(oe.signal).then(Ue=>{te.current===oe&&(i(Ue),(!Ue.configured||Ue.oauthConfigured&&!Ue.oauthConnected)&&(f(!1),H(!1)))}).catch(Ue=>{oe.signal.aborted||te.current!==oe||(s(Ue instanceof Error?Ue.message:String(Ue)),f(!1),H(!1))}).finally(()=>{te.current===oe&&(te.current=null,l(!1))}),()=>{var Ue,be;oe.abort(),(Ue=ue.current)==null||Ue.abort(),(be=fe.current)==null||be.abort()}},[]),p.useEffect(()=>{Ne&&(We(1,""),Xe(1))},[Ne]);const Re=()=>{const oe=O.trim();E(oe),y(1),We(1,oe)},re=async oe=>{if((g==null?void 0:g.reviewSettingsConfigured)!==!0||C!==null)return;if(!oe.reviewEnabled&&!Ne){m("请先连接 GitLab 后再启用自动评审。");return}const $e=new AbortController;j(oe.projectId),m("");try{await stn({projectId:oe.projectId,reviewEnabled:!oe.reviewEnabled},$e.signal),u(Ue=>Ue.map(be=>be.projectId===oe.projectId?{...be,reviewEnabled:!oe.reviewEnabled}:be))}catch(Ue){m(Ue instanceof Error?Ue.message:String(Ue))}finally{j(null)}},ce=async()=>{const oe=new AbortController;K(!0),s("");try{await atn(oe.signal);const $e=await ule(oe.signal);i($e),u([]),b(null)}catch($e){s($e instanceof Error?$e.message:String($e))}finally{K(!1)}},ve=async()=>{const oe=new AbortController;ae(!0),s("");try{window.location.href=await otn(oe.signal)}catch($e){s($e instanceof Error?$e.message:String($e)),ae(!1)}},Se=async()=>{const oe=T.trim();if(!oe){I("请输入 GitLab Merge Request URL。");return}if(!(n!=null&&n.configured)){I("管理员未配置 GitLab OAuth。");return}if(!Ne){I("请先连接 GitLab 后再发起评审。");return}if(!cle(n.baseUrl,oe)){I("请输入当前 GitLab 实例下的完整 Merge Request URL。");return}N(!0),I(""),_(null);const $e=new AbortController;try{const Ue=await ctn({mergeRequestUrl:oe},$e.signal);_(Ue),Xe(1)}catch(Ue){I(Ue instanceof Error?Ue.message:String(Ue))}finally{N(!1)}};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:e,"aria-label":"返回自动化",children:a.jsx(utn,{})}),a.jsx(dtn,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:"GitLab MR Review"}),a.jsx("p",{children:"通过 GitLab webhook 触发 Sandbox 评审,并将结果写回 Merge Request。"})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:"请先为目标项目开启自动评审,再通过 webhook 或手动 URL 发起 MR 评审。"})}),a.jsxs("div",{className:"github-release-form",children:[a.jsxs("div",{className:`github-app-card${n!=null&&n.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitLab 集成配置"}),a.jsx("span",{children:o?"正在检查中心服务配置...":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?a.jsxs("button",{type:"button",className:"github-app-install-link",onClick:()=>{ve()},disabled:V,children:[V?"连接中...":"连接 GitLab",a.jsx(Ej,{})]}):n!=null&&n.oauthConnected?a.jsx("button",{type:"button",className:"github-app-install-link",onClick:()=>{ce()},disabled:Y,children:Y?"断开中...":"断开授权"}):n!=null&&n.webhookUrl?a.jsxs("a",{className:"github-app-install-link",href:n.webhookUrl,target:"_blank",rel:"noreferrer",children:["Webhook",a.jsx(Ej,{})]}):null]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"gitlab-projects-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-projects-title",children:"可访问项目"}),a.jsx("p",{children:"只有开启评审的项目会响应 GitLab webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>We(),disabled:!Ne||d,children:d?"刷新中...":"刷新"})]}),h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:h}):null,(g==null?void 0:g.reviewSettingsConfigured)===!1&&!h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:O,onChange:oe=>k(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),Re())},placeholder:"搜索 group 或项目名","aria-label":"搜索 GitLab 项目"}),a.jsx("button",{type:"button",onClick:Re,disabled:!Ne||d,children:"搜索"}),S?a.jsx("button",{type:"button",onClick:()=>{k(""),E(""),y(1),We(1,"")},disabled:d||!Ne,children:"清除"}):null]}),!Ne&&!o?a.jsx("div",{className:"github-app-repository-empty",children:"请先连接 GitLab。"}):null,d&&c.length===0&&Ne?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitLab 项目..."}):null,!d&&c.length===0&&!h&&Ne?a.jsx("div",{className:"github-app-repository-empty",children:S?`没有匹配 “${S}” 的 GitLab 项目。`:"GitLab 集成暂无可访问项目。"}):null,c.length>0?a.jsx("div",{className:"github-app-repository-list",children:c.map(oe=>{const $e=C===oe.projectId,Ue=(g==null?void 0:g.reviewSettingsConfigured)!==!0||C!==null||!oe.reviewEnabled&&!Ne;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:oe.webUrl,target:"_blank",rel:"noreferrer",title:oe.pathWithNamespace,children:[oe.pathWithNamespace,a.jsx(Ej,{})]}),a.jsxs("span",{children:[oe.private?"Private":"Public"," · Project ",oe.projectId,oe.permissionsNote?` · ${oe.permissionsNote}`:"",oe.reviewBindingStatus&&oe.reviewBindingStatus!=="active"&&oe.reviewBindingStatus!=="disabled"?` · ${oe.reviewBindingReason||"授权失效"}`:""]})]}),a.jsx("button",{type:"button",className:`github-review-switch${oe.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":oe.reviewEnabled,disabled:Ue,onClick:()=>{re(oe)},children:a.jsx("span",{children:$e?"保存中":oe.reviewEnabled?"已启用":"未启用"})})]},`${oe.instanceId}:${oe.projectId}`)})}):null,Ee?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 项目分页",children:[a.jsx("span",{children:dle(v,Sj,c.length,w)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{y(v-1),We(v-1,S)},disabled:v<=1||d,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{y(v+1),We(v+1,S)},disabled:!w||d,children:"下一页"})]})]}):null]})]}),a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"gitlab-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入当前 GitLab 实例下的 MR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{"aria-label":"Merge Request URL",value:T,onChange:oe=>R(oe.target.value),placeholder:`${(n==null?void 0:n.baseUrl)||"https://gitlab.example.com"}/group/project/-/merge_requests/123`}),se?a.jsx("span",{className:"github-field-help",children:me?`将使用 GitLab 授权评审 ${me.pathWithNamespace}`:`MR URL 所属项目 ${se} 不在当前项目列表中`}):null]}),P?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:P}):null,D?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",D.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:Se,disabled:A||!Ne,children:A?"发起评审中...":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"gitlab-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>Xe(),disabled:!Ne||M,children:M?"刷新中...":"刷新"})]}),q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:q}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,M&&L.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 MR 评审记录..."}):null,!M&&L.length===0&&!q?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 MR 评审记录。"}):null,L.length>0?a.jsx("div",{className:"github-review-record-list",children:L.map(oe=>{const $e=mtn(oe),Ue=oe.status==="completed"?"":oe.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:oe.mergeRequestUrl,target:"_blank",rel:"noreferrer",children:[oe.pathWithNamespace,"!",oe.mergeRequestIid,a.jsx(Ej,{})]}),a.jsx("span",{className:`github-review-record-status is-${oe.status}`,children:ftn(oe.status)})]}),a.jsxs("span",{children:[htn(oe.trigger),oe.action?` · ${oe.action}`:""," · ",ptn(oe.createdAt),$e?` · ${$e}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:Ue&&t?a.jsx("button",{type:"button",onClick:()=>t(Ue),children:"打开 Session"}):null})]},oe.id)})}):null,xe?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 评审记录分页",children:[a.jsx("span",{children:dle(Z,Sj,L.length,J)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{z(Z-1),Xe(Z-1)},disabled:Z<=1||M,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{z(Z+1),Xe(Z+1)},disabled:!J||M,children:"下一页"})]})]}):null]})]})]})})]})}const btn=1050062,fle="1.0",ytn="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class vtn{constructor(){Zt(this,"enabled",!1);Zt(this,"initialized",!1);Zt(this,"pending",[]);Zt(this,"userUniqueId","");Zt(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:btn,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=ytn,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 xtn=256,H9e=1024,w6="[REDACTED]";function wtn(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 ep(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function q9e(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 Otn(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${w6}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${w6}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${w6}`)}function By(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 q9e(Otn(r),H9e,t)}function Xo(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=wtn(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return ep("runtime_probe_error",i);if(r==="AbortError")return ep("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return ep("auth",i);if(t.phase==="build")return ep("build_failed",i);if(r==="TimeoutError")return ep("timeout",i);if(r==="NetworkError"||r==="TypeError")return ep("network",i);if(r==="ValidationError")return ep("validation",i);if(r==="ServerError")return ep("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 ep("unknown",i);const o=String(s);return s===401||s===403?{errorKind:"auth",errorCode:o}:s===400||s===409||s===422?{errorKind:"validation",errorCode:o}:s>=500?{errorKind:"server",errorCode:o}:{errorKind:"unknown",errorCode:o}}const ktn=["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"],Stn={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 Etn(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function hle(e,t){const n=new Set([...ktn,...Stn[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!Etn(s)||(typeof s=="string"?i[r]=q9e(s,r==="error_message"?H9e:xtn):i[r]=s);return i}function Ctn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Atn(){return typeof performance<"u"?performance.now():Date.now()}function Gv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class Ttn{constructor(t){Zt(this,"sink");Zt(this,"createId");Zt(this,"now");Zt(this,"pageInstanceId");Zt(this,"context");Zt(this,"identity");Zt(this,"entryViewed",!1);Zt(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??Ctn,this.now=t.now??Atn,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=hle("studio_entry_viewed",Gv({schema_version:fle,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=>Gv({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>Gv({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",Gv({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=>Gv({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(),o=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()-o)},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=hle(t,Gv({schema_version:fle,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 W9e=new vtn,Lh=new Ttn({sink:W9e});function _tn(e){return W9e.init(e)}function jtn(e){Lh.setContext(e)}function Ntn(e){Lh.identify(e)}function Rtn(e){Lh.trackStudioEntryViewed(e)}function Itn(e){Lh.trackStudioSessionStarted(e)}function K9e(e){return Lh.beginAgentDeploy(e)}function Ptn(e){return Lh.beginSandboxCreate(e)}function Dtn(e){return Lh.beginAgentDebug(e)}function Cj(e){return Lh.beginAgentConnect(e)}function ple(e){return Lh.beginAgentMessage(e)}function G9e(e){return Lh.beginAgentSourceDownload(e)}const Mtn=/^[A-Za-z_][A-Za-z0-9_]*$/;function GT(e,t=n=>Xt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):Mtn.test(e)?null:t("characters")}function Ltn(e){const t=new Set,n=new Set,i=r=>{GT(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function $tn(e){return{...kd(),name:e,description:Ah("feishu.generatedAgent.description"),instruction:Ah("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function Ftn(e){const t=$tn(e.agentName),n=await tE(t);return Q0(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 qf=["cn-beijing","cn-shanghai"],X9e=["prepare","build","deploy","publish"];function Btn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 Utn(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function mle(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Qtn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 ztn(e){if(!e||e==="upload")return 0;const t=X9e.findIndex(n=>n===e);return t<0?0:t}function O6(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function gle(e){const t=GT(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function Vtn({onBack:e}){const{t}=Te("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[o,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,k]=p.useState("idle"),[S,E]=p.useState(null),[C,j]=p.useState(""),[T,R]=p.useState(null),A=p.useRef(null),N=p.useRef(null),P=p.useRef([]),I=p.useRef(0),D=p.useRef(null),_=p.useRef(null),L=p.useRef("prepare"),F=p.useRef(!1),M=p.useRef(!0),H=["preparing","running","cancelling"].includes(O);p.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]),p.useEffect(()=>{var ae;if(!h)return;(ae=P.current[I.current])==null||ae.focus();const X=Y=>{Y.target instanceof Node&&A.current&&!A.current.contains(Y.target)&&m(!1)},V=Y=>{var K;Y.key==="Escape"&&(m(!1),(K=N.current)==null||K.focus())};return window.addEventListener("pointerdown",X),window.addEventListener("keydown",V),()=>{window.removeEventListener("pointerdown",X),window.removeEventListener("keydown",V)}},[h]);const q=X=>{X.key==="Enter"&&(X.nativeEvent.isComposing||X.nativeEvent.keyCode===229)&&X.preventDefault()},U=()=>{const X=gle(n.trim()),V=r.trim()?"":"feishu.validation.appId",ae=o.trim()?"":"feishu.validation.appSecret";return b(X),y(V),x(ae),!X&&!V&&!ae},Z=async X=>{if(X.preventDefault(),!U()||H)return;const V=crypto.randomUUID();D.current=V,L.current="prepare",F.current=!1,k("preparing"),E(null),j(""),R(null);const ae=K9e({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});_.current=ae;try{const Y=await Ftn({agentName:n.trim(),appId:r.trim(),appSecret:o.trim(),region:d,taskId:V,onStage:K=>{L.current=K.phase||"deploy",!(!M.current||F.current)&&(k("running"),E(K))}});if(F.current){ae.fail({failedPhase:O6(L.current),errorKind:"abort",errorMessage:By("User cancelled deployment")});return}if(ae.succeed({runtimeId:String(Y.runtimeId||"")}),!M.current)return;R(Y),l(""),u(!1),k("succeeded")}catch(Y){if(ae.fail({failedPhase:O6(L.current),...F.current?{errorKind:"abort"}:Xo(Y,{phase:L.current}),errorMessage:By(Y)}),!M.current||F.current)return;k("failed"),j(Y instanceof Error?Y.message:String(Y))}finally{D.current===V&&(D.current=null),_.current===ae&&(_.current=null)}},z=async()=>{var V;const X=D.current;if(!(!X||O!=="running")&&window.confirm(t("feishu.confirmCancel"))){F.current=!0,k("cancelling"),j("");try{await o2e(X),(V=_.current)==null||V.fail({failedPhase:O6(L.current),errorKind:"abort",errorMessage:By("User cancelled deployment")}),M.current&&k("cancelled")}catch(ae){if(F.current=!1,!M.current)return;k("failed"),j(ae instanceof Error?ae.message:String(ae))}}},J=ztn((S==null?void 0:S.phase)??null),ne=!!(n.trim()&&r.trim()&&o.trim()&&!H),W=t(`feishu.regions.${d}`);return a.jsxs("div",{className:"feishu-integration-page",children:[a.jsxs("header",{className:"feishu-integration-header",children:[a.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:H,children:a.jsx(Btn,{})}),a.jsx("img",{className:"feishu-integration-logo",src:PL,alt:"","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("feishu.title")}),a.jsx("p",{children:t("feishu.description")})]})]}),a.jsx("div",{className:"feishu-integration-layout",children:a.jsxs("section",{className:"feishu-section-panel",children:[a.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),a.jsxs("form",{className:"feishu-form",onSubmit:Z,onKeyDown:q,noValidate:!0,children:[a.jsxs("div",{className:"feishu-field-grid",children:[a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),a.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:H,onChange:X=>{i(X.target.value),g&&b("")},onBlur:()=>b(gle(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),a.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?a.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),a.jsxs("div",{className:"feishu-region-picker",ref:A,children:[a.jsxs("button",{ref:N,type:"button",className:"feishu-region-trigger",disabled:H,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{I.current=qf.findIndex(X=>X===d),m(X=>!X)},onKeyDown:X=>{X.key!=="ArrowDown"&&X.key!=="ArrowUp"||(X.preventDefault(),I.current=X.key==="ArrowUp"?qf.length-1:qf.findIndex(V=>V===d),m(!0))},children:[a.jsx("span",{id:"feishu-region-value",children:W}),a.jsx(Utn,{})]}),h?a.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:X=>{var Y;const V=P.current.findIndex(K=>K===document.activeElement);let ae=null;X.key==="ArrowDown"?ae=(V+1)%qf.length:X.key==="ArrowUp"?ae=(V-1+qf.length)%qf.length:X.key==="Home"?ae=0:X.key==="End"?ae=qf.length-1:X.key==="Tab"&&m(!1),ae!==null&&(X.preventDefault(),(Y=P.current[ae])==null||Y.focus())},children:qf.map(X=>a.jsx("button",{ref:V=>{const ae=qf.findIndex(Y=>Y===X);P.current[ae]=V},type:"button",role:"option","aria-selected":d===X,className:`feishu-region-option${d===X?" is-selected":""}`,onClick:()=>{var V;f(X),m(!1),(V=N.current)==null||V.focus()},children:t(`feishu.regions.${X}`)},X))}):null]}),a.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),a.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:H,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:X=>{s(X.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":""}`}),a.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?a.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),a.jsxs("div",{className:"feishu-secret-input",children:[a.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:o,maxLength:256,autoComplete:"off",disabled:H,placeholder:t("feishu.appSecretPlaceholder"),onChange:X=>{l(X.target.value),w&&x("")},onBlur:()=>x(o.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!w,"aria-describedby":`feishu-app-secret-help${w?" feishu-app-secret-error":""}`}),a.jsx("button",{type:"button",disabled:H,onClick:()=>u(X=>!X),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),a.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),w?a.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(w)}):null]})]}),O!=="idle"?a.jsxs("div",{className:`feishu-deployment-status is-${O}`,role:O==="failed"?"alert":"status",children:[a.jsxs("div",{className:"feishu-deployment-heading",children:[O==="preparing"?a.jsx(cn,{as:"strong",children:t("feishu.status.preparing")}):null,O==="running"?a.jsx(cn,{as:"strong",children:S?mL(S):t("feishu.status.running")}):null,O==="cancelling"?a.jsx(cn,{as:"strong",children:t("feishu.status.cancelling")}):null,O==="succeeded"?a.jsxs("strong",{children:[a.jsx(mle,{}),t("feishu.status.succeeded")]}):null,O==="cancelled"?a.jsx("strong",{children:t("feishu.status.cancelled")}):null,O==="failed"?a.jsx("strong",{children:t("feishu.status.failed")}):null]}),O==="preparing"||O==="running"||O==="cancelling"?a.jsx("ol",{className:"feishu-deployment-steps",children:X9e.map((X,V)=>{const ae=O==="running"&&Vvoid z(),children:t("feishu.cancelDeployment")}):null,a.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ne,children:t(H?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function AK(e,t,n,i=ho){var s;const r=await yn(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let o="";try{o=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(o||Q("common.requestFailed",{status:r.status}))}return r.json()}function Htn(e){return AK("/web/coding-agents/capabilities",{method:"GET"},e,mz)}function qtn(e,t){return AK(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function Wtn(e,t){return AK("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const Ktn="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 Gtn(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function ble(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function yle(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Xtn(e){return e instanceof DOMException&&e.name==="AbortError"}function Ytn(e){return e instanceof Error&&e.message?e.message:""}function Ztn(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function Jtn(e){const t=e.split("/");return t[t.length-1]??e}function enn(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 tnn({skill:e,onClose:t}){const{t:n}=Te("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),o=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 k;O!=null&&O.open&&O.close(),(k=r.current)==null||k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return h(!0),g(""),c(null),d(""),qtn(e.id,O.signal).then(k=>{if(O.signal.aborted)return;c(k);const S=k.files.find(E=>E.path==="SKILL.md")??k.files[0];d((S==null?void 0:S.path)??"")}).catch(k=>{!O.signal.aborted&&!Xtn(k)&&g(Ytn(k))}).finally(()=>{O.signal.aborted||h(!1)}),()=>O.abort()},[b,e.id]);const y=p.useMemo(()=>enn((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 a.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":o,onCancel:O=>{O.preventDefault(),t()},onMouseDown:O=>{const k=O.currentTarget.getBoundingClientRect();(O.clientXk.right||O.clientYk.bottom)&&t()},children:[a.jsxs("header",{className:"coding-agents-preview-header",children:[a.jsx("span",{className:"coding-agents-preview-mark",children:a.jsx(yle,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:s,children:x}),a.jsx("p",{id:o,children:n("codingAgents.preview.description")})]}),a.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:a.jsx(Gtn,{})})]}),f?a.jsxs("div",{className:"coding-agents-preview-state",children:[a.jsx("i",{}),n("codingAgents.preview.loading")]}):m?a.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[a.jsx("span",{children:m||n("codingAgents.preview.error")}),a.jsx("button",{type:"button",onClick:()=>v(O=>O+1),children:n("codingAgents.retry")})]}):a.jsxs("div",{className:"coding-agents-preview-layout",children:[a.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:x}),children:[a.jsxs("div",{className:"coding-agents-preview-tree-title",children:[a.jsx("span",{children:n("codingAgents.preview.files")}),a.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),a.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(O=>O.directory?a.jsxs("details",{open:!0,children:[a.jsxs("summary",{children:[a.jsx(yle,{}),a.jsx("span",{children:O.directory})]}),a.jsx("div",{children:O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(ble,{}),a.jsx("span",{children:Jtn(k.path)})]},k.path))})]},O.directory):O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(ble,{}),a.jsx("span",{children:k.path})]},k.path)))})]}),a.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:w?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("strong",{children:w.path}),a.jsx("span",{children:Ztn(w.size)})]}),w.previewable&&w.content!==null?a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:w.content})}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function nnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 inn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),a.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"}),a.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function rnn(e){return a.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[a.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),a.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),a.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),a.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),a.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),a.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function snn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.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"}),a.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 vle(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function ann(e){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[a.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"}),a.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 onn({agentId:e}){return e==="trae"?a.jsx("img",{src:Ktn,alt:"","aria-hidden":"true"}):e==="claude-code"?a.jsx(rnn,{}):a.jsx(snn,{})}function xle(e){return e instanceof DOMException&&e.name==="AbortError"}function wle(e,t){return e instanceof Error&&e.message?e.message:t}function lnn({onBack:e}){var R;const{t}=Te("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[o,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 A=new AbortController;return s(!0),l(null),Htn(A.signal).then(N=>{if(A.signal.aborted)return;i(N);const P=N.agents.filter(I=>I.available);f(I=>{const D=P.filter(_=>I.has(_.id));return new Set((D.length?D:P.slice(0,1)).map(_=>_.id))}),m(I=>{const D=N.skills.filter(_=>I.has(_.id));return new Set((D.length?D:N.skills).map(_=>_.id))})}).catch(N=>{!xle(N)&&!A.signal.aborted&&(i(null),l(wle(N,"")))}).finally(()=>{A.signal.aborted||s(!1)}),()=>A.abort()},[c]),p.useEffect(()=>()=>{var A;return(A=O.current)==null?void 0:A.abort()},[]);const k=p.useMemo(()=>(n==null?void 0:n.agents.filter(A=>A.available&&d.has(A.id)))||[],[n,d]),S=p.useMemo(()=>(n==null?void 0:n.skills.filter(A=>h.has(A.id)))||[],[n,h]),E=!!(!v&&k.length&&S.length),C=(A,N)=>{!N||v||(x(null),f(P=>{const I=new Set(P);return I.has(A)?I.delete(A):I.add(A),I}))},j=A=>{v||(x(null),m(N=>{const P=new Set(N);return P.has(A)?P.delete(A):P.add(A),P}))},T=async()=>{var N;if(!E)return;(N=O.current)==null||N.abort();const A=new AbortController;O.current=A,y(!0),x(null);try{const P=await Wtn({agents:k.map(D=>D.id),skills:S.map(D=>D.id)},A.signal);if(A.signal.aborted)return;const I=P.installations;x({tone:"success",agentCount:k.length,skillCount:S.length,installations:I})}catch(P){!xle(P)&&!A.signal.aborted&&x({tone:"error",message:wle(P,"")})}finally{O.current===A&&(O.current=null),A.signal.aborted||y(!1)}};return a.jsxs("section",{className:"coding-agents-page",children:[a.jsxs("header",{className:"coding-agents-header",children:[a.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:a.jsx(nnn,{})}),a.jsx(inn,{className:"coding-agents-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("codingAgents.title")}),a.jsx("p",{children:t("codingAgents.description")})]})]}),a.jsx("div",{className:"coding-agents-scroll",children:a.jsxs("div",{className:"coding-agents-content",children:[a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-section-heading",children:[a.jsxs("div",{children:[a.jsx("span",{children:"1"}),a.jsx("h2",{children:t("codingAgents.clients.title")})]}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?a.jsxs("div",{className:"coding-agents-inline-state",children:[a.jsx("i",{}),t("codingAgents.clients.detecting")]}):o!==null?a.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[a.jsx("span",{children:o||t("codingAgents.errors.detect")}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),children:t("codingAgents.retry")})]}):a.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(A=>a.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(A.id)?"is-selected":""}`,"aria-pressed":d.has(A.id),disabled:!A.available||v,onClick:()=>C(A.id,A.available),title:A.available?A.name:A.reason,children:[a.jsx("span",{className:`coding-agents-agent-mark is-${A.id}`,children:a.jsx(onn,{agentId:A.id})}),a.jsxs("span",{className:"coding-agents-agent-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("small",{children:A.available?A.version||t("codingAgents.clients.detected"):A.reason})]}),a.jsx("span",{className:`coding-agents-status ${A.available?"is-ready":""}`,children:A.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),a.jsx("span",{className:"coding-agents-check",children:a.jsx(vle,{})})]},A.id))})]}),a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[a.jsx("div",{className:"coding-agents-section-heading",children:a.jsxs("div",{children:[a.jsx("span",{children:"2"}),a.jsx("h2",{children:t("codingAgents.skills.title")})]})}),a.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(A=>a.jsxs("div",{className:`coding-agents-skill ${h.has(A.id)?"is-selected":""}`,children:[a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:h.has(A.id),onChange:()=>j(A.id),disabled:v}),a.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:a.jsx(vle,{})}),a.jsxs("span",{children:[a.jsx("strong",{children:t(`codingAgents.skills.items.${A.id}.name`,{defaultValue:A.name})}),a.jsx("small",{children:t(`codingAgents.skills.items.${A.id}.description`,{defaultValue:A.description})})]})]}),a.jsx("button",{type:"button",onClick:()=>b(A),children:t("codingAgents.skills.viewFiles")})]},A.id))}),a.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-global-heading",children:[a.jsx(ann,{}),a.jsxs("div",{children:[a.jsx("strong",{children:t("codingAgents.global.title")}),a.jsx("span",{children:t("codingAgents.global.description")})]})]}),k.length?a.jsx("dl",{children:k.map(A=>a.jsxs("div",{children:[a.jsx("dt",{children:A.name}),a.jsx("dd",{children:A.globalSkillsPath})]},A.id))}):a.jsx("p",{children:t("codingAgents.global.empty")})]})]}),w?a.jsxs("div",{className:`coding-agents-result is-${w.tone}`,role:w.tone==="error"?"alert":"status",children:[a.jsx("strong",{children:w.tone==="success"?t("codingAgents.success",{agentCount:w.agentCount,skillCount:w.skillCount}):w.message||t("codingAgents.errors.configure")}),(R=w.installations)!=null&&R.length?a.jsx("ul",{children:w.installations.map(A=>a.jsxs("li",{children:[A.agentName," · ",t(`codingAgents.skills.items.${A.skillId}.name`,{defaultValue:A.skill})," → ",A.displayPath]},`${A.agent}:${A.skillId}`))}):null]}):null,a.jsxs("div",{className:"coding-agents-actions",children:[a.jsx("span",{children:k.length?t("codingAgents.selection",{agentCount:k.length,skillCount:S.length}):t("codingAgents.selectClient")}),a.jsx("button",{type:"button",onClick:()=>void T(),disabled:!E,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?a.jsx(tnn,{skill:g,onClose:()=>b(null)}):null]})}function cnn(e){return a.jsxs("span",{className:"studio-radio__control",children:[a.jsx("input",{...e,className:"studio-radio__input",type:"radio"}),a.jsx("span",{className:"studio-radio__box","aria-hidden":"true",children:a.jsx("span",{className:"studio-radio__dot"})})]})}function unn({label:e,className:t="",...n}){return a.jsxs("label",{className:`studio-radio ${t}`.trim(),children:[a.jsx(cnn,{...n}),e!=null&&a.jsx("span",{className:"studio-radio__label",children:e})]})}const Fk={QR_CODE_READY:"QR_CODE_READY",AUTH_SUCCESS:"AUTH_SUCCESS",AUTH_ERROR:"AUTH_ERROR",AUTH_CANCEL:"AUTH_CANCEL",WINDOW_CLOSE:"WINDOW_CLOSE"},Ole={WINDOW_BLOCKED:"WINDOW_BLOCKED",CANCELLED:"CANCELLED"},dnn={authOrigin:"https://work.weixin.qq.com",width:950,height:640,debug:!1},fnn=500;class hnn{constructor(){this.handlers=new Map}on(t,n){const i=this.handlers.get(t)||[];return i.push(n),this.handlers.set(t,i),this}off(t,n){if(!n)return this.handlers.delete(t),this;const i=this.handlers.get(t);if(i){const r=i.filter(s=>s!==n);r.length>0?this.handlers.set(t,r):this.handlers.delete(t)}return this}emit(t,...n){const i=this.handlers.get(t);i&&i.forEach(r=>{try{r(...n)}catch(s){console.error(`[WecomAIBotSDK] Event handler error for "${t}":`,s)}})}removeAll(){this.handlers.clear()}listenerCount(t){var n,i;return(i=(n=this.handlers.get(t))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0}}class Y9e{constructor(){this.authWindow=null,this.pollingTimer=null,this.messageListener=null,this.config={...dnn},this.emitter=new hnn,this.setupMessageListener()}openBotInfoAuthWindow(t){var n;this.validateOptions(t),this.mergeConfig(t);const i=t.state||this.generateState(),r=this.buildAuthUrl(t.source,i),s=this.buildWindowFeatures();if(this.authWindow=window.open(r,"WecomAIBotAuthWindow",s),!this.authWindow){const o={code:Ole.WINDOW_BLOCKED,message:"弹窗被拦截,请允许弹窗或点击手动打开"};return this.emitter.emit("error",o),(n=t.onError)===null||n===void 0||n.call(t,o),Promise.reject(o)}return this.startPolling(),new Promise((o,l)=>{const c=()=>{this.emitter.off("success",u),this.emitter.off("error",d),this.emitter.off("cancel",f)},u=h=>{c(),o(h)},d=h=>{c(),l(h)},f=()=>{c(),l({code:Ole.CANCELLED,message:"用户取消授权"})};this.emitter.on("success",u),this.emitter.on("error",d),this.emitter.on("cancel",f),t.onCreated&&this.emitter.on("success",t.onCreated),t.onError&&this.emitter.on("error",t.onError)})}closeWindow(){this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),this.authWindow=null,this.stopPolling()}destroy(){this.closeWindow(),this.removeMessageListener(),this.emitter.removeAll(),this.log("SDK destroyed")}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}validateOptions(t){if(!t.source)throw new Error("[WecomAIBotSDK] source is required")}mergeConfig(t){t.authOrigin&&(this.config.authOrigin=t.authOrigin),t.width!=null&&(this.config.width=t.width),t.height!=null&&(this.config.height=t.height),t.debug!=null&&(this.config.debug=t.debug)}buildAuthUrl(t,n){const i=new URLSearchParams({source:t,state:n,timestamp:String(Date.now())});return`${this.config.authOrigin}/ai/qc/gen?${i.toString()}`}buildWindowFeatures(){const{width:t,height:n}=this.config,i=(window.screen.width-t)/2,r=(window.screen.height-n)/2;return[`width=${t}`,`height=${n}`,`left=${i}`,`top=${r}`,"resizable=false","scrollbars=false","status=no","toolbar=no","menubar=no","location=no"].join(",")}generateState(){return`state_${Math.random().toString(36).substring(2,11)}_${Date.now()}`}setupMessageListener(){this.messageListener=t=>{var n;if(t.origin!==this.config.authOrigin){this.log("Message from unknown origin:",t.origin);return}const i=t.data;if(!(!i||!i.type))switch(this.log("Message received:",i.type,i.payload),i.type){case Fk.QR_CODE_READY:{this.emitter.emit("ready",i.payload);break}case Fk.AUTH_SUCCESS:{this.emitter.emit("success",i.payload),this.closeWindow();break}case Fk.AUTH_ERROR:{const r=((n=i.payload)===null||n===void 0?void 0:n.error)||i.payload;this.emitter.emit("error",r),this.closeWindow();break}case Fk.AUTH_CANCEL:{this.emitter.emit("cancel",null),this.closeWindow();break}case Fk.WINDOW_CLOSE:{this.closeWindow();break}}},window.addEventListener("message",this.messageListener)}removeMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}startPolling(){this.stopPolling(),this.pollingTimer=setInterval(()=>{var t;!((t=this.authWindow)===null||t===void 0)&&t.closed&&(this.stopPolling(),this.authWindow=null,this.emitter.emit("cancel",null))},fnn)}stopPolling(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)}log(...t){this.config.debug&&console.log("[WecomAIBotSDK]",...t)}}const Z9e=new Y9e;typeof window<"u"&&(window.WecomAIBotSDK=Z9e);Z9e.destroy();class AS extends Error{constructor(t){super("WeCom authorization failed"),this.code=t}}function pnn(e){if(e.aborted)return Promise.reject(new DOMException("Cancelled","AbortError"));const t=new Y9e;return new Promise((n,i)=>{let r=!1;const s=()=>{r=!0,clearTimeout(c),e.removeEventListener("abort",l),t.destroy()},o=u=>{r||(s(),i(u))},l=()=>o(new DOMException("Cancelled","AbortError")),c=setTimeout(()=>o(new AS("AUTH_TIMEOUT")),3e5);e.addEventListener("abort",l,{once:!0});try{t.openBotInfoAuthWindow({source:"mpa-agent",state:crypto.randomUUID(),debug:!1}).then(u=>{if(!r){if(typeof(u==null?void 0:u.botid)!="string"||!u.botid.trim()||typeof(u==null?void 0:u.secret)!="string"||!u.secret.trim()){o(new AS("INVALID_RESULT"));return}s(),n({botId:u.botid.trim(),secret:u.secret.trim()})}},u=>{const d=u&&typeof u=="object"&&"code"in u&&typeof u.code=="string"?u.code:"FAILED";o(new AS(d))})}catch{o(new AS("FAILED"))}})}function mnn({runtimeId:e,region:t,capability:n,renderPanel:i}){const{t:r}=Te("ui"),s=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!0),[g,b]=p.useState(!1),[v,y]=p.useState(""),[w,x]=p.useState(0),O=p.useRef(null),k=p.useRef(null),S=p.useRef(void 0),E=o.find(T=>T.appId===c);p.useEffect(()=>{const T=new AbortController;return O.current=T,m(!0),y(""),Q9e(s,T.signal).then(R=>{if(T.signal.aborted)return;l(R);const A=S.current;u(N=>{const P=A??N;return R.some(I=>I.appId===P)?P:R.length===1?R[0].appId:""}),S.current=void 0}).catch(R=>{T.signal.aborted||y(r(R instanceof fd&&[401,403].includes(R.status)?"channels.unauthorized":"channels.accountsFailed"))}).finally(()=>{T.signal.aborted||m(!1)}),()=>T.abort()},[s,w,r]),p.useEffect(()=>()=>{var T,R;(T=O.current)==null||T.abort(),(R=k.current)==null||R.abort()},[]);function C(T){S.current=T,f(!1),x(R=>R+1)}async function j(){if(!E||g||k.current)return;const T=new AbortController;k.current=T,b(!0),y("");try{await Ec(s,`/feishu/accounts/${encodeURIComponent(E.appId)}`,{method:"PATCH",body:JSON.stringify({enabled:!E.enabled}),signal:T.signal}),T.signal.aborted||C(E.appId)}catch(R){T.signal.aborted||y(r(R instanceof fd&&[401,403].includes(R.status)?"channels.unauthorized":"channels.requestFailed"))}finally{k.current===T&&(k.current=null),T.signal.aborted||b(!1)}}return a.jsxs("section",{className:"runtime-channels runtime-channels-accounts","aria-label":r("channels.accountsTitle"),"aria-busy":h||g,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:r("channels.accountsTitle")}),a.jsx(Ci,{variant:"outline",size:"compact",disabled:g||h,onClick:()=>C(c),children:r("channels.refresh")})]}),h&&a.jsx("p",{role:"status",children:a.jsx(cn,{children:r("channels.loading")})}),v&&a.jsxs("div",{role:"alert",className:"aw-integration-error",children:[a.jsx("span",{children:v}),a.jsx(Ci,{variant:"outline",size:"compact",disabled:g||h,onClick:()=>C(c),children:r("common.retry")})]}),a.jsxs("div",{className:"runtime-channels-account-actions",children:[a.jsxs("label",{className:"runtime-channels-account-select",children:[r("channels.account"),a.jsx(ML,{"aria-label":r("channels.account"),value:c,disabled:g||h||!!v,options:[{value:"",label:r("channels.selectAccount")},...o.map(T=>({value:T.appId,label:`${T.appName||T.appId} | ${T.enabled?r("channels.accountEnabled"):r("channels.accountDisabled")}`,description:T.appName?T.appId:void 0}))],onChange:T=>{f(!1),u(T.target.value)}})]}),a.jsx(Ci,{size:"compact",disabled:g||h||!!v||!n.bindingReady,onClick:()=>f(!0),children:r("channels.addAccount")}),E&&!d&&a.jsx(Ci,{variant:"outline",size:"compact",disabled:g||h||!!v,onClick:()=>void j(),children:r(E.enabled?"channels.disableAccount":"channels.enableAccount")})]}),!h&&!v&&!o.length&&a.jsx("p",{role:"status",children:r("channels.noAccounts")}),!h&&!v&&!d&&!c&&o.length>0&&a.jsx("p",{role:"status",children:r("channels.selectAccount")}),!h&&!v&&(d||E)&&a.jsxs("div",{children:[d&&a.jsx(Ci,{variant:"ghost",size:"compact",disabled:g,onClick:()=>f(!1),children:r("channels.cancelAddAccount")}),i({accountId:d?void 0:c,accountMode:d?"add":"manage",onBound:C,onDeleted:()=>C(""),onBusyChange:b})]},d?"add":c)]})}const Xv=["feishu","wecom","dingtalk"];function gnn(e){const{t}=Te("ui"),[n,i]=p.useState("feishu"),r=p.useId(),s=p.useRef([]);return a.jsxs("div",{className:"message-channels",children:[e.showHeader!==!1&&a.jsxs("div",{className:"message-channels-header",children:[a.jsx("h2",{children:t("channels.workspaceTitle")}),a.jsx("p",{children:t("channels.workspaceDescription")})]}),a.jsx("div",{className:"message-channels-tabs",role:"tablist","aria-label":t("channels.workspaceTitle"),children:Xv.map((o,l)=>a.jsx("button",{ref:c=>{s.current[l]=c},type:"button",role:"tab",id:`${r}-${o}`,"aria-controls":`${r}-panel`,"aria-selected":n===o,tabIndex:n===o?0:-1,onClick:()=>i(o),onKeyDown:c=>{var d;let u;if(c.key==="ArrowRight")u=(l+1)%Xv.length;else if(c.key==="ArrowLeft")u=(l+Xv.length-1)%Xv.length;else if(c.key==="Home")u=0;else if(c.key==="End")u=Xv.length-1;else return;c.preventDefault(),i(Xv[u]),(d=s.current[u])==null||d.focus()},children:t(`channels.provider_${o}`)},o))}),a.jsx("div",{role:"tabpanel",id:`${r}-panel`,"aria-labelledby":`${r}-${n}`,tabIndex:0,children:a.jsx(J9e,{...e,provider:n},`${e.region}:${e.runtimeId}:${n}`)})]})}function k6({label:e,value:t,complete:n,description:i}){return a.jsxs("div",{className:"runtime-channels-status-card",children:[a.jsx("dt",{children:e}),a.jsxs("dd",{children:[a.jsxs("span",{className:`runtime-channels-status-value${n?" is-complete":""}`,children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),n?a.jsx("path",{d:"m8 12 3 3 5-6"}):a.jsx("path",{d:"M12 7v5l3 2"})]}),t]}),a.jsx("p",{children:i})]})]})}const Aj=new Set(["BOUND","FAILED","EXPIRED"]),bnn=["group_sender","group","group_topic_sender","group_topic"];function J9e({runtimeId:e,region:t,provider:n,accountId:i,accountMode:r,onBound:s,onDeleted:o,onBusyChange:l}){var ve,Se;const{t:c}=Te("ui"),u=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),d=p.useId(),[f,h]=p.useState("quick"),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState([]),[x,O]=p.useState(!1),[k,S]=p.useState(null),[E,C]=p.useState(""),[j,T]=p.useState(""),[R,A]=p.useState(!1),[N,P]=p.useState(!1),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState("group_sender"),[H,q]=p.useState(""),[U,Z]=p.useState(!1),[z,J]=p.useState(!0),[ne,W]=p.useState(0),X=p.useRef(!0),V=p.useRef(null),ae=p.useRef(null),Y=p.useRef(!1),K=`mpa-${n}-binding:${t}:${e}`,te=n==="feishu"&&(!!r||!!((ve=m==null?void 0:m.multiBotChannels)!=null&&ve.includes("feishu")));p.useEffect(()=>(l==null||l(U),()=>l==null?void 0:l(!1)),[U,l]);const ue=(oe,$e=!1)=>{if(!X.current)return;if(oe instanceof AS){const be={WINDOW_BLOCKED:"wecomPopupBlocked",CANCELLED:"wecomAuthCancelled",AUTH_TIMEOUT:"wecomAuthTimeout",INVALID_RESULT:"wecomInvalidResult"}[oe.code]||"wecomAuthFailed";q(c(`channels.${be}`));return}const Ue=oe instanceof fd?oe.status:0;Ue===409&&($e||!te)&&D(!0),q(c(`channels.${Ue===409?$e||!te?"uncertain":"accountConflict":Ue===404?"unsupported":Ue===401||Ue===403?"unauthorized":Ue===503?"configurationError":"requestFailed"}`))};async function fe(oe){if(r==="add"){v(null),w([]);return}const $e=i?`?appId=${encodeURIComponent(i)}`:"",[Ue,be]=await Promise.all([Ec(u,`/${n}/diagnostics${$e}`,{signal:oe}),n==="feishu"?Ec(u,`/chat-permissions?channel=feishu${i?`&appId=${encodeURIComponent(i)}`:""}`,{signal:oe}):Promise.resolve({permissions:[]})]);!oe.aborted&&X.current&&(v(Ue),w(be.permissions))}p.useEffect(()=>{X.current=!0;try{sessionStorage.removeItem(K)}catch{}return()=>{var oe,$e;X.current=!1,(oe=V.current)==null||oe.abort(),($e=ae.current)==null||$e.abort()}},[]),p.useEffect(()=>{var $e;const oe=new AbortController;return J(!0),q(""),g(null),S(null),O(!1),P(!1),($e=ae.current)==null||$e.abort(),(async()=>{var Ue;try{const be=await Ec(u,"/capabilities",{signal:oe.signal});if(oe.signal.aborted)return;if(!be.serverSideBinding||!(be.channels??["feishu"]).includes(n))throw new fd(404);if(g(be),n==="feishu"&&((Ue=be.multiBotChannels)!=null&&Ue.includes("feishu"))&&!r)return;await fe(oe.signal)}catch(be){oe.signal.aborted||ue(be)}finally{oe.signal.aborted||J(!1)}})(),()=>oe.abort()},[u,ne]),p.useEffect(()=>{if(f!=="quick"||!k||Aj.has(k.status)||U)return;const oe=new AbortController;ae.current=oe;const $e=window.setTimeout(()=>{Ec(u,`/${n}/bindings/${encodeURIComponent(k.id)}`,{signal:oe.signal}).then(async Ue=>{oe.signal.aborted||(S(Ue),Ue.lastErrorCode==="REGISTRATION_UNCERTAIN"&&D(!0),Ue.status==="BOUND"&&(r?s==null||s(Ue.appId||void 0):await fe(oe.signal)))}).catch(Ue=>{oe.signal.aborted||ue(Ue)})},Math.max(1,k.pollAfterSeconds)*1e3);return()=>{window.clearTimeout($e),oe.abort()}},[k,u,U,ne,f]);async function se(oe,$e=!1){var be;if(V.current)return;const Ue=new AbortController;V.current=Ue,Z(!0),q(""),(be=ae.current)==null||be.abort();try{await oe(Ue.signal)}catch(ke){Ue.signal.aborted||ue(ke,$e)}finally{V.current===Ue&&(V.current=null,X.current&&Z(!1))}}function me(oe=!1){se(async $e=>{O(!0),oe||S(null);const Ue=await Ec(u,oe&&k?`/${n}/bindings/${encodeURIComponent(k.id)}/retry`:`/${n}/bindings`,{method:"POST",body:"{}",signal:$e});$e.aborted||(S(Ue),Ue.lastErrorCode==="REGISTRATION_UNCERTAIN"&&D(!0),Ue.status==="BOUND"&&(r?s==null||s(Ue.appId||void 0):await fe($e)))},!0)}function Ee(){se(async oe=>{O(!0),P(!1),A(!0),Y.current=!0;try{const $e=await pnn(oe);if(oe.aborted)return;Y.current=!1,A(!1),await Ec(u,"/wecom/bindings",{method:"POST",body:JSON.stringify($e),signal:oe}),oe.aborted||(P(!0),T(""),C(""),await fe(oe))}finally{X.current&&!oe.aborted&&(Y.current=!1,A(!1))}})}const xe=n==="wecom"||!!((Se=m==null?void 0:m.credentialBindingChannels)!=null&&Se.includes(n)),Ne=!!k&&!Aj.has(k.status),We=U||z||I||Ne,Xe=z||U&&!R;function Re(oe){var $e,Ue;oe===f||z||V.current&&!Y.current||(($e=V.current)==null||$e.abort(),V.current=null,Y.current=!1,(Ue=ae.current)==null||Ue.abort(),Z(!1),A(!1),S(null),O(!1),P(!1),C(""),T(""),q(""),h(oe))}const re=oe=>{try{const $e=new URL(oe||"");return $e.protocol==="https:"?$e.href:void 0}catch{return}};if(te&&!r&&m)return a.jsx(mnn,{runtimeId:e,region:t,capability:m,renderPanel:oe=>a.jsx(J9e,{runtimeId:e,region:t,provider:"feishu",...oe})});const ce=n==="wecom"&&m&&a.jsxs(a.Fragment,{children:[a.jsx(_t,{color:"primary",size:"sm",disabled:U||z||I||!m.bindingReady,onClick:Ee,children:c(b!=null&&b.configured?"channels.newQr":"channels.bind")}),R&&a.jsxs(a.Fragment,{children:[a.jsx("span",{role:"status",children:c("channels.wecomAuthorizing")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",onClick:()=>{var oe;(oe=V.current)==null||oe.abort(),Y.current=!1,A(!1)},children:c("channels.cancelAuthorization")})]})]});return a.jsxs("section",{className:"runtime-channels","aria-label":c(`channels.provider_${n}`),"aria-busy":z||U,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:c("channels.providerBindingTitle",{name:c(`channels.provider_${n}`)})}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:U||z,onClick:()=>W(oe=>oe+1),children:c("channels.refresh")})]}),z&&a.jsx("p",{role:"status",children:a.jsx(cn,{children:c("channels.loading")})}),H&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:H}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:U||z,onClick:()=>W(oe=>oe+1),children:c("common.retry")})]}),m&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"runtime-channels-binding-summary",children:[a.jsx("span",{className:`runtime-channels-badge${b!=null&&b.configured?" is-bound":""}`,children:c(b!=null&&b.configured?"channels.connected":"channels.notBound")}),a.jsx("p",{children:b!=null&&b.configured?c("channels.bound",{name:b.appName||b.appId}):c("channels.providerUnbound",{name:c(`channels.provider_${n}`)})})]}),!m.bindingReady&&a.jsx("p",{role:"alert",children:c("channels.keyRequired")}),b&&a.jsxs("dl",{className:"runtime-channels-diagnostics",children:[a.jsx(k6,{label:c("channels.gateway"),value:c(b.gatewayConfigured?"channels.configured":"channels.missing"),complete:b.gatewayConfigured,description:c("channels.gatewayDescription")}),a.jsx(k6,{label:c("channels.route"),value:c(b.routeConfigured?"channels.configured":"channels.missing"),complete:b.routeConfigured,description:c("channels.routeDescription")}),a.jsx(k6,{label:c("channels.delivery"),value:c(`channels.delivery_${b.deliveryHealth}`,{defaultValue:c("channels.delivery_not_observed")}),complete:b.deliveryHealth==="delivered",description:c("channels.deliveryDescription")})]}),!!(b!=null&&b.missingConfiguration.length)&&a.jsx("p",{role:"alert",children:c("channels.missingConfig",{fields:b.missingConfiguration.join(", ")})}),r!=="manage"&&a.jsxs(a.Fragment,{children:[a.jsxs("fieldset",{className:"runtime-channels-methods",children:[a.jsx("legend",{children:c("channels.configurationMethod")}),a.jsx("div",{children:["quick","manual"].map(oe=>a.jsx(unn,{name:`${d}-method`,value:oe,checked:f===oe,disabled:Xe,label:a.jsx("span",{className:"runtime-channels-method-label","data-selected":f===oe,children:c(`channels.${oe}Setup`)}),onChange:()=>Re(oe)},oe))})]}),a.jsx("p",{children:c(f==="quick"?"channels.qrGuidance":"channels.manualGuidance",{name:c(`channels.provider_${n}`)})}),f==="manual"&&(b==null?void 0:b.configured)&&!te&&a.jsx("p",{children:c("channels.manualReplacement")}),f==="manual"&&!xe&&a.jsx("p",{children:c("channels.manualUpgrade",{name:c(`channels.provider_${n}`)})}),f==="manual"&&xe&&a.jsxs("form",{className:"runtime-channels-form","data-channel-binding":!0,onSubmit:oe=>{oe.preventDefault(),!(!E.trim()||!j.trim()||We||!m.bindingReady)&&se(async $e=>{await Ec(u,n==="wecom"?"/wecom/bindings":`/${n}/bindings/manual`,{method:"POST",body:JSON.stringify(n==="wecom"?{botId:E.trim(),secret:j.trim()}:n==="feishu"?{appId:E.trim(),appSecret:j.trim()}:{clientId:E.trim(),clientSecret:j.trim()}),signal:$e}),$e.aborted||(T(""),C(""),r?s==null||s(E.trim()):await fe($e))},!0)},children:[a.jsxs("label",{children:[c(n==="wecom"?"channels.wecomBotId":n==="feishu"?"channels.feishuAppId":"channels.dingtalkClientId"),a.jsx("input",{name:n==="wecom"?"botId":n==="feishu"?"appId":"clientId",value:E,required:!0,autoComplete:"off",disabled:We,onChange:oe=>C(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.nativeEvent.isComposing||oe.nativeEvent.keyCode===229)&&oe.preventDefault()}})]}),a.jsxs("label",{children:[c(n==="wecom"?"channels.wecomSecret":n==="feishu"?"channels.feishuAppSecret":"channels.dingtalkClientSecret"),a.jsx("input",{name:"secret",type:"password",value:j,required:!0,autoComplete:"new-password",disabled:We,onChange:oe=>T(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.nativeEvent.isComposing||oe.nativeEvent.keyCode===229)&&oe.preventDefault()}})]}),a.jsx(_t,{color:"primary",size:"sm",type:"submit",disabled:We||!m.bindingReady||!E.trim()||!j.trim()||I,children:c("channels.bindCredentials")})]})]}),I&&a.jsx("p",{role:"alert",children:c("channels.uncertain")}),a.jsxs("div",{className:"runtime-channels-actions",children:[f==="quick"&&ce,f==="quick"&&n!=="wecom"&&r!=="manage"&&a.jsx(_t,{color:"primary",size:"sm",disabled:U||z||!m.bindingReady||I||!!k&&!Aj.has(k.status),onClick:()=>me(),children:c(k||b!=null&&b.configured||x?"channels.newQr":"channels.bind")}),(b==null?void 0:b.configured)&&a.jsx(_t,{color:"danger",variant:"outline",size:"sm",disabled:U,onClick:()=>{window.confirm(c("channels.confirmUnbind"))&&se(async oe=>{await Ec(u,`?channel=${n}&appId=${encodeURIComponent(b.appId||"")}`,{method:"DELETE",signal:oe}),oe.aborted||(S(null),O(!1),P(!1),D(!1),r?o==null||o():await fe(oe))})},children:c("channels.unbind")})]}),f==="quick"&&(k||x)&&a.jsxs("div",{className:"runtime-channels-binding-progress",role:"status","aria-live":"polite",children:[a.jsx("h3",{children:c("channels.pairingTitle")}),n==="feishu"&&a.jsx("p",{children:c(te?"channels.multiBotPairingDescription":"channels.feishuPairingDescription")}),n==="wecom"&&a.jsx("p",{children:c("channels.wecomPairingDescription")}),n==="wecom"&&N&&a.jsx("p",{children:c("channels.status_BOUND")}),!k&&U&&a.jsx("p",{children:a.jsx(cn,{children:c(n==="wecom"?R?"channels.wecomAuthorizing":"channels.status_REGISTERING":"channels.generatingQr")})}),k&&a.jsxs(a.Fragment,{children:[k.status!=="PENDING"&&a.jsx("p",{children:c(`channels.status_${k.status}`)}),!Aj.has(k.status)&&a.jsx(a.Fragment,{children:re(k.qrCodeImage)&&a.jsx("img",{className:"runtime-channels-qr",src:re(k.qrCodeImage),alt:c("channels.qrAlt"),referrerPolicy:"no-referrer"})}),k.lastErrorCode&&a.jsx("p",{children:k.lastErrorCode==="REGISTRATION_UNCERTAIN"?c("channels.uncertain"):c("channels.bindingFailed")}),k.status==="FAILED"&&k.lastErrorCode!=="REGISTRATION_UNCERTAIN"&&a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:U,onClick:()=>me(!0),children:c("common.retry")})]})]}),n==="feishu"&&r!=="add"&&a.jsxs("section",{className:"runtime-channels-permissions","aria-label":c("channels.groupsTitle"),children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:c("channels.groupsTitle")}),a.jsx("span",{className:"runtime-channels-count",children:y.length})]}),a.jsx("p",{children:c("channels.groupsDescription")}),a.jsxs("form",{className:"runtime-channels-form",onSubmit:oe=>{oe.preventDefault(),!(!_.trim()||U)&&se(async $e=>{await Ec(u,"/chat-permissions",{method:"POST",body:JSON.stringify({channel:n,...i?{appId:i}:{},chatId:_.trim(),groupSessionScope:F}),signal:$e}),$e.aborted||(L(""),await fe($e))})},children:[a.jsxs("label",{children:[c("channels.chatId"),a.jsx("input",{value:_,required:!0,disabled:U,onChange:oe=>L(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.nativeEvent.isComposing||oe.nativeEvent.keyCode===229)&&oe.preventDefault()}})]}),a.jsxs("label",{children:[c("channels.scope"),a.jsx(ML,{style:{width:"100%",minWidth:0,background:"hsl(var(--background))",color:"hsl(var(--foreground))",border:"1px solid hsl(var(--border))"},value:F,disabled:U,options:bnn.map(oe=>({value:oe,label:c(`channels.scope_${oe}`)})),onChange:oe=>M(oe.target.value)})]}),a.jsx(_t,{color:"primary",size:"sm",type:"submit",disabled:U||!_.trim(),children:c("channels.saveGroup")})]}),!y.length&&a.jsx("p",{className:"runtime-channels-empty",children:c("channels.noGroups")}),a.jsx("ul",{className:"runtime-channels-groups",children:y.map(oe=>a.jsxs("li",{children:[a.jsxs("span",{children:[oe.chatName||oe.chatId," |"," ",c(`channels.scope_${oe.groupSessionScope||"group"}`)]}),a.jsx(_t,{color:"danger",variant:"ghost",size:"sm",className:"runtime-channels-remove-group",disabled:U,"aria-label":c("channels.removeGroup",{name:oe.chatName||oe.chatId}),onClick:()=>void se(async $e=>{await Ec(u,`/chat-permissions?channel=${n}&chat_id=${encodeURIComponent(oe.chatId)}${i?`&appId=${encodeURIComponent(i)}`:""}`,{method:"DELETE",signal:$e}),await fe($e)}),children:a.jsx(wT,{})})]},`${oe.appId||i||""}:${oe.chatId}`))})]})]})]})}const Bk=e=>`${e.region}:${e.runtimeId}`;function ynn({role:e,runtimeScope:t,onBack:n}){const{t:i}=Te("automations"),r=e==="admin"||e==="super_admin";return a.jsxs("div",{className:"mpa-channels-page",children:[a.jsxs("header",{className:"mpa-channels-header",children:[a.jsx("button",{type:"button",className:"mpa-channels-back","aria-label":i("backToAutomations"),onClick:n,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m14 6-6 6 6 6"})})}),a.jsx(U9e,{className:"mpa-channels-icon"}),a.jsxs("div",{children:[a.jsx("h1",{children:i("cards.mpa-channels.name")}),a.jsx("p",{children:i("cards.mpa-channels.description")})]})]}),a.jsx("div",{className:"mpa-channels-scroll",children:r?a.jsx(vnn,{runtimeScope:t},`${e}:${t}`):a.jsx("p",{className:"mpa-channels-notice",role:"status",children:i("mpaChannels.unauthorized")})})]})}function vnn({runtimeScope:e}){const{t,i18n:n}=Te("automations"),[i,r]=p.useState([]),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(!1),[b,v]=p.useState(null),y=p.useRef(null),w=p.useRef("");async function x(E=""){var j;(j=y.current)==null||j.abort();const C=new AbortController;y.current=C,h(!0),v(null),w.current=E;try{const T=await z0({agentCategory:"mpa",scope:e,region:"all",pageSize:100,nextToken:E||void 0,signal:C.signal});if(C.signal.aborted)return;const R=T.runtimes.filter(A=>A.runtimeId&&A.region&&(A.agentCategory==="mpa"||A.agentCategory===void 0));r(A=>[...new Map((E?[...A,...R]:R).map(N=>[Bk(N),N])).values()]),E||o(A=>R.some(N=>Bk(N)===A)?A:""),d(T.nextToken),g(!0)}catch(T){if(C.signal.aborted)return;const R=T instanceof ID&&(T.status===401||T.status===403);v(R?"unauthorized":"loadFailed"),R&&(r([]),o(""),d(""),g(!1),w.current="")}finally{C.signal.aborted||h(!1)}}p.useEffect(()=>(x(),()=>{var E;return(E=y.current)==null?void 0:E.abort()}),[]);const O=i.find(E=>Bk(E)===s),k=l.trim().toLocaleLowerCase(),S=i.filter(E=>`${E.name} ${E.runtimeId} ${E.region}`.toLocaleLowerCase().includes(k)).map(E=>{var j,T;const C=BT(E.createdAt,Date.now(),n.resolvedLanguage||n.language);return{value:Bk(E),label:E.name||E.runtimeId,description:((j=E.description)==null?void 0:j.trim())||t("mpaChannels.noDescription"),metadata:`${t("mpaChannels.optionMetadata",{creator:((T=E.author)==null?void 0:T.trim())||t("mpaChannels.unknownCreator"),createdAt:C})} -${E.region} · ${E.runtimeId}`}});return a.jsxs("div",{className:"mpa-channels-content",children:[a.jsxs("section",{className:"mpa-channels-picker","aria-label":t("mpaChannels.selectAgent"),children:[a.jsxs("div",{className:"mpa-channels-picker-heading",children:[a.jsx("h2",{children:t("mpaChannels.selectAgent")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(),children:t("mpaChannels.refresh")})]}),a.jsx(xf,{ariaLabel:t("mpaChannels.selectAgent"),placeholder:t("mpaChannels.chooseAgent"),value:s,valueLabel:(O==null?void 0:O.name)||(O==null?void 0:O.runtimeId),options:S,disabled:!i.length,searchValue:l,searchPlaceholder:t("mpaChannels.search"),emptyMessage:t("mpaChannels.noMatches"),onSearchChange:c,onChange:o}),O&&a.jsxs("p",{className:"mpa-channels-target",children:[O.region," · ",O.runtimeId]}),f&&a.jsx(cn,{as:"p",role:"status",children:t("mpaChannels.loading")}),b&&a.jsxs("div",{className:"mpa-channels-error",role:"alert",children:[a.jsx("p",{children:t(`mpaChannels.${b}`)}),a.jsx("button",{type:"button",className:"mpa-channels-action",onClick:()=>void x(w.current),children:t("mpaChannels.retry")})]}),!f&&!b&&m&&!i.length&&!u&&a.jsx("p",{role:"status",children:t("mpaChannels.empty")}),u&&a.jsxs("div",{className:"mpa-channels-pagination",children:[a.jsx("p",{children:t("mpaChannels.moreAvailable")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(u),children:t("mpaChannels.loadMore")})]})]}),O?a.jsx(gnn,{runtimeId:O.runtimeId,region:O.region,showHeader:!1},Bk(O)):m&&i.length>0?a.jsx("p",{className:"mpa-channels-notice",role:"status",children:t("mpaChannels.chooseHint")}):null]})}async function TK(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function xnn(e){const t=await yn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await TK(t,Q("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function wnn(e){const t=await yn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await TK(t,Q("websiteIntegration.createFailed"));return t.json()}async function Onn(e){const t=await yn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await TK(t,Q("websiteIntegration.deleteFailed"))}function knn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.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 kle(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.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"}),a.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Snn(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 Enn(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await z0({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 Cnn({onBack:e}){const{t,i18n:n}=Te("websiteIntegration"),[i,r]=p.useState([]),[s,o]=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 R=new AbortController;return g(!0),O(""),Promise.all([xnn(R.signal),Enn(R.signal)]).then(([A,N])=>{var I;if(R.signal.aborted)return;r(A),o(N),d(((I=A[0])==null?void 0:I.id)??"");const P=N[0];P&&c(`${P.region}::${P.runtimeId}`)}).catch(A=>{R.signal.aborted||O(A instanceof Error?A.message:t("errors.load"))}).finally(()=>{R.signal.aborted||g(!1)}),()=>R.abort()},[t]);const k=p.useMemo(()=>s.map(R=>({value:`${R.region}::${R.runtimeId}`,label:R.name||R.runtimeId,description:`${R.region} · ${R.status}`,runtime:R})),[s]),S=p.useMemo(()=>new Map(k.map(R=>[R.value,R.runtime])),[k]),E=i.find(R=>R.id===u)??i[0],C=E?` - + +
diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index 11f00d91e..1def7bcaf 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -53,7 +53,7 @@ Response details: {{response}}`,errorWithRawResponse:`{{context}} 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",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",listSessionsFailed:"Failed to load sessions",mpaOperationFailed:"Failed to apply the MPA Runtime profile",mpaOperationLoadFailed:"Failed to load MPA Runtime operations",mpaRuntimeLegacyAuthUnsupported:`This MPA Runtime uses an older authentication adapter and cannot list Studio sessions. Update the Runtime image to the current MPA AgentKit build, then refresh this Agent. -{{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",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}} +{{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",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",mpaDeleteUnconfirmed:"The deletion request timed out and Runtime deletion is not confirmed. Cleanup may still be running; refresh and check again later.",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)"},SBe={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},TBe={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},CBe={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"},kBe={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."},OBe={common:nBe,agentkitCli:iBe,cloudRegion:aBe,connections:oBe,feishuBot:sBe,requestError:lBe,runSse:cBe,runtimeLogs:uBe,search:dBe,skills:hBe,sse:fBe,identity:pBe,github:gBe,video:mBe,websiteIntegration:vBe,knowledge:yBe,intelligentDevelopment:bBe,migrations:xBe,sandbox:wBe,client:ABe,newChatCapabilities:SBe,jsonResponse:TBe,workspaceProjects:CBe,developmentRuns:kBe},Zur=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:iBe,client:ABe,cloudRegion:aBe,common:nBe,connections:oBe,default:OBe,developmentRuns:kBe,feishuBot:sBe,github:gBe,identity:pBe,intelligentDevelopment:bBe,jsonResponse:TBe,knowledge:yBe,migrations:xBe,newChatCapabilities:SBe,requestError:lBe,runSse:cBe,runtimeLogs:uBe,sandbox:wBe,search:dBe,skills:hBe,sse:fBe,video:mBe,websiteIntegration:vBe,workspaceProjects:CBe},Symbol.toStringTag,{value:"Module"})),EBe="Agent reviews",_Be="Request access for everyone in your organization",RBe="Close",DBe="Refresh",LBe="Status",MBe="Applicant",IBe="Submitted",PBe="Current version",NBe="Model",BBe="Returned by",$Be="Approved by",FBe="Reviewed",zBe="Agent description",UBe="Application notes",VBe="Return reason",GBe="Review comment",QBe="Return reason (required)",HBe="Content changed after submission; return and submit again",WBe="Withdraw to edit this Agent, then submit a new request to publish it",YBe="Other users will lose access to this Agent. Unpublish it?",qBe="Cancel",jBe="Confirm",XBe="Saving",KBe="Unpublish",ZBe="Withdraw request",JBe="Approve",e7e="Publish for everyone",t7e="Request publication",r7e="Everyone",n7e={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},i7e="Search agents or applicants",a7e="Region",o7e="All statuses",s7e="Agent",l7e="Actions",c7e="Review application",u7e="Application details",d7e="No matching applications",h7e="No Agent review requests",f7e="{{count}} / {{limit}} characters",Jur=Object.freeze(Object.defineProperty({__proto__:null,actions:l7e,agent:s7e,all:o7e,approve:JBe,approvedBy:$Be,cancel:qBe,close:RBe,comment:GBe,confirm:jBe,contentChanged:HBe,default:{title:EBe,dialogDescription:_Be,close:RBe,refresh:DBe,statusTitle:LBe,submitter:MBe,submittedAt:IBe,version:PBe,model:NBe,returnedBy:BBe,approvedBy:$Be,reviewedAt:FBe,description:zBe,message:UBe,reason:VBe,comment:GBe,reasonRequired:QBe,contentChanged:HBe,withdrawConfirm:WBe,unpublishConfirm:YBe,cancel:qBe,confirm:jBe,saving:XBe,unpublish:KBe,withdraw:ZBe,return:"Return",approve:JBe,publish:e7e,submit:t7e,private:"Private",enterprise:r7e,status:n7e,search:i7e,region:a7e,all:o7e,agent:s7e,actions:l7e,review:c7e,details:u7e,noMatches:d7e,empty:h7e,textCount:f7e},description:zBe,details:u7e,dialogDescription:_Be,empty:h7e,enterprise:r7e,message:UBe,model:NBe,noMatches:d7e,publish:e7e,reason:VBe,reasonRequired:QBe,refresh:DBe,region:a7e,returnedBy:BBe,review:c7e,reviewedAt:FBe,saving:XBe,search:i7e,status:n7e,statusTitle:LBe,submit:t7e,submittedAt:IBe,submitter:MBe,textCount:f7e,title:EBe,unpublish:KBe,unpublishConfirm:YBe,version:PBe,withdraw:ZBe,withdrawConfirm:WBe},Symbol.toStringTag,{value:"Module"})),p7e={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},g7e={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."}},m7e={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"}},v7e={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},y7e={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."},b7e={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},x7e={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"}},w7e={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."},A7e={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},S7e={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"},T7e={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},C7e={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."},k7e={volcengine:"Volcengine"},O7e={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"},_7e={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},R7e={actions:p7e,addAgent:g7e,approval:m7e,common:v7e,conversation:y7e,credentials:b7e,dialogs:x7e,errors:w7e,feedback:A7e,greetings:S7e,loading:T7e,oauth:C7e,providers:k7e,sandbox:O7e,titles:E7e,workspaceProjectEntry:_7e},edr=Object.freeze(Object.defineProperty({__proto__:null,actions:p7e,addAgent:g7e,approval:m7e,common:v7e,conversation:y7e,credentials:b7e,default:R7e,dialogs:x7e,errors:w7e,feedback:A7e,greetings:S7e,loading:T7e,oauth:C7e,providers:k7e,sandbox:O7e,titles:E7e,workspaceProjectEntry:_7e},Symbol.toStringTag,{value:"Module"})),D7e="Automations",L7e="Connect development tools and extend your Agents with automated workflows",M7e="Search automations",I7e="Automation categories",P7e={development:"Development",channels:"Messaging channels"},N7e="{{category}} automations",B7e="Open {{name}}",$7e="Available only in local deployments",F7e="No matching automations",z7e="Try searching for another name",U7e="Back to automations",V7e={"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."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"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"}}},Q7e={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."}},H7e={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},W7e={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."}},tdr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:U7e,cards:V7e,categories:P7e,categoriesLabel:I7e,codingAgents:Q7e,default:{title:D7e,description:L7e,search:M7e,categoriesLabel:I7e,categories:P7e,resultsLabel:N7e,open:B7e,localOnly:$7e,emptyTitle:F7e,emptyDescription:z7e,backToAutomations:U7e,cards:V7e,github:G7e,codingAgents:Q7e,mpaChannels:H7e,feishu:W7e},description:L7e,emptyDescription:z7e,emptyTitle:F7e,feishu:W7e,github:G7e,localOnly:$7e,mpaChannels:H7e,open:B7e,resultsLabel:N7e,search:M7e,title:D7e},Symbol.toStringTag,{value:"Module"})),Y7e={"zh-CN":"简体中文","en-US":"English"},rdr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:Y7e},languageNames:Y7e},Symbol.toStringTag,{value:"Module"})),q7e={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"},j7e={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}}"},X7e={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.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},K7e={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"},Z7e={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}}"},J7e={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",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"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},e$e={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",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},t$e={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"},r$e={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},n$e={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},i$e={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"},a$e={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},o$e={annotation:q7e,media:j7e,runtimeLogs:X7e,trace:K7e,share:Z7e,blocks:J7e,tokenUsage:e$e,addAgentKit:t$e,composer:r$e,invocation:n$e,visualization:i$e,markdown:a$e},ndr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:t$e,annotation:q7e,blocks:J7e,composer:r$e,default:o$e,invocation:n$e,markdown:a$e,media:j7e,runtimeLogs:X7e,share:Z7e,tokenUsage:e$e,trace:K7e,visualization:i$e},Symbol.toStringTag,{value:"Module"})),s$e={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"},l$e={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},c$e={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"}},u$e={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. @@ -68,7 +68,7 @@ Summarize the result in three points`,preview:"{{count}} cases will be added",co 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"}},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"}},K9e={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."},ddr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Y9e,agentWorkspace:q9e,approval:G9e,commands:X9e,common:$9e,composer:Q9e,default:{common:$9e,tool:F9e,threads:z9e,permissions:U9e,workspace:V9e,approval:G9e,composer:Q9e,launch:H9e,session:W9e,agentDetails:Y9e,agentWorkspace:q9e,handoff:j9e,commands:X9e,taskNotice:K9e},handoff:j9e,launch:H9e,permissions:U9e,session:W9e,taskNotice:K9e,threads:z9e,tool:F9e,workspace:V9e},Symbol.toStringTag,{value:"Module"})),Z9e={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."},J9e={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"},eze={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},tze={cancel:"Cancel",close:"Close confirmation dialog"},hdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:J9e,confirm:tze,default:{login:Z9e,authExpired:J9e,navbar:eze,confirm:tze},login:Z9e,navbar:eze},Symbol.toStringTag,{value:"Module"})),rze={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"}},nze={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"},ize={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"},fdr=Object.freeze(Object.defineProperty({__proto__:null,account:rze,default:{account:rze,navigation:nze,history:ize},history:ize,navigation:nze},Symbol.toStringTag,{value:"Module"})),aze={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."},oze={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},sze={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={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"},cze={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)"},uze={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."},dze={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"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={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"},fze={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"},pze={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"},gze={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",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},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",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},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",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},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",retryOperation:"Retry operation",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"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},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",loadMpaDeletePreview:"Unable to load MPA delete preview",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",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",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"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",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."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={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"},xze={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."},wze={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"},Aze={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"},Sze={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."},Tze={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"},Cze={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.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",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",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},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}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",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."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",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"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={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"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},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"},Rze={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"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA 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.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},Lze={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}}"},Mze={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"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={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"},xUe={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"},wUe={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"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={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"},HUe={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"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={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"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={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"},jUe={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"},XUe={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}}"},KUe={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}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={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 is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",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)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",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",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},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.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={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."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={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"},cze={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)"},uze={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."},dze={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"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={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"},fze={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"},pze={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"},gze={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",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},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",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},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",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},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",retryOperation:"Retry operation",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"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},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",loadMpaDeletePreview:"Unable to load MPA delete preview",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",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",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"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",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."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={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"},xze={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."},wze={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"},Aze={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"},Sze={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."},Tze={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"},Cze={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.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",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",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},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}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",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."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",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"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={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"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},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"},Rze={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"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA 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.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},Lze={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}}"},Mze={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"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={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"},xUe={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"},wUe={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"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={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"},HUe={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"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={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"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={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"},jUe={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"},XUe={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}}"},KUe={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}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={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 is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",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)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",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",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},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.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={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."},rVe={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"},nVe={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"},iVe={artifactLibrary:WUe,resourceMetadata:YUe,artifactEdit:qUe,codeBrowser:jUe,search:XUe,developerResources:KUe,library:ZUe,manageAgents:JUe,agentTopology:eVe,sessionEnvironment:tVe,agentKitCli:rVe,studioTools:nVe},ydr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:rVe,agentTopology:eVe,artifactEdit:qUe,artifactLibrary:WUe,codeBrowser:jUe,default:iVe,developerResources:KUe,library:ZUe,manageAgents:JUe,resourceMetadata:YUe,search:XUe,sessionEnvironment:tVe,studioTools:nVe},Symbol.toStringTag,{value:"Module"})),aVe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},oVe={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 返回了无效的终端地址。"},sVe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},lVe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},cVe={autoConfigureFailed:"飞书机器人自动配置失败"},uVe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},dVe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},hVe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},fVe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},pVe={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:"上传技能新版本失败"},gVe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},mVe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},vVe={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"},yVe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},bVe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},xVe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},wVe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},AVe={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:"分析问题选项"}},SVe={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}} 返回了不安全的地址。"},TVe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -76,7 +76,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: {{response}}`,errorWithRawResponse:`{{context}} 响应详情: {{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"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 配置",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",listSessionsFailed:"加载 Session 失败",mpaOperationFailed:"应用 MPA Runtime 配置失败",mpaOperationLoadFailed:"加载 MPA Runtime 操作失败",mpaRuntimeLegacyAuthUnsupported:`该 MPA Runtime 使用旧版鉴权适配,当前无法读取 Studio Session。请将 Runtime 镜像更新到最新 MPA AgentKit 版本后刷新此 Agent。 -{{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",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}} +{{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",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 认证信息格式无效",mpaDeleteUnconfirmed:"删除请求超时,尚未确认 Runtime 已删除。后台可能仍在清理,请稍后刷新并检查。",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:"(响应正文为空)"},CVe={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},kVe={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},OVe={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},EVe={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:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},_Ve={common:aVe,agentkitCli:oVe,cloudRegion:sVe,connections:lVe,feishuBot:cVe,requestError:uVe,runSse:dVe,runtimeLogs:hVe,search:fVe,skills:pVe,sse:gVe,identity:mVe,github:vVe,video:yVe,websiteIntegration:bVe,knowledge:xVe,intelligentDevelopment:wVe,migrations:AVe,sandbox:SVe,client:TVe,newChatCapabilities:CVe,jsonResponse:kVe,workspaceProjects:OVe,developmentRuns:EVe},bdr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:oVe,client:TVe,cloudRegion:sVe,common:aVe,connections:lVe,default:_Ve,developmentRuns:EVe,feishuBot:cVe,github:vVe,identity:mVe,intelligentDevelopment:wVe,jsonResponse:kVe,knowledge:xVe,migrations:AVe,newChatCapabilities:CVe,requestError:uVe,runSse:dVe,runtimeLogs:hVe,sandbox:SVe,search:fVe,skills:pVe,sse:gVe,video:yVe,websiteIntegration:bVe,workspaceProjects:OVe},Symbol.toStringTag,{value:"Module"})),RVe="智能体审核",DVe="申请企业内全员使用,审批后生效",LVe="关闭",MVe="刷新",IVe="状态",PVe="申请人",NVe="申请时间",BVe="当前版本",$Ve="模型",FVe="退回人",zVe="通过人",UVe="审批时间",VVe="智能体描述",GVe="申请说明",QVe="退回理由",HVe="审批意见",WVe="退回理由(必填)",YVe="提交后内容已变化,请退回并重新申请",qVe="撤回后可以修改 Agent,需要公开时重新申请",jVe="取消公开后其他用户将无法继续使用,确定取消公开吗?",XVe="取消",KVe="确认",ZVe="正在保存",JVe="取消公开",eGe="撤回申请",tGe="通过",rGe="直接公开",nGe="申请公开",iGe="全员可见",aGe={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},oGe="搜索智能体或申请人",sGe="地域",lGe="全部状态",cGe="智能体",uGe="操作",dGe="查看并审批",hGe="申请详情",fGe="没有符合条件的申请",pGe="暂无智能体审核申请",gGe="{{count}} / {{limit}} 字",xdr=Object.freeze(Object.defineProperty({__proto__:null,actions:uGe,agent:cGe,all:lGe,approve:tGe,approvedBy:zVe,cancel:XVe,close:LVe,comment:HVe,confirm:KVe,contentChanged:YVe,default:{title:RVe,dialogDescription:DVe,close:LVe,refresh:MVe,statusTitle:IVe,submitter:PVe,submittedAt:NVe,version:BVe,model:$Ve,returnedBy:FVe,approvedBy:zVe,reviewedAt:UVe,description:VVe,message:GVe,reason:QVe,comment:HVe,reasonRequired:WVe,contentChanged:YVe,withdrawConfirm:qVe,unpublishConfirm:jVe,cancel:XVe,confirm:KVe,saving:ZVe,unpublish:JVe,withdraw:eGe,return:"退回",approve:tGe,publish:rGe,submit:nGe,private:"仅自己可见",enterprise:iGe,status:aGe,search:oGe,region:sGe,all:lGe,agent:cGe,actions:uGe,review:dGe,details:hGe,noMatches:fGe,empty:pGe,textCount:gGe},description:VVe,details:hGe,dialogDescription:DVe,empty:pGe,enterprise:iGe,message:GVe,model:$Ve,noMatches:fGe,publish:rGe,reason:QVe,reasonRequired:WVe,refresh:MVe,region:sGe,returnedBy:FVe,review:dGe,reviewedAt:UVe,saving:ZVe,search:oGe,status:aGe,statusTitle:IVe,submit:nGe,submittedAt:NVe,submitter:PVe,textCount:gGe,title:RVe,unpublish:JVe,unpublishConfirm:jVe,version:BVe,withdraw:eGe,withdrawConfirm:qVe},Symbol.toStringTag,{value:"Module"})),mGe={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},vGe={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。"}},yGe={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},bGe={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},xGe={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},wGe={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},AGe={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},SGe={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},TGe={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},CGe={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},kGe={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},OGe={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},EGe={volcengine:"火山引擎"},_Ge={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:"已更新工作空间"},RGe={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},DGe={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},LGe={actions:mGe,addAgent:vGe,approval:yGe,common:bGe,conversation:xGe,credentials:wGe,dialogs:AGe,errors:SGe,feedback:TGe,greetings:CGe,loading:kGe,oauth:OGe,providers:EGe,sandbox:_Ge,titles:RGe,workspaceProjectEntry:DGe},wdr=Object.freeze(Object.defineProperty({__proto__:null,actions:mGe,addAgent:vGe,approval:yGe,common:bGe,conversation:xGe,credentials:wGe,default:LGe,dialogs:AGe,errors:SGe,feedback:TGe,greetings:CGe,loading:kGe,oauth:OGe,providers:EGe,sandbox:_Ge,titles:RGe,workspaceProjectEntry:DGe},Symbol.toStringTag,{value:"Module"})),MGe="自动化",IGe="连接研发工具,为智能体扩展自动化工作流",PGe="搜索自动化",NGe="自动化分类",BGe={development:"研发",channels:"消息渠道"},$Ge="{{category}}自动化列表",FGe="打开{{name}}",zGe="仅本地部署可用",UGe="没有匹配的自动化",VGe="请尝试搜索其他名称",GGe="返回自动化列表",QGe={"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。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},HGe={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 个字符"}}},WGe={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:"没有可预览的文件。"}},YGe={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},qGe={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},Adr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:GGe,cards:QGe,categories:BGe,categoriesLabel:NGe,codingAgents:WGe,default:{title:MGe,description:IGe,search:PGe,categoriesLabel:NGe,categories:BGe,resultsLabel:$Ge,open:FGe,localOnly:zGe,emptyTitle:UGe,emptyDescription:VGe,backToAutomations:GGe,cards:QGe,github:HGe,codingAgents:WGe,mpaChannels:YGe,feishu:qGe},description:IGe,emptyDescription:VGe,emptyTitle:UGe,feishu:qGe,github:HGe,localOnly:zGe,mpaChannels:YGe,open:FGe,resultsLabel:$Ge,search:PGe,title:MGe},Symbol.toStringTag,{value:"Module"})),jGe={"zh-CN":"简体中文","en-US":"English"},Sdr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:jGe},languageNames:jGe},Symbol.toStringTag,{value:"Module"})),XGe={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},KGe={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},ZGe={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:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},JGe={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:"选择左侧的一个调用查看详情"},eQe={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}}"},tQe={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",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 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},rQe={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:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},nQe={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:"连接并添加"},iQe={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},aQe={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},oQe={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},sQe={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},lQe={annotation:XGe,media:KGe,runtimeLogs:ZGe,trace:JGe,share:eQe,blocks:tQe,tokenUsage:rQe,addAgentKit:nQe,composer:iQe,invocation:aQe,visualization:oQe,markdown:sQe},Tdr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:nQe,annotation:XGe,blocks:tQe,composer:iQe,default:lQe,invocation:aQe,markdown:sQe,media:KGe,runtimeLogs:ZGe,share:eQe,tokenUsage:rQe,trace:JGe,visualization:oQe},Symbol.toStringTag,{value:"Module"})),cQe={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},uQe={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},dQe={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},hQe={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 @@ -91,7 +91,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: 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:"接力失败"}},ZWe={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 快捷命令"}},JWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Ldr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jWe,agentWorkspace:XWe,approval:HWe,commands:ZWe,common:zWe,composer:WWe,default:{common:zWe,tool:UWe,threads:VWe,permissions:GWe,workspace:QWe,approval:HWe,composer:WWe,launch:YWe,session:qWe,agentDetails:jWe,agentWorkspace:XWe,handoff:KWe,commands:ZWe,taskNotice:JWe},handoff:KWe,launch:YWe,permissions:GWe,session:qWe,taskNotice:JWe,threads:VWe,tool:UWe,workspace:QWe},Symbol.toStringTag,{value:"Module"})),eYe={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。保留所有权利。"},tYe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},rYe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},nYe={cancel:"取消",close:"关闭确认框"},Mdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:tYe,confirm:nYe,default:{login:eYe,authExpired:tYe,navbar:rYe,confirm:nYe},login:eYe,navbar:rYe},Symbol.toStringTag,{value:"Module"})),iYe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},aYe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},oYe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Idr=Object.freeze(Object.defineProperty({__proto__:null,account:iYe,default:{account:iYe,navigation:aYe,history:oYe},history:oYe,navigation:aYe},Symbol.toStringTag,{value:"Module"})),sYe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},lYe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},cYe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={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}} 个文件"},hYe={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:"所有方案均创建失败,可分别重试。"},fYe={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 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={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:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={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 未配置用户池"},vYe={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:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},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:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},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:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",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 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},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:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",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,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={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:"当前没有可选择的自定义环境。"},SYe={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:"日志"},TYe={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"},CYe={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 名称一致。"},kYe={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:"重新尝试"},OYe={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 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",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:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},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}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",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:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={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"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},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:"查看日志"},LYe={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:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},IYe={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}}"},PYe={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:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={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 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={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:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={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:"查看和编辑项目源码"},Zqe={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}}"},Jqe={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}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={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}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={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 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={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}} 个文件"},hYe={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:"所有方案均创建失败,可分别重试。"},fYe={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 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={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:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={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 未配置用户池"},vYe={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:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},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:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},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:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",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 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},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:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",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,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={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:"当前没有可选择的自定义环境。"},SYe={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:"日志"},TYe={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"},CYe={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 名称一致。"},kYe={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:"重新尝试"},OYe={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 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",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:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},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}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",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:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={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"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},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:"查看日志"},LYe={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:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",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:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},IYe={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}}"},PYe={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:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={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 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={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:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={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:"查看和编辑项目源码"},Zqe={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}}"},Jqe={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}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={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}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={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 环境。"},ije={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 终端"},aje={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:"添加"},oje={artifactLibrary:qqe,resourceMetadata:jqe,artifactEdit:Xqe,codeBrowser:Kqe,search:Zqe,developerResources:Jqe,library:eje,manageAgents:tje,agentTopology:rje,sessionEnvironment:nje,agentKitCli:ije,studioTools:aje},Fdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:ije,agentTopology:rje,artifactEdit:Xqe,artifactLibrary:qqe,codeBrowser:Kqe,default:oje,developerResources:Jqe,library:eje,manageAgents:tje,resourceMetadata:jqe,search:Zqe,sessionEnvironment:nje,studioTools:aje},Symbol.toStringTag,{value:"Module"})),sje=["zh-CN","en-US"],nle="en-US",zdr="agentkit.studio.locale",Udr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function ile(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=sje.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Vdr(){if(typeof window>"u")return null;try{return ile(window.localStorage.getItem(zdr))}catch{return null}}function Gdr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Qdr(){const t=Vdr();if(t)return t;for(const e of Gdr()){const r=ile(e);if(r)return r}return nle}function lje(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=Udr[t].dir)}const vn=t=>typeof t=="string",R6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},ale=t=>t==null?"":String(t),Hdr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Wdr=/###/g,cje=t=>t&&t.includes("###")?t.replace(Wdr,"."):t,uje=t=>!t||vn(t),D6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=D6(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=D6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=D6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Ydr=(t,e,r,n)=>{const{obj:i,k:a}=D6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},tG=(t,e)=>{const{obj:r,k:n}=D6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},qdr=(t,e,r)=>{const n=tG(t,r);return n!==void 0?n:tG(e,r)},hje=(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]):hje(t[n],e[n],r):t[n]=e[n]);return t},qv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),jdr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Xdr=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>jdr[e]):t;class Kdr{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 Zdr=[" ",",","?","!",";"],Jdr=new Kdr(20),ehr=(t,e,r)=>{e=e||"",r=r||"";const n=Zdr.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Jdr.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},ole=(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,"-"),thr={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 rG{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||thr,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 rG(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new rG(this.logger,e)}}var mm=new rG;class nG{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,d;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=tG(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:ole((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[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),dje(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=tG(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?hje(l,n,a):l={...l,...n},dje(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 pje={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 gje=Symbol("i18next/PATH_KEY");function rhr(){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===gje?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function bA(t,e){const{[gje]:r}=t(rhr()),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 sle=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class iG extends nG{constructor(e,r={}){super(),Hdr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mm.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=sle(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&&!ehr(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=bA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?bA(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 d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?a?{res:`${u}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:h,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=iG.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(h,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,O=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=O);const _=sle(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:sle(O)?O[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=O),this.isValidLookup(g)||(R=!0,g=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&O!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,w&&!I?`${s}${this.pluralResolver.getSuffix(h,i.count,i)}`:s,I?O: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 H;const G=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,G,I,i):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(V,u,z,G,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}`]||O)})}):B(N,s,O))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${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 d=vn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const p=e.match(this.interpolator.nestingRegexp);h=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),d){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;h(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=pje.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"?bA(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),d=u.key;i=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.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);h.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=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,x,v,r);else{let T;f&&(T=this.pluralResolver.getSuffix(x,r.count,r));const C=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&T.startsWith(O)&&w.push(d+T.replace(O,this.options.pluralSeparator)),w.push(d+T),p&&w.push(d+C)),g){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&T.startsWith(O)&&w.push(E+T.replace(O,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 mje{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=L6(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=L6(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),d=[],h=f=>{f&&(this.isSupportedCode(f)?d.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return vn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(e))):vn(e)&&h(this.formatLanguageCode(e)),u.forEach(f=>{d.includes(f)||h(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=d,d.slice()):d}}const vje={zero:0,one:1,two:2,few:3,many:4,other:5},yje={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nhr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=mm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=L6(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!"),yje;if(!e.match(/-|_/))return yje;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)=>vje[i]-vje[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 bje=(t,e,r,n=".",i=!0)=>{let a=qdr(t,e,r);return!a&&i&&vn(r)&&(a=ole(t,r,n),a===void 0&&(a=ole(e,r,n))),a},xje=t=>t.replace(/\$/g,"$$$$");class wje{constructor(e={}){var r;this.logger=mm.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:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Xdr,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?qv(a):o||"{{",this.suffix=s?qv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?qv(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qv(d):"",this.nestingPrefix=f?qv(f):p||qv("$t("),this.nestingSuffix=g?qv(g):m||qv(")"),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=bje(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(bje(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 d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((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 d=="function"){const y=d(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(h){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=ale(o));const v=g.safeValue(o);if(e=e.replace(a[0],xje(v)),h?(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 d=this.nestingOptionsSeparator;if(!l.includes(d))return l;const h=l.split(new RegExp(`${qv(d)}[ ]*{`));let f=`{${h[1]}`;l=h[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}${d}${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(d=>d.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=ale(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,h)=>this.format(d,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],xje(ale(a))),this.regexp.lastIndex=0}return e}}const ihr=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,""),d=s.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Aje=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(L6(n),i),e[o]=s),s(r)}},ahr=t=>(e,r,n)=>t(L6(r),n)(e);class ohr{constructor(e={}){this.logger=mm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?Aje:ahr;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()]=Aje(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:d,formatOptions:h}=ihr(u);if(this.formats[d]){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[d](l,m,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const shr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lhr extends nG{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=mm.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 d=!0;r.forEach(h=>{const f=`${u}|${h}`;!n.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(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=>{Ydr(l.loaded,[a],o),shr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(h=>{s[u][h]===void 0&&(s[u][h]=!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,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&i{this.read(e,r,n,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(d=>s(null,d)).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,d,h,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.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 lle=()=>({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}),Sje=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),aG=()=>{},chr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class M6 extends nG{constructor(e={},r){if(super(),this.options=Sje(e),this.services={},this.logger=mm,this.modules={external:[]},chr(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=lle();this.options={...n,...this.options,...Sje(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?mm.init(i(this.modules.logger),this.options):mm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ohr;const d=new mje(this.options);this.store=new fje(this.options.resources,this.options);const h=this.services;h.logger=mm,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new nhr(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=i(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new wje(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new lhr(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new iG(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=aG),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 s=R6(),l=()=>{const u=(d,h)=>{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(h),r(d,h)};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=aG){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(h=>{h!=="cimode"&&(s.includes(h)||s.push(h))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(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=R6();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=aG),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"&&pje.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 d,h;!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),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,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 d;typeof l!="object"?d=this.options.overloadTranslationOptionHandler([s,l].concat(u)):d={...l},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||n||o.keyPrefix);const f={...this.options,...d};Array.isArray(a)&&!h&&(f.ns=a),typeof d.keyPrefix=="function"&&(d.keyPrefix=bA(d.keyPrefix,f));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=bA(m,f)),`${d.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=bA(s,f)),g=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s),this.t(g,d)};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=R6();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=R6();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 mje(lle());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 M6(e,r);return n.createInstance=M6.createInstance,n}cloneInstance(e={},r=aG){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new M6(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((d,h)=>(d[h]={...l[u][h]},d),l[u]),l),{});a.store=new fje(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...lle().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new wje(u)}return a.translator=new iG(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 Su=M6.createInstance();Su.createInstance,Su.dir,Su.init,Su.loadResources,Su.reloadResources,Su.use,Su.changeLanguage,Su.getFixedT,Su.t,Su.exists,Su.setDefaultNamespace,Su.hasLoadedNamespace,Su.loadNamespaces,Su.loadLanguages;const uhr={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},dhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Tje(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(uhr[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(dhr);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 oG=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,hhr=/<\/?([^\s]+?)[/\s>]/,fhr=/^\s*$/,phr=/^(script|style)$/i,I6="\0",ghr=Object.create(null);function Cje(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(I6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(I6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(I6)>-1&&(e.attrs[r]=n.split(I6).join("<"))}e.children.length&&Cje(e.children)})}function mhr(t,e){const r=e&&e.components||ghr,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;oG.lastIndex=0;let y;for(;y=oG.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(hhr);b.startsWith("",t}}function yhr(t){return t.reduce(function(e,r){return e+kje("",r)},"")}var bhr={parse:mhr,stringify:yhr};const sG=(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);Rd(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)},Oje={},wE=(t,e,r,n)=>{Rd(r)&&Oje[r]||(Rd(r)&&(Oje[r]=new Date),sG(t,e,r,n))},Eje=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},cle=(t,e,r)=>{t.loadNamespaces(e,Eje(t,r))},_je=(t,e,r,n)=>{if(Rd(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return cle(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Eje(t,n))},xhr=(t,e,r={})=>!e.languages||!e.languages.length?(wE(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}}),Rd=t=>typeof t=="string",jv=t=>typeof t=="object"&&t!==null,whr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ahr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Shr=t=>Ahr[t],Rje=t=>t.replace(whr,Shr);let ule={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Rje,transDefaultProps:void 0};const Thr=(t={})=>{ule={...ule,...t}},dle=()=>ule;let Dje;const Chr=t=>{Dje=t},hle=()=>Dje,lG=(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},P6=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?nx(e):e},khr=t=>Array.isArray(t)&&t.every(Y.isValidElement),nx=t=>Array.isArray(t)?t:[t],Ohr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},Ehr=t=>{const e={};if(!t)return e;const r=n=>{nx(n).forEach(a=>{Rd(a)||(lG(a)?r(P6(a)):jv(a)&&!Y.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},fle=(t,e,r,n)=>{if(!t)return"";let i="";const a=nx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Rd(s)){i+=`${s}`;return}if(Y.isValidElement(s)){const{props:u,type:d}=s,h=Object.keys(u).length,f=o.indexOf(d)>-1,p=u.children;if(!p&&f&&!h){i+=`<${d}/>`;return}if(!p&&(!f||h)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&h<=1){const m=Rd(p)?p:fle(p,e,r,n);i+=`<${d}>${m}`;return}const g=fle(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){sG(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(jv(s)){const{format:u,...d}=s,h=Object.keys(d);if(h.length===1){const f=u?`${h[0]}, ${u}`:h[0];i+=`{{${f}}}`;return}sG(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}sG(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},_hr=(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??{},d=x=>{nx(x).forEach(A=>{Rd(A)||(lG(A)?d(P6(A)):jv(A)&&!Y.isValidElement(A)&&Object.assign(u,A))})};d(t);const h=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||h.indexOf(x)>-1,p=bhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=P6(x),T=y(S,w.children,A);return khr(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(Y.cloneElement(x,{key:S},T?void 0:w))):A.push(...Y.Children.map([x],C=>{var E;if(C.type===Y.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])}),Y.createElement(C.type,_,T?null:w)}const O={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(O[_]=C.props[_])}),Y.cloneElement(C,O,T?null:w)}))},y=(x,w,A)=>{const S=nx(x),T=nx(w),C={};return T.reduce((O,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];Rd(U)&&(M[z]=Rje(U))});const I=Object.keys(M).length!==0?Ohr({props:M},D):D,N=Y.isValidElement(I),F=N&&lG(E,!0)&&!E.voidElement,B=l&&jv(I)&&I.dummy&&!N,V=jv(e)&&Object.hasOwnProperty.call(e,E.name);if(Rd(I)){const z=n.services.interpolator.interpolate(I,g,n.language);O.push(z)}else if(lG(I)||F){const z=m(I,E,A);v(I,z,O,_)}else if(B){const z=y(S,E.children,A);v(I,z,O,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,O,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)O.push(Y.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[E.name]=z+1;let U,G=0;for(let q=0;q`);else{const z=y(S,E.children,A);O.push(`<${E.name}>${z}`)}else if(jv(I)&&!N){const z=E.children[0]?P:null;z&&O.push(z)}else v(I,P,O,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:dle().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?O.push(Y.createElement(D,{key:`${E.name}-${_}`},I)):O.push(I)}return O},[])},b=y([{dummy:!0,children:t||[]}],p,nx(t||[]));return P6(b[0])},Lje=(t,e,r)=>{const n=t.key||e,i=Y.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return Y.createElement(Y.Fragment,null,i)}return Y.createElement(a,{key:n})},Rhr=(t,e)=>t.map((r,n)=>Lje(r,n,e)),Dhr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Lje(t[n],n,e)})}),r},Lhr=(t,e,r,n)=>t?Array.isArray(t)?Rhr(t,e):jv(t)?Dhr(t,e):(wE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Mhr=t=>!jv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var B,V,z,U,G,H;const g=d||hle();if(!g)return wE(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=h||g.t.bind(g)||(j=>j),v={...dle(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=Rd(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=fle(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?bA(n):n),{hashTransKey:O}=v,E=n||(O?O(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 _=Ehr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||e!==void 0&&!((H=(G=g.options)==null?void 0:G.interpolation)!=null&&H.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=Lhr(S,R,g,n);let M=D||t,I=null;Mhr(D)&&(I=D,M=t);const N=_hr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?Y.createElement(F,p,N):N}const Phr={type:"3rdParty",init(t){Thr(t.options.react),Chr(t)}},Mje=Y.createContext();class Nhr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function cG({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=Y.useContext(Mje)||{},v=d||g||hle(),y=h||(v==null?void 0:v.t.bind(v));return Ihr({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:h,shouldUnescape:f,...p})}var Ije={exports:{}},Pje={};/** * @license React * use-sync-external-store-shim.production.js @@ -251,7 +251,7 @@ Studio:{{studioUrl}} ]`,g={scope:"string",variants:[d,u,h,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"}}]},O={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[O,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=[O,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 JOr(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 eEr(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function tEr(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:/#/},d={begin:/\{\{/,relevance:0},h={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,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,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,h,t.HASH_COMMENT_MODE]}]};return u.contains=[h,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"},h,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,h]}]}}function rEr(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function nEr(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 iEr(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)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},h={className:"string",contains:[t.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: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,d]})]}]},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=[h,{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:[h,{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,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=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 aEr(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!"],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:t.IDENT_RE+"!?",type:d,keyword:s,literal:l,built_in:u},illegal:""},a]}}const oEr=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_-]*/}}),sEr=["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"],lEr=["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"],cEr=[...sEr,...lEr],uEr=["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(),dEr=["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(),hEr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fEr=["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 pEr(t){const e=oEr(t),r=hEr,n=dEr,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("+cEr.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("+fEr.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:uEr.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 gEr(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function mEr(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"],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"],h=["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=d,g=[...u,...l].filter(A=>!d.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(O=>O.match(/\|\d+$/)||S.includes(O)?O:C(O)?`${O}|0`:O)}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:h},contains:[{scope:"type",match:b(o)},x,y,m,n,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}function knt(t){return t?typeof t=="string"?t:t.source:null}function SN(t){return va("(?=",t,")")}function va(...t){return t.map(r=>knt(r)).join("")}function vEr(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"("+(vEr(t).capture?"":"?:")+t.map(n=>knt(n)).join("|")+")"}const xde=t=>va(/\b/,t,/\w$/.test(t)?/\b/:/\B/),yEr=["Protocol","Type"].map(xde),Ont=["init","self"].map(xde),bEr=["Any","Self"],wde=["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"],Ent=["false","nil","true"],xEr=["assignment","associativity","higherThan","left","lowerThan","none","right"],wEr=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],_nt=["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"],Rnt=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]/),Dnt=Ou(Rnt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ade=va(Rnt,Dnt,"*"),Lnt=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]/),MQ=Ou(Lnt,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Tm=va(Lnt,MQ,"*"),IQ=va(/[A-Z]/,MQ,"*"),AEr=["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\(/,Tm,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],SEr=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function TEr(t){const e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],i={match:[/\./,Ou(...yEr,...Ont)],className:{2:"keyword"}},a={match:va(/\./,Ou(...wde)),relevance:0},o=wde.filter(Oe=>typeof Oe=="string").concat(["_|0"]),s=wde.filter(Oe=>typeof Oe!="string").concat(bEr).map(xde),l={variants:[{className:"keyword",match:Ou(...s,...Ont)}]},u={$pattern:Ou(/\b\w+/,/#\w+/),keyword:o.concat(wEr),literal:Ent},d=[i,a,l],h={match:va(/\./,Ou(..._nt)),relevance:0},f={className:"built_in",match:va(/\b/,Ou(..._nt),/(?=\()/)},p=[h,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Ade},{match:`\\.(\\.|${Dnt})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(Oe="")=>({className:"subst",variants:[{match:va(/\\/,Oe,/[0\\tnr"']/)},{match:va(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(Oe="")=>({className:"subst",match:va(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(Oe="")=>({className:"subst",label:"interpol",begin:va(/\\/,Oe,/\(/),end:/\)/}),T=(Oe="")=>({begin:va(Oe,/"""/),end:va(/"""/,Oe),contains:[w(Oe),A(Oe),S(Oe)]}),C=(Oe="")=>({begin:va(Oe,/"/),end:va(/"/,Oe),contains:[w(Oe),S(Oe)]}),O={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=Oe=>{const Ee=va(Oe,/\//),ue=va(/\//,Oe);return{begin:Ee,end:ue,contains:[...E,{scope:"comment",begin:`#(?!.*${ue})`,end:/$/}]}},L={scope:"regexp",variants:[P("###"),P("##"),P("#"),_]},R={match:va(/`/,Tm,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${MQ}+`},I=[R,D,M],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:SEr,contains:[...v,x,O]}]}},F={scope:"keyword",match:va(/@/,Ou(...AEr),SN(Ou(/\(/,/\s+/)))},B={scope:"meta",match:va(/@/,Tm)},V=[N,F,B],z={match:SN(/\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)/,MQ,"+")},{className:"type",match:IQ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:va(/\s+&\s+/,SN(IQ)),relevance:0}]},U={begin://,keywords:u,contains:[...n,...d,...V,g,z]};z.contains.push(U);const G={match:va(Tm,/\s*:/),keywords:"_|0",relevance:0},H={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",G,...n,L,...d,...p,...v,x,O,...I,...V,z]},j={begin://,keywords:"repeat each",contains:[...n,z]},q={begin:Ou(SN(va(Tm,/\s*:/)),SN(va(Tm,/\s+/,Tm,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Tm}]},ne={begin:/\(/,end:/\)/,keywords:u,contains:[q,...n,...d,...v,x,O,...V,z,H],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,Ou(R.match,Tm,Ade)],className:{1:"keyword",3:"title.function"},contains:[j,ne,e],illegal:[/\[/,/%/]},J={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[j,ne,e],illegal:/\[|%/},ee={match:[/operator/,/\s+/,Ade],className:{1:"keyword",3:"title"}},te={begin:[/precedencegroup/,/\s+/,IQ],className:{1:"keyword",3:"title"},contains:[z],keywords:[...xEr,...Ent],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+/,Tm,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[j,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:IQ},...d],relevance:0}]};for(const Oe of O.variants){const Ee=Oe.contains.find(he=>he.label==="interpol");Ee.keywords=u;const ue=[...d,...p,...v,x,O,...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,...d,...p,...v,x,O,...I,...V,z,H]}}const PQ="[A-Za-z$_][0-9A-Za-z$_]*",Mnt=["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"],Int=["true","false","null","undefined","NaN","Infinity"],Pnt=["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"],Nnt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Bnt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$nt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Fnt=[].concat(Bnt,Pnt,Nnt);function CEr(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:PQ,keyword:Mnt,literal:Int,built_in:Fnt,"variable.language":$nt},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},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+/},h];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:{_:[...Pnt,...Nnt]}},O={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([...Bnt,"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}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},h,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 kEr(t){const e=t.regex,r=CEr(t),n=PQ,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:PQ,keyword:Mnt.concat(l),literal:Int,built_in:Fnt.concat(i),"variable.language":$nt},d={className:"meta",begin:"@"+n},h=(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(d);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([d,a,o,p]),h(r,"shebang",t.SHEBANG()),h(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 OEr(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])|[%&])?/}]},d={className:"label",begin:/^\w+:/},h=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,d,h,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 EEr(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 _Er(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 REr(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 DEr={arduino:hOr,bash:fOr,c:pOr,cpp:gOr,csharp:mOr,css:COr,diff:kOr,go:OOr,graphql:EOr,ini:_Or,java:ROr,javascript:POr,json:NOr,kotlin:$Or,less:WOr,lua:YOr,makefile:qOr,markdown:jOr,objectivec:XOr,perl:KOr,php:ZOr,"php-template":JOr,plaintext:eEr,python:tEr,"python-repl":rEr,r:nEr,ruby:iEr,rust:aEr,scss:pEr,shell:gEr,sql:mEr,swift:TEr,typescript:kEr,vbnet:OEr,wasm:EEr,xml:_Er,yaml:REr};function znt(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)&&znt(r)}),t}class Unt{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Vnt(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function yx(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 LEr="
",Gnt=t=>!!t.scope,MEr=(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 IEr{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=Vnt(e)}openNode(e){if(!Gnt(e))return;const r=MEr(e.scope,{prefix:this.classPrefix});this.span(r)}closeNode(e){Gnt(e)&&(this.buffer+=LEr)}value(){return this.buffer}span(e){this.buffer+=``}}const Qnt=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class Sde{constructor(){this.rootNode=Qnt(),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=Qnt({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=>{Sde._collapse(r)}))}}class PEr extends Sde{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 IEr(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function TN(t){return t?typeof t=="string"?t:t.source:null}function Hnt(t){return BA("(?=",t,")")}function NEr(t){return BA("(?:",t,")*")}function BEr(t){return BA("(?:",t,")?")}function BA(...t){return t.map(r=>TN(r)).join("")}function $Er(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Tde(...t){return"("+($Er(t).capture?"":"?:")+t.map(n=>TN(n)).join("|")+")"}function Wnt(t){return new RegExp(t.toString()+"|").exec("").length-1}function FEr(t,e){const r=t&&t.exec(e);return r&&r.index===0}const zEr=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Cde(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;const i=r;let a=TN(n),o="";for(;a.length>0;){const s=zEr.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 UEr=/\b\B/,Ynt="[a-zA-Z]\\w*",kde="[a-zA-Z_]\\w*",qnt="\\b\\d+(\\.\\d+)?",jnt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Xnt="\\b(0b[01]+)",VEr="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",GEr=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=BA(e,/.*\b/,t.binary,/\b.*/)),yx({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},t)},CN={begin:"\\\\[\\s\\S]",relevance:0},QEr={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[CN]},HEr={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[CN]},WEr={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/},NQ=function(t,e,r={}){const n=yx({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=Tde("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:BA(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},YEr=NQ("//","$"),qEr=NQ("/\\*","\\*/"),jEr=NQ("#","$"),XEr={scope:"number",begin:qnt,relevance:0},KEr={scope:"number",begin:jnt,relevance:0},ZEr={scope:"number",begin:Xnt,relevance:0},JEr={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[CN,{begin:/\[/,end:/\]/,relevance:0,contains:[CN]}]},e_r={scope:"title",begin:Ynt,relevance:0},t_r={scope:"title",begin:kde,relevance:0},r_r={begin:"\\.\\s*"+kde,relevance:0};var BQ=Object.freeze({__proto__:null,APOS_STRING_MODE:QEr,BACKSLASH_ESCAPE:CN,BINARY_NUMBER_MODE:ZEr,BINARY_NUMBER_RE:Xnt,COMMENT:NQ,C_BLOCK_COMMENT_MODE:qEr,C_LINE_COMMENT_MODE:YEr,C_NUMBER_MODE:KEr,C_NUMBER_RE:jnt,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:jEr,IDENT_RE:Ynt,MATCH_NOTHING_RE:UEr,METHOD_GUARD:r_r,NUMBER_MODE:XEr,NUMBER_RE:qnt,PHRASAL_WORDS_MODE:WEr,QUOTE_STRING_MODE:HEr,REGEXP_MODE:JEr,RE_STARTERS_RE:VEr,SHEBANG:GEr,TITLE_MODE:e_r,UNDERSCORE_IDENT_RE:kde,UNDERSCORE_TITLE_MODE:t_r});function n_r(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function i_r(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function a_r(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=n_r,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function o_r(t,e){Array.isArray(t.illegal)&&(t.illegal=Tde(...t.illegal))}function s_r(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 l_r(t,e){t.relevance===void 0&&(t.relevance=1)}const c_r=(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=BA(r.beforeMatch,Hnt(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},u_r=["of","and","for","in","not","or","if","then","parent","list","value"],d_r="keyword";function Knt(t,e,r=d_r){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,Knt(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,h_r(l[0],l[1])]})}}function h_r(t,e){return e?Number(e):f_r(t)?0:1}function f_r(t){return u_r.includes(t.toLowerCase())}const Znt={},$A=t=>{console.error(t)},Jnt=(t,...e)=>{console.log(`WARN: ${t}`,...e)},t_=(t,e)=>{Znt[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Znt[`${t}/${e}`]=!0)},$Q=new Error;function eit(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+=Wnt(e[s-1]);t[r]=o,t[r]._emit=a,t[r]._multi=!0}function p_r(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw $A("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$Q;if(typeof t.beginScope!="object"||t.beginScope===null)throw $A("beginScope must be object"),$Q;eit(t,t.begin,{key:"beginScope"}),t.begin=Cde(t.begin,{joinWith:""})}}function g_r(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw $A("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$Q;if(typeof t.endScope!="object"||t.endScope===null)throw $A("endScope must be object"),$Q;eit(t,t.end,{key:"endScope"}),t.end=Cde(t.end,{joinWith:""})}}function m_r(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function v_r(t){m_r(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),p_r(t),g_r(t)}function y_r(t){function e(o,s){return new RegExp(TN(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+=Wnt(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=e(Cde(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((h,f)=>f>0&&h!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}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,d])=>l.addRule(u,d)),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 d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.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;[i_r,s_r,v_r,c_r].forEach(d=>d(o,s)),t.compilerExtensions.forEach(d=>d(o,s)),o.__beforeBegin=null,[a_r,o_r,l_r].forEach(d=>d(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=Knt(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=TN(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(d){return b_r(d==="self"?o:d)})),o.contains.forEach(function(d){a(d,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=yx(t.classNameAliases||{}),a(t)}function tit(t){return t?t.endsWithParent||tit(t.starts):!1}function b_r(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return yx(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:tit(t)?yx(t,{starts:t.starts?yx(t.starts):null}):Object.isFrozen(t)?yx(t):t}var x_r="11.11.1";class w_r extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}}const Ode=Vnt,rit=yx,nit=Symbol("nomatch"),A_r=7,iit=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:PEr};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||(Jnt(a.replace("{}",N[1])),Jnt("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 d(M,I,N){let F="",B="";typeof I=="object"?(F=M,N=I.ignoreIllegals,B=I.language):(t_("10.7.0","highlight(lang, code, ...args) has been deprecated."),t_("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:h(V.language,V.code,N);return z.code=V.code,R("after:highlight",z),z}function h(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]<=A_r&&(ze+=me),se.startsWith("_"))be+=le[0];else{const oe=Ce.classNameAliases[se]||se;H(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=h(ue.subLanguage,ge,!0,he[ue.subLanguage]),he[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 G(){ue.subLanguage!=null?U():z(),ge=""}function H(Z,le){Z!==""&&(xe.startScope(le),xe.addText(Z),xe.endScope())}function j(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?H(se,K):(ge=se,z(),ge=""),be++}}function q(Z,le){return Z.scope&&typeof Z.scope=="string"&&xe.openNode(Ce.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(H(ge,Ce.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),ge=""):Z.beginScope._multi&&(j(Z.beginScope,le),ge="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function ne(Z,le,be){let ae=FEr(Z.endRe,be);if(ae){if(Z["on:end"]){const K=new Unt(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 Unt(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),G(),!be.returnBegin&&!be.excludeBegin&&(ge=le)),q(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 nit;const K=ue;ue.endScope&&ue.endScope._wrap?(G(),H(le,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(G(),j(ue.endScope,Z)):K.skip?ge+=le:(K.returnEnd||K.excludeEnd||(ge+=le),G(),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&&q(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 G(),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!==nit)return ae}if(le.type==="illegal"&&be==="")return ge+=` `,1;if(ke>1e5&&ke>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 $A(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');const Oe=y_r(Ce);let Ee="",ue=F||Oe;const he={},xe=new s.__emitter(s);te();let ge="",ze=0,we=0,ke=0,Be=!1;try{if(Ce.__emitTokens)Ce.__emitTokens(I,xe);else{for(ue.matcher.considerAll();;){ke++,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:Ode(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:Ode(I),illegal:!1,relevance:0,errorRaised:Z,_emitter:xe,_top:ue};throw Z}}function f(M){const I={value:Ode(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(G=>h(G,M,!1));F.unshift(N);const B=F.sort((G,H)=>{if(G.relevance!==H.relevance)return H.relevance-G.relevance;if(G.language&&H.language){if(C(G.language).supersetOf===H.language)return 1;if(C(H.language).supersetOf===G.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 w_r("One of your code blocks includes unescaped HTML.",M.innerHTML);I=M;const F=I.textContent,B=N?d(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=rit(s,M)}const y=()=>{w(),t_("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){w(),t_("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($A("Language definition for '{}' could not be registered.".replace("{}",M)),i)$A(F);else throw F;N=o}N.name||(N.name=M),e[M]=N,N.rawDefinition=I.bind(null,t),N.aliases&&O(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 O(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 t_("10.7.0","highlightBlock will be removed entirely in v12.0"),t_("10.7.0","Please use highlightElement now."),m(M)}Object.assign(t,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:m,highlightBlock:D,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:A,unregisterLanguage:S,listLanguages:T,getLanguage:C,registerAliases:O,autoDetection:E,inherit:rit,addPlugin:P,removePlugin:L}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=x_r,t.regex={concat:BA,lookahead:Hnt,either:Tde,optional:BEr,anyNumberOfTimes:NEr};for(const M in BQ)typeof BQ[M]=="object"&&znt(BQ[M]);return Object.assign(t,BQ),t},r_=iit({});r_.newInstance=()=>iit({});var S_r=r_;r_.HighlightJS=r_,r_.default=r_;const T_r=Ad(S_r),ait={},C_r="hljs-";function k_r(t){const e=T_r.newInstance();return t&&a(t),{highlight:r,highlightAuto:n,listLanguages:i,register:a,registerAlias:o,registered:s};function r(l,u,d){const h=d||ait,f=typeof h.prefix=="string"?h.prefix:C_r;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:O_r,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 h=(u||ait).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 d;for(d in l)Object.hasOwn(l,d)&&e.registerLanguage(d,l[d])}}function o(l,u){if(typeof l=="string")e.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const h=l[d];e.registerAliases(typeof h=="string"?h:[...h],{languageName:d})}}}function s(l){return!!e.getLanguage(l)}}class O_r{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 E_r={};function oit(t){const e=t||E_r,r=e.aliases,n=e.detect||!1,i=e.languages||DEr,a=e.plainText,o=e.prefix,s=e.subset;let l="hljs";const u=k_r(i);if(r&&u.registerAlias(r),o){const d=o.indexOf("-");l=d===-1?o:o.slice(0,d)}return function(d,h){xN(d,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=__r(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=iOr(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)){h.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 __r(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=uit(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 t5r(t){return t>=56320&&t<=57343}function r5r(t,e){return(t-55296)*1024+9216+e}function mit(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function vit(t){return t>=64976&&t<=65007||e5r.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 n5r=65536;class i5r{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=n5r,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(t5r(r))return this.pos++,this._addGap(),r5r(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,git(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){mit(e)?this._err(bt.controlCharacterInInputStream):vit(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 a5r=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))),o5r=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 s5r(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=o5r.get(t))!==null&&e!==void 0?e:t}var Cl;(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"})(Cl||(Cl={}));const l5r=32;var bx;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(bx||(bx={}));function Dde(t){return t>=Cl.ZERO&&t<=Cl.NINE}function c5r(t){return t>=Cl.UPPER_A&&t<=Cl.UPPER_F||t>=Cl.LOWER_A&&t<=Cl.LOWER_F}function u5r(t){return t>=Cl.UPPER_A&&t<=Cl.UPPER_Z||t>=Cl.LOWER_A&&t<=Cl.LOWER_Z||Dde(t)}function d5r(t){return t===Cl.EQUALS||u5r(t)}var kl;(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"})(kl||(kl={}));var cy;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(cy||(cy={}));class h5r{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=kl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=cy.Strict}startEntity(e){this.decodeMode=e,this.state=kl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case kl.EntityStart:return e.charCodeAt(r)===Cl.NUM?(this.state=kl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=kl.NamedEntity,this.stateNamedEntity(e,r));case kl.NumericStart:return this.stateNumericStart(e,r);case kl.NumericDecimal:return this.stateNumericDecimal(e,r);case kl.NumericHex:return this.stateNumericHex(e,r);case kl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|l5r)===Cl.LOWER_X?(this.state=kl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=kl.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===Cl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==cy.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]&bx.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]&~bx.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case kl.NamedEntity:return this.result!==0&&(this.decodeMode!==cy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case kl.NumericDecimal:return this.emitNumericEntity(0,2);case kl.NumericHex:return this.emitNumericEntity(0,3);case kl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case kl.EntityStart:return 0}}}function f5r(t,e,r,n){const i=(e&bx.BRANCH_LENGTH)>>7,a=e&bx.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 zA;(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"})(zA||(zA={}));var Qf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Qf||(Qf={}));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 p5r=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 a_(t){var e;return(e=p5r.get(t))!==null&&e!==void 0?e:W.UNKNOWN}const jt=W,g5r={[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},Lde=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 Qe;(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"})(Qe||(Qe={}));const us={DATA:Qe.DATA,RCDATA:Qe.RCDATA,RAWTEXT:Qe.RAWTEXT,SCRIPT_DATA:Qe.SCRIPT_DATA,PLAINTEXT:Qe.PLAINTEXT,CDATA_SECTION:Qe.CDATA_SECTION};function m5r(t){return t>=Ue.DIGIT_0&&t<=Ue.DIGIT_9}function kN(t){return t>=Ue.LATIN_CAPITAL_A&&t<=Ue.LATIN_CAPITAL_Z}function v5r(t){return t>=Ue.LATIN_SMALL_A&&t<=Ue.LATIN_SMALL_Z}function xx(t){return v5r(t)||kN(t)}function bit(t){return xx(t)||m5r(t)}function zQ(t){return t+32}function xit(t){return t===Ue.SPACE||t===Ue.LINE_FEED||t===Ue.TABULATION||t===Ue.FORM_FEED}function wit(t){return xit(t)||t===Ue.SOLIDUS||t===Ue.GREATER_THAN_SIGN}function y5r(t){return t===Ue.NULL?bt.nullCharacterReference:t>1114111?bt.characterReferenceOutsideUnicodeRange:git(t)?bt.surrogateCharacterReference:vit(t)?bt.noncharacterCharacterReference:mit(t)||t===Ue.CARRIAGE_RETURN?bt.controlCharacterReference:null}class b5r{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=Qe.DATA,this.returnState=Qe.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new i5r(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new h5r(a5r,(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=y5r(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=xit(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=Qe.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?cy.Attribute:cy.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Qe.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Qe.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Qe.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Qe.DATA:{this._stateData(e);break}case Qe.RCDATA:{this._stateRcdata(e);break}case Qe.RAWTEXT:{this._stateRawtext(e);break}case Qe.SCRIPT_DATA:{this._stateScriptData(e);break}case Qe.PLAINTEXT:{this._statePlaintext(e);break}case Qe.TAG_OPEN:{this._stateTagOpen(e);break}case Qe.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Qe.TAG_NAME:{this._stateTagName(e);break}case Qe.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Qe.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Qe.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Qe.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Qe.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Qe.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Qe.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Qe.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Qe.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Qe.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Qe.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Qe.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Qe.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Qe.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Qe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Qe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Qe.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Qe.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Qe.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Qe.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Qe.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Qe.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Qe.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Qe.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Qe.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Qe.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Qe.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Qe.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Qe.COMMENT_START:{this._stateCommentStart(e);break}case Qe.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Qe.COMMENT:{this._stateComment(e);break}case Qe.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Qe.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Qe.COMMENT_END:{this._stateCommentEnd(e);break}case Qe.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Qe.DOCTYPE:{this._stateDoctype(e);break}case Qe.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Qe.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Qe.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Qe.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Qe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Qe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Qe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Qe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Qe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Qe.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Qe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Qe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Qe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Qe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Qe.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Qe.CDATA_SECTION:{this._stateCdataSection(e);break}case Qe.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Qe.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Qe.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Qe.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Qe.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=Qe.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=Qe.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=Qe.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(xx(e))this._createStartTagToken(),this.state=Qe.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.EXCLAMATION_MARK:{this.state=Qe.MARKUP_DECLARATION_OPEN;break}case Ue.SOLIDUS:{this.state=Qe.END_TAG_OPEN;break}case Ue.QUESTION_MARK:{this._err(bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Qe.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=Qe.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(xx(e))this._createEndTagToken(),this.state=Qe.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.GREATER_THAN_SIGN:{this._err(bt.missingEndTagName),this.state=Qe.DATA;break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Qe.SCRIPT_DATA_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Qe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ue.SOLIDUS?this.state=Qe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:xx(e)?(this._emitChars("<"),this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Qe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){xx(e)?(this.state=Qe.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ue.SOLIDUS?(this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Nd.SCRIPT,!1)&&wit(this.preprocessor.peek(Nd.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(T5r,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(S5r,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(A5r,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(Cit.has(i))return!1;break}case Ut.MATHML:{if(Tit.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,UQ)}hasInListItemScope(e){return this.hasInDynamicScope(e,x5r)}hasInButtonScope(e){return this.hasInDynamicScope(e,w5r)}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(Lde.has(r))return!0;if(UQ.has(r))return!1;break}case Ut.SVG:{if(Cit.has(r))return!1;break}case Ut.MATHML:{if(Tit.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&&Ait.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Sit.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Sit.has(this.currentTagId);)this.pop()}}const Mde=3;var Cm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Cm||(Cm={}));const kit={type:Cm.Marker};class O5r{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>=Mde&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(kit)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:Cm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Cm.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(kit);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===Cm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===Cm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===Cm.Element&&r.element===e)}}const Ax={createDocument(){return{nodeName:"#document",mode:Qf.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};Ax.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(Ax.isTextNode(r)){r.value+=e;return}}Ax.appendChild(t,Ax.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&Ax.isTextNode(n)?n.value+=e:Ax.insertBefore(t,Ax.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function M5r(t){return t.name===Oit&&t.publicId===null&&(t.systemId===null||t.systemId===E5r)}function I5r(t){if(t.name!==Oit)return Qf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===_5r)return Qf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),D5r.has(r))return Qf.QUIRKS;let n=e===null?R5r:Eit;if(Rit(r,n))return Qf.QUIRKS;if(n=e===null?_it:L5r,Rit(r,n))return Qf.LIMITED_QUIRKS}return Qf.NO_QUIRKS}const Dit={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},P5r="definitionurl",N5r="definitionURL",B5r=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])),$5r=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}]]),F5r=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])),z5r=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 U5r(t){const e=t.tagID;return e===W.FONT&&t.attrs.some(({name:n})=>n===zA.COLOR||n===zA.SIZE||n===zA.FACE)||z5r.has(e)}function Lit(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:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:u,endOffset:d})}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 H5r(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===Cm.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 Iit.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 g5r[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){C4r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{$it(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:{$de(this,e);break}case Ke.IN_TABLE_TEXT:{Wit(this,e);break}case Ke.IN_COLUMN_GROUP:{QQ(this,e);break}case Ke.AFTER_BODY:{YQ(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){T4r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{$de(this,e);break}case Ke.IN_COLUMN_GROUP:{QQ(this,e);break}case Ke.AFTER_BODY:{YQ(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Nde(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:{Nde(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.AFTER_BODY:{rRr(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{nRr(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{iRr(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:{PN(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)?k4r(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{aRr(this,e);break}case Ke.BEFORE_HEAD:{sRr(this,e);break}case Ke.IN_HEAD:{ng(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{uRr(this,e);break}case Ke.AFTER_HEAD:{hRr(this,e);break}case Ke.IN_BODY:{Qc(this,e);break}case Ke.IN_TABLE:{o_(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_CAPTION:{l4r(this,e);break}case Ke.IN_COLUMN_GROUP:{Fde(this,e);break}case Ke.IN_TABLE_BODY:{HQ(this,e);break}case Ke.IN_ROW:{WQ(this,e);break}case Ke.IN_CELL:{d4r(this,e);break}case Ke.IN_SELECT:{jit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{f4r(this,e);break}case Ke.IN_TEMPLATE:{g4r(this,e);break}case Ke.AFTER_BODY:{v4r(this,e);break}case Ke.IN_FRAMESET:{y4r(this,e);break}case Ke.AFTER_FRAMESET:{x4r(this,e);break}case Ke.AFTER_AFTER_BODY:{A4r(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{S4r(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?O4r(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{oRr(this,e);break}case Ke.BEFORE_HEAD:{lRr(this,e);break}case Ke.IN_HEAD:{cRr(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{dRr(this,e);break}case Ke.AFTER_HEAD:{fRr(this,e);break}case Ke.IN_BODY:{GQ(this,e);break}case Ke.TEXT:{ZRr(this,e);break}case Ke.IN_TABLE:{MN(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_CAPTION:{c4r(this,e);break}case Ke.IN_COLUMN_GROUP:{u4r(this,e);break}case Ke.IN_TABLE_BODY:{zde(this,e);break}case Ke.IN_ROW:{qit(this,e);break}case Ke.IN_CELL:{h4r(this,e);break}case Ke.IN_SELECT:{Xit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{p4r(this,e);break}case Ke.IN_TEMPLATE:{m4r(this,e);break}case Ke.AFTER_BODY:{Zit(this,e);break}case Ke.IN_FRAMESET:{b4r(this,e);break}case Ke.AFTER_FRAMESET:{w4r(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(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:{Qit(this,e);break}case Ke.TEXT:{JRr(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_TEMPLATE:{Kit(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:{Bde(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:{Bit(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{$de(this,e);break}case Ke.IN_TABLE_TEXT:{Hit(this,e);break}}}};function X5r(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):Git(t,e),r}function K5r(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 Z5r(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>=q5r;!s||l?(l&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=J5r(t,s),n===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(o,n),n=o)}return n}function J5r(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 eRr(t,e,r){const n=t.treeAdapter.getTagName(e),i=a_(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 tRr(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 Pde(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 iRr(t,e){t._setDocumentType(e);const r=e.forceQuirks?Qf.QUIRKS:I5r(e);M5r(e)||t._err(e,bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function ON(t,e){t._err(e,bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Qf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function aRr(t,e){e.tagID===W.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):EN(t,e)}function oRr(t,e){const r=e.tagID;(r===W.HTML||r===W.HEAD||r===W.BODY||r===W.BR)&&EN(t,e)}function EN(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function sRr(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:_N(t,e)}}function lRr(t,e){const r=e.tagID;r===W.HEAD||r===W.BODY||r===W.HTML||r===W.BR?_N(t,e):t._err(e,bt.endTagWithoutMatchingOpenElement)}function _N(t,e){t._insertFakeElement(st.HEAD,W.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function ng(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:RN(t,e)}}function cRr(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:{RN(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function UA(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 RN(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function uRr(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:{ng(t,e);break}case W.NOSCRIPT:{t._err(e,bt.nestedNoscriptInHead);break}default:DN(t,e)}}function dRr(t,e){switch(e.tagID){case W.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case W.BR:{DN(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function DN(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 hRr(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),ng(t,e),t.openElements.remove(t.headElement);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:LN(t,e)}}function fRr(t,e){switch(e.tagID){case W.BODY:case W.HTML:case W.BR:{LN(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function LN(t,e){t._insertFakeElement(st.BODY,W.BODY),t.insertionMode=Ke.IN_BODY,VQ(t,e)}function VQ(t,e){switch(e.type){case ai.CHARACTER:{$it(t,e);break}case ai.WHITESPACE_CHARACTER:{Bit(t,e);break}case ai.COMMENT:{Nde(t,e);break}case ai.START_TAG:{Qc(t,e);break}case ai.END_TAG:{GQ(t,e);break}case ai.EOF:{Qit(t,e);break}}}function Bit(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function $it(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function pRr(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function gRr(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function mRr(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 vRr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function yRr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Lde.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function bRr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function xRr(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 wRr(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 ARr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=us.PLAINTEXT}function SRr(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 TRr(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(Pde(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 CRr(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function kRr(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(W.NOBR)&&(Pde(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function ORr(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function ERr(t,e){t.treeAdapter.getDocumentMode(t.document)!==Qf.QUIRKS&&t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function Fit(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function zit(t){const e=yit(t,zA.TYPE);return e!=null&&e.toLowerCase()===W5r}function _Rr(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),zit(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function RRr(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function DRr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function LRr(t,e){e.tagName=st.IMG,e.tagID=W.IMG,Fit(t,e)}function MRr(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 IRr(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function PRr(t,e){t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function Uit(t,e){t._switchToTextParsing(e,us.RAWTEXT)}function NRr(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 BRr(t,e){t.openElements.currentTagId===W.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function $Rr(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function FRr(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(W.RTC),t._insertElement(e,Ut.HTML)}function zRr(t,e){t._reconstructActiveFormattingElements(),Lit(e),Ide(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function URr(t,e){t._reconstructActiveFormattingElements(),Mit(e),Ide(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function Vit(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:{CRr(t,e);break}case W.A:{TRr(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{yRr(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:{vRr(t,e);break}case W.LI:case W.DD:case W.DT:{wRr(t,e);break}case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:{Fit(t,e);break}case W.HR:{DRr(t,e);break}case W.RB:case W.RTC:{$Rr(t,e);break}case W.RT:case W.RP:{FRr(t,e);break}case W.PRE:case W.LISTING:{bRr(t,e);break}case W.XMP:{IRr(t,e);break}case W.SVG:{URr(t,e);break}case W.HTML:{pRr(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:{ng(t,e);break}case W.BODY:{gRr(t,e);break}case W.FORM:{xRr(t,e);break}case W.NOBR:{kRr(t,e);break}case W.MATH:{zRr(t,e);break}case W.TABLE:{ERr(t,e);break}case W.INPUT:{_Rr(t,e);break}case W.PARAM:case W.TRACK:case W.SOURCE:{RRr(t,e);break}case W.IMAGE:{LRr(t,e);break}case W.BUTTON:{SRr(t,e);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{ORr(t,e);break}case W.IFRAME:{PRr(t,e);break}case W.SELECT:{NRr(t,e);break}case W.OPTION:case W.OPTGROUP:{BRr(t,e);break}case W.NOEMBED:case W.NOFRAMES:{Uit(t,e);break}case W.FRAMESET:{mRr(t,e);break}case W.TEXTAREA:{MRr(t,e);break}case W.NOSCRIPT:{t.options.scriptingEnabled?Uit(t,e):Vit(t,e);break}case W.PLAINTEXT:{ARr(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:Vit(t,e)}}function VRr(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 GRr(t,e){t.openElements.hasInScope(W.BODY)&&(t.insertionMode=Ke.AFTER_BODY,Zit(t,e))}function QRr(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function HRr(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 WRr(t){t.openElements.hasInButtonScope(W.P)||t._insertFakeElement(st.P,W.P),t._closePElement()}function YRr(t){t.openElements.hasInListItemScope(W.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(W.LI),t.openElements.popUntilTagNamePopped(W.LI))}function qRr(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function jRr(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function XRr(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function KRr(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,W.BR),t.openElements.pop(),t.framesetOk=!1}function Git(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 GQ(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:{Pde(t,e);break}case W.P:{WRr(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:{QRr(t,e);break}case W.LI:{YRr(t);break}case W.DD:case W.DT:{qRr(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{jRr(t);break}case W.BR:{KRr(t);break}case W.BODY:{VRr(t,e);break}case W.HTML:{GRr(t,e);break}case W.FORM:{HRr(t);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{XRr(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:Git(t,e)}}function Qit(t,e){t.tmplInsertionModeStack.length>0?Kit(t,e):Bde(t,e)}function ZRr(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 JRr(t,e){t._err(e,bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function $de(t,e){if(t.openElements.currentTagId!==void 0&&Iit.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:{Wit(t,e);break}case ai.WHITESPACE_CHARACTER:{Hit(t,e);break}}else IN(t,e)}function e4r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function t4r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function r4r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,W.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,Fde(t,e)}function n4r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function i4r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,W.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,HQ(t,e)}function a4r(t,e){t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function o4r(t,e){zit(e)?t._appendElement(e,Ut.HTML):IN(t,e),e.ackSelfClosing=!0}function s4r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function o_(t,e){switch(e.tagID){case W.TD:case W.TH:case W.TR:{i4r(t,e);break}case W.STYLE:case W.SCRIPT:case W.TEMPLATE:{ng(t,e);break}case W.COL:{r4r(t,e);break}case W.FORM:{s4r(t,e);break}case W.TABLE:{a4r(t,e);break}case W.TBODY:case W.TFOOT:case W.THEAD:{n4r(t,e);break}case W.INPUT:{o4r(t,e);break}case W.CAPTION:{e4r(t,e);break}case W.COLGROUP:{t4r(t,e);break}default:IN(t,e)}}function MN(t,e){switch(e.tagID){case W.TABLE:{t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode());break}case W.TEMPLATE:{UA(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:IN(t,e)}}function IN(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,VQ(t,e),t.fosterParentingEnabled=r}function Hit(t,e){t.pendingCharacterTokens.push(e)}function Wit(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function PN(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:{UA(t,e);break}}}function f4r(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)):jit(t,e)}function p4r(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)):Xit(t,e)}function g4r(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:{ng(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,o_(t,e);break}case W.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,Fde(t,e);break}case W.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,HQ(t,e);break}case W.TD:case W.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,WQ(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Qc(t,e)}}function m4r(t,e){e.tagID===W.TEMPLATE&&UA(t,e)}function Kit(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Bde(t,e)}function v4r(t,e){e.tagID===W.HTML?Qc(t,e):YQ(t,e)}function Zit(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 YQ(t,e)}function YQ(t,e){t.insertionMode=Ke.IN_BODY,VQ(t,e)}function y4r(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:{ng(t,e);break}}}function b4r(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 x4r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{ng(t,e);break}}}function w4r(t,e){e.tagID===W.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function A4r(t,e){e.tagID===W.HTML?Qc(t,e):qQ(t,e)}function qQ(t,e){t.insertionMode=Ke.IN_BODY,VQ(t,e)}function S4r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{ng(t,e);break}}}function T4r(t,e){e.chars=bo,t._insertCharacters(e)}function C4r(t,e){t._insertCharacters(e),t.framesetOk=!1}function Jit(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 k4r(t,e){if(U5r(e))Jit(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Lit(e):n===Ut.SVG&&(V5r(e),Mit(e)),Ide(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function O4r(t,e){if(e.tagID===W.P||e.tagID===W.BR){Jit(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 E4r=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_4r=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),eat={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function tat(t,e){const r=F4r(t),n=$rt("type",{handlers:{root:R4r,element:D4r,text:L4r,comment:nat,doctype:M4r,raw:P4r},unknown:N4r}),i={parser:r?new Nit(eat):Nit.getFragmentParser(void 0,eat),handle(s){n(s,i)},stitches:!1,options:e||{}};n(t,i),s_(i,wm());const a=r?i.parser.document:i.parser.getFragment(),o=z_r(a,{file:i.options.file});return i.stitches&&xN(o,"comment",function(s,l,u){const d=s;if(d.value.stitch&&u&&l!==void 0){const h=u.children;return h[l]=d.value.stitch,l}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function rat(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ai.CHARACTER,chars:t.value,location:NN(t)};s_(e,wm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function M4r(t,e){const r={type:ai.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:NN(t)};s_(e,wm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function I4r(t,e){e.stitches=!0;const r=z4r(t);if("children"in t&&"children"in r){const n=tat({type:"root",children:t.children},e.options);r.children=n.children}nat({type:"comment",value:{stitch:r}},e)}function nat(t,e){const r=t.value,n={type:ai.COMMENT,data:r,location:NN(t)};s_(e,wm(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function P4r(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,iat(e,wm(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(E4r,"<$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 N4r(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))I4r(r,e);else{let n="";throw _4r.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 s_(t,e){iat(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 iat(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 B4r(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===us.PLAINTEXT)return;s_(e,wm(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:FA.html;i===FA.html&&r==="svg"&&(i=FA.svg);const a=H_r({...t,children:[]},{space:i===FA.svg?"svg":"html"}),o={type:ai.START_TAG,tagName:r,tagID:a_(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:NN(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function $4r(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&J_r.includes(r)||e.parser.tokenizer.state===us.PLAINTEXT)return;s_(e,gQ(t));const n={type:ai.END_TAG,tagName:r,tagID:a_(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:NN(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 F4r(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function NN(t){const e=wm(t)||{line:void 0,column:void 0,offset:void 0},r=gQ(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 z4r(t){return"children"in t?KE({...t,children:[]}):KE(t)}function U4r(t){return function(e,r){return tat(e,{...t,file:r})}}var V4r=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,G4r=/[\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]/,Q4r=/[\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]/,Ude={Space_Separator:V4r,ID_Start:G4r,ID_Continue:Q4r},ds={isSpaceSeparator(t){return typeof t=="string"&&Ude.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Ude.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==="‍"||Ude.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 Vde,Eu,uy,jQ,Sx,ig,Ol,Gde,BN;var H4r=function(e,r){Vde=String(e),Eu="start",uy=[],jQ=0,Sx=1,ig=0,Ol=void 0,Gde=void 0,BN=void 0;do Ol=W4r(),j4r[Eu]();while(Ol.type!=="eof");return typeof r=="function"?Qde({"":BN},"",r):BN};function Qde(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i=55296&&t<=57343}function tRr(t){return t>=56320&&t<=57343}function rRr(t,e){return(t-55296)*1024+9216+e}function mit(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function vit(t){return t>=64976&&t<=65007||eRr.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 nRr=65536;class iRr{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=nRr,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(tRr(r))return this.pos++,this._addGap(),rRr(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,git(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){mit(e)?this._err(bt.controlCharacterInInputStream):vit(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 aRr=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))),oRr=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 sRr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=oRr.get(t))!==null&&e!==void 0?e:t}var Cl;(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"})(Cl||(Cl={}));const lRr=32;var bx;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(bx||(bx={}));function Dde(t){return t>=Cl.ZERO&&t<=Cl.NINE}function cRr(t){return t>=Cl.UPPER_A&&t<=Cl.UPPER_F||t>=Cl.LOWER_A&&t<=Cl.LOWER_F}function uRr(t){return t>=Cl.UPPER_A&&t<=Cl.UPPER_Z||t>=Cl.LOWER_A&&t<=Cl.LOWER_Z||Dde(t)}function dRr(t){return t===Cl.EQUALS||uRr(t)}var kl;(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"})(kl||(kl={}));var cy;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(cy||(cy={}));class hRr{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=kl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=cy.Strict}startEntity(e){this.decodeMode=e,this.state=kl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case kl.EntityStart:return e.charCodeAt(r)===Cl.NUM?(this.state=kl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=kl.NamedEntity,this.stateNamedEntity(e,r));case kl.NumericStart:return this.stateNumericStart(e,r);case kl.NumericDecimal:return this.stateNumericDecimal(e,r);case kl.NumericHex:return this.stateNumericHex(e,r);case kl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|lRr)===Cl.LOWER_X?(this.state=kl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=kl.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===Cl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==cy.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]&bx.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]&~bx.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case kl.NamedEntity:return this.result!==0&&(this.decodeMode!==cy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case kl.NumericDecimal:return this.emitNumericEntity(0,2);case kl.NumericHex:return this.emitNumericEntity(0,3);case kl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case kl.EntityStart:return 0}}}function fRr(t,e,r,n){const i=(e&bx.BRANCH_LENGTH)>>7,a=e&bx.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 zA;(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"})(zA||(zA={}));var Qf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Qf||(Qf={}));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 pRr=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 a_(t){var e;return(e=pRr.get(t))!==null&&e!==void 0?e:W.UNKNOWN}const jt=W,gRr={[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},Lde=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 Qe;(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"})(Qe||(Qe={}));const us={DATA:Qe.DATA,RCDATA:Qe.RCDATA,RAWTEXT:Qe.RAWTEXT,SCRIPT_DATA:Qe.SCRIPT_DATA,PLAINTEXT:Qe.PLAINTEXT,CDATA_SECTION:Qe.CDATA_SECTION};function mRr(t){return t>=Ue.DIGIT_0&&t<=Ue.DIGIT_9}function kN(t){return t>=Ue.LATIN_CAPITAL_A&&t<=Ue.LATIN_CAPITAL_Z}function vRr(t){return t>=Ue.LATIN_SMALL_A&&t<=Ue.LATIN_SMALL_Z}function xx(t){return vRr(t)||kN(t)}function bit(t){return xx(t)||mRr(t)}function zQ(t){return t+32}function xit(t){return t===Ue.SPACE||t===Ue.LINE_FEED||t===Ue.TABULATION||t===Ue.FORM_FEED}function wit(t){return xit(t)||t===Ue.SOLIDUS||t===Ue.GREATER_THAN_SIGN}function yRr(t){return t===Ue.NULL?bt.nullCharacterReference:t>1114111?bt.characterReferenceOutsideUnicodeRange:git(t)?bt.surrogateCharacterReference:vit(t)?bt.noncharacterCharacterReference:mit(t)||t===Ue.CARRIAGE_RETURN?bt.controlCharacterReference:null}class bRr{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=Qe.DATA,this.returnState=Qe.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new iRr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new hRr(aRr,(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=yRr(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=xit(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=Qe.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?cy.Attribute:cy.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Qe.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Qe.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Qe.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Qe.DATA:{this._stateData(e);break}case Qe.RCDATA:{this._stateRcdata(e);break}case Qe.RAWTEXT:{this._stateRawtext(e);break}case Qe.SCRIPT_DATA:{this._stateScriptData(e);break}case Qe.PLAINTEXT:{this._statePlaintext(e);break}case Qe.TAG_OPEN:{this._stateTagOpen(e);break}case Qe.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Qe.TAG_NAME:{this._stateTagName(e);break}case Qe.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Qe.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Qe.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Qe.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Qe.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Qe.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Qe.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Qe.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Qe.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Qe.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Qe.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Qe.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Qe.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Qe.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Qe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Qe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Qe.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Qe.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Qe.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Qe.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Qe.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Qe.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Qe.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Qe.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Qe.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Qe.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Qe.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Qe.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Qe.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Qe.COMMENT_START:{this._stateCommentStart(e);break}case Qe.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Qe.COMMENT:{this._stateComment(e);break}case Qe.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Qe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Qe.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Qe.COMMENT_END:{this._stateCommentEnd(e);break}case Qe.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Qe.DOCTYPE:{this._stateDoctype(e);break}case Qe.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Qe.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Qe.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Qe.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Qe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Qe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Qe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Qe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Qe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Qe.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Qe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Qe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Qe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Qe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Qe.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Qe.CDATA_SECTION:{this._stateCdataSection(e);break}case Qe.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Qe.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Qe.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Qe.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Qe.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=Qe.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=Qe.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=Qe.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(xx(e))this._createStartTagToken(),this.state=Qe.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.EXCLAMATION_MARK:{this.state=Qe.MARKUP_DECLARATION_OPEN;break}case Ue.SOLIDUS:{this.state=Qe.END_TAG_OPEN;break}case Ue.QUESTION_MARK:{this._err(bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Qe.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=Qe.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(xx(e))this._createEndTagToken(),this.state=Qe.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.GREATER_THAN_SIGN:{this._err(bt.missingEndTagName),this.state=Qe.DATA;break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Qe.SCRIPT_DATA_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Qe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ue.SOLIDUS?this.state=Qe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:xx(e)?(this._emitChars("<"),this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Qe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){xx(e)?(this.state=Qe.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ue.SOLIDUS?(this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Qe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Nd.SCRIPT,!1)&&wit(this.preprocessor.peek(Nd.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(TRr,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(SRr,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(ARr,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(Cit.has(i))return!1;break}case Ut.MATHML:{if(Tit.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,UQ)}hasInListItemScope(e){return this.hasInDynamicScope(e,xRr)}hasInButtonScope(e){return this.hasInDynamicScope(e,wRr)}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(Lde.has(r))return!0;if(UQ.has(r))return!1;break}case Ut.SVG:{if(Cit.has(r))return!1;break}case Ut.MATHML:{if(Tit.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&&Ait.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Sit.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Sit.has(this.currentTagId);)this.pop()}}const Mde=3;var Cm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Cm||(Cm={}));const kit={type:Cm.Marker};class ORr{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>=Mde&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(kit)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:Cm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Cm.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(kit);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===Cm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===Cm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===Cm.Element&&r.element===e)}}const Ax={createDocument(){return{nodeName:"#document",mode:Qf.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};Ax.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(Ax.isTextNode(r)){r.value+=e;return}}Ax.appendChild(t,Ax.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&Ax.isTextNode(n)?n.value+=e:Ax.insertBefore(t,Ax.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function MRr(t){return t.name===Oit&&t.publicId===null&&(t.systemId===null||t.systemId===ERr)}function IRr(t){if(t.name!==Oit)return Qf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===_Rr)return Qf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),DRr.has(r))return Qf.QUIRKS;let n=e===null?RRr:Eit;if(Rit(r,n))return Qf.QUIRKS;if(n=e===null?_it:LRr,Rit(r,n))return Qf.LIMITED_QUIRKS}return Qf.NO_QUIRKS}const Dit={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},PRr="definitionurl",NRr="definitionURL",BRr=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])),$Rr=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}]]),FRr=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])),zRr=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 URr(t){const e=t.tagID;return e===W.FONT&&t.attrs.some(({name:n})=>n===zA.COLOR||n===zA.SIZE||n===zA.FACE)||zRr.has(e)}function Lit(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:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:u,endOffset:d})}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 HRr(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===Cm.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 Iit.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 gRr[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){C4r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{$it(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:{$de(this,e);break}case Ke.IN_TABLE_TEXT:{Wit(this,e);break}case Ke.IN_COLUMN_GROUP:{QQ(this,e);break}case Ke.AFTER_BODY:{YQ(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){T4r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{$de(this,e);break}case Ke.IN_COLUMN_GROUP:{QQ(this,e);break}case Ke.AFTER_BODY:{YQ(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Nde(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:{Nde(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.AFTER_BODY:{r5r(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{n5r(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{i5r(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:{PN(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)?k4r(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{a5r(this,e);break}case Ke.BEFORE_HEAD:{s5r(this,e);break}case Ke.IN_HEAD:{ng(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{u5r(this,e);break}case Ke.AFTER_HEAD:{h5r(this,e);break}case Ke.IN_BODY:{Qc(this,e);break}case Ke.IN_TABLE:{o_(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_CAPTION:{l4r(this,e);break}case Ke.IN_COLUMN_GROUP:{Fde(this,e);break}case Ke.IN_TABLE_BODY:{HQ(this,e);break}case Ke.IN_ROW:{WQ(this,e);break}case Ke.IN_CELL:{d4r(this,e);break}case Ke.IN_SELECT:{jit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{f4r(this,e);break}case Ke.IN_TEMPLATE:{g4r(this,e);break}case Ke.AFTER_BODY:{v4r(this,e);break}case Ke.IN_FRAMESET:{y4r(this,e);break}case Ke.AFTER_FRAMESET:{x4r(this,e);break}case Ke.AFTER_AFTER_BODY:{A4r(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{S4r(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?O4r(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{o5r(this,e);break}case Ke.BEFORE_HEAD:{l5r(this,e);break}case Ke.IN_HEAD:{c5r(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{d5r(this,e);break}case Ke.AFTER_HEAD:{f5r(this,e);break}case Ke.IN_BODY:{GQ(this,e);break}case Ke.TEXT:{Z5r(this,e);break}case Ke.IN_TABLE:{MN(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_CAPTION:{c4r(this,e);break}case Ke.IN_COLUMN_GROUP:{u4r(this,e);break}case Ke.IN_TABLE_BODY:{zde(this,e);break}case Ke.IN_ROW:{qit(this,e);break}case Ke.IN_CELL:{h4r(this,e);break}case Ke.IN_SELECT:{Xit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{p4r(this,e);break}case Ke.IN_TEMPLATE:{m4r(this,e);break}case Ke.AFTER_BODY:{Zit(this,e);break}case Ke.IN_FRAMESET:{b4r(this,e);break}case Ke.AFTER_FRAMESET:{w4r(this,e);break}case Ke.AFTER_AFTER_BODY:{qQ(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{ON(this,e);break}case Ke.BEFORE_HTML:{EN(this,e);break}case Ke.BEFORE_HEAD:{_N(this,e);break}case Ke.IN_HEAD:{RN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{DN(this,e);break}case Ke.AFTER_HEAD:{LN(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:{Qit(this,e);break}case Ke.TEXT:{J5r(this,e);break}case Ke.IN_TABLE_TEXT:{PN(this,e);break}case Ke.IN_TEMPLATE:{Kit(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:{Bde(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:{Bit(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{$de(this,e);break}case Ke.IN_TABLE_TEXT:{Hit(this,e);break}}}};function XRr(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):Git(t,e),r}function KRr(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 ZRr(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>=qRr;!s||l?(l&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=JRr(t,s),n===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(o,n),n=o)}return n}function JRr(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 e5r(t,e,r){const n=t.treeAdapter.getTagName(e),i=a_(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 t5r(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 Pde(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 i5r(t,e){t._setDocumentType(e);const r=e.forceQuirks?Qf.QUIRKS:IRr(e);MRr(e)||t._err(e,bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function ON(t,e){t._err(e,bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Qf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function a5r(t,e){e.tagID===W.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):EN(t,e)}function o5r(t,e){const r=e.tagID;(r===W.HTML||r===W.HEAD||r===W.BODY||r===W.BR)&&EN(t,e)}function EN(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function s5r(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:_N(t,e)}}function l5r(t,e){const r=e.tagID;r===W.HEAD||r===W.BODY||r===W.HTML||r===W.BR?_N(t,e):t._err(e,bt.endTagWithoutMatchingOpenElement)}function _N(t,e){t._insertFakeElement(st.HEAD,W.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function ng(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:RN(t,e)}}function c5r(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:{RN(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function UA(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 RN(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function u5r(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:{ng(t,e);break}case W.NOSCRIPT:{t._err(e,bt.nestedNoscriptInHead);break}default:DN(t,e)}}function d5r(t,e){switch(e.tagID){case W.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case W.BR:{DN(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function DN(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 h5r(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),ng(t,e),t.openElements.remove(t.headElement);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:LN(t,e)}}function f5r(t,e){switch(e.tagID){case W.BODY:case W.HTML:case W.BR:{LN(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function LN(t,e){t._insertFakeElement(st.BODY,W.BODY),t.insertionMode=Ke.IN_BODY,VQ(t,e)}function VQ(t,e){switch(e.type){case ai.CHARACTER:{$it(t,e);break}case ai.WHITESPACE_CHARACTER:{Bit(t,e);break}case ai.COMMENT:{Nde(t,e);break}case ai.START_TAG:{Qc(t,e);break}case ai.END_TAG:{GQ(t,e);break}case ai.EOF:{Qit(t,e);break}}}function Bit(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function $it(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function p5r(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function g5r(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function m5r(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 v5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function y5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Lde.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function b5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function x5r(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 w5r(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 A5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=us.PLAINTEXT}function S5r(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 T5r(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(Pde(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 C5r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function k5r(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(W.NOBR)&&(Pde(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function O5r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function E5r(t,e){t.treeAdapter.getDocumentMode(t.document)!==Qf.QUIRKS&&t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function Fit(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function zit(t){const e=yit(t,zA.TYPE);return e!=null&&e.toLowerCase()===WRr}function _5r(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),zit(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function R5r(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function D5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function L5r(t,e){e.tagName=st.IMG,e.tagID=W.IMG,Fit(t,e)}function M5r(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 P5r(t,e){t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function Uit(t,e){t._switchToTextParsing(e,us.RAWTEXT)}function N5r(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 B5r(t,e){t.openElements.currentTagId===W.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function $5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function F5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(W.RTC),t._insertElement(e,Ut.HTML)}function z5r(t,e){t._reconstructActiveFormattingElements(),Lit(e),Ide(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function U5r(t,e){t._reconstructActiveFormattingElements(),Mit(e),Ide(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function Vit(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:{C5r(t,e);break}case W.A:{T5r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{y5r(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:{v5r(t,e);break}case W.LI:case W.DD:case W.DT:{w5r(t,e);break}case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:{Fit(t,e);break}case W.HR:{D5r(t,e);break}case W.RB:case W.RTC:{$5r(t,e);break}case W.RT:case W.RP:{F5r(t,e);break}case W.PRE:case W.LISTING:{b5r(t,e);break}case W.XMP:{I5r(t,e);break}case W.SVG:{U5r(t,e);break}case W.HTML:{p5r(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:{ng(t,e);break}case W.BODY:{g5r(t,e);break}case W.FORM:{x5r(t,e);break}case W.NOBR:{k5r(t,e);break}case W.MATH:{z5r(t,e);break}case W.TABLE:{E5r(t,e);break}case W.INPUT:{_5r(t,e);break}case W.PARAM:case W.TRACK:case W.SOURCE:{R5r(t,e);break}case W.IMAGE:{L5r(t,e);break}case W.BUTTON:{S5r(t,e);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{O5r(t,e);break}case W.IFRAME:{P5r(t,e);break}case W.SELECT:{N5r(t,e);break}case W.OPTION:case W.OPTGROUP:{B5r(t,e);break}case W.NOEMBED:case W.NOFRAMES:{Uit(t,e);break}case W.FRAMESET:{m5r(t,e);break}case W.TEXTAREA:{M5r(t,e);break}case W.NOSCRIPT:{t.options.scriptingEnabled?Uit(t,e):Vit(t,e);break}case W.PLAINTEXT:{A5r(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:Vit(t,e)}}function V5r(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,Zit(t,e))}function Q5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function H5r(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 W5r(t){t.openElements.hasInButtonScope(W.P)||t._insertFakeElement(st.P,W.P),t._closePElement()}function Y5r(t){t.openElements.hasInListItemScope(W.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(W.LI),t.openElements.popUntilTagNamePopped(W.LI))}function q5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function j5r(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 K5r(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,W.BR),t.openElements.pop(),t.framesetOk=!1}function Git(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 GQ(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:{Pde(t,e);break}case W.P:{W5r(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:{Q5r(t,e);break}case W.LI:{Y5r(t);break}case W.DD:case W.DT:{q5r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{j5r(t);break}case W.BR:{K5r(t);break}case W.BODY:{V5r(t,e);break}case W.HTML:{G5r(t,e);break}case W.FORM:{H5r(t);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{X5r(t,e);break}case W.TEMPLATE:{UA(t,e);break}default:Git(t,e)}}function Qit(t,e){t.tmplInsertionModeStack.length>0?Kit(t,e):Bde(t,e)}function Z5r(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 J5r(t,e){t._err(e,bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function $de(t,e){if(t.openElements.currentTagId!==void 0&&Iit.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:{Wit(t,e);break}case ai.WHITESPACE_CHARACTER:{Hit(t,e);break}}else IN(t,e)}function e4r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function t4r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function r4r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,W.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,Fde(t,e)}function n4r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function i4r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,W.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,HQ(t,e)}function a4r(t,e){t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function o4r(t,e){zit(e)?t._appendElement(e,Ut.HTML):IN(t,e),e.ackSelfClosing=!0}function s4r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function o_(t,e){switch(e.tagID){case W.TD:case W.TH:case W.TR:{i4r(t,e);break}case W.STYLE:case W.SCRIPT:case W.TEMPLATE:{ng(t,e);break}case W.COL:{r4r(t,e);break}case W.FORM:{s4r(t,e);break}case W.TABLE:{a4r(t,e);break}case W.TBODY:case W.TFOOT:case W.THEAD:{n4r(t,e);break}case W.INPUT:{o4r(t,e);break}case W.CAPTION:{e4r(t,e);break}case W.COLGROUP:{t4r(t,e);break}default:IN(t,e)}}function MN(t,e){switch(e.tagID){case W.TABLE:{t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode());break}case W.TEMPLATE:{UA(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:IN(t,e)}}function IN(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,VQ(t,e),t.fosterParentingEnabled=r}function Hit(t,e){t.pendingCharacterTokens.push(e)}function Wit(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function PN(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:{UA(t,e);break}}}function f4r(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)):jit(t,e)}function p4r(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)):Xit(t,e)}function g4r(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:{ng(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,o_(t,e);break}case W.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,Fde(t,e);break}case W.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,HQ(t,e);break}case W.TD:case W.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,WQ(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Qc(t,e)}}function m4r(t,e){e.tagID===W.TEMPLATE&&UA(t,e)}function Kit(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Bde(t,e)}function v4r(t,e){e.tagID===W.HTML?Qc(t,e):YQ(t,e)}function Zit(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 YQ(t,e)}function YQ(t,e){t.insertionMode=Ke.IN_BODY,VQ(t,e)}function y4r(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:{ng(t,e);break}}}function b4r(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 x4r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{ng(t,e);break}}}function w4r(t,e){e.tagID===W.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function A4r(t,e){e.tagID===W.HTML?Qc(t,e):qQ(t,e)}function qQ(t,e){t.insertionMode=Ke.IN_BODY,VQ(t,e)}function S4r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{ng(t,e);break}}}function T4r(t,e){e.chars=bo,t._insertCharacters(e)}function C4r(t,e){t._insertCharacters(e),t.framesetOk=!1}function Jit(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 k4r(t,e){if(URr(e))Jit(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Lit(e):n===Ut.SVG&&(VRr(e),Mit(e)),Ide(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function O4r(t,e){if(e.tagID===W.P||e.tagID===W.BR){Jit(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 E4r=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_4r=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),eat={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function tat(t,e){const r=F4r(t),n=$rt("type",{handlers:{root:R4r,element:D4r,text:L4r,comment:nat,doctype:M4r,raw:P4r},unknown:N4r}),i={parser:r?new Nit(eat):Nit.getFragmentParser(void 0,eat),handle(s){n(s,i)},stitches:!1,options:e||{}};n(t,i),s_(i,wm());const a=r?i.parser.document:i.parser.getFragment(),o=z_r(a,{file:i.options.file});return i.stitches&&xN(o,"comment",function(s,l,u){const d=s;if(d.value.stitch&&u&&l!==void 0){const h=u.children;return h[l]=d.value.stitch,l}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function rat(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ai.CHARACTER,chars:t.value,location:NN(t)};s_(e,wm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function M4r(t,e){const r={type:ai.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:NN(t)};s_(e,wm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function I4r(t,e){e.stitches=!0;const r=z4r(t);if("children"in t&&"children"in r){const n=tat({type:"root",children:t.children},e.options);r.children=n.children}nat({type:"comment",value:{stitch:r}},e)}function nat(t,e){const r=t.value,n={type:ai.COMMENT,data:r,location:NN(t)};s_(e,wm(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function P4r(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,iat(e,wm(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(E4r,"<$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 N4r(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))I4r(r,e);else{let n="";throw _4r.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 s_(t,e){iat(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 iat(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 B4r(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===us.PLAINTEXT)return;s_(e,wm(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:FA.html;i===FA.html&&r==="svg"&&(i=FA.svg);const a=H_r({...t,children:[]},{space:i===FA.svg?"svg":"html"}),o={type:ai.START_TAG,tagName:r,tagID:a_(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:NN(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function $4r(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&J_r.includes(r)||e.parser.tokenizer.state===us.PLAINTEXT)return;s_(e,gQ(t));const n={type:ai.END_TAG,tagName:r,tagID:a_(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:NN(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 F4r(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function NN(t){const e=wm(t)||{line:void 0,column:void 0,offset:void 0},r=gQ(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 z4r(t){return"children"in t?KE({...t,children:[]}):KE(t)}function U4r(t){return function(e,r){return tat(e,{...t,file:r})}}var V4r=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,G4r=/[\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]/,Q4r=/[\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]/,Ude={Space_Separator:V4r,ID_Start:G4r,ID_Continue:Q4r},ds={isSpaceSeparator(t){return typeof t=="string"&&Ude.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Ude.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==="‍"||Ude.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 Vde,Eu,uy,jQ,Sx,ig,Ol,Gde,BN;var H4r=function(e,r){Vde=String(e),Eu="start",uy=[],jQ=0,Sx=1,ig=0,Ol=void 0,Gde=void 0,BN=void 0;do Ol=W4r(),j4r[Eu]();while(Ol.type!=="eof");return typeof r=="function"?Qde({"":BN},"",r):BN};function Qde(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;is)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},LDr=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},MDr=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},oot=function(t,e){return t==="v"?RDr(e):DDr(e)},sot=function(t,e){return t==="v"?LDr(e):MDr(e)},IDr=function(t,e){return t==="h"&&e==="rtl"?-1:1},PDr=function(t,e,r,n,i){var a=IDr(t,window.getComputedStyle(e).direction),o=a*n,s=r.target,l=e.contains(s),u=!1,d=o>0,h=0,f=0;do{if(!s)break;var p=sot(t,s),g=p[0],m=p[1],v=p[2],y=m-v-a*g;(g||y)&&oot(t,s)&&(h+=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(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(u=!0),u},oH=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},lot=function(t){return[t.deltaX,t.deltaY]},cot=function(t){return t&&"current"in t?t.current:t},NDr=function(t,e){return t[0]===e[0]&&t[1]===e[1]},BDr=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},$Dr=0,p_=[];function FDr(t){var e=Y.useRef([]),r=Y.useRef([0,0]),n=Y.useRef(),i=Y.useState($Dr++)[0],a=Y.useState(rot)[0],o=Y.useRef(t);Y.useEffect(function(){o.current=t},[t]),Y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=oDr([t.lockRef.current],(t.shards||[]).map(cot),!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=Y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=oH(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(),O=C&&C.anchorNode,E=O?O===S||O.contains(S):!1;if(E)return!1;var _=aot(T,S);if(!_)return!0;if(_?A=T:(A=T==="v"?"h":"v",_=aot(T,S)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var P=n.current||A;return PDr(P,v,m,P==="h"?x:w)},[]),l=Y.useCallback(function(m){var v=m;if(!(!p_.length||p_[p_.length-1]!==a)){var y="deltaY"in v?lot(v):oH(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&NDr(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(cot).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=Y.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:zDr(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),d=Y.useCallback(function(m){r.current=oH(m),n.current=void 0},[]),h=Y.useCallback(function(m){u(m.type,lot(m),m.target,s(m,t.lockRef.current))},[]),f=Y.useCallback(function(m){u(m.type,oH(m),m.target,s(m,t.lockRef.current))},[]);Y.useEffect(function(){return p_.push(a),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,f_),document.addEventListener("touchmove",l,f_),document.addEventListener("touchstart",d,f_),function(){p_=p_.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,f_),document.removeEventListener("touchmove",l,f_),document.removeEventListener("touchstart",d,f_)}},[]);var p=t.removeScrollBar,g=t.inert;return Y.createElement(Y.Fragment,null,g?Y.createElement(a,{styles:BDr(i)}):null,p?Y.createElement(EDr,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function zDr(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const UDr=gDr(tot,FDr);var uot=Y.forwardRef(function(t,e){return Y.createElement(iH,Om({},t,{ref:e,sideCar:UDr}))});uot.classNames=iH.classNames;var VDr=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},g_=new WeakMap,sH=new WeakMap,lH={},bhe=0,dot=function(t){return t&&(t.host||dot(t.parentNode))},GDr=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=dot(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})},QDr=function(t,e,r,n){var i=GDr(e,Array.isArray(t)?t:[t]);lH[r]||(lH[r]=new WeakMap);var a=lH[r],o=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(g_.get(f)||0)+1,v=(a.get(f)||0)+1;g_.set(f,m),a.set(f,v),o.push(f),m===1&&g&&sH.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 d(e),s.clear(),bhe++,function(){o.forEach(function(h){var f=g_.get(h)-1,p=a.get(h)-1;g_.set(h,f),a.set(h,p),f||(sH.has(h)||h.removeAttribute(n),sH.delete(h)),p||h.removeAttribute(r)}),bhe--,bhe||(g_=new WeakMap,g_=new WeakMap,sH=new WeakMap,lH={})}},HDr=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=VDr(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),QDr(n,i,r,"aria-hidden")):function(){return null}},WDr=Object.defineProperty,YDr=(t,e)=>WDr(t,"name",{value:e,configurable:!0});function hot(t){const[e,r]=Y.useState(void 0);return sg(()=>{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}YDr(hot,"useSize");var qDr=Object.defineProperty,Cx=(t,e)=>qDr(t,"name",{value:e,configurable:!0}),fot="Popper",[pot,got]=HA(fot),[jDr,mot]=pot(fot),XDr=Cx(t=>{const{__scopePopper:e,children:r}=t,[n,i]=Y.useState(null),[a,o]=Y.useState(void 0);return Q.jsx(jDr,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:o,children:r})},"Popper"),KDr="PopperAnchor",ZDr=Y.forwardRef(Cx(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,o=mot(KDr,n),s=Y.useRef(null),l=o.onAnchorChange,u=Y.useCallback(m=>{s.current=m,m&&l(m)},[l]),d=Bd(r,u),h=Y.useRef(null);Y.useEffect(()=>{if(!i)return;const m=h.current;h.current=i.current,m!==h.current&&l(h.current)});const f=o.placementState&&cH(o.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:Q.jsx(og.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:d})},"PopperAnchor")),vot="PopperContent",[JDr,emi]=pot(vot),eLr=Y.forwardRef(Cx(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:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:m,...v}=e,y=mot(vot,n),[b,x]=Y.useState(null),w=Bd(r,x),[A,S]=Y.useState(null),T=hot(A),C=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,E=i+(o!=="center"?"-"+o:""),_=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(d)?d:[d],L=P.length>0,R={padding:_,boundary:P.filter(yot),altBoundary:L},{refs:D,floatingStyles:M,placement:I,isPositioned:N,middlewareData:F}=uet({strategy:"fixed",placement:E,whileElementsMounted:Cx((...Oe)=>gue(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[det({mainAxis:a+O,alignmentAxis:s}),u&&het({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?fet():void 0,...R}),u&&pet({...R}),get({...R,apply:Cx(({elements:Oe,rects:Ee,availableWidth:ue,availableHeight:he})=>{const{width:xe,height:ge}=Ee.reference,ze=Oe.floating.style;ze.setProperty("--radix-popper-available-width",`${ue}px`),ze.setProperty("--radix-popper-available-height",`${he}px`),ze.setProperty("--radix-popper-anchor-width",`${xe}px`),ze.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&S1r({element:A,padding:l}),tLr({arrowWidth:C,arrowHeight:O}),p&&A1r({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;sg(()=>(B(I),()=>{B(void 0)}),[I,B]);const[V,z]=cH(I),U=Tx(m);sg(()=>{N&&(U==null||U())},[N,U]);const G=(X=F.arrow)==null?void 0:X.x,H=(J=F.arrow)==null?void 0:J.y,j=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[q,ne]=Y.useState();return sg(()=>{b&&ne(window.getComputedStyle(b).zIndex)},[b]),Q.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:N?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--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:Q.jsx(JDr,{scope:n,placedSide:V,placedAlign:z,onArrowChange:S,arrowX:G,arrowY:H,shouldHideArrow:j,children:Q.jsx(og.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 yot(t){return t!==null}Cx(yot,"isNotNull");var tLr=Cx(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,d]=cH(r),h={start:"0%",center:"50%",end:"100%"}[d],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?h:`${f}px`,m=`${-l}px`):u==="top"?(g=o?h:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?h:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=o?h:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function cH(t){const[e,r="center"]=t.split("-");return[e,r]}Cx(cH,"getSideAndAlignFromPlacement");var rLr=XDr,nLr=ZDr,iLr=eLr,aLr=Object.defineProperty,xhe=(t,e)=>aLr(t,"name",{value:e,configurable:!0}),whe=!1;function bot(){const[t,e]=Y.useState(whe);return Y.useEffect(()=>{whe||(whe=!0,e(!0))},[]),t}xhe(bot,"useIsHydrated");var xot=Z2[" useSyncExternalStore ".trim().toString()];function wot(){return()=>{}}xhe(wot,"subscribe");function Aot(){return xot(wot,()=>!0,()=>!1)}xhe(Aot,"useIsHydratedModern");var oLr=typeof xot=="function"?Aot:bot,sLr=Object.defineProperty,WA=(t,e)=>sLr(t,"name",{value:e,configurable:!0}),Ahe="rovingFocusGroup.onEntryFocus",lLr={bubbles:!1,cancelable:!0},uH="RovingFocusGroup",[She,Sot,cLr]=xat(uH),[uLr,Tot]=HA(uH,[cLr]),[dLr,hLr]=uLr(uH),fLr=Y.forwardRef(WA(function(e,r){return Q.jsx(She.Provider,{scope:e.__scopeRovingFocusGroup,children:Q.jsx(She.Slot,{scope:e.__scopeRovingFocusGroup,children:Q.jsx(pLr,{...e,ref:r})})})},"RovingFocusGroup")),pLr=Y.forwardRef(WA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=Y.useRef(null),g=Bd(r,p),m=nhe(o),[v,y]=u_({prop:s,defaultProp:l??null,onChange:u,caller:uH}),[b,x]=Y.useState(!1),w=Tx(d),A=Sot(n),S=Y.useRef(!1),[T,C]=Y.useState(0);return Y.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(Ahe,w),()=>O.removeEventListener(Ahe,w)},[w]),Q.jsx(dLr,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:Y.useCallback(O=>y(O),[y]),onItemShiftTab:Y.useCallback(()=>x(!0),[]),onFocusableItemAdd:Y.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:Y.useCallback(()=>C(O=>O-1),[]),children:Q.jsx(og.div,{tabIndex:b||T===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:_u(e.onMouseDown,()=>{S.current=!0}),onFocus:_u(e.onFocus,O=>{const E=!S.current;if(O.target===O.currentTarget&&E&&!b){const _=new CustomEvent(Ahe,lLr);if(O.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);The(M,h)}}S.current=!1}),onBlur:_u(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),gLr="RovingFocusGroupItem",mLr=Y.forwardRef(WA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...l}=e,u=rhe(),d=o||u,h=hLr(gLr,n),f=h.currentTabStopId===d,p=Sot(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=h,y=oLr();return sg(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),Y.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),Q.jsx(She.ItemSlot,{scope:n,id:d,focusable:i,active:a,children:Q.jsx(og.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:r,onMouseDown:_u(e.onMouseDown,b=>{i?h.onItemFocus(d):b.preventDefault()}),onFocus:_u(e.onFocus,()=>h.onItemFocus(d)),onKeyDown:_u(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=kot(b,h.orientation,h.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=h.loop?Oot(A,S+1):A.slice(S+1)}setTimeout(()=>The(A))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:v!=null}):s})})},"RovingFocusGroupItem")),vLr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cot(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}WA(Cot,"getDirectionAwareKey");function kot(t,e,r){const n=Cot(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return vLr[n]}WA(kot,"getFocusIntent");function The(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}WA(The,"focusFirst");function Oot(t,e){return t.map((r,n)=>t[(e+n)%t.length])}WA(Oot,"wrapArray");var yLr=fLr,bLr=mLr,xLr=Object.defineProperty,kx=(t,e)=>xLr(t,"name",{value:e,configurable:!0}),Che="Popover",[Eot,tmi]=HA(Che,[got]),khe=got(),[wLr,m_]=Eot(Che),ALr=kx(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=t,s=khe(e),l=Y.useRef(null),[u,d]=Y.useState(!1),[h,f]=u_({prop:n,defaultProp:i??!1,onChange:a,caller:Che});return Q.jsx(rLr,{...s,children:Q.jsx(wLr,{scope:e,contentId:rhe(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:Y.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:Y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:Y.useCallback(()=>d(!1),[]),modal:o,children:r})})},"Popover"),SLr="PopoverTrigger",TLr=Y.forwardRef(kx(function(e,r){const{__scopePopover:n,...i}=e,a=m_(SLr,n),o=khe(n),s=Bd(r,a.triggerRef),l=Q.jsx(og.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Ohe(a.open),...i,ref:s,onClick:_u(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:Q.jsx(nLr,{asChild:!0,...o,children:l})},"PopoverTrigger")),_ot="PopoverPortal",[CLr,kLr]=Eot(_ot,{forceMount:void 0}),OLr=kx(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=m_(_ot,e);return Q.jsx(CLr,{scope:e,forceMount:r,children:Q.jsx(Nat,{present:r||a.open,children:Q.jsx(nDr,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),UN="PopoverContent",ELr=Y.forwardRef(kx(function(e,r){const n=kLr(UN,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,o=m_(UN,e.__scopePopover);return Q.jsx(Nat,{present:i||o.open,children:o.modal?Q.jsx(RLr,{...a,ref:r}):Q.jsx(DLr,{...a,ref:r})})},"PopoverContent")),_Lr=QA("PopoverContent.RemoveScroll"),RLr=Y.forwardRef(kx(function(e,r){const n=m_(UN,e.__scopePopover),i=Y.useRef(null),a=Bd(r,i),o=Y.useRef(!1);return Y.useEffect(()=>{const s=i.current;if(s)return HDr(s)},[]),Q.jsx(uot,{as:_Lr,allowPinchZoom:!0,children:Q.jsx(Rot,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_u(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_u(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_u(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),DLr=Y.forwardRef(kx(function(e,r){const n=m_(UN,e.__scopePopover),i=Y.useRef(!1),a=Y.useRef(!1);return Q.jsx(Rot,{...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,d;(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;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})},"PopoverContentNonModal")),Rot=Y.forwardRef(kx(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,...f}=e,p=m_(UN,n),g=khe(n);return fhe(),Q.jsx(eDr,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:Q.jsx(X3r,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:Q.jsx(iLr,{"data-state":Ohe(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 Ohe(t){return t?"open":"closed"}kx(Ohe,"getState");var LLr=ALr,MLr=TLr,ILr=OLr,PLr=ELr,NLr=Object.defineProperty,BLr=(t,e)=>NLr(t,"name",{value:e,configurable:!0}),$Lr="Toggle",FLr=Y.forwardRef(BLr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...o}=e,[s,l]=u_({prop:n,onChange:a,defaultProp:i??!1,caller:$Lr});return Q.jsx(og.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:_u(e.onClick,()=>{e.disabled||l(!s)})})},"Toggle")),zLr=Object.defineProperty,Ox=(t,e)=>zLr(t,"name",{value:e,configurable:!0}),v_="ToggleGroup",[Dot,rmi]=HA(v_,[Tot]),Lot=Tot(),ULr=Y.forwardRef(Ox(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return Q.jsx(VLr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return Q.jsx(GLr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${v_}\``)},"ToggleGroup")),[Mot,Iot]=Dot(v_),VLr=Y.forwardRef(Ox(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Ox(()=>{},"onValueChange"),...o}=e,[s,l]=u_({prop:n,defaultProp:i??"",onChange:a,caller:v_});return Q.jsx(Mot,{scope:e.__scopeToggleGroup,type:"single",value:Y.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:Y.useCallback(()=>l(""),[l]),children:Q.jsx(Pot,{...o,ref:r})})},"ToggleGroupImplSingle")),GLr=Y.forwardRef(Ox(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Ox(()=>{},"onValueChange"),...o}=e,[s,l]=u_({prop:n,defaultProp:i??[],onChange:a,caller:v_}),u=Y.useCallback(h=>l((f=[])=>[...f,h]),[l]),d=Y.useCallback(h=>l((f=[])=>f.filter(p=>p!==h)),[l]);return Q.jsx(Mot,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:u,onItemDeactivate:d,children:Q.jsx(Pot,{...o,ref:r})})},"ToggleGroupImplMultiple")),[QLr,HLr]=Dot(v_),Pot=Y.forwardRef(Ox(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:o,dir:s,loop:l=!0,...u}=e,d=Lot(n),h=nhe(s),f={dir:h,...u};return Q.jsx(QLr,{scope:n,rovingFocus:a,disabled:i,children:a?Q.jsx(yLr,{asChild:!0,...d,orientation:o,dir:h,loop:l,children:Q.jsx(og.div,{...f,ref:r})}):Q.jsx(og.div,{...f,ref:r})})},"ToggleGroupImpl")),Ehe="ToggleGroupItem",WLr=Y.forwardRef(Ox(function(e,r){const n=Iot(Ehe,e.__scopeToggleGroup),i=HLr(Ehe,e.__scopeToggleGroup),a=Lot(e.__scopeToggleGroup),o=n.value.includes(e.value),s=i.disabled||e.disabled,l={...e,pressed:o,disabled:s},u=Y.useRef(null);return i.rovingFocus?Q.jsx(bLr,{asChild:!0,...a,focusable:!s,active:o,ref:u,children:Q.jsx(Not,{...l,ref:r})}):Q.jsx(Not,{...l,ref:r})},"ToggleGroupItem")),Not=Y.forwardRef(Ox(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,o=Iot(Ehe,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=o.type==="single"?s:void 0;return Q.jsx(FLr,{...l,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(i):o.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),YLr=typeof Ci=="object"&&Ci&&Ci.Object===Object&&Ci,qLr=typeof self=="object"&&self&&self.Object===Object&&self;YLr||qLr||Function("return this")();var jLr=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function XLr(){const t=Y.useRef(!1);return Y.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),Y.useCallback(()=>t.current,[])}var Bot={width:void 0,height:void 0};function KLr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=Y.useState(Bot),o=XLr(),s=Y.useRef({...Bot}),l=Y.useRef(void 0);return l.current=t.onResize,Y.useEffect(()=>{if(!e.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const h=r==="border-box"?"borderBoxSize":r==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=$ot(d,h,"inlineSize"),p=$ot(d,h,"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 $ot(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 Fot(t,e){const r=Y.useRef(t);jLr(()=>{r.current=t},[t]),Y.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const ZLr={DEV:!1,MODE:"production"},y_=typeof{url:qa&&qa.tagName.toUpperCase()==="SCRIPT"&&qa.src||new URL("website-integration.js",document.baseURI).href}<"u"?ZLr:void 0,JLr=!!(y_!=null&&y_.DEV),eMr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",zot=(y_==null?void 0:y_.MODE)==="test"||eMr,tMr=typeof window<"u",Uot=typeof document<"u",rMr=tMr&&Uot,Vot=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())},_he=(t,e)=>{const r=()=>{const o=setTimeout(t);return()=>{clearTimeout(o)}};if(!rMr||typeof window.requestAnimationFrame!="function"||Uot&&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)}},Got=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},{}),Rhe=t=>{t.preventDefault()},Qot=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Dhe={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},dH=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:o,className:s,onClick:l,...u})=>{const d=Y.useRef(null),h=Y.useRef(null),f=Y.useCallback(g=>{const m=d.current,v=h.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"})}},[]);KLr({ref:d,onResize:()=>{const g=h.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),Y.useLayoutEffect(()=>{const g=d.current,m=h.current;!g||!m||(f(!!m.style.transition),m.style.transition||_he(()=>{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 Q.jsxs(ULr,{ref:d,className:l_(Dhe.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:[Q.jsx("div",{className:Dhe.SegmentedControlThumb,ref:h}),r]})},nMr=({children:t,...e})=>Q.jsx(WLr,{className:Dhe.SegmentedControlOption,...e,onPointerEnter:Vot,children:Q.jsx("span",{className:"relative",children:t})});dH.Option=nMr;function iMr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=gi("conversation"),[o,s]=Y.useState("preview"),l=i?"code":o;return Q.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[Q.jsx("div",{className:"visualization-card__toolbar",children:Q.jsxs(dH,{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:[Q.jsx(dH.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),Q.jsx(dH.Option,{value:"code",children:a("visualization.code")})]})}),Q.jsx("div",{className:"visualization-card__body",children:l==="code"?Q.jsx("pre",{className:"visualization-card__code",children:Q.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const aMr=Y.memo(iMr);function oMr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const Hot=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function Lhe(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(Lhe).join(""):Y.isValidElement(t)?Lhe(t.props.children):""}function sMr(t){var n;const e=Y.Children.toArray(t)[0];if(!Y.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return oMr(r==null?void 0:r.slice(9))}function Wot(t){if(!t)return!1;try{const e=t.toLowerCase();return Hot.some(r=>e.includes(r))}catch{return!1}}function lMr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(Wot(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 Hot.some(a=>i.includes(a))}return!1}function cMr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=gi("conversation"),a=Y.useContext(pwr),[o,s]=Y.useState(null),l=(h,f)=>{if(h.src)return h.src;if(f){const p=m=>{var v;if(!m)return null;if(m.type==="source"&&((v=m.properties)!=null&&v.src))return m.properties.src;if(m.children)for(const y of m.children){const b=p(y);if(b)return b}return null},g=p({children:f});if(g)return g}return""},u=h=>{try{const p=new URL(h).pathname.split("/");return p[p.length-1]||"video.mp4"}catch{return"video.mp4"}},d=h=>h?Array.isArray(h)?h.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(h==null?void 0:h.value)||"video":"video";return Q.jsxs("div",{className:e?`md ${e}`:"md",children:[Q.jsx(NTr,{disallowedElements:a?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[Kkr],rehypePlugins:r?[U4r,oit]:[oit],components:{pre:({node:h,children:f,...p})=>{const g=sMr(f);if(g==="mermaid"||g==="echarts"){const m=Lhe(f).replace(/\n$/,"");return Q.jsx(aMr,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:m,streaming:n,children:g==="mermaid"?Q.jsx(g3r,{source:m}):Q.jsx(u3r,{source:m})})}return Q.jsx("pre",{...p,children:f})},a:({node:h,...f})=>{const p=f.href,g=a&&gwr(p);if(g)return Q.jsx(mwr,{...a,path:g,children:f.children});if(p&&(Wot(p)||lMr(h))){const m=p,v=d(h==null?void 0:h.children);return Q.jsxs("div",{className:"video-container",children:[Q.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:v}),onClick:()=>s({src:m,title:v}),children:[Q.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),Q.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]}),Q.jsx("div",{className:"video-caption",children:Q.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return Q.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:f,alt:p,...g})=>{const m=Q.jsx("img",{...g,src:f,alt:p??"",loading:"lazy"});return f?Q.jsx(Rrt,{src:f,children:Q.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:p||i("markdown.image")}),children:[m,Q.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]})}):m},video:({node:h,src:f,children:p,...g})=>{const m=l({src:f},p);return m?Q.jsx("div",{className:"video-container",children:Q.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>s({src:m}),children:[Q.jsx("video",{src:m,...g,playsInline:!0,className:"video-thumbnail",children:p}),Q.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]})}):Q.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...g,children:p})}},children:t}),o&&Q.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>s(null),children:Q.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[Q.jsxs("div",{className:"video-viewer-header",children:[Q.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),Q.jsxs("nav",{className:"video-viewer-nav",children:[Q.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":i("markdown.downloadVideo"),title:i("markdown.downloadVideo"),className:"video-viewer-download",children:Q.jsx(Tle,{})}),Q.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>s(null),children:Q.jsx(SE,{})})]})]}),Q.jsx("div",{className:"video-viewer-body",children:Q.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const hH=Y.memo(cMr);function uMr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=gi("conversation");return t.skills.length===0&&!t.targetAgent?null:Q.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>Q.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[Q.jsx(Bfr,{"aria-hidden":!0}),Q.jsxs("span",{children:[e,a.name]}),r?Q.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:Q.jsx(SE,{})}):null]},a.name)),t.targetAgent?Q.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[Q.jsx(Rfr,{"aria-hidden":!0}),Q.jsx("span",{children:t.targetAgent.name}),n?Q.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:Q.jsx(SE,{})}):null]}):null]})}function Mhe(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function Yot(t){var r,n,i,a;const e=Mhe(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 qot(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function jot(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?fwr(e,t.uri):""}function dMr({kind:t}){return t==="image"?Q.jsx(Pfr,{}):t==="video"?Q.jsx(Ifr,{}):t==="pdf"?Q.jsx(Mfr,{}):Q.jsx(rXe,{})}function hMr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=gi("conversation"),[a,o]=Y.useState(null);return Q.jsxs(Q.Fragment,{children:[Q.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(s=>{const l=Mhe(s.mimeType),u=jot(s,t),d=s.status==="uploading"||s.status==="error"||!u,h=Q.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:l==="image"?void 0:()=>o(s),"aria-label":i("media.preview",{name:s.name??i("media.attachment")}),children:[l==="image"&&u?Q.jsx("img",{className:"media-card-image",src:u,alt:s.name??i("media.image"),loading:"lazy"}):l==="video"&&u?Q.jsxs("div",{className:"media-card-video-container",children:[Q.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),Q.jsx("span",{className:"media-card-video-play",children:Q.jsx(Nfr,{})})]}):Q.jsx("span",{className:"media-card-icon",children:Q.jsx(dMr,{kind:l})}),Q.jsxs("span",{className:"media-card-copy",children:[Q.jsx("span",{className:"media-card-name",children:s.name??i("media.attachment")}),Q.jsxs("span",{className:"media-card-meta",children:[Q.jsx("span",{className:"media-card-type",children:Yot(s)}),s.status==="uploading"?Q.jsxs(Q.Fragment,{children:[Q.jsx(Xv,{className:"media-card-spinner"})," ",i("media.uploading")]}):s.status==="error"?s.error??i("media.uploadFailed"):qot(s.sizeBytes)]})]}),!r&&s.status!=="uploading"&&s.status!=="error"?Q.jsx(hG,{className:"media-card-open"}):null]});return Q.jsxs(EA.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"&&!d?Q.jsx(Rrt,{src:u,children:h}):h,n?Q.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:s.name??i("media.attachment")}),onClick:()=>n(s.id),children:Q.jsx(SE,{})}):null]},s.id)})}),Q.jsx(Vfr,{children:a?Q.jsx(fMr,{appName:t,item:a,onClose:()=>o(null)}):null})]})}function fMr({appName:t,item:e,onClose:r}){const{t:n}=gi("conversation"),i=Y.useMemo(()=>jot(e,t),[t,e]),a=Mhe(e.mimeType),[o,s]=Y.useState(""),[l,u]=Y.useState(a==="text"||a==="markdown"),[d,h]=Y.useState("");return Y.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),Y.useEffect(()=>{if(a!=="text"&&a!=="markdown")return;const f=new AbortController;return u(!0),h(""),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||h(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),Q.jsx(EA.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":n("media.previewDialog",{name:e.name??n("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&r()},children:Q.jsxs(EA.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[Q.jsxs("header",{className:"media-viewer-header",children:[Q.jsxs("div",{children:[Q.jsx("strong",{children:e.name??n("media.attachment")}),Q.jsxs("span",{children:[Yot(e),e.sizeBytes?` · ${qot(e.sizeBytes)}`:""]})]}),Q.jsxs("nav",{children:[Q.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:Q.jsx(Tle,{})}),Q.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:Q.jsx(SE,{})})]})]}),Q.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?Q.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?Q.jsx("div",{className:"media-viewer-video-wrapper",children:Q.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?Q.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?Q.jsxs("div",{className:"media-viewer-loading",children:[Q.jsx(Xv,{})," ",n("media.reading")]}):null,!l&&d?Q.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:d})}):null,!l&&a==="markdown"?Q.jsx("div",{className:"media-document",children:Q.jsx(hH,{text:o})}):null,!l&&a==="text"?Q.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function pMr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=gi("conversation"),o=t.icon,s=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:s});return Q.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[Q.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:Q.jsx(o,{})}),r?Q.jsx("span",{className:"builtin-tool-label",children:l}):Q.jsx(xm,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),Q.jsx(HE,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function Nh(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function tn(t){return typeof t=="string"?t:""}function Xot(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function Wf(t){return Array.isArray(t)?t:[]}function Ihe(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Nh(e)??{};return Nh(r.result)??r}function fH(t){if(typeof t=="string")try{return fH(JSON.parse(t))}catch{return t}const e=Nh(t);if(!e)return"";const r=Nh(e.result);return tn(e.error)||tn(e.message)||tn(r==null?void 0:r.error)||tn(r==null?void 0:r.message)}function gMr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=Nh(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 Kot={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function mMr(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 vMr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function yMr(t,e=Kot){const r=Ihe(t),n=Nh(r.capabilities)??{},i=Wf(r.resources).flatMap(o=>{const s=Nh(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:gMr(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=Nh(o);if(!s)return[];const l=tn(s.source),u=tn(s.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:vMr(l),label:mMr(l,e),status:d,count:Xot(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:Xot(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 bMr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function Zot(t,e,r=Kot){const n=Ihe(t),i=Ihe(e),a=new Map(Wf(i.results).flatMap(d=>{const h=Nh(d),f=tn(h==null?void 0:h.name);return h&&f?[[f,h]]:[]})),o=Wf(n.agents).flatMap(d=>{const h=Nh(d),f=tn(h==null?void 0:h.name);return h&&f?[h]:[]}),s=new Set(o.map(d=>tn(d.name))),l=[...a.entries()].filter(([d])=>!s.has(d)).map(([d])=>({name:d})),u=[...o,...l].map(d=>{const h=tn(d.name),f=Wf(d.nodes).flatMap(T=>{const C=Nh(T);return C?[C]:[]}),p=tn(d.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(h),y=tn(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=Jot(v==null?void 0:v.resources),w=x.length>0?x:Jot(f.flatMap(T=>Wf(T.resources))),A=est(v==null?void 0:v.python_tools),S=A.length>0?A:est(f.flatMap(T=>Wf(T.python_tools)));return{name:h,description:tn(v==null?void 0:v.description)||tn(g==null?void 0:g.description)||tn(d.task),task:tn(d.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(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function xMr(t,e){return!!fH(e)||Zot(t,e).failedCount>0}function Jot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Nh(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 est(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Nh(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 wMr=t=>{const e=Y.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},Phe=t=>{const e=wMr(t),r=Y.Children.count(e);return Y.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:Q.jsx("span",{children:n});if(Y.isValidElement(n)){const i=n,{children:a,...o}=i.props;return a!=null?Y.cloneElement(i,o,Phe(a)):i}return n})},AMr={Badge:"_Badge_1viyg_1"},Ex=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...o})=>Q.jsx("div",{className:l_(AMr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...o,children:Phe(t)});Y.createContext(null);const SMr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},TMr=({className:t,size:e,strokeWidth:r,style:n,...i})=>Q.jsx("div",{...i,className:l_(SMr.LoadingIndicator,t),style:n||Got({"indicator-size":e,"indicator-stroke":r})});function CMr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const kMr=()=>zot,tst=(t,e=!1,r="TransitionGroup")=>{const n=[];return Y.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},b_=()=>{},x_=t=>{const e=Y.useRef(t);return e.current=t,Y.useCallback(r=>e.current(r),[])};function OMr(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 EMr(t,e,r){if((zot||JLr)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const _Mr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},rst={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},RMr=t=>({...rst,enter:!t}),DMr=(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 rst}},LMr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:o,shouldRender:s,enterDuration:l,exitDuration:u,removeChild:d,onEnter:h,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=Y.useReducer(DMr,RMr(o||!1)),x=Y.useRef(!1),w=Y.useRef(null),A=Y.useRef(l);A.current=l;const S=Y.useRef(u);S.current=u;const T=Y.useRef(null),C=Y.useCallback(O=>{const E=w.current;if(!(!E||O===T.current))switch(T.current=O,O){case"enter":h(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}},[h,f,p,g,m,v]);return VIe.useLayoutEffect(()=>{if(!s){let _;b({type:"exit-before"}),C("exit");const P=_he(()=>{b({type:"exit-active"}),C("exit-active"),_=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{P(),_!==void 0&&clearTimeout(_)}}if(o&&!x.current){x.current=!0;return}let O;b({type:"enter-before"}),C("enter");const E=_he(()=>{b({type:"enter-active"}),C("enter-active"),O=window.setTimeout(()=>{b({type:"done"}),C("enter-complete")},A.current)});return()=>{E(),O!==void 0&&clearTimeout(O)}},[s,o,d,C]),Y.useEffect(()=>()=>{x.current=!1},[]),Q.jsx(e,{ref:CMr([w,t]),className:l_(n,_Mr.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})},MMr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=Y.useState(n==null);return Fot(()=>a(!0),i?null:n),i?Q.jsx(LMr,{...t}):null},nst=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:d,insertMethod:h="append",disableAnimations:f=kMr()}=t,p=x_(t.onEnter??b_),g=x_(t.onEnterActive??b_),m=x_(t.onEnterComplete??b_),v=x_(t.onExit??b_),y=x_(t.onExitActive??b_),b=x_(t.onExitComplete??b_);Y.Children.forEach(n,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=Y.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]=Y.useState(()=>tst(n).map(S=>({...x(S),preventMountTransition:u})));return Y.useLayoutEffect(()=>{A(S=>{const T=tst(n);return OMr(T,S,x,h)})},[n,h,x]),EMr("TransitionGroup",e,Y.Children.count(n)),f?Q.jsx(Q.Fragment,{children:Y.Children.map(n,S=>Q.jsx(r,{ref:e,className:i,style:o,"data-transition-id":a,children:S}))}):Q.jsx(Q.Fragment,{children:w.map(({component:S,...T})=>Q.jsx(MMr,{...T,as:r,className:i,transitionId:a,enterDuration:s,exitDuration:l,enterMountDelay:d,style:o,ref:e,children:S},S.key))})},Nhe={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},IMr=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:d,block:h,opticallyAlign:f,children:p,className:g,onClick:m,disabled:v,disabledTone:y,inert:b=u,...x}=t,w=v||b,A=Y.useCallback(S=>{v||m==null||m(S)},[m,v]);return Q.jsxs("button",{type:e,className:l_(Nhe.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":d?"":void 0,"data-block":h?"":void 0,"data-optically-align":f,onPointerEnter:Vot,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:[Q.jsx(nst,{className:Nhe.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&Q.jsx(TMr,{},"loader")}),Q.jsx("span",{className:Nhe.ButtonInner,children:Phe(p)})]})},PMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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"})}),NMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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"})}),BMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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 $Mr({branch:t}){return Q.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?Q.jsx(hH,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?Q.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?Q.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function FMr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=gi("conversation"),a=Y.useMemo(()=>Fje(t,e,r),[t,e,r]),[o,s]=Y.useState(0);return Q.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[Q.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>Q.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:Q.jsx(Ex,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),Q.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>Q.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[Q.jsx("header",{className:"branch-compare__head",children:Q.jsx(Ex,{color:"info",size:"sm",variant:"soft",children:l.label})}),Q.jsx($Mr,{branch:l}),Q.jsx("footer",{className:"branch-compare__footer",children:Q.jsx(IMr,{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 ist({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=Y.useRef(t!==void 0),[a,o]=Y.useState(e),s=i?t:a,l=Y.useCallback(u=>{i||o(u)},[]);return[s,l]}const ast=Y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function zMr(){return Y.useContext(ast)}function UMr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Pn(i),[,o]=Y.useState(!1),s=Zp(GMr).current,l=Zp(VMr).current,u=Y.useRef(0),d=Y.useRef(!0),h=Y.useRef([]),f=Y.useRef(null),p=Pn(()=>{d.current||(d.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,O;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:((O=(C=T.registration.textRef)==null?void 0:C.current)==null?void 0:O.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(O=>{if(!WMr(O))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&ost(E,_)>0){S.disconnect(),p();return}E=_}});f.current=S;const T=new Set;for(let O=1;OS.observe(O,{childList:!0}))}const b=Pn(()=>{const[A,S]=QMr(l),T=v(A);y(S),h.current=A,d.current=!1,s.forEach(C=>C(T)),a(T)});Bn(()=>(d.current||v(h.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Bn(()=>{d.current&&b()}),Bn(()=>()=>{var A;(A=f.current)==null||A.disconnect(),d.current=!0},[]);const x=Pn(A=>(s.add(A),()=>{s.delete(A)})),w=Y.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return Q.jsx(ast.Provider,{value:w,children:e})}function VMr(){return new Map}function GMr(){return new Set}function QMr(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)=>ost(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 HMr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function WMr(t){for(const e of t)for(let r=0;rnull},cst=Y.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:o,keepMounted:s,loopFocus:l,onValueChange:u,multiple:d=!1,orientation:h="vertical",value:f,defaultValue:p,style:g,...m}=e,v=Y.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=Y.useRef([]),[b,x]=ist({controlled:f,default:v,name:"Accordion",state:"value"}),w=Pn((C,O,E)=>{if(d)if(O){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=Y.useMemo(()=>({value:b,disabled:a,orientation:h}),[b,a,h]),S=Y.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:o??!1,keepMounted:s??!1,state:A,value:b}),[a,w,o,s,A,b]),T=tg("div",e,{state:A,ref:r,props:m,stateAttributesMapping:YMr});return Q.jsx(sst.Provider,{value:S,children:Q.jsx(UMr,{elementsRef:y,children:T})})});function qMr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,o]=ist({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:l,transitionStatus:u}=xet(a,!0,!0),d=QE(),[h,f]=Y.useState(),p=h===null?void 0:h??d,g=Pn(m=>{const v=!a,y=Rs($E,m.nativeEvent);n(v,y),!y.isCanceled&&o(v)});return Y.useMemo(()=>({defaultPanelId:d,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:p,setMounted:l,setOpen:o,setPanelIdState:f,transitionStatus:u}),[d,i,g,s,a,p,l,o,f,u])}const ust=Y.createContext(void 0);function dst(){const t=Y.useContext(ust);if(t===void 0)throw new Error(oy(15));return t}function jMr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:o,unregister:s,subscribeMapChange:l,nextIndexRef:u}=zMr(),d=Y.useRef(-1),[h,f]=Y.useState(a==null&&e?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),p=a??h,g=Y.useRef(null),m=Y.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 hst=Y.createContext(void 0);function Bhe(){const t=Y.useContext(hst);if(t===void 0)throw new Error(oy(9));return t}let $he=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=lQ.startingStyle]="startingStyle",t[t.endingStyle=lQ.endingStyle]="endingStyle",t}({}),XMr=function(t){return t.panelOpen="data-panel-open",t}({});const KMr={[$he.open]:""},ZMr={[$he.closed]:""},JMr={open(t){return t?{[XMr.panelOpen]:""}:null}},eIr={open(t){return t?KMr:ZMr}};let tIr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const Fhe={...eIr,index:t=>({[tIr.index]:String(t)}),...Det,value:()=>null},fst=Y.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:o,value:s,style:l,...u}=e,{ref:d,index:h}=jMr(),f=FE(r,d),{disabled:p,handleValueChange:g,state:m,value:v}=lst(),y=QE(),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=qMr({open:w,onOpenChange:A,disabled:x}),T=Y.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=Y.useMemo(()=>({...S,onOpenChange:A,state:T}),[S,T,A]),O=Y.useMemo(()=>({...m,hidden:!w&&!S.mounted,index:h,disabled:x,open:w}),[S.mounted,x,h,w,m]),E=QE(),[_,P]=Y.useState(),L=_===null?void 0:_??E,R=Y.useMemo(()=>({defaultTriggerId:E,open:w,state:O,setTriggerId:P,triggerId:L}),[E,w,O,P,L]),D=tg("div",e,{state:O,ref:f,props:u,stateAttributesMapping:Fhe});return Q.jsx(ust.Provider,{value:C,children:Q.jsx(hst.Provider,{value:R,children:D})})}),pst=Y.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,{state:s}=Bhe();return tg("h3",e,{state:s,ref:r,props:o,stateAttributesMapping:Fhe})}),gst=Y.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:l,...u}=e,{panelId:d,open:h,handleTrigger:f,disabled:p}=dst(),g=n||p,{getButtonProps:m,buttonRef:v}=Ret({disabled:g,focusableWhenDisabled:!0,native:s}),{defaultTriggerId:y,state:b,setTriggerId:x}=Bhe(),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]),tg("button",e,{state:b,ref:[r,v],props:[{"aria-controls":h?d:void 0,"aria-expanded":h,id:A,onClick:f},u,m],stateAttributesMapping:JMr})}),VN={height:void 0,width:void 0};function rIr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:l,setOpen:u,transitionStatus:d}=t,h=Y.useRef(null),f=Y.useRef(null),[p,g]=Y.useState(VN),m=Y.useRef(VN),v=Y.useRef(!1),y=Y.useRef(s),b=Y.useRef(!1),[x,w]=Y.useState(!1),A=Y.useRef(null),S=FE(e,h),T=Cu(s),C=yue(h),O=!s&&!a,E=x?"idle":d,_=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&&O&&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||d==="starting"||w(!1)},[x,d]),Y.useEffect(()=>()=>{I(),D()},[I,D]),Bn(()=>{const F=h.current;if(!F)return;!s&&A.current&&D();const B=nIr(F,_);if(f.current=B,s&&d==="idle"&&y.current&&B==="css-animation"){m.current=w_(F);return}if(s&&d==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(w_(F)),w(!0);return}if(B==="css-transition"){const j=iIr(F);if(R(w_(F)),!U)return j;const q=pH(F,"transition-duration","0s");return M(q),w(!0),j}R(w_(F));const G=pH(F,"animation-name","none");if(!U){G();return}const H=pH(F,"animation-duration","0s");G(),M(H),w(!0);return}if(!s&&a&&(d==="idle"||d==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(VN,!1),l(!1);return}R(w_(F));return}if(d!=="ending")return;if(B==="none"){l(!1);return}const V=w_(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&pH(F,"animation-name","none")()},[a,s,D,R,l,M,_,d]),bue({enabled:s&&a&&E==="idle",open:!0,ref:h,onComplete(){s&&R(VN,!1)}}),Y.useEffect(()=>{if(s||!a||E!=="ending"||!h.current)return;const B=new AbortController;let V=-1;function z(){T.current||(l(!1),R(VN,!1))}return V=Md.request(()=>{C(z,B.signal)}),()=>{Md.cancel(V),B.abort()}},[T,a,s,E,C,R,l]),Bn(()=>{const F=h.current;!F||!r||!O||F.setAttribute("hidden","until-found")},[O,r]),Y.useEffect(function(){const B=h.current;if(!B)return;function V(z){const U=Rs(iJe,z);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return xi(B,"beforematch",V)},[o,u]);const N=i||r||a||s;return{height:P.height,props:{...L?{[$he.startingStyle]:""}:void 0,hidden:O,id:n},ref:S,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:P.width}}function w_(t){return{height:t.scrollHeight,width:t.scrollWidth}}function nIr(t,e){const r=cs(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&mst(r.animationDuration),i=mst(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function mst(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function pH(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 iIr(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=Md.request(r);return()=>{Md.cancel(n),r()}}let vst=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const yst=Y.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:o,render:s,style:l,...u}=e,{hiddenUntilFound:d,keepMounted:h}=lst(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=dst(),w=i??d,A=a??h,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:O,ref:E,shouldPreventOpenAnimation:_,shouldRender:P,transitionStatus:L,width:R}=rIr({externalRef:r,hiddenUntilFound:w,id:T,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=Bhe(),I={...D,transitionStatus:L},N=MJe(l,I),F=tg("div",{...e,style:void 0},{state:I,ref:E,props:[O,{"aria-labelledby":M,role:"region",style:{[vst.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[vst.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Fhe});return P?F:null});function zhe(t){const e=Y.useRef(t);return e.current=t,e}let A_=[],gH=!1;const bst=t=>{var e,r;if(t.key==="Escape"){const[n]=A_;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},xst=()=>{A_.length>0&&!gH?(document.body.addEventListener("keydown",bst),gH=!0):A_.length===0&&gH&&(document.body.removeEventListener("keydown",bst),gH=!1)},aIr=t=>{A_.unshift(t),xst()},oIr=({id:t})=>{A_=A_.filter(e=>e.id!==t),xst()},sIr=(t,e)=>{const r=Y.useId(),n=zhe(e);Y.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return aIr(i),()=>oIr(i)},[r,t,n])},lIr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=cIr(n,r.getBoundingClientRect()),a=uIr(n,i),o=dIr(e.getBoundingClientRect());return fIr([...a,...o])};function cIr(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 uIr(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 dIr(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 hIr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,o=e.length-1;an!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(i=!i)}return i}function fIr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),pIr(e)}function pIr(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 wst={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},Ast=Y.createContext(null),mH=()=>{const t=Y.use(Ast);if(!t)throw new Error("Popover components must be wrapped in ");return t},GN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,o]=Y.useState(!1),[s,l]=Y.useState(!1),u=Y.useRef(null),d=Y.useRef(null),h=Y.useRef(void 0),f=Y.useRef(!1),p=Y.useRef(!1),g=t??a,[m,v]=Y.useState(!1);Fot(()=>v(!1),m?500:null);const y=zhe(e),b=zhe(T=>{var C,O;clearTimeout(h.current),g!==T&&(T||(l(!1),r&&f.current&&((C=u.current)==null||C.focus()),f.current=!1),(O=y.current)==null||O.call(y,T),o(T),r&&v(T))}),x=Y.useCallback(T=>{b.current(T)},[b]),w=Y.useCallback(()=>{h.current=setTimeout(()=>x(!0),n)},[x,n]),A=Y.useCallback(()=>{clearTimeout(h.current)},[]);Y.useEffect(()=>()=>{clearTimeout(h.current)},[]);const S=Y.useMemo(()=>({open:g,setOpen:x,shake:s,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:f}),[g,x,s,l,r,m,f,p,w,A]);return Q.jsx(Ast,{value:S,children:Q.jsx(LLr,{open:g,onOpenChange:x,modal:!1,children:i})})},gIr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:o,onTriggerLeave:s,isPointerInTransitRef:l,triggerRef:u,contentRef:d}=mH(),h=Y.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!h.current&&!l.current&&(o(),h.current=!0)},g=()=>{h.current&&(s(),h.current=!1)};return Q.jsx(MLr,{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=d.current)!=null&&m.contains(document.activeElement)||n(!1)},50)}:void 0,children:t})},Sst=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:o=8,align:s,alignOffset:l,translucent:u,className:d,autoFocus:h=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=mH(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=Qot(y),x=b[b.length-1];x==null||x.focus()}};return Y.useEffect(()=>{const v=g.current;!v||!h||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,h]),Q.jsx(PLr,{forceMount:!0,ref:g,className:l_(wst.Popover,d),style:Got({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?Rhe: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:Rhe,onEscapeKeyDown:Rhe,onKeyDown:m,children:t})},mIr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=mH(),[o,s]=Y.useState(null),l=Y.useCallback(()=>{s(null),i.current=!1},[i]),u=Y.useCallback((d,h)=>{const f=lIr(d,h);s(f),i.current=!0},[i]);return Y.useEffect(()=>()=>l(),[l]),Y.useEffect(()=>{const d=r.current,h=n.current;if(!d||!h)return;const f=g=>u(g,h),p=g=>u(g,d);return d.addEventListener("pointerleave",f),h.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",f),h.removeEventListener("pointerleave",p)}},[n,r,u,l]),Y.useEffect(()=>{if(!o)return;const d=h=>{const f=r.current,p=n.current,g=h.target,m={x:h.clientX,y:h.clientY},v=(f==null?void 0:f.contains(g))||(p==null?void 0:p.contains(g)),y=!hIr(m,o),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,e,l,r,n]),Y.useEffect(()=>{const d=h=>{if(n.current&&h.key==="Tab"&&!h.shiftKey){const[f]=Qot(n.current);f&&(h.preventDefault(),f.focus(),a.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[n,a]),Q.jsx(Sst,{...t})},vIr=t=>{const{open:e,showOnHover:r,setOpen:n}=mH();return sIr(e,()=>{n(!1)}),Q.jsx(ILr,{forceMount:!0,children:Q.jsx(nst,{enterDuration:600,exitDuration:300,className:wst.Transition,disableAnimations:!0,children:e&&(r?Q.jsx(mIr,{...t},"popover-hover"):Q.jsx(Sst,{...t},"popover"))})})};GN.Trigger=gIr,GN.Content=vIr,Y.createContext(null),Y.createContext(null),Y.createContext(null),Y.createContext(null);function Uhe(...t){return t.filter(Boolean).join(" ")}const Tst=[["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 yIr(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]=Tst[r%Tst.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 bIr({seed:t,className:e}){return Q.jsx("span",{className:Uhe("resource-card__identity-mark",e),style:yIr(t),"aria-hidden":"true"})}Y.forwardRef(function({className:e,...r},n){return Q.jsx("section",{ref:n,className:Uhe("resource-results",e),...r})});function xIr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...o}){return Q.jsxs("article",{className:Uhe("resource-card",i&&"is-interactive",t),...o,children:[i&&n?Q.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,Q.jsx("div",{className:"resource-card__content",children:a}),e||r?Q.jsxs("footer",{className:"resource-card__footer",children:[e,r?Q.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function wIr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return Q.jsxs("div",{className:"resource-card__header",children:[Q.jsxs("div",{className:"resource-card__identity",children:[t,Q.jsxs("div",{className:"resource-card__title-copy",children:[Q.jsx("h3",{title:r,children:e}),n]})]}),i]})}function AIr({children:t,title:e}){return Q.jsx("p",{className:"resource-card__description",title:e,children:t})}function SIr(t){return Q.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[Q.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"}),Q.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"}),Q.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 TIr=["skill_hub","skill_space","knowledge_base","tool"];function Cst(t){return Q.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:Q.jsx("path",{d:"m4 6 4 4 4-4"})})}function kst({label:t}){return Q.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>Q.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[Q.jsx("span",{}),Q.jsx("span",{})]},e))})}function CIr(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 Vhe({label:t,resources:e}){const{t:r}=gi("conversation");return e.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:t}),Q.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>Q.jsxs("div",{className:"create-agent-card__popover-item",children:[Q.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[Q.jsx("strong",{children:n.name}),Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:CIr(n,r)})]}),n.description?Q.jsx("p",{children:n.description}):null]},n.ref))})]})}function kIr({tools:t}){const{t:e}=gi("conversation");return t.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),Q.jsx(cst,{children:t.map((r,n)=>Q.jsxs(fst,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[Q.jsx(pst,{className:"create-agent-card__python-tool-header",children:Q.jsxs(gst,{className:"create-agent-card__python-tool-trigger",children:[Q.jsxs("span",{children:[Q.jsx("strong",{children:r.name}),r.description?Q.jsx("small",{children:r.description}):null]}),Q.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),Q.jsx(Cst,{className:"create-agent-card__python-tool-chevron"})]})]})}),Q.jsxs(yst,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?Q.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,Q.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:Q.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function OIr({agents:t}){const{t:e}=gi("conversation");return t.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:e("blocks.createAgents.subAgents")}),Q.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>Q.jsxs("div",{className:"create-agent-card__popover-item",children:[Q.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[Q.jsx("strong",{children:r.id}),Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?Q.jsx("p",{children:r.description}):null]},r.id))})]})}function vH({label:t,count:e,icon:r,children:n}){const{t:i}=gi("conversation"),a=Q.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,Q.jsx("span",{children:e})]});return e===0?a:Q.jsxs(GN,{showOnHover:!0,hoverOpenDelay:120,children:[Q.jsx(GN.Trigger,{children:a}),Q.jsx(GN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function EIr({response:t,status:e}){const{t:r}=gi("conversation"),n=Y.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=Y.useMemo(()=>yMr(t,n),[n,t]),a=Y.useMemo(()=>TIr.map(l=>{const u=bMr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[i,r]),o=e==="failed",s=o?fH(t):"";return Q.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?Q.jsx(kst,{label:r("blocks.createAgents.retrieving")}):o?Q.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),Q.jsx("span",{children:s||r("blocks.createAgents.checkConfig")})]}):Q.jsx(cst,{className:"create-agent-card__accordion",children:a.map(l=>Q.jsxs(fst,{className:"create-agent-card__accordion-item",value:l.value,children:[Q.jsx(pst,{className:"create-agent-card__accordion-header",children:Q.jsxs(gst,{className:"create-agent-card__accordion-trigger",children:[Q.jsx("span",{children:l.label}),Q.jsxs("span",{className:"create-agent-card__accordion-meta",children:[Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.notSearched"):r("blocks.createAgents.notConfigured"):l.resources.length}),Q.jsx(Cst,{className:"create-agent-card__accordion-chevron"})]})]})}),Q.jsx(yst,{className:"create-agent-card__accordion-content",children:Q.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?Q.jsxs("div",{className:"create-agent-card__search-keywords",children:[Q.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),Q.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?Q.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>Q.jsx("div",{className:"create-agent-card__resource",children:Q.jsxs("div",{className:"create-agent-card__resource-main",children:[Q.jsxs("div",{className:"create-agent-card__resource-title",children:[Q.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?Q.jsx(Ex,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?Q.jsx("p",{children:u.description}):null]})},u.ref))}):Q.jsxs("div",{className:"create-agent-card__empty-category",children:[Q.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=>Q.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function _Ir({args:t,response:e,status:r}){const{t:n}=gi("conversation"),i=Y.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=Y.useMemo(()=>Zot(t,e,i),[t,i,e]),o=r==="failed"?fH(e):"";return Q.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[o?Q.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),Q.jsx("span",{children:o})]}):null,a.agents.length>0?Q.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,d=s.builtinTools.length+s.pythonTools.length;return Q.jsxs(xIr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[Q.jsx(wIr,{leading:Q.jsx(bIr,{seed:s.name}),title:s.name,titleText:s.name,status:Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${s.rootType}`,{defaultValue:s.rootType})})}),s.description?Q.jsx(AIr,{children:s.description}):null,u?Q.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,Q.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:s.name}),children:[Q.jsx(vH,{label:n("blocks.createAgents.skill"),count:s.skills.length,icon:Q.jsx(NMr,{"aria-hidden":"true"}),children:Q.jsx(Vhe,{label:n("blocks.createAgents.skill"),resources:s.skills})}),Q.jsx(vH,{label:n("blocks.createAgents.knowledgeBase"),count:s.knowledgeBases.length,icon:Q.jsx(SIr,{"aria-hidden":"true"}),children:Q.jsx(Vhe,{label:n("blocks.createAgents.knowledgeBase"),resources:s.knowledgeBases})}),Q.jsxs(vH,{label:n("blocks.createAgents.toolsLabel"),count:d,icon:Q.jsx(PMr,{"aria-hidden":"true"}),children:[Q.jsx(Vhe,{label:n("blocks.createAgents.builtinTool"),resources:s.builtinTools}),Q.jsx(kIr,{tools:s.pythonTools})]}),Q.jsx(vH,{label:n("blocks.createAgents.subAgents"),count:s.subAgentCount,icon:Q.jsx(BMr,{"aria-hidden":"true"}),children:Q.jsx(OIr,{agents:s.subAgents})})]})]},s.name)})}):r==="running"?Q.jsx(kst,{label:n("blocks.createAgents.creating")}):Q.jsxs("div",{className:"create-agent-card__message",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),Q.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const RIr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Het},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Het},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:Exr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:Rxr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:Dxr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Yet},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:Yet},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:Axr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:Sxr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Txr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:Cxr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:kxr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:Oxr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:_xr,detailRenderer:EIr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Wet,detailRenderer:_Ir},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Wet,detailRenderer:FMr,hideHeader:!0}};function Ghe(t){return RIr[t]}function DIr(t){return Q.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[Q.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),Q.jsx("path",{d:"M14 3v5h5"}),Q.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function LIr(t){return Q.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[Q.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"}),Q.jsx("path",{d:"m9 12 2 2 4-4"})]})}Dd.hasResourceBundle("en-US","workspaceTools")||Dd.addResourceBundle("en-US","workspaceTools",iVe,!0,!0),Dd.hasResourceBundle("zh-CN","workspaceTools")||Dd.addResourceBundle("zh-CN","workspaceTools",oje,!0,!0);function MIr(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 YA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function IIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function Qhe(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function PIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function NIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m9 5 7 7-7 7"})})}function BIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function $Ir(t){return Q.jsxs("svg",{...YA(t),children:[Q.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),Q.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 FIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const zIr=Y.lazy(()=>Promise.resolve().then(()=>G_n)),UIr=Y.lazy(()=>Promise.resolve().then(()=>w5n)),Ost="veadk-code-workspace-theme";function VIr(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 GIr(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 QIr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(Ost)==="dark"?"dark":"light"}catch{return"light"}}function HIr(t){return t===""?0:t.split(` +`)},$Dr=0,p_=[];function FDr(t){var e=Y.useRef([]),r=Y.useRef([0,0]),n=Y.useRef(),i=Y.useState($Dr++)[0],a=Y.useState(rot)[0],o=Y.useRef(t);Y.useEffect(function(){o.current=t},[t]),Y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=oDr([t.lockRef.current],(t.shards||[]).map(cot),!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=Y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=oH(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(),O=C&&C.anchorNode,E=O?O===S||O.contains(S):!1;if(E)return!1;var _=aot(T,S);if(!_)return!0;if(_?A=T:(A=T==="v"?"h":"v",_=aot(T,S)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var P=n.current||A;return PDr(P,v,m,P==="h"?x:w)},[]),l=Y.useCallback(function(m){var v=m;if(!(!p_.length||p_[p_.length-1]!==a)){var y="deltaY"in v?lot(v):oH(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&NDr(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(cot).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=Y.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:zDr(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),d=Y.useCallback(function(m){r.current=oH(m),n.current=void 0},[]),h=Y.useCallback(function(m){u(m.type,lot(m),m.target,s(m,t.lockRef.current))},[]),f=Y.useCallback(function(m){u(m.type,oH(m),m.target,s(m,t.lockRef.current))},[]);Y.useEffect(function(){return p_.push(a),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,f_),document.addEventListener("touchmove",l,f_),document.addEventListener("touchstart",d,f_),function(){p_=p_.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,f_),document.removeEventListener("touchmove",l,f_),document.removeEventListener("touchstart",d,f_)}},[]);var p=t.removeScrollBar,g=t.inert;return Y.createElement(Y.Fragment,null,g?Y.createElement(a,{styles:BDr(i)}):null,p?Y.createElement(EDr,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function zDr(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const UDr=gDr(tot,FDr);var uot=Y.forwardRef(function(t,e){return Y.createElement(iH,Om({},t,{ref:e,sideCar:UDr}))});uot.classNames=iH.classNames;var VDr=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},g_=new WeakMap,sH=new WeakMap,lH={},bhe=0,dot=function(t){return t&&(t.host||dot(t.parentNode))},GDr=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=dot(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})},QDr=function(t,e,r,n){var i=GDr(e,Array.isArray(t)?t:[t]);lH[r]||(lH[r]=new WeakMap);var a=lH[r],o=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(g_.get(f)||0)+1,v=(a.get(f)||0)+1;g_.set(f,m),a.set(f,v),o.push(f),m===1&&g&&sH.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 d(e),s.clear(),bhe++,function(){o.forEach(function(h){var f=g_.get(h)-1,p=a.get(h)-1;g_.set(h,f),a.set(h,p),f||(sH.has(h)||h.removeAttribute(n),sH.delete(h)),p||h.removeAttribute(r)}),bhe--,bhe||(g_=new WeakMap,g_=new WeakMap,sH=new WeakMap,lH={})}},HDr=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=VDr(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),QDr(n,i,r,"aria-hidden")):function(){return null}},WDr=Object.defineProperty,YDr=(t,e)=>WDr(t,"name",{value:e,configurable:!0});function hot(t){const[e,r]=Y.useState(void 0);return sg(()=>{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}YDr(hot,"useSize");var qDr=Object.defineProperty,Cx=(t,e)=>qDr(t,"name",{value:e,configurable:!0}),fot="Popper",[pot,got]=HA(fot),[jDr,mot]=pot(fot),XDr=Cx(t=>{const{__scopePopper:e,children:r}=t,[n,i]=Y.useState(null),[a,o]=Y.useState(void 0);return Q.jsx(jDr,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:o,children:r})},"Popper"),KDr="PopperAnchor",ZDr=Y.forwardRef(Cx(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,o=mot(KDr,n),s=Y.useRef(null),l=o.onAnchorChange,u=Y.useCallback(m=>{s.current=m,m&&l(m)},[l]),d=Bd(r,u),h=Y.useRef(null);Y.useEffect(()=>{if(!i)return;const m=h.current;h.current=i.current,m!==h.current&&l(h.current)});const f=o.placementState&&cH(o.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:Q.jsx(og.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:d})},"PopperAnchor")),vot="PopperContent",[JDr,emi]=pot(vot),eLr=Y.forwardRef(Cx(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:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:m,...v}=e,y=mot(vot,n),[b,x]=Y.useState(null),w=Bd(r,x),[A,S]=Y.useState(null),T=hot(A),C=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,E=i+(o!=="center"?"-"+o:""),_=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(d)?d:[d],L=P.length>0,R={padding:_,boundary:P.filter(yot),altBoundary:L},{refs:D,floatingStyles:M,placement:I,isPositioned:N,middlewareData:F}=uet({strategy:"fixed",placement:E,whileElementsMounted:Cx((...Oe)=>gue(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[det({mainAxis:a+O,alignmentAxis:s}),u&&het({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?fet():void 0,...R}),u&&pet({...R}),get({...R,apply:Cx(({elements:Oe,rects:Ee,availableWidth:ue,availableHeight:he})=>{const{width:xe,height:ge}=Ee.reference,ze=Oe.floating.style;ze.setProperty("--radix-popper-available-width",`${ue}px`),ze.setProperty("--radix-popper-available-height",`${he}px`),ze.setProperty("--radix-popper-anchor-width",`${xe}px`),ze.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&S1r({element:A,padding:l}),tLr({arrowWidth:C,arrowHeight:O}),p&&A1r({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;sg(()=>(B(I),()=>{B(void 0)}),[I,B]);const[V,z]=cH(I),U=Tx(m);sg(()=>{N&&(U==null||U())},[N,U]);const G=(X=F.arrow)==null?void 0:X.x,H=(J=F.arrow)==null?void 0:J.y,j=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[q,ne]=Y.useState();return sg(()=>{b&&ne(window.getComputedStyle(b).zIndex)},[b]),Q.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:N?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--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:Q.jsx(JDr,{scope:n,placedSide:V,placedAlign:z,onArrowChange:S,arrowX:G,arrowY:H,shouldHideArrow:j,children:Q.jsx(og.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 yot(t){return t!==null}Cx(yot,"isNotNull");var tLr=Cx(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,d]=cH(r),h={start:"0%",center:"50%",end:"100%"}[d],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?h:`${f}px`,m=`${-l}px`):u==="top"?(g=o?h:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?h:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=o?h:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function cH(t){const[e,r="center"]=t.split("-");return[e,r]}Cx(cH,"getSideAndAlignFromPlacement");var rLr=XDr,nLr=ZDr,iLr=eLr,aLr=Object.defineProperty,xhe=(t,e)=>aLr(t,"name",{value:e,configurable:!0}),whe=!1;function bot(){const[t,e]=Y.useState(whe);return Y.useEffect(()=>{whe||(whe=!0,e(!0))},[]),t}xhe(bot,"useIsHydrated");var xot=Z2[" useSyncExternalStore ".trim().toString()];function wot(){return()=>{}}xhe(wot,"subscribe");function Aot(){return xot(wot,()=>!0,()=>!1)}xhe(Aot,"useIsHydratedModern");var oLr=typeof xot=="function"?Aot:bot,sLr=Object.defineProperty,WA=(t,e)=>sLr(t,"name",{value:e,configurable:!0}),Ahe="rovingFocusGroup.onEntryFocus",lLr={bubbles:!1,cancelable:!0},uH="RovingFocusGroup",[She,Sot,cLr]=xat(uH),[uLr,Tot]=HA(uH,[cLr]),[dLr,hLr]=uLr(uH),fLr=Y.forwardRef(WA(function(e,r){return Q.jsx(She.Provider,{scope:e.__scopeRovingFocusGroup,children:Q.jsx(She.Slot,{scope:e.__scopeRovingFocusGroup,children:Q.jsx(pLr,{...e,ref:r})})})},"RovingFocusGroup")),pLr=Y.forwardRef(WA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=Y.useRef(null),g=Bd(r,p),m=nhe(o),[v,y]=u_({prop:s,defaultProp:l??null,onChange:u,caller:uH}),[b,x]=Y.useState(!1),w=Tx(d),A=Sot(n),S=Y.useRef(!1),[T,C]=Y.useState(0);return Y.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(Ahe,w),()=>O.removeEventListener(Ahe,w)},[w]),Q.jsx(dLr,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:Y.useCallback(O=>y(O),[y]),onItemShiftTab:Y.useCallback(()=>x(!0),[]),onFocusableItemAdd:Y.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:Y.useCallback(()=>C(O=>O-1),[]),children:Q.jsx(og.div,{tabIndex:b||T===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:_u(e.onMouseDown,()=>{S.current=!0}),onFocus:_u(e.onFocus,O=>{const E=!S.current;if(O.target===O.currentTarget&&E&&!b){const _=new CustomEvent(Ahe,lLr);if(O.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);The(M,h)}}S.current=!1}),onBlur:_u(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),gLr="RovingFocusGroupItem",mLr=Y.forwardRef(WA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...l}=e,u=rhe(),d=o||u,h=hLr(gLr,n),f=h.currentTabStopId===d,p=Sot(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=h,y=oLr();return sg(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),Y.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),Q.jsx(She.ItemSlot,{scope:n,id:d,focusable:i,active:a,children:Q.jsx(og.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:r,onMouseDown:_u(e.onMouseDown,b=>{i?h.onItemFocus(d):b.preventDefault()}),onFocus:_u(e.onFocus,()=>h.onItemFocus(d)),onKeyDown:_u(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=kot(b,h.orientation,h.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=h.loop?Oot(A,S+1):A.slice(S+1)}setTimeout(()=>The(A))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:v!=null}):s})})},"RovingFocusGroupItem")),vLr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cot(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}WA(Cot,"getDirectionAwareKey");function kot(t,e,r){const n=Cot(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return vLr[n]}WA(kot,"getFocusIntent");function The(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}WA(The,"focusFirst");function Oot(t,e){return t.map((r,n)=>t[(e+n)%t.length])}WA(Oot,"wrapArray");var yLr=fLr,bLr=mLr,xLr=Object.defineProperty,kx=(t,e)=>xLr(t,"name",{value:e,configurable:!0}),Che="Popover",[Eot,tmi]=HA(Che,[got]),khe=got(),[wLr,m_]=Eot(Che),ALr=kx(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=t,s=khe(e),l=Y.useRef(null),[u,d]=Y.useState(!1),[h,f]=u_({prop:n,defaultProp:i??!1,onChange:a,caller:Che});return Q.jsx(rLr,{...s,children:Q.jsx(wLr,{scope:e,contentId:rhe(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:Y.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:Y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:Y.useCallback(()=>d(!1),[]),modal:o,children:r})})},"Popover"),SLr="PopoverTrigger",TLr=Y.forwardRef(kx(function(e,r){const{__scopePopover:n,...i}=e,a=m_(SLr,n),o=khe(n),s=Bd(r,a.triggerRef),l=Q.jsx(og.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Ohe(a.open),...i,ref:s,onClick:_u(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:Q.jsx(nLr,{asChild:!0,...o,children:l})},"PopoverTrigger")),_ot="PopoverPortal",[CLr,kLr]=Eot(_ot,{forceMount:void 0}),OLr=kx(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=m_(_ot,e);return Q.jsx(CLr,{scope:e,forceMount:r,children:Q.jsx(Nat,{present:r||a.open,children:Q.jsx(nDr,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),UN="PopoverContent",ELr=Y.forwardRef(kx(function(e,r){const n=kLr(UN,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,o=m_(UN,e.__scopePopover);return Q.jsx(Nat,{present:i||o.open,children:o.modal?Q.jsx(RLr,{...a,ref:r}):Q.jsx(DLr,{...a,ref:r})})},"PopoverContent")),_Lr=QA("PopoverContent.RemoveScroll"),RLr=Y.forwardRef(kx(function(e,r){const n=m_(UN,e.__scopePopover),i=Y.useRef(null),a=Bd(r,i),o=Y.useRef(!1);return Y.useEffect(()=>{const s=i.current;if(s)return HDr(s)},[]),Q.jsx(uot,{as:_Lr,allowPinchZoom:!0,children:Q.jsx(Rot,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_u(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_u(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_u(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),DLr=Y.forwardRef(kx(function(e,r){const n=m_(UN,e.__scopePopover),i=Y.useRef(!1),a=Y.useRef(!1);return Q.jsx(Rot,{...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,d;(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;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})},"PopoverContentNonModal")),Rot=Y.forwardRef(kx(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,...f}=e,p=m_(UN,n),g=khe(n);return fhe(),Q.jsx(eDr,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:Q.jsx(X3r,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:Q.jsx(iLr,{"data-state":Ohe(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 Ohe(t){return t?"open":"closed"}kx(Ohe,"getState");var LLr=ALr,MLr=TLr,ILr=OLr,PLr=ELr,NLr=Object.defineProperty,BLr=(t,e)=>NLr(t,"name",{value:e,configurable:!0}),$Lr="Toggle",FLr=Y.forwardRef(BLr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...o}=e,[s,l]=u_({prop:n,onChange:a,defaultProp:i??!1,caller:$Lr});return Q.jsx(og.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:_u(e.onClick,()=>{e.disabled||l(!s)})})},"Toggle")),zLr=Object.defineProperty,Ox=(t,e)=>zLr(t,"name",{value:e,configurable:!0}),v_="ToggleGroup",[Dot,rmi]=HA(v_,[Tot]),Lot=Tot(),ULr=Y.forwardRef(Ox(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return Q.jsx(VLr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return Q.jsx(GLr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${v_}\``)},"ToggleGroup")),[Mot,Iot]=Dot(v_),VLr=Y.forwardRef(Ox(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Ox(()=>{},"onValueChange"),...o}=e,[s,l]=u_({prop:n,defaultProp:i??"",onChange:a,caller:v_});return Q.jsx(Mot,{scope:e.__scopeToggleGroup,type:"single",value:Y.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:Y.useCallback(()=>l(""),[l]),children:Q.jsx(Pot,{...o,ref:r})})},"ToggleGroupImplSingle")),GLr=Y.forwardRef(Ox(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Ox(()=>{},"onValueChange"),...o}=e,[s,l]=u_({prop:n,defaultProp:i??[],onChange:a,caller:v_}),u=Y.useCallback(h=>l((f=[])=>[...f,h]),[l]),d=Y.useCallback(h=>l((f=[])=>f.filter(p=>p!==h)),[l]);return Q.jsx(Mot,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:u,onItemDeactivate:d,children:Q.jsx(Pot,{...o,ref:r})})},"ToggleGroupImplMultiple")),[QLr,HLr]=Dot(v_),Pot=Y.forwardRef(Ox(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:o,dir:s,loop:l=!0,...u}=e,d=Lot(n),h=nhe(s),f={dir:h,...u};return Q.jsx(QLr,{scope:n,rovingFocus:a,disabled:i,children:a?Q.jsx(yLr,{asChild:!0,...d,orientation:o,dir:h,loop:l,children:Q.jsx(og.div,{...f,ref:r})}):Q.jsx(og.div,{...f,ref:r})})},"ToggleGroupImpl")),Ehe="ToggleGroupItem",WLr=Y.forwardRef(Ox(function(e,r){const n=Iot(Ehe,e.__scopeToggleGroup),i=HLr(Ehe,e.__scopeToggleGroup),a=Lot(e.__scopeToggleGroup),o=n.value.includes(e.value),s=i.disabled||e.disabled,l={...e,pressed:o,disabled:s},u=Y.useRef(null);return i.rovingFocus?Q.jsx(bLr,{asChild:!0,...a,focusable:!s,active:o,ref:u,children:Q.jsx(Not,{...l,ref:r})}):Q.jsx(Not,{...l,ref:r})},"ToggleGroupItem")),Not=Y.forwardRef(Ox(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,o=Iot(Ehe,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=o.type==="single"?s:void 0;return Q.jsx(FLr,{...l,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(i):o.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),YLr=typeof Ci=="object"&&Ci&&Ci.Object===Object&&Ci,qLr=typeof self=="object"&&self&&self.Object===Object&&self;YLr||qLr||Function("return this")();var jLr=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function XLr(){const t=Y.useRef(!1);return Y.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),Y.useCallback(()=>t.current,[])}var Bot={width:void 0,height:void 0};function KLr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=Y.useState(Bot),o=XLr(),s=Y.useRef({...Bot}),l=Y.useRef(void 0);return l.current=t.onResize,Y.useEffect(()=>{if(!e.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const h=r==="border-box"?"borderBoxSize":r==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=$ot(d,h,"inlineSize"),p=$ot(d,h,"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 $ot(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 Fot(t,e){const r=Y.useRef(t);jLr(()=>{r.current=t},[t]),Y.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const ZLr={DEV:!1,MODE:"production"},y_=typeof{url:qa&&qa.tagName.toUpperCase()==="SCRIPT"&&qa.src||new URL("website-integration.js",document.baseURI).href}<"u"?ZLr:void 0,JLr=!!(y_!=null&&y_.DEV),eMr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",zot=(y_==null?void 0:y_.MODE)==="test"||eMr,tMr=typeof window<"u",Uot=typeof document<"u",rMr=tMr&&Uot,Vot=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())},_he=(t,e)=>{const r=()=>{const o=setTimeout(t);return()=>{clearTimeout(o)}};if(!rMr||typeof window.requestAnimationFrame!="function"||Uot&&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)}},Got=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},{}),Rhe=t=>{t.preventDefault()},Qot=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Dhe={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},dH=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:o,className:s,onClick:l,...u})=>{const d=Y.useRef(null),h=Y.useRef(null),f=Y.useCallback(g=>{const m=d.current,v=h.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"})}},[]);KLr({ref:d,onResize:()=>{const g=h.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),Y.useLayoutEffect(()=>{const g=d.current,m=h.current;!g||!m||(f(!!m.style.transition),m.style.transition||_he(()=>{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 Q.jsxs(ULr,{ref:d,className:l_(Dhe.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:[Q.jsx("div",{className:Dhe.SegmentedControlThumb,ref:h}),r]})},nMr=({children:t,...e})=>Q.jsx(WLr,{className:Dhe.SegmentedControlOption,...e,onPointerEnter:Vot,children:Q.jsx("span",{className:"relative",children:t})});dH.Option=nMr;function iMr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=gi("conversation"),[o,s]=Y.useState("preview"),l=i?"code":o;return Q.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[Q.jsx("div",{className:"visualization-card__toolbar",children:Q.jsxs(dH,{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:[Q.jsx(dH.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),Q.jsx(dH.Option,{value:"code",children:a("visualization.code")})]})}),Q.jsx("div",{className:"visualization-card__body",children:l==="code"?Q.jsx("pre",{className:"visualization-card__code",children:Q.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const aMr=Y.memo(iMr);function oMr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const Hot=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function Lhe(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(Lhe).join(""):Y.isValidElement(t)?Lhe(t.props.children):""}function sMr(t){var n;const e=Y.Children.toArray(t)[0];if(!Y.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return oMr(r==null?void 0:r.slice(9))}function Wot(t){if(!t)return!1;try{const e=t.toLowerCase();return Hot.some(r=>e.includes(r))}catch{return!1}}function lMr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(Wot(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 Hot.some(a=>i.includes(a))}return!1}function cMr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=gi("conversation"),a=Y.useContext(pwr),[o,s]=Y.useState(null),l=(h,f)=>{if(h.src)return h.src;if(f){const p=m=>{var v;if(!m)return null;if(m.type==="source"&&((v=m.properties)!=null&&v.src))return m.properties.src;if(m.children)for(const y of m.children){const b=p(y);if(b)return b}return null},g=p({children:f});if(g)return g}return""},u=h=>{try{const p=new URL(h).pathname.split("/");return p[p.length-1]||"video.mp4"}catch{return"video.mp4"}},d=h=>h?Array.isArray(h)?h.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(h==null?void 0:h.value)||"video":"video";return Q.jsxs("div",{className:e?`md ${e}`:"md",children:[Q.jsx(NTr,{disallowedElements:a?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[Kkr],rehypePlugins:r?[U4r,oit]:[oit],components:{pre:({node:h,children:f,...p})=>{const g=sMr(f);if(g==="mermaid"||g==="echarts"){const m=Lhe(f).replace(/\n$/,"");return Q.jsx(aMr,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:m,streaming:n,children:g==="mermaid"?Q.jsx(g3r,{source:m}):Q.jsx(u3r,{source:m})})}return Q.jsx("pre",{...p,children:f})},a:({node:h,...f})=>{const p=f.href,g=a&&gwr(p);if(g)return Q.jsx(mwr,{...a,path:g,children:f.children});if(p&&(Wot(p)||lMr(h))){const m=p,v=d(h==null?void 0:h.children);return Q.jsxs("div",{className:"video-container",children:[Q.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:v}),onClick:()=>s({src:m,title:v}),children:[Q.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),Q.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]}),Q.jsx("div",{className:"video-caption",children:Q.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return Q.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:f,alt:p,...g})=>{const m=Q.jsx("img",{...g,src:f,alt:p??"",loading:"lazy"});return f?Q.jsx(Rrt,{src:f,children:Q.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:p||i("markdown.image")}),children:[m,Q.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]})}):m},video:({node:h,src:f,children:p,...g})=>{const m=l({src:f},p);return m?Q.jsx("div",{className:"video-container",children:Q.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>s({src:m}),children:[Q.jsx("video",{src:m,...g,playsInline:!0,className:"video-thumbnail",children:p}),Q.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:Q.jsx(hG,{})})]})}):Q.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...g,children:p})}},children:t}),o&&Q.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>s(null),children:Q.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[Q.jsxs("div",{className:"video-viewer-header",children:[Q.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),Q.jsxs("nav",{className:"video-viewer-nav",children:[Q.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":i("markdown.downloadVideo"),title:i("markdown.downloadVideo"),className:"video-viewer-download",children:Q.jsx(Tle,{})}),Q.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>s(null),children:Q.jsx(SE,{})})]})]}),Q.jsx("div",{className:"video-viewer-body",children:Q.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const hH=Y.memo(cMr);function uMr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=gi("conversation");return t.skills.length===0&&!t.targetAgent?null:Q.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>Q.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[Q.jsx(Bfr,{"aria-hidden":!0}),Q.jsxs("span",{children:[e,a.name]}),r?Q.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:Q.jsx(SE,{})}):null]},a.name)),t.targetAgent?Q.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[Q.jsx(Rfr,{"aria-hidden":!0}),Q.jsx("span",{children:t.targetAgent.name}),n?Q.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:Q.jsx(SE,{})}):null]}):null]})}function Mhe(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function Yot(t){var r,n,i,a;const e=Mhe(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 qot(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function jot(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?fwr(e,t.uri):""}function dMr({kind:t}){return t==="image"?Q.jsx(Pfr,{}):t==="video"?Q.jsx(Ifr,{}):t==="pdf"?Q.jsx(Mfr,{}):Q.jsx(rXe,{})}function hMr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=gi("conversation"),[a,o]=Y.useState(null);return Q.jsxs(Q.Fragment,{children:[Q.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(s=>{const l=Mhe(s.mimeType),u=jot(s,t),d=s.status==="uploading"||s.status==="error"||!u,h=Q.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:l==="image"?void 0:()=>o(s),"aria-label":i("media.preview",{name:s.name??i("media.attachment")}),children:[l==="image"&&u?Q.jsx("img",{className:"media-card-image",src:u,alt:s.name??i("media.image"),loading:"lazy"}):l==="video"&&u?Q.jsxs("div",{className:"media-card-video-container",children:[Q.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),Q.jsx("span",{className:"media-card-video-play",children:Q.jsx(Nfr,{})})]}):Q.jsx("span",{className:"media-card-icon",children:Q.jsx(dMr,{kind:l})}),Q.jsxs("span",{className:"media-card-copy",children:[Q.jsx("span",{className:"media-card-name",children:s.name??i("media.attachment")}),Q.jsxs("span",{className:"media-card-meta",children:[Q.jsx("span",{className:"media-card-type",children:Yot(s)}),s.status==="uploading"?Q.jsxs(Q.Fragment,{children:[Q.jsx(Xv,{className:"media-card-spinner"})," ",i("media.uploading")]}):s.status==="error"?s.error??i("media.uploadFailed"):qot(s.sizeBytes)]})]}),!r&&s.status!=="uploading"&&s.status!=="error"?Q.jsx(hG,{className:"media-card-open"}):null]});return Q.jsxs(EA.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"&&!d?Q.jsx(Rrt,{src:u,children:h}):h,n?Q.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:s.name??i("media.attachment")}),onClick:()=>n(s.id),children:Q.jsx(SE,{})}):null]},s.id)})}),Q.jsx(Vfr,{children:a?Q.jsx(fMr,{appName:t,item:a,onClose:()=>o(null)}):null})]})}function fMr({appName:t,item:e,onClose:r}){const{t:n}=gi("conversation"),i=Y.useMemo(()=>jot(e,t),[t,e]),a=Mhe(e.mimeType),[o,s]=Y.useState(""),[l,u]=Y.useState(a==="text"||a==="markdown"),[d,h]=Y.useState("");return Y.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),Y.useEffect(()=>{if(a!=="text"&&a!=="markdown")return;const f=new AbortController;return u(!0),h(""),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||h(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),Q.jsx(EA.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":n("media.previewDialog",{name:e.name??n("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&r()},children:Q.jsxs(EA.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[Q.jsxs("header",{className:"media-viewer-header",children:[Q.jsxs("div",{children:[Q.jsx("strong",{children:e.name??n("media.attachment")}),Q.jsxs("span",{children:[Yot(e),e.sizeBytes?` · ${qot(e.sizeBytes)}`:""]})]}),Q.jsxs("nav",{children:[Q.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:Q.jsx(Tle,{})}),Q.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:Q.jsx(SE,{})})]})]}),Q.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?Q.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?Q.jsx("div",{className:"media-viewer-video-wrapper",children:Q.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?Q.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?Q.jsxs("div",{className:"media-viewer-loading",children:[Q.jsx(Xv,{})," ",n("media.reading")]}):null,!l&&d?Q.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:d})}):null,!l&&a==="markdown"?Q.jsx("div",{className:"media-document",children:Q.jsx(hH,{text:o})}):null,!l&&a==="text"?Q.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function pMr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=gi("conversation"),o=t.icon,s=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:s});return Q.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[Q.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:Q.jsx(o,{})}),r?Q.jsx("span",{className:"builtin-tool-label",children:l}):Q.jsx(xm,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),Q.jsx(HE,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function Nh(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function tn(t){return typeof t=="string"?t:""}function Xot(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function Wf(t){return Array.isArray(t)?t:[]}function Ihe(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Nh(e)??{};return Nh(r.result)??r}function fH(t){if(typeof t=="string")try{return fH(JSON.parse(t))}catch{return t}const e=Nh(t);if(!e)return"";const r=Nh(e.result);return tn(e.error)||tn(e.message)||tn(r==null?void 0:r.error)||tn(r==null?void 0:r.message)}function gMr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=Nh(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 Kot={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function mMr(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 vMr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function yMr(t,e=Kot){const r=Ihe(t),n=Nh(r.capabilities)??{},i=Wf(r.resources).flatMap(o=>{const s=Nh(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:gMr(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=Nh(o);if(!s)return[];const l=tn(s.source),u=tn(s.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:vMr(l),label:mMr(l,e),status:d,count:Xot(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:Xot(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 bMr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function Zot(t,e,r=Kot){const n=Ihe(t),i=Ihe(e),a=new Map(Wf(i.results).flatMap(d=>{const h=Nh(d),f=tn(h==null?void 0:h.name);return h&&f?[[f,h]]:[]})),o=Wf(n.agents).flatMap(d=>{const h=Nh(d),f=tn(h==null?void 0:h.name);return h&&f?[h]:[]}),s=new Set(o.map(d=>tn(d.name))),l=[...a.entries()].filter(([d])=>!s.has(d)).map(([d])=>({name:d})),u=[...o,...l].map(d=>{const h=tn(d.name),f=Wf(d.nodes).flatMap(T=>{const C=Nh(T);return C?[C]:[]}),p=tn(d.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(h),y=tn(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=Jot(v==null?void 0:v.resources),w=x.length>0?x:Jot(f.flatMap(T=>Wf(T.resources))),A=est(v==null?void 0:v.python_tools),S=A.length>0?A:est(f.flatMap(T=>Wf(T.python_tools)));return{name:h,description:tn(v==null?void 0:v.description)||tn(g==null?void 0:g.description)||tn(d.task),task:tn(d.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(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function xMr(t,e){return!!fH(e)||Zot(t,e).failedCount>0}function Jot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Nh(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 est(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Nh(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 wMr=t=>{const e=Y.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},Phe=t=>{const e=wMr(t),r=Y.Children.count(e);return Y.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:Q.jsx("span",{children:n});if(Y.isValidElement(n)){const i=n,{children:a,...o}=i.props;return a!=null?Y.cloneElement(i,o,Phe(a)):i}return n})},AMr={Badge:"_Badge_1viyg_1"},Ex=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...o})=>Q.jsx("div",{className:l_(AMr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...o,children:Phe(t)});Y.createContext(null);const SMr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},TMr=({className:t,size:e,strokeWidth:r,style:n,...i})=>Q.jsx("div",{...i,className:l_(SMr.LoadingIndicator,t),style:n||Got({"indicator-size":e,"indicator-stroke":r})});function CMr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const kMr=()=>zot,tst=(t,e=!1,r="TransitionGroup")=>{const n=[];return Y.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},b_=()=>{},x_=t=>{const e=Y.useRef(t);return e.current=t,Y.useCallback(r=>e.current(r),[])};function OMr(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 EMr(t,e,r){if((zot||JLr)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const _Mr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},rst={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},RMr=t=>({...rst,enter:!t}),DMr=(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 rst}},LMr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:o,shouldRender:s,enterDuration:l,exitDuration:u,removeChild:d,onEnter:h,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=Y.useReducer(DMr,RMr(o||!1)),x=Y.useRef(!1),w=Y.useRef(null),A=Y.useRef(l);A.current=l;const S=Y.useRef(u);S.current=u;const T=Y.useRef(null),C=Y.useCallback(O=>{const E=w.current;if(!(!E||O===T.current))switch(T.current=O,O){case"enter":h(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}},[h,f,p,g,m,v]);return VIe.useLayoutEffect(()=>{if(!s){let _;b({type:"exit-before"}),C("exit");const P=_he(()=>{b({type:"exit-active"}),C("exit-active"),_=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{P(),_!==void 0&&clearTimeout(_)}}if(o&&!x.current){x.current=!0;return}let O;b({type:"enter-before"}),C("enter");const E=_he(()=>{b({type:"enter-active"}),C("enter-active"),O=window.setTimeout(()=>{b({type:"done"}),C("enter-complete")},A.current)});return()=>{E(),O!==void 0&&clearTimeout(O)}},[s,o,d,C]),Y.useEffect(()=>()=>{x.current=!1},[]),Q.jsx(e,{ref:CMr([w,t]),className:l_(n,_Mr.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})},MMr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=Y.useState(n==null);return Fot(()=>a(!0),i?null:n),i?Q.jsx(LMr,{...t}):null},nst=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:d,insertMethod:h="append",disableAnimations:f=kMr()}=t,p=x_(t.onEnter??b_),g=x_(t.onEnterActive??b_),m=x_(t.onEnterComplete??b_),v=x_(t.onExit??b_),y=x_(t.onExitActive??b_),b=x_(t.onExitComplete??b_);Y.Children.forEach(n,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=Y.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]=Y.useState(()=>tst(n).map(S=>({...x(S),preventMountTransition:u})));return Y.useLayoutEffect(()=>{A(S=>{const T=tst(n);return OMr(T,S,x,h)})},[n,h,x]),EMr("TransitionGroup",e,Y.Children.count(n)),f?Q.jsx(Q.Fragment,{children:Y.Children.map(n,S=>Q.jsx(r,{ref:e,className:i,style:o,"data-transition-id":a,children:S}))}):Q.jsx(Q.Fragment,{children:w.map(({component:S,...T})=>Q.jsx(MMr,{...T,as:r,className:i,transitionId:a,enterDuration:s,exitDuration:l,enterMountDelay:d,style:o,ref:e,children:S},S.key))})},Nhe={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},IMr=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:d,block:h,opticallyAlign:f,children:p,className:g,onClick:m,disabled:v,disabledTone:y,inert:b=u,...x}=t,w=v||b,A=Y.useCallback(S=>{v||m==null||m(S)},[m,v]);return Q.jsxs("button",{type:e,className:l_(Nhe.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":d?"":void 0,"data-block":h?"":void 0,"data-optically-align":f,onPointerEnter:Vot,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:[Q.jsx(nst,{className:Nhe.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&Q.jsx(TMr,{},"loader")}),Q.jsx("span",{className:Nhe.ButtonInner,children:Phe(p)})]})},PMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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"})}),NMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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"})}),BMr=t=>Q.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:Q.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 $Mr({branch:t}){return Q.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?Q.jsx(hH,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?Q.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?Q.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function FMr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=gi("conversation"),a=Y.useMemo(()=>Fje(t,e,r),[t,e,r]),[o,s]=Y.useState(0);return Q.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[Q.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>Q.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:Q.jsx(Ex,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),Q.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>Q.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[Q.jsx("header",{className:"branch-compare__head",children:Q.jsx(Ex,{color:"info",size:"sm",variant:"soft",children:l.label})}),Q.jsx($Mr,{branch:l}),Q.jsx("footer",{className:"branch-compare__footer",children:Q.jsx(IMr,{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 ist({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=Y.useRef(t!==void 0),[a,o]=Y.useState(e),s=i?t:a,l=Y.useCallback(u=>{i||o(u)},[]);return[s,l]}const ast=Y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function zMr(){return Y.useContext(ast)}function UMr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Pn(i),[,o]=Y.useState(!1),s=Zp(GMr).current,l=Zp(VMr).current,u=Y.useRef(0),d=Y.useRef(!0),h=Y.useRef([]),f=Y.useRef(null),p=Pn(()=>{d.current||(d.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,O;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:((O=(C=T.registration.textRef)==null?void 0:C.current)==null?void 0:O.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(O=>{if(!WMr(O))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&ost(E,_)>0){S.disconnect(),p();return}E=_}});f.current=S;const T=new Set;for(let O=1;OS.observe(O,{childList:!0}))}const b=Pn(()=>{const[A,S]=QMr(l),T=v(A);y(S),h.current=A,d.current=!1,s.forEach(C=>C(T)),a(T)});Bn(()=>(d.current||v(h.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Bn(()=>{d.current&&b()}),Bn(()=>()=>{var A;(A=f.current)==null||A.disconnect(),d.current=!0},[]);const x=Pn(A=>(s.add(A),()=>{s.delete(A)})),w=Y.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return Q.jsx(ast.Provider,{value:w,children:e})}function VMr(){return new Map}function GMr(){return new Set}function QMr(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)=>ost(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 HMr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function WMr(t){for(const e of t)for(let r=0;rnull},cst=Y.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:o,keepMounted:s,loopFocus:l,onValueChange:u,multiple:d=!1,orientation:h="vertical",value:f,defaultValue:p,style:g,...m}=e,v=Y.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=Y.useRef([]),[b,x]=ist({controlled:f,default:v,name:"Accordion",state:"value"}),w=Pn((C,O,E)=>{if(d)if(O){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=Y.useMemo(()=>({value:b,disabled:a,orientation:h}),[b,a,h]),S=Y.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:o??!1,keepMounted:s??!1,state:A,value:b}),[a,w,o,s,A,b]),T=tg("div",e,{state:A,ref:r,props:m,stateAttributesMapping:YMr});return Q.jsx(sst.Provider,{value:S,children:Q.jsx(UMr,{elementsRef:y,children:T})})});function qMr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,o]=ist({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:l,transitionStatus:u}=xet(a,!0,!0),d=QE(),[h,f]=Y.useState(),p=h===null?void 0:h??d,g=Pn(m=>{const v=!a,y=Rs($E,m.nativeEvent);n(v,y),!y.isCanceled&&o(v)});return Y.useMemo(()=>({defaultPanelId:d,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:p,setMounted:l,setOpen:o,setPanelIdState:f,transitionStatus:u}),[d,i,g,s,a,p,l,o,f,u])}const ust=Y.createContext(void 0);function dst(){const t=Y.useContext(ust);if(t===void 0)throw new Error(oy(15));return t}function jMr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:o,unregister:s,subscribeMapChange:l,nextIndexRef:u}=zMr(),d=Y.useRef(-1),[h,f]=Y.useState(a==null&&e?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),p=a??h,g=Y.useRef(null),m=Y.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 hst=Y.createContext(void 0);function Bhe(){const t=Y.useContext(hst);if(t===void 0)throw new Error(oy(9));return t}let $he=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=lQ.startingStyle]="startingStyle",t[t.endingStyle=lQ.endingStyle]="endingStyle",t}({}),XMr=function(t){return t.panelOpen="data-panel-open",t}({});const KMr={[$he.open]:""},ZMr={[$he.closed]:""},JMr={open(t){return t?{[XMr.panelOpen]:""}:null}},eIr={open(t){return t?KMr:ZMr}};let tIr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const Fhe={...eIr,index:t=>({[tIr.index]:String(t)}),...Det,value:()=>null},fst=Y.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:o,value:s,style:l,...u}=e,{ref:d,index:h}=jMr(),f=FE(r,d),{disabled:p,handleValueChange:g,state:m,value:v}=lst(),y=QE(),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=qMr({open:w,onOpenChange:A,disabled:x}),T=Y.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=Y.useMemo(()=>({...S,onOpenChange:A,state:T}),[S,T,A]),O=Y.useMemo(()=>({...m,hidden:!w&&!S.mounted,index:h,disabled:x,open:w}),[S.mounted,x,h,w,m]),E=QE(),[_,P]=Y.useState(),L=_===null?void 0:_??E,R=Y.useMemo(()=>({defaultTriggerId:E,open:w,state:O,setTriggerId:P,triggerId:L}),[E,w,O,P,L]),D=tg("div",e,{state:O,ref:f,props:u,stateAttributesMapping:Fhe});return Q.jsx(ust.Provider,{value:C,children:Q.jsx(hst.Provider,{value:R,children:D})})}),pst=Y.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,{state:s}=Bhe();return tg("h3",e,{state:s,ref:r,props:o,stateAttributesMapping:Fhe})}),gst=Y.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:l,...u}=e,{panelId:d,open:h,handleTrigger:f,disabled:p}=dst(),g=n||p,{getButtonProps:m,buttonRef:v}=Ret({disabled:g,focusableWhenDisabled:!0,native:s}),{defaultTriggerId:y,state:b,setTriggerId:x}=Bhe(),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]),tg("button",e,{state:b,ref:[r,v],props:[{"aria-controls":h?d:void 0,"aria-expanded":h,id:A,onClick:f},u,m],stateAttributesMapping:JMr})}),VN={height:void 0,width:void 0};function rIr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:l,setOpen:u,transitionStatus:d}=t,h=Y.useRef(null),f=Y.useRef(null),[p,g]=Y.useState(VN),m=Y.useRef(VN),v=Y.useRef(!1),y=Y.useRef(s),b=Y.useRef(!1),[x,w]=Y.useState(!1),A=Y.useRef(null),S=FE(e,h),T=Cu(s),C=yue(h),O=!s&&!a,E=x?"idle":d,_=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&&O&&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||d==="starting"||w(!1)},[x,d]),Y.useEffect(()=>()=>{I(),D()},[I,D]),Bn(()=>{const F=h.current;if(!F)return;!s&&A.current&&D();const B=nIr(F,_);if(f.current=B,s&&d==="idle"&&y.current&&B==="css-animation"){m.current=w_(F);return}if(s&&d==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(w_(F)),w(!0);return}if(B==="css-transition"){const j=iIr(F);if(R(w_(F)),!U)return j;const q=pH(F,"transition-duration","0s");return M(q),w(!0),j}R(w_(F));const G=pH(F,"animation-name","none");if(!U){G();return}const H=pH(F,"animation-duration","0s");G(),M(H),w(!0);return}if(!s&&a&&(d==="idle"||d==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(VN,!1),l(!1);return}R(w_(F));return}if(d!=="ending")return;if(B==="none"){l(!1);return}const V=w_(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&pH(F,"animation-name","none")()},[a,s,D,R,l,M,_,d]),bue({enabled:s&&a&&E==="idle",open:!0,ref:h,onComplete(){s&&R(VN,!1)}}),Y.useEffect(()=>{if(s||!a||E!=="ending"||!h.current)return;const B=new AbortController;let V=-1;function z(){T.current||(l(!1),R(VN,!1))}return V=Md.request(()=>{C(z,B.signal)}),()=>{Md.cancel(V),B.abort()}},[T,a,s,E,C,R,l]),Bn(()=>{const F=h.current;!F||!r||!O||F.setAttribute("hidden","until-found")},[O,r]),Y.useEffect(function(){const B=h.current;if(!B)return;function V(z){const U=Rs(iJe,z);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return xi(B,"beforematch",V)},[o,u]);const N=i||r||a||s;return{height:P.height,props:{...L?{[$he.startingStyle]:""}:void 0,hidden:O,id:n},ref:S,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:P.width}}function w_(t){return{height:t.scrollHeight,width:t.scrollWidth}}function nIr(t,e){const r=cs(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&mst(r.animationDuration),i=mst(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function mst(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function pH(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 iIr(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=Md.request(r);return()=>{Md.cancel(n),r()}}let vst=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const yst=Y.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:o,render:s,style:l,...u}=e,{hiddenUntilFound:d,keepMounted:h}=lst(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=dst(),w=i??d,A=a??h,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:O,ref:E,shouldPreventOpenAnimation:_,shouldRender:P,transitionStatus:L,width:R}=rIr({externalRef:r,hiddenUntilFound:w,id:T,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=Bhe(),I={...D,transitionStatus:L},N=MJe(l,I),F=tg("div",{...e,style:void 0},{state:I,ref:E,props:[O,{"aria-labelledby":M,role:"region",style:{[vst.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[vst.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Fhe});return P?F:null});function zhe(t){const e=Y.useRef(t);return e.current=t,e}let A_=[],gH=!1;const bst=t=>{var e,r;if(t.key==="Escape"){const[n]=A_;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},xst=()=>{A_.length>0&&!gH?(document.body.addEventListener("keydown",bst),gH=!0):A_.length===0&&gH&&(document.body.removeEventListener("keydown",bst),gH=!1)},aIr=t=>{A_.unshift(t),xst()},oIr=({id:t})=>{A_=A_.filter(e=>e.id!==t),xst()},sIr=(t,e)=>{const r=Y.useId(),n=zhe(e);Y.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return aIr(i),()=>oIr(i)},[r,t,n])},lIr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=cIr(n,r.getBoundingClientRect()),a=uIr(n,i),o=dIr(e.getBoundingClientRect());return fIr([...a,...o])};function cIr(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 uIr(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 dIr(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 hIr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,o=e.length-1;an!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(i=!i)}return i}function fIr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),pIr(e)}function pIr(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 wst={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},Ast=Y.createContext(null),mH=()=>{const t=Y.use(Ast);if(!t)throw new Error("Popover components must be wrapped in ");return t},GN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,o]=Y.useState(!1),[s,l]=Y.useState(!1),u=Y.useRef(null),d=Y.useRef(null),h=Y.useRef(void 0),f=Y.useRef(!1),p=Y.useRef(!1),g=t??a,[m,v]=Y.useState(!1);Fot(()=>v(!1),m?500:null);const y=zhe(e),b=zhe(T=>{var C,O;clearTimeout(h.current),g!==T&&(T||(l(!1),r&&f.current&&((C=u.current)==null||C.focus()),f.current=!1),(O=y.current)==null||O.call(y,T),o(T),r&&v(T))}),x=Y.useCallback(T=>{b.current(T)},[b]),w=Y.useCallback(()=>{h.current=setTimeout(()=>x(!0),n)},[x,n]),A=Y.useCallback(()=>{clearTimeout(h.current)},[]);Y.useEffect(()=>()=>{clearTimeout(h.current)},[]);const S=Y.useMemo(()=>({open:g,setOpen:x,shake:s,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:f}),[g,x,s,l,r,m,f,p,w,A]);return Q.jsx(Ast,{value:S,children:Q.jsx(LLr,{open:g,onOpenChange:x,modal:!1,children:i})})},gIr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:o,onTriggerLeave:s,isPointerInTransitRef:l,triggerRef:u,contentRef:d}=mH(),h=Y.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!h.current&&!l.current&&(o(),h.current=!0)},g=()=>{h.current&&(s(),h.current=!1)};return Q.jsx(MLr,{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=d.current)!=null&&m.contains(document.activeElement)||n(!1)},50)}:void 0,children:t})},Sst=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:o=8,align:s,alignOffset:l,translucent:u,className:d,autoFocus:h=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=mH(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=Qot(y),x=b[b.length-1];x==null||x.focus()}};return Y.useEffect(()=>{const v=g.current;!v||!h||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,h]),Q.jsx(PLr,{forceMount:!0,ref:g,className:l_(wst.Popover,d),style:Got({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?Rhe: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:Rhe,onEscapeKeyDown:Rhe,onKeyDown:m,children:t})},mIr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=mH(),[o,s]=Y.useState(null),l=Y.useCallback(()=>{s(null),i.current=!1},[i]),u=Y.useCallback((d,h)=>{const f=lIr(d,h);s(f),i.current=!0},[i]);return Y.useEffect(()=>()=>l(),[l]),Y.useEffect(()=>{const d=r.current,h=n.current;if(!d||!h)return;const f=g=>u(g,h),p=g=>u(g,d);return d.addEventListener("pointerleave",f),h.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",f),h.removeEventListener("pointerleave",p)}},[n,r,u,l]),Y.useEffect(()=>{if(!o)return;const d=h=>{const f=r.current,p=n.current,g=h.target,m={x:h.clientX,y:h.clientY},v=(f==null?void 0:f.contains(g))||(p==null?void 0:p.contains(g)),y=!hIr(m,o),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,e,l,r,n]),Y.useEffect(()=>{const d=h=>{if(n.current&&h.key==="Tab"&&!h.shiftKey){const[f]=Qot(n.current);f&&(h.preventDefault(),f.focus(),a.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[n,a]),Q.jsx(Sst,{...t})},vIr=t=>{const{open:e,showOnHover:r,setOpen:n}=mH();return sIr(e,()=>{n(!1)}),Q.jsx(ILr,{forceMount:!0,children:Q.jsx(nst,{enterDuration:600,exitDuration:300,className:wst.Transition,disableAnimations:!0,children:e&&(r?Q.jsx(mIr,{...t},"popover-hover"):Q.jsx(Sst,{...t},"popover"))})})};GN.Trigger=gIr,GN.Content=vIr,Y.createContext(null),Y.createContext(null),Y.createContext(null),Y.createContext(null);function Uhe(...t){return t.filter(Boolean).join(" ")}const Tst=[["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 yIr(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]=Tst[r%Tst.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 bIr({seed:t,className:e}){return Q.jsx("span",{className:Uhe("resource-card__identity-mark",e),style:yIr(t),"aria-hidden":"true"})}Y.forwardRef(function({className:e,...r},n){return Q.jsx("section",{ref:n,className:Uhe("resource-results",e),...r})});function xIr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...o}){return Q.jsxs("article",{className:Uhe("resource-card",i&&"is-interactive",t),...o,children:[i&&n?Q.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,Q.jsx("div",{className:"resource-card__content",children:a}),e||r?Q.jsxs("footer",{className:"resource-card__footer",children:[e,r?Q.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function wIr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return Q.jsxs("div",{className:"resource-card__header",children:[Q.jsxs("div",{className:"resource-card__identity",children:[t,Q.jsxs("div",{className:"resource-card__title-copy",children:[Q.jsx("h3",{title:r,children:e}),n]})]}),i]})}function AIr({children:t,title:e}){return Q.jsx("p",{className:"resource-card__description",title:e,children:t})}function SIr(t){return Q.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[Q.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"}),Q.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"}),Q.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 TIr=["skill_hub","skill_space","knowledge_base","tool"];function Cst(t){return Q.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:Q.jsx("path",{d:"m4 6 4 4 4-4"})})}function kst({label:t}){return Q.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>Q.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[Q.jsx("span",{}),Q.jsx("span",{})]},e))})}function CIr(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 Vhe({label:t,resources:e}){const{t:r}=gi("conversation");return e.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:t}),Q.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>Q.jsxs("div",{className:"create-agent-card__popover-item",children:[Q.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[Q.jsx("strong",{children:n.name}),Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:CIr(n,r)})]}),n.description?Q.jsx("p",{children:n.description}):null]},n.ref))})]})}function kIr({tools:t}){const{t:e}=gi("conversation");return t.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),Q.jsx(cst,{children:t.map((r,n)=>Q.jsxs(fst,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[Q.jsx(pst,{className:"create-agent-card__python-tool-header",children:Q.jsxs(gst,{className:"create-agent-card__python-tool-trigger",children:[Q.jsxs("span",{children:[Q.jsx("strong",{children:r.name}),r.description?Q.jsx("small",{children:r.description}):null]}),Q.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),Q.jsx(Cst,{className:"create-agent-card__python-tool-chevron"})]})]})}),Q.jsxs(yst,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?Q.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,Q.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:Q.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function OIr({agents:t}){const{t:e}=gi("conversation");return t.length===0?null:Q.jsxs("section",{className:"create-agent-card__popover-section",children:[Q.jsx("h4",{children:e("blocks.createAgents.subAgents")}),Q.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>Q.jsxs("div",{className:"create-agent-card__popover-item",children:[Q.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[Q.jsx("strong",{children:r.id}),Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?Q.jsx("p",{children:r.description}):null]},r.id))})]})}function vH({label:t,count:e,icon:r,children:n}){const{t:i}=gi("conversation"),a=Q.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,Q.jsx("span",{children:e})]});return e===0?a:Q.jsxs(GN,{showOnHover:!0,hoverOpenDelay:120,children:[Q.jsx(GN.Trigger,{children:a}),Q.jsx(GN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function EIr({response:t,status:e}){const{t:r}=gi("conversation"),n=Y.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=Y.useMemo(()=>yMr(t,n),[n,t]),a=Y.useMemo(()=>TIr.map(l=>{const u=bMr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[i,r]),o=e==="failed",s=o?fH(t):"";return Q.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?Q.jsx(kst,{label:r("blocks.createAgents.retrieving")}):o?Q.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),Q.jsx("span",{children:s||r("blocks.createAgents.checkConfig")})]}):Q.jsx(cst,{className:"create-agent-card__accordion",children:a.map(l=>Q.jsxs(fst,{className:"create-agent-card__accordion-item",value:l.value,children:[Q.jsx(pst,{className:"create-agent-card__accordion-header",children:Q.jsxs(gst,{className:"create-agent-card__accordion-trigger",children:[Q.jsx("span",{children:l.label}),Q.jsxs("span",{className:"create-agent-card__accordion-meta",children:[Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.notSearched"):r("blocks.createAgents.notConfigured"):l.resources.length}),Q.jsx(Cst,{className:"create-agent-card__accordion-chevron"})]})]})}),Q.jsx(yst,{className:"create-agent-card__accordion-content",children:Q.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?Q.jsxs("div",{className:"create-agent-card__search-keywords",children:[Q.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),Q.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?Q.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>Q.jsx("div",{className:"create-agent-card__resource",children:Q.jsxs("div",{className:"create-agent-card__resource-main",children:[Q.jsxs("div",{className:"create-agent-card__resource-title",children:[Q.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?Q.jsx(Ex,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?Q.jsx("p",{children:u.description}):null]})},u.ref))}):Q.jsxs("div",{className:"create-agent-card__empty-category",children:[Q.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=>Q.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function _Ir({args:t,response:e,status:r}){const{t:n}=gi("conversation"),i=Y.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=Y.useMemo(()=>Zot(t,e,i),[t,i,e]),o=r==="failed"?fH(e):"";return Q.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[o?Q.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),Q.jsx("span",{children:o})]}):null,a.agents.length>0?Q.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,d=s.builtinTools.length+s.pythonTools.length;return Q.jsxs(xIr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[Q.jsx(wIr,{leading:Q.jsx(bIr,{seed:s.name}),title:s.name,titleText:s.name,status:Q.jsx(Ex,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${s.rootType}`,{defaultValue:s.rootType})})}),s.description?Q.jsx(AIr,{children:s.description}):null,u?Q.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,Q.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:s.name}),children:[Q.jsx(vH,{label:n("blocks.createAgents.skill"),count:s.skills.length,icon:Q.jsx(NMr,{"aria-hidden":"true"}),children:Q.jsx(Vhe,{label:n("blocks.createAgents.skill"),resources:s.skills})}),Q.jsx(vH,{label:n("blocks.createAgents.knowledgeBase"),count:s.knowledgeBases.length,icon:Q.jsx(SIr,{"aria-hidden":"true"}),children:Q.jsx(Vhe,{label:n("blocks.createAgents.knowledgeBase"),resources:s.knowledgeBases})}),Q.jsxs(vH,{label:n("blocks.createAgents.toolsLabel"),count:d,icon:Q.jsx(PMr,{"aria-hidden":"true"}),children:[Q.jsx(Vhe,{label:n("blocks.createAgents.builtinTool"),resources:s.builtinTools}),Q.jsx(kIr,{tools:s.pythonTools})]}),Q.jsx(vH,{label:n("blocks.createAgents.subAgents"),count:s.subAgentCount,icon:Q.jsx(BMr,{"aria-hidden":"true"}),children:Q.jsx(OIr,{agents:s.subAgents})})]})]},s.name)})}):r==="running"?Q.jsx(kst,{label:n("blocks.createAgents.creating")}):Q.jsxs("div",{className:"create-agent-card__message",children:[Q.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),Q.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const RIr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Het},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Het},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:Exr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:Rxr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:Dxr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Yet},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:Yet},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:Axr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:Sxr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Txr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:Cxr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:kxr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:Oxr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:_xr,detailRenderer:EIr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Wet,detailRenderer:_Ir},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Wet,detailRenderer:FMr,hideHeader:!0}};function Ghe(t){return RIr[t]}function DIr(t){return Q.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[Q.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),Q.jsx("path",{d:"M14 3v5h5"}),Q.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function LIr(t){return Q.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[Q.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"}),Q.jsx("path",{d:"m9 12 2 2 4-4"})]})}Dd.hasResourceBundle("en-US","workspaceTools")||Dd.addResourceBundle("en-US","workspaceTools",iVe,!0,!0),Dd.hasResourceBundle("zh-CN","workspaceTools")||Dd.addResourceBundle("zh-CN","workspaceTools",oje,!0,!0);function MIr(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 YA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function IIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function Qhe(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function PIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function NIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m9 5 7 7-7 7"})})}function BIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function $Ir(t){return Q.jsxs("svg",{...YA(t),children:[Q.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),Q.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 FIr(t){return Q.jsx("svg",{...YA(t),children:Q.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const zIr=Y.lazy(()=>Promise.resolve().then(()=>G_n)),UIr=Y.lazy(()=>Promise.resolve().then(()=>wRn)),Ost="veadk-code-workspace-theme";function VIr(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 GIr(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 QIr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(Ost)==="dark"?"dark":"light"}catch{return"light"}}function HIr(t){return t===""?0:t.split(` `).length}function Est({project:t,open:e,onClose:r,onChange:n,readOnly:i=!1,comparison:a}){var L;const{t:o}=gi("workspaceTools"),s=Y.useId(),l=Y.useRef(null),u=Y.useRef(null),d=Y.useRef(r),[h,f]=Y.useState(QIr),p=Y.useMemo(()=>a?MIr(a.baseProject.files,t.files):[],[a,t.files]),g=Y.useMemo(()=>a?p.map(R=>({path:R.path,content:R.status==="deleted"?R.before:R.after})):t.files,[p,a,t.files]),m=Y.useMemo(()=>new Map(p.map(R=>[R.path,R.status])),[p]),[v,y]=Y.useState(((L=g[0])==null?void 0:L.path)??null),[b,x]=Y.useState(new Set),w=Y.useMemo(()=>VIr(g),[g]),A=g.find(R=>R.path===v)??null,S=p.find(R=>R.path===v)??null;if(d.current=r,Y.useEffect(()=>{try{window.localStorage.setItem(Ost,h)}catch{}},[h]),Y.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(),d.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]),Y.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?Q.jsx("span",{className:`code-browser-change is-${R}`,children:o(`codeBrowser.change.${R}`)}):null}function O(R,D,M){return GIr(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 Q.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:[Q.jsx(Qhe,{}),Q.jsx("span",{children:I.name}),C(V)]},N)}const B=b.has(N);return Q.jsxs("div",{children:[Q.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>T(N),"aria-expanded":!B,children:[Q.jsx(NIr,{className:B?"":"is-open"}),Q.jsx(PIr,{}),Q.jsx("span",{children:I.name})]}),!B&&O(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 _=h==="light"?"dark":"light",P=o(a?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Ef.createPortal(Q.jsx("div",{className:"code-browser-backdrop",onMouseDown:R=>{R.target===R.currentTarget&&r()},children:Q.jsxs("section",{ref:l,className:`code-browser-dialog is-${h}`,role:"dialog","aria-modal":"true","aria-labelledby":s,children:[Q.jsxs("header",{className:"code-browser-head",children:[Q.jsxs("div",{className:"code-browser-title-wrap",children:[Q.jsx("span",{className:"code-browser-title-icon",children:Q.jsx(IIr,{})}),Q.jsxs("div",{children:[Q.jsx("h2",{id:s,children:o(a?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),Q.jsx("p",{title:t.name,children:t.name||o("codeBrowser.projectFallback")})]})]}),Q.jsxs("div",{className:"code-browser-head-actions",children:[Q.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:h==="light"?Q.jsx(FIr,{}):Q.jsx($Ir,{})}),Q.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:r,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:Q.jsx(BIr,{})})]})]}),Q.jsxs("div",{className:"code-browser-workspace",children:[Q.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(a?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[Q.jsxs("div",{className:"code-browser-sidebar-head",children:[Q.jsx("span",{children:o(a?"codeBrowser.changes":"codeBrowser.files")}),Q.jsx("span",{children:g.length})]}),Q.jsx("div",{className:"code-browser-tree",children:g.length>0?O(w,0,""):Q.jsx("div",{className:"code-browser-empty",children:P})})]}),Q.jsxs("main",{className:"code-browser-main",children:[Q.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:A?Q.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[Q.jsx(Qhe,{}),Q.jsx("span",{children:A.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),Q.jsxs("div",{className:"code-browser-path",children:[Q.jsx(Qhe,{}),Q.jsx("span",{children:(A==null?void 0:A.path)??o("codeBrowser.noFileSelected")})]}),a?Q.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[Q.jsx("span",{children:a.baseLabel??o("codeBrowser.before")}),Q.jsx("span",{children:a.targetLabel??o("codeBrowser.after")})]}):null,Q.jsx("div",{className:"code-browser-editor",children:A?Q.jsx(Y.Suspense,{fallback:Q.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?Q.jsx(UIr,{before:S.before,after:S.after,path:S.path,theme:h}):Q.jsx(zIr,{value:A.content,path:A.path,onChange:E,readOnly:i,theme:h})}):Q.jsx("div",{className:"code-browser-empty",children:P})}),Q.jsxs("footer",{className:"code-browser-statusbar",children:[Q.jsx("span",{children:a?o("codeBrowser.changedFileCount",{count:p.length}):o("codeBrowser.fileCount",{count:t.files.length})}),Q.jsx("span",{children:A?o("codeBrowser.lineCount",{count:HIr(A.content)}):"UTF-8"})]})]})]})]})}),document.body)}const qA="••••••••",yH=5,S_=8e3,WIr=8,YIr=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,_st=/\u001b\[[0-?]*[ -/]*[@-~]/g,Rst=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,Dst=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,qIr=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),jIr=new Set(["web_search","search","grep","rg"]),XIr=new Set(["read_file","read","list_files","glob","ls"]),KIr=new Set(["apply_patch","file_change","fileChange"]),ZIr=new Set(["create_goal","update_goal","get_goal"]);function _x(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function jA(...t){for(const e of t)if(typeof e=="string"&&e.trim())return e.trim();return""}function Hhe(...t){for(const e of t){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()&&Number.isFinite(Number(e)))return Number(e)}}function bH(t){const e=_x(t);if(!e)return[];const r=[e];for(const n of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const i=_x(e[n]);i&&r.push(i)}return r}function QN(t,...e){return jA(...t.flatMap(r=>e.map(n=>r[n])))}function JIr(t){let e=t.replace(_st,"").replace(Rst,"").replace(Dst,"");return/[=:]|Bearer|Cookie|AKLT/i.test(e)&&(e=e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${qA}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${qA}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,qA).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${qA}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${qA}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${qA}`)),e}function lg(t){return JIr(t).replace(_st,"").replace(Rst,"").replace(Dst,"")}function xH(t,e=0,r=new WeakSet){if(e>=WIr)return"[truncated: maximum depth]";if(typeof t=="string")return lg(t);if(t===null||typeof t!="object")return t;if(r.has(t))return"[circular]";if(r.add(t),Array.isArray(t))return t.map(i=>xH(i,e+1,r));const n=_x(t);return n?Object.fromEntries(Object.entries(n).map(([i,a])=>[i,YIr.test(i)?qA:xH(a,e+1,r)])):t}function Whe(t){const e=lg(t).trimEnd();if(!e)return;const r=e.split(/\r?\n/);return e.length>S_*2?{text:e.slice(0,S_)+e.slice(-S_),head:[e.slice(0,S_)],tail:[e.slice(-S_)],omittedLines:0,omittedCharacters:e.length-S_*2}:r.length<=yH*2?{text:e,head:r,tail:[],omittedLines:0,omittedCharacters:0}:{text:e,head:r.slice(0,yH),tail:r.slice(-yH),omittedLines:r.length-yH*2,omittedCharacters:0}}function ePr(t){return ZIr.has(t)?"goal":qIr.has(t)?"command":jIr.has(t)||/search/i.test(t)?"search":XIr.has(t)||/(?:read|list|glob)/i.test(t)?"read":KIr.has(t)||/(?:write|edit|patch|file.?change)/i.test(t)?"file-change":/^(?:mcp|tool__)/i.test(t)||t.includes("/")?"mcp":/auth|credential|approval/i.test(t)?"authorization":"generic"}function tPr(t,e){if(t.status)return t.status;const r=jA(e==null?void 0:e.status).toLowerCase();return(e==null?void 0:e.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(r)?"failed":t.done||["completed","done","success"].includes(r)?"completed":"running"}function Lst(t){return typeof t=="string"?t.trim()?[t.trim()]:[]:Array.isArray(t)?t.flatMap(e=>{if(typeof e=="string")return e.trim()?[e.trim()]:[];const r=_x(e),n=jA(r==null?void 0:r.path,r==null?void 0:r.filename,r==null?void 0:r.name);return n?[n]:[]}):[]}function rPr(t,e,r,n,i){const a=[...bH(r),...bH(n)];return t==="goal"?lg(QN(a,"objective","title","name")):t==="command"?lg(QN(a,"command","cmd","script","commandPreview","binary")):t==="search"?lg(QN(a,"query","pattern","search")):t==="read"||t==="file-change"?i.slice(0,2).map(lg).join(", "):lg(t==="mcp"?jA(r==null?void 0:r.query,r==null?void 0:r.resource,r==null?void 0:r.path):jA(r==null?void 0:r.title,r==null?void 0:r.name,n==null?void 0:n.message,n==null?void 0:n.status,e))}function Yhe(t){const e=_x(t.args),r=_x(t.response),n=t.args===void 0?void 0:xH(t.args),i=t.response===void 0?void 0:xH(t.response),a=[...bH(t.args),...bH(t.response)],o=ePr(t.name),s=tPr(t,r),l=_x(r==null?void 0:r.display)??_x(e==null?void 0:e.display),u=jA(r==null?void 0:r.aggregatedOutput,r==null?void 0:r.aggregated_output,r==null?void 0:r.output,r==null?void 0:r.errorMessage,r==null?void 0:r.error_message),d=[...Lst((e==null?void 0:e.paths)??(e==null?void 0:e.files)??(e==null?void 0:e.changes)??(e==null?void 0:e.path)),...Lst((r==null?void 0:r.paths)??(r==null?void 0:r.files)??(r==null?void 0:r.changes))],h=Hhe(r==null?void 0:r.exitCode,r==null?void 0:r.exit_code),f=Hhe(r==null?void 0:r.durationMs,r==null?void 0:r.duration_ms,l==null?void 0:l.durationMs),p=Hhe(r==null?void 0:r.count,r==null?void 0:r.total,r==null?void 0:r.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${s}`:`${o}.${s}`,titleParams:o==="generic"?{tool:t.name}:void 0,title:t.title,summary:rPr(o,t.name,e,r,d),status:s,source:t.source,command:o==="command"?lg(jA(QN(a,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&lg(QN(a,"cwd"))||void 0,output:Whe(u),exitCode:h,durationMs:f,resultCount:p,paths:[...new Set(d.map(lg))],defaultOpen:t.defaultOpen===!0||s==="running"||s==="failed",rawArgs:n,rawResponse:i,rawArgsPreview:n===void 0?void 0:Whe(Mst(n)),rawResponsePreview:i===void 0?void 0:Whe(Mst(i))}}function Mst(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}function Ist(t){return t.status==="completed"&&(t.category==="read"||t.category==="search")}function Yf(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function nPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),Q.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function Pst(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),Q.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),Q.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function iPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),Q.jsx("path",{d:"m15 15 4.25 4.25"})]})}function aPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),Q.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function oPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),Q.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function sPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),Q.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Nst(t){return Q.jsx("svg",{...Yf(t),children:Q.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function qhe(t){return Q.jsx("svg",{...Yf(t),children:Q.jsx("path",{d:"m9 5 7 7-7 7"})})}function Bst(t){return Q.jsx("svg",{...Yf(t),children:Q.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function lPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),Q.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function cPr(t){return Q.jsx("svg",{...Yf(t),children:Q.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function uPr(t){return Q.jsxs("svg",{...Yf(t),children:[Q.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),Q.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const dPr={goal:Nst,command:nPr,read:Pst,search:iPr,"file-change":aPr,mcp:oPr,authorization:sPr,generic:Nst};function hPr(t){return t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(t<1e4?1:0)} s`}function $st(t){if(t===void 0)return"";if(typeof t=="string"){const e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{return JSON.stringify(JSON.parse(e),null,2)}catch{return t}return t}try{return JSON.stringify(t,null,2)}catch{return String(t)}}function fPr({status:t}){return t==="running"||t==="queued"?Q.jsx(cPr,{className:"tool-activity__status-icon is-spinning"}):t==="failed"?Q.jsx(lPr,{className:"tool-activity__status-icon"}):Q.jsx(Bst,{className:"tool-activity__status-icon"})}function pPr({presentation:t,callId:e}){const{t:r}=gi("conversation"),[n,i]=Y.useState(!1),[a,o]=Y.useState(""),[s,l]=Y.useState(!1),u=Y.useRef(void 0);Y.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(h,f)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof f=="string"?f:$st(f)),o(h),l(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),l(!0),u.current=window.setTimeout(()=>l(!1),3e3)}};return t.rawArgs===void 0&&t.rawResponse===void 0&&!e?null:Q.jsxs("div",{className:"tool-activity__raw",children:[Q.jsxs("button",{type:"button",onClick:()=>i(h=>!h),"aria-expanded":n,children:[r("blocks.toolActivity.rawData"),Q.jsx(qhe,{className:n?"is-open":""})]}),n?Q.jsxs("div",{className:"tool-activity__raw-body",children:[e?Q.jsxs("div",{className:"tool-activity__raw-id",children:[Q.jsx("span",{children:r("blocks.toolActivity.callId")}),Q.jsx("code",{children:e}),Q.jsx("button",{type:"button",onClick:()=>void d("id",e),"aria-label":r("blocks.toolActivity.copyCallId"),children:Q.jsx(uPr,{})})]}):null,t.rawArgs!==void 0?Q.jsx(Fst,{label:r("blocks.arguments"),value:t.rawArgs,preview:t.rawArgsPreview,copied:a==="input",onCopy:()=>void d("input",t.rawArgs)}):null,t.rawResponse!==void 0?Q.jsx(Fst,{label:r("blocks.result"),value:t.rawResponse,preview:t.rawResponsePreview,copied:a==="result",onCopy:()=>void d("result",t.rawResponse)}):null,s?Q.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:r("blocks.toolActivity.copyFailed")}):null]}):null]})}function Fst({label:t,value:e,preview:r,copied:n,onCopy:i}){const{t:a}=gi("conversation");return Q.jsxs("section",{className:"tool-activity__raw-section",children:[Q.jsxs("div",{children:[Q.jsx("span",{children:t}),Q.jsx("button",{type:"button",onClick:i,children:a(n?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),Q.jsxs("pre",{children:[(r==null?void 0:r.head.join(` `))??$st(e),r&&r.omittedCharacters>0?` ${a("blocks.toolActivity.omittedCharacters",{count:r.omittedCharacters})} @@ -367,23 +367,23 @@ ${g("blocks.truncated")}`:P;return Q.jsxs(EA.div,{className:`block-tool${b?" blo `):[];var b=y.length*f;if(v==null&&(v=b),b>v&&p){var x=Math.floor(v/f);g=g||y.length>x,y=y.slice(0,x),b=y.length*f}if(i&&d&&m!=null)for(var w=Nct(m,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),A={},S=0;Sg&&xpe(a,o.substring(g,v),e,p),xpe(a,m[2],e,p,m[1]),g=bpe.lastIndex}gh){var F=a.lines.length;P>0?(O.tokens=O.tokens.slice(0,P),T(O,_,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&&(d=e.split(` `),u=!0),n.accumWidth=g}else{var m=Fct(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+p,h=m.linesWidths,d=m.lines}}d||(d=e.split(` `));for(var v=Mm(l),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var M8r=qf(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function I8r(t){return L8r(t)?!!M8r[t]:!0}function Fct(t,e,r,n,i){for(var a=[],o=[],s="",l="",u=0,d=0,h=Mm(e),f=0;fr:i+d+g>r){d?(s||l)&&(m?(s||(s=l,l="",u=0,d=u),a.push(s),o.push(d-u),l+=p,u+=g,s="",d=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(d),s=p,d=g)):m?(a.push(l),o.push(u),l=p,u=g):(a.push(p),o.push(g));continue}d+=g,m?(l+=p,u+=g):(l&&(s+=l,l="",u=0),s+=p)}return l&&(s+=l),s&&(a.push(s),o.push(d)),a.length===1&&(d+=i),{accumWidth:d,lines:a,linesWidths:o}}function zct(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(Uct,B_(r,o,i),oS(n,s,a),o,s),pr.intersect(e,Uct,null,Vct);var l=Vct.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=B_(l.x,l.width,i,!0),t.baseY=oS(l.y,l.height,a,!0)}}var Uct=new pr(0,0,0,0),Vct={outIntersectRect:{},clamp:!0};function wpe(t){return t!=null?t+="":t=""}function P8r(t){var e=wpe(t.text),r=t.font,n=Im(Mm(r),e),i=m8(r);return Ape(t,n,i,null)}function Ape(t,e,r,n){var i=new pr(B_(t.x||0,e,t.textAlign),oS(t.y||0,r,t.textBaseline),e,r),a=n??(Gct(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Gct(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var Spe="__zr_style_"+Math.round(Math.random()*10),yS={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},mW={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};yS[Spe]=!0;var Qct=["z","z2","invisible"],N8r=["invisible"],rp=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(vW[0]=Ope(i)*r+t,vW[1]=kpe(i)*n+e,yW[0]=Ope(a)*r+t,yW[1]=kpe(a)*n+e,u(s,vW,yW),d(l,vW,yW),i=i%bS,i<0&&(i=i+bS),a=a%bS,a<0&&(a=a+bS),i>a&&!o?a+=bS:ii&&(bW[0]=Ope(p)*r+t,bW[1]=kpe(p)*n+e,u(s,bW,s),d(l,bW,l))}var na={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},xS=[],wS=[],Vm=[],Ux=[],Gm=[],Qm=[],Epe=Math.min,_pe=Math.max,AS=Math.cos,SS=Math.sin,Ey=Math.abs,Rpe=Math.PI,Vx=Rpe*2,Dpe=typeof Float32Array<"u",A8=[];function Lpe(t){var e=Math.round(t/Rpe*1e8)/1e8;return e%2*Rpe}function wW(t,e){var r=Lpe(t[0]);r<0&&(r+=Vx);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=Vx?i=r+Vx:e&&r-i>=Vx?i=r-Vx:!e&&r>i?i=r+(Vx-Lpe(r-i)):e&&r0&&(this._ux=Ey(n/KH/e)||0,this._uy=Ey(n/KH/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(na.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=Ey(e-this._xi),i=Ey(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(na.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(na.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(na.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(),A8[0]=i,A8[1]=a,wW(A8,o),i=A8[0],a=A8[1];var s=a-i;return this.addData(na.A,e,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,o),this._xi=AS(a)*n+e,this._yi=SS(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(na.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(na.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)&&Dpe&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sd.length&&(this._expandData(),d=this.data);for(var h=0;h0&&(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(){Vm[0]=Vm[1]=Gm[0]=Gm[1]=Number.MAX_VALUE,Ux[0]=Ux[1]=Qm[0]=Qm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Ey(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,o=y);break}case na.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],S=e[f++],T=e[f++];m=U6r(a,o,w,A,v,y,S,T,10),a=S,o=T;break}case na.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=G6r(a,o,w,A,v,y,10),a=v,o=y;break}case na.A:var C=e[f++],O=e[f++],E=e[f++],_=e[f++],P=e[f++],L=e[f++],R=L+P;f+=1,g&&(s=AS(P)*E+C,l=SS(P)*_+O),m=_pe(E,_)*Epe(Vx,Math.abs(L)),a=AS(R)*E+C,o=SS(R)*_+O;break;case na.R:{s=a=e[f++],l=o=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case na.Z:{var b=s-a,x=l-o;m=Math.sqrt(b*b+x*x),a=s,o=l;break}}m>=0&&(u[h++]=m,d+=m)}return this._pathLen=d,d},t.prototype.rebuildPath=function(e,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,d,h,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 na.M:s=u=n[S++],l=d=n[S++],e.moveTo(u,d);break;case na.L:{h=n[S++],f=n[S++];var O=Ey(h-u),E=Ey(f-d);if(O>i||E>a){if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+h*P,d*(1-P)+f*P);break e}v+=_}e.lineTo(h,f),u=h,d=f,x=0}else{var L=O*O+E*E;L>x&&(w=h,A=f,x=L)}break}case na.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)/_;Nx(u,R,M,N,P,xS),Nx(d,D,I,F,P,wS),e.bezierCurveTo(xS[1],wS[1],xS[2],wS[2],xS[3],wS[3]);break e}v+=_}e.bezierCurveTo(R,D,M,I,N,F),u=N,d=F;break}case na.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)/_;s8(u,R,M,P,xS),s8(d,D,I,P,wS),e.quadraticCurveTo(xS[1],wS[1],xS[2],wS[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,I),u=M,d=I;break}case na.A:var B=n[S++],V=n[S++],z=n[S++],U=n[S++],G=n[S++],H=n[S++],j=n[S++],q=!n[S++],ne=z>U?z:U,X=Ey(z-U)>.001,J=G+H,ee=!1;if(p){var _=g[y++];v+_>b&&(J=G+H*(b-v)/_,ee=!0),v+=_}if(X&&e.ellipse?e.ellipse(B,V,z,U,j,G,J,q):e.arc(B,V,ne,G,J,q),ee)break e;C&&(s=AS(G)*z+B,l=SS(G)*U+V),u=AS(J)*z+B,d=SS(J)*U+V;break;case na.R:s=u=n[S],l=d=n[S+1],h=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(h,f),e.lineTo(h+Epe(ie,te),f),ie-=te,ie>0&&e.lineTo(h+te,f+Epe(ie,pe)),ie-=pe,ie>0&&e.lineTo(h+_pe(te-ie,0),f+pe),ie-=te,ie>0&&e.lineTo(h,f+_pe(pe-ie,0));break e}v+=_}e.rect(h,f,te,pe);break;case na.Z:if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+s*P,d*(1-P)+l*P);break e}v+=_}e.closePath(),u=s,d=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=na,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function Gx(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+h&&d>n+h&&d>a+h&&d>s+h||dt+h&&u>r+h&&u>i+h&&u>o+h||ue+u&&l>n+u&&l>a+u||lt+u&&s>r+u&&s>i+u||sr||d+ui&&(i+=S8);var f=Math.atan2(l,s);return f<0&&(f+=S8),f>=n&&f<=i||f+S8>=n&&f+S8<=i}function _y(t,e,r,n,i,a){if(a>e&&a>n||ai?s:0}var Qx=Hm.CMD,TS=Math.PI*2,G8r=1e-4;function Q8r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&H8r(),p=nl(e,n,a,s,np[0]),f>1&&(g=nl(e,n,a,s,np[1]))),f===2?ve&&s>n&&s>a||s=0&&u<=1){for(var d=0,h=Rl(e,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Lu[0]=-l,Lu[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=TS-1e-4){n=0,i=TS;var d=a?1:-1;return o>=Lu[0]+t&&o<=Lu[1]+t?d:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=TS,i+=TS);for(var f=0,p=0;p<2;p++){var g=Lu[p];if(g+t>o){var m=Math.atan2(s,g),d=a?1:-1;m<0&&(m=TS+m),(m>=n&&m<=i||m+TS>=n&&m+TS<=i)&&(m>Math.PI/2&&m1&&(r||(s+=_y(l,u,d,h,n,i))),v&&(l=a[g],u=a[g+1],d=l,h=u),m){case Qx.M:d=a[g++],h=a[g++],l=d,u=h;break;case Qx.L:if(r){if(Gx(l,u,a[g],a[g+1],e,n,i))return!0}else s+=_y(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case Qx.C:if(r){if(U8r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=W8r(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 Qx.Q:if(r){if(qct(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=Y8r(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case Qx.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?(d=f,h=p):s+=_y(l,u,f,p,n,i);var C=(n-y)*w/x+y;if(r){if(V8r(y,b,w,A,A+S,T,e,C,i))return!0}else s+=q8r(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 Qx.R:d=l=a[g++],h=u=a[g++];var O=a[g++],E=a[g++];if(f=d+O,p=h+E,r){if(Gx(d,h,f,h,e,n,i)||Gx(f,h,f,p,e,n,i)||Gx(f,p,d,p,e,n,i)||Gx(d,p,d,h,e,n,i))return!0}else s+=_y(f,h,f,p,n,i),s+=_y(d,p,d,h,n,i);break;case Qx.Z:if(r){if(Gx(l,u,d,h,e,n,i))return!0}else s+=_y(l,u,d,h,n,i);l=d,u=h;break}}return!r&&!Q8r(u,h)&&(s+=_y(l,u,d,h,n,i)||0),s!==0}function j8r(t,e,r){return Xct(t,0,!1,e,r)}function X8r(t,e,r,n){return Xct(t,e,!0,r,n)}var AW=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},yS),K8r={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},mW.style)},Mpe=ky.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?Yfe:n>.2?xNr:qfe}else if(r)return qfe}return Yfe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if($t(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=d8(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&R_)&&(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 d=this.strokeContainThreshold;u=Math.max(u,d??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)),X8r(s,l/u,r,n)))return!0}if(this.hasFill())return j8r(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=R_,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&R_)},e.prototype.createStyle=function(r){return XN(AW,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!==nW){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 d={},h=En(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+d>i&&(h=u+d,u*=i/h,d*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+d>a&&(h=s+d,s*=a/h,d*=a/h),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+d,n+a),d!==0&&t.arc(r+d,n+a-d,d,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 Q_=Math.round;function SW(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&&(Q_(n*2)===Q_(i*2)&&(t.x1=t.x2=Vh(n,s,!0)),Q_(a*2)===Q_(o*2)&&(t.y1=t.y2=Vh(a,s,!0))),t}}function Kct(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=Vh(n,s,!0),t.y=Vh(i,s,!0),t.width=Math.max(Vh(n+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Vh(i+o,s,!1)-t.y,o===0?0:1)),t}}function Vh(t,e,r){if(!e)return t;var n=Q_(t*2);return(n+Q_(e))%2===0?n/2:(n+(r?1:-1))/2}var nBr=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),iBr={},nn=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new nBr},e.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=Kct(iBr,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?rBr(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 Zct={fill:"#000"},Jct=2,Wm={},aBr={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},mW.style)},$n=function(t){ya(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Zct,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),O-=R.width,P-=R.width,L--;for(_+=(d-(_-v)-(b-P)-O)/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 d=r.verticalAlign,h=a+i/2;d==="top"?h=a+r.height/2:d==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&Ipe(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(o=sut(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(G_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=out("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),S=aut("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Jct,w=!0,y.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,v.y=h,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||gy,v.opacity=$d(u.opacity,n.opacity,1),rut(v,u),S&&(v.lineWidth=$d(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(Ape(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,d=r.borderColor,h=l&&l.image,f=l&&!h,p=r.borderRadius,g=this,m,v;if(f||r.lineHeight||u&&d){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(h){v=this._getOrCreateChild(il),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&&d){var b=m.style;b.lineWidth=u,b.stroke=d,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=$d(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return nut(r)&&(n=[r.fontStyle,r.fontWeight,tut(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Bh(n)||r.textFont||r.font},e}(rp),oBr={left:!0,right:1,center:1},sBr={top:1,bottom:1,middle:1},eut=["fontStyle","fontWeight","fontSize","fontFamily"];function tut(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?efe+"px":t+"px"}function rut(t,e){for(var r=0;r=0,a=!1;if(t instanceof yn){var o=mut(t),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Y_(s)||Y_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=lt({},n),u=lt({},u),u.fill=s):!Y_(u.fill)&&Y_(s)?(a=!0,n=lt({},n),u=lt({},u),u.fill=UH(s)):!Y_(u.stroke)&&Y_(l)&&(a||(n=lt({},n),u=lt({},u)),u.stroke=UH(l)),n.style=u}}if(n&&n.z2==null){a||(n=lt({},n));var d=t.z2EmphasisLift;n.z2=t.z2+(d??W_)}return n}function gBr(t,e,r){if(r&&r.z2==null){r=lt({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??uBr)}return r}function mBr(t,e,r){var n=Nr(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:fBr(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 Upe(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return pBr(this,t,e,r);if(t==="blur")return mBr(this,t,r);if(t==="select")return gBr(this,t,r)}return r}function OS(t){t.stateProxy=Upe;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Upe),r&&(r.stateProxy=Upe)}function wut(t,e){!kut(t,e)&&!t.__highByOuter&&Ry(t,vut)}function Aut(t,e){!kut(t,e)&&!t.__highByOuter&&Ry(t,yut)}function Dy(t,e){t.__highByOuter|=1<<(e||0),Ry(t,vut)}function Ly(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ry(t,yut)}function Sut(t){Ry(t,zpe)}function Vpe(t){Ry(t,but)}function Tut(t){Ry(t,dBr)}function Cut(t){Ry(t,hBr)}function kut(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Out(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var o=Npe(a),s=fut(t,a),l=i==="series";!l&&n.push(s),o.isBlured&&(s.group.traverse(function(u){but(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,d){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Wx(t,e,r){ES(t,!0),Ry(t,OS),Wpe(t,e,r)}function ABr(t){ES(t,!1)}function Ea(t,e,r,n){n?ABr(t):Wx(t,e,r)}function Wpe(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var _ut=["emphasis","blur","select"],SBr={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Is(t,e,r,n){r=r||"itemStyle";for(var i=0;i<_ut.length;i++){var a=_ut[i],o=e.getModel([a,r]),s=t.ensureState(a);s.style=n?n(o):o[SBr[r]]()}}function ES(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function k8(t){return!!(t&&t.__highDownDispatcher)}function TBr(t,e,r){var n=Cr(t);n.componentMainType=e.mainType,n.componentIndex=e.componentIndex,n.componentHighDownName=r}function CBr(t){var e=gut[t];return e==null&&put<=32&&(e=gut[t]=put++),e}function Ype(t){var e=t.type;return e===kW||e===$pe||e===OW}function Rut(t){var e=t.type;return e===kS||e===CW}function kBr(t){var e=mut(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var q_=Hm.CMD,OBr=[[],[],[]],Dut=Math.sqrt,EBr=Math.atan2;function Lut(t,e){if(e){var r=t.data,n=t.len(),i,a,o,s,l,u,d=q_.M,h=q_.C,f=q_.L,p=q_.R,g=q_.A,m=q_.Q;for(o=0,s=0;o1&&(o*=qpe(g),s*=qpe(g));var m=(i===a?-1:1)*qpe((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+DW(h)*v-RW(h)*y,x=(e+n)/2+RW(h)*v+DW(h)*y,w=Iut([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=Iut(A,S);if(jpe(A,S)<=-1&&(T=O8),jpe(A,S)>=1&&(T=0),T<0){var C=Math.round(T/O8*1e6)/1e6;T=O8*2+C%2*O8}d.addData(u,b,x,o,s,w,T,h,a)}var _Br=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,RBr=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function DBr(t){var e=new Hm;if(!t)return e;var r=0,n=0,i=r,a=n,o,s=Hm.CMD,l=t.match(_Br);if(!l)return e;for(var u=0;uR*R+D*D&&(C=E,O=_),{cx:C,cy:O,x0:-d,y0:-h,x1:C*(i/A-1),y1:O*(i/A-1)}}function $Br(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 FBr(t,e){var r,n=R8(e.r,0),i=R8(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 d=e.cx,h=e.cy,f=!!e.clockwise,p=Uut(u-l),g=p>Kpe&&p%Kpe;if(g>pg&&(p=g),!(n>pg))t.moveTo(d,h);else if(p>Kpe-pg)t.moveTo(d+n*j_(l),h+n*_S(l)),t.arc(d,h,n,l,u,!f),i>pg&&(t.moveTo(d+i*j_(u),h+i*_S(u)),t.arc(d,h,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,O=void 0,E=void 0,_=void 0,P=void 0,L=void 0,R=void 0,D=n*j_(l),M=n*_S(l),I=i*j_(u),N=i*_S(u),F=p>pg;if(F){var B=e.cornerRadius;B&&(r=$Br(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=Uut(n-i)/2;if(x=jm(V,y),w=jm(V,b),A=jm(V,m),S=jm(V,v),O=T=R8(x,w),E=C=R8(A,S),(T>pg||C>pg)&&(_=n*j_(u),P=n*_S(u),L=i*j_(l),R=i*_S(l),ppg){var X=jm(y,O),J=jm(b,O),ee=LW(L,R,D,M,n,X,f),te=LW(_,P,I,N,n,J,f);t.moveTo(d+ee.cx+ee.x0,h+ee.cy+ee.y0),O0&&t.arc(d+ee.cx,h+ee.cy,X,qc(ee.y0,ee.x0),qc(ee.y1,ee.x1),!f),t.arc(d,h,n,qc(ee.cy+ee.y1,ee.cx+ee.x1),qc(te.cy+te.y1,te.cx+te.x1),!f),J>0&&t.arc(d+te.cx,h+te.cy,J,qc(te.y1,te.x1),qc(te.y0,te.x0),!f))}else t.moveTo(d+D,h+M),t.arc(d,h,n,l,u,!f);if(!(i>pg)||!F)t.lineTo(d+I,h+N);else if(E>pg){var X=jm(m,E),J=jm(v,E),ee=LW(I,N,_,P,i,-J,f),te=LW(D,M,L,R,i,-X,f);t.lineTo(d+ee.cx+ee.x0,h+ee.cy+ee.y0),E0&&t.arc(d+ee.cx,h+ee.cy,J,qc(ee.y0,ee.x0),qc(ee.y1,ee.x1),!f),t.arc(d,h,i,qc(ee.cy+ee.y1,ee.cx+ee.x1),qc(te.cy+te.y1,te.cx+te.x1),f),X>0&&t.arc(d+te.cx,h+te.cy,X,qc(te.y1,te.x1),qc(te.y0,te.x0),!f))}else t.lineTo(d+I,h+N),t.arc(d,h,i,u,l,f)}t.closePath()}}}var zBr=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}(),pc=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new zBr},e.prototype.buildPath=function(r,n){FBr(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(yn);pc.prototype.type="sector";var UBr=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),X_=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new UBr},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);X_.prototype.type="ring";function VBr(t,e,r,n){var i=[],a=[],o=[],s=[],l,u,d,h;if(n){d=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,p=t.length;f=2){if(n){var a=VBr(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],d=i[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],d[0],d[1])}}else{t.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;sLS[1]){if(a=!1,Il.negativeSize||n)return a;var l=MW(LS[0]-DS[1]),u=MW(DS[0]-LS[1]);Jpe(l,u)>PW.len()&&(l=u||!Il.bidirectional)&&(wr.scale(IW,s,-u*i),Il.useDir&&Il.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 h=d.duration,f=d.delay,p=d.easing,g={duration:h,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){ege("update",t,e,r,n,i,a)}function ua(t,e,r,n,i,a){ege("enter",t,e,r,n,i,a)}function J_(t){if(!t.__zr)return!0;for(var e=0;eao(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function tdt(t){return!t.isGroup}function n7r(t){return t.shape!=null}function I8(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){tdt(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return n7r(o)&&(s.shape=lr(o.shape)),s}var a=n(t);e.traverse(function(o){if(tdt(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 ige(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 rdt(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 n5(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 il(n)):t5(t.replace("path://",""),n,r,"center")}function P8(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=age(p,g,d,h)/f;return!(v<0||v>1)}function age(t,e,r,n){return t*n-r*e}function i7r(t){return t<=1e-6&&t>=-1e-6}function IS(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]),idt(t,Na,"x","width",3,1,i&&i[0]||0),idt(t,Na,"y","height",0,2,i&&i[1]||0)),t}var Na=[0,0,0,0];function idt(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 Iy(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(d){Kt(s,d)||(s[d]=l[d],s.$vars.push(d))});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 oge(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function qx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=o),oe&&(r=e=0),{min:r,max:e}}function zW(t,e,r){odt(t,e,r,-1/0)}function odt(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 jx(t,e){return Gr(Gr({},t,!0),e,!0)}const m7r={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:". "}}}},v7r={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 QW="ZH",gge="EN",o5=gge,HW={},mge={},mdt=Dn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||o5).toUpperCase();return t.indexOf(QW)>-1?QW:o5}():o5;function vge(t,e){t=t.toUpperCase(),mge[t]=new bn(e),HW[t]=e}function y7r(t){if($t(t)){var e=HW[t.toUpperCase()]||{};return t===QW||t===gge?lr(e):Gr(lr(e),lr(HW[o5]),!1)}else return Gr(lr(t),lr(HW[o5]),!1)}function yge(t){return mge[t]}function b7r(){return mge[o5]}vge(gge,m7r),vge(QW,v7r);var bge=null;function x7r(t){bge||(bge=t)}function Ho(){return bge}function vdt(t,e){var r=Ho(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function WW(t){var e=t.brk;return e?e.breaks:[]}function YW(t){var e=t.brk;return e?e.hasBreaks():!1}var xge=1e3,wge=xge*60,$8=wge*60,op=$8*24,ydt=op*365,w7r={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})/},qW={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},A7r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",jW="{yyyy}-{MM}-{dd}",bdt={year:"{yyyy}",month:"{yyyy}-{MM}",day:jW,hour:jW+" "+qW.hour,minute:jW+" "+qW.minute,second:jW+" "+qW.second,millisecond:A7r},Wh=["year","month","day","hour","minute","second","millisecond"],S7r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function T7r(t){return!$t(t)&&!ur(t)?C7r(t):t}function C7r(t){t=t||{};var e={},r=!0;return fe(Wh,function(n){r&&(r=t[n]==null)}),fe(Wh,function(n,i){var a=t[n];e[n]={};for(var o=null,s=i;s>=0;s--){var l=Wh[s],u=yr(a)&&!ft(a)?a[l]:a,d=void 0;ft(u)?(d=u.slice(),o=d[0]||""):$t(u)?(o=u,d=[o]):(o==null?o=qW[n]:w7r[l].test(o)||(o=e[l][l][0]+" "+o),d=[o],r&&(d[1]="{primary|"+o+"}")),e[n][l]=d}}),e}function Iu(t,e){return t+="","0000".substr(0,e-t.length)+t}function F8(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 k7r(t){return t===F8(t)}function O7r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function z8(t,e,r,n){var i=$m(t),a=i[xdt(r)](),o=i[Age(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Sge(r)](),u=i["get"+(r?"UTC":"")+"Day"](),d=i[Tge(r)](),h=(d-1)%12+1,f=i[Cge(r)](),p=i[kge(r)](),g=i[Oge(r)](),m=d>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof bn?n:yge(n||mdt)||b7r(),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,Iu(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,x[o-1]).replace(/{MMM}/g,w[o-1]).replace(/{MM}/g,Iu(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Iu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Iu(d,2)).replace(/{H}/g,d+"").replace(/{hh}/g,Iu(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Iu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Iu(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Iu(g,3)).replace(/{S}/g,g+"")}function E7r(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 d=s5(t.value,i);a=r[d][d][0]}}return z8(new Date(t.value),a,i,n)}function s5(t,e){var r=$m(t),n=r[Age(e)]()+1,i=r[Sge(e)](),a=r[Tge(e)](),o=r[Cge(e)](),s=r[kge(e)](),l=r[Oge(e)](),u=l===0,d=u&&s===0,h=d&&o===0,f=h&&a===0,p=f&&i===1,g=p&&n===1;return g?"year":p?"month":f?"day":h?"hour":d?"minute":u?"second":"millisecond"}function XW(t,e,r){switch(e){case"year":t[wdt(r)](0);case"month":t[Adt(r)](1);case"day":t[Sdt(r)](0);case"hour":t[Tdt(r)](0);case"minute":t[Cdt(r)](0);case"second":t[kdt(r)](0)}return t}function xdt(t){return t?"getUTCFullYear":"getFullYear"}function Age(t){return t?"getUTCMonth":"getMonth"}function Sge(t){return t?"getUTCDate":"getDate"}function Tge(t){return t?"getUTCHours":"getHours"}function Cge(t){return t?"getUTCMinutes":"getMinutes"}function kge(t){return t?"getUTCSeconds":"getSeconds"}function Oge(t){return t?"getUTCMilliseconds":"getMilliseconds"}function _7r(t){return t?"setUTCFullYear":"setFullYear"}function wdt(t){return t?"setUTCMonth":"setMonth"}function Adt(t){return t?"setUTCDate":"setDate"}function Sdt(t){return t?"setUTCHours":"setHours"}function Tdt(t){return t?"setUTCMinutes":"setMinutes"}function Cdt(t){return t?"setUTCSeconds":"setSeconds"}function kdt(t){return t?"setUTCMilliseconds":"setMilliseconds"}function R7r(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(!lpe(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 _ge(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 l5=qN;function Rge(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(d){return d&&Bh(d)?d:"-"}function a(d){return tp(d)}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?$m(t):t;if(isNaN(+l)){if(s)return"-"}else return z8(l,n,r)}if(e==="ordinal")return CH(t)?i(t):Vn(t)&&a(t)?t+"":"-";var u=Fm(t);return a(u)?Ege(u):CH(t)?i(t):typeof t=="boolean"?t+"":"-"}var Odt=["a","b","c","d","e","f","g"],Dge=function(t,e){return"{"+t+(e??"")+"}"};function Lge(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 D7r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd -yyyy`);var n=$m(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"](),d=n[i+"Seconds"](),h=n[i+"Milliseconds"]();return t=t.replace("MM",Iu(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Iu(a%100+"",2)).replace("dd",Iu(s,2)).replace("d",s).replace("hh",Iu(l,2)).replace("h",l).replace("mm",Iu(u,2)).replace("m",u).replace("ss",Iu(d,2)).replace("s",d).replace("SSS",Iu(h,3)),t}function L7r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function $S(t,e){return e=e||"transparent",$t(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function KW(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var ZW={},Mge={},c5=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n(ZW),this._normalMasterList=n(Mge);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"){ZW[e]=r;return}Mge[e]=r},t.get=function(e){return Mge[e]||ZW[e]},t}();function M7r(t){return!!ZW[t]}var I7r=1,Rdt=2;function P7r(t){Ddt.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var Ddt=qt();function Ldt(t){var e=t.getShallow("coord",!0),r=I7r;if(e==null){var n=Ddt.get(t.type);n&&n.getCoord2&&(r=Rdt,e=n.getCoord2(t))}return{coord:e,from:r}}var u5=0,JW=1,Mdt=2;function Idt(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=u5;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=JW,a||(i=u5)):n==="box"&&(i=Mdt,!a&&!M7r(r)&&(i=u5))}return{coordSysType:r,kind:i}}function U8(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Idt(e),o=a.kind,s=a.coordSysType;if(i&&o!==JW&&(o=JW,s=r),o===u5||s!==r)return u5;var l=n(r,e);return l?(o===JW?e.coordinateSystem=l:e.boxCoordinateSystem=l,o):u5}var Pdt=function(t,e){var r=e.getReferringComponents(t,xo).models[0];return r&&r.coordinateSystem},eY=fe,Ndt=["left","right","top","bottom","width","height"],FS=[["width","left","right"],["height","top","bottom"]];function Ige(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 d=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),p,g;if(t==="horizontal"){var m=d.width+(f?-f.x+d.x:0);p=a+m,p>n||l.newline?(a=0,p=m,o+=s+r,s=d.height):s=Math.max(s,d.height)}else{var v=d.height+(f?-f.y+d.y:0);g=o+v,g>i||l.newline?(a+=s+r,o=0,g=v,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=p+r:o=g+r)})}var zS=Ige;Kr(Ige,"vertical"),Kr(Ige,"horizontal");function Bdt(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 N7r(t,e){var r=Ns(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===V8.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===Rdt?r.refPoint:[Gt(s[0],i.width)+i.x,Gt(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function $dt(t,e){var r=N7r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var o=Gt(n.width,e.getWidth()),s=Gt(n.height,e.getHeight()),l=Math.min(o,s),u=Gt(a[0],l/2),d=Gt(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:d,viewRect:n}}function ba(t,e,r){r=l5(r||0);var n=e.width,i=e.height,a=Gt(t.left,n),o=Gt(t.top,i),s=Gt(t.right,n),l=Gt(t.bottom,i),u=Gt(t.width,n),d=Gt(t.height,i),h=r[2]+r[0],f=r[1]+r[3],p=t.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(d)&&(d=i-l-h-o),p!=null&&(isNaN(u)&&isNaN(d)&&(p>n/i?u=n*.8:d=i*.8),isNaN(u)&&(u=p*d),isNaN(d)&&(d=u/p)),isNaN(a)&&(a=n-s-u-f),isNaN(o)&&(o=i-l-d-h),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-d/2-r[0];break;case"bottom":o=i-d-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(d)&&(d=i-h-o-(l||0));var g=new pr((e.x||0)+a+r[3],(e.y||0)+o+r[0],u,d);return g.margin=r,g}function Fdt(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 h;for(var v=0;v=0;l--)s=Gr(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return U_(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){return Bdt(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);Mct(pn,bn),pW(pn),p7r(pn),g7r(pn,F7r);function F7r(t){var e=[];return fe(pn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return Um(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 VS in Wo)if(Wo.hasOwnProperty(VS)){var Udt=Wo[VS];VS==="theme"?tt.darkColor.theme=Wo.theme.slice():VS==="highlight"?tt.darkColor.highlight="rgba(255,231,130,0.4)":VS.indexOf("accent")===0?tt.darkColor[VS]=Ty(Udt,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):tt.darkColor[VS]=Ty(Udt,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 Vdt="";typeof navigator<"u"&&(Vdt=navigator.platform||"");var d5="rgba(0, 0, 0, 0.2)",Gdt=tt.color.theme[0],z7r=Ty(Gdt,null,null,.9);const Qdt={darkMode:"auto",colorBy:"series",color:tt.color.theme,gradientColor:[z7r,Gdt],aria:{decal:{decals:[{color:d5,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:d5,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:d5,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:d5,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:d5,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:d5,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Vdt.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 mc={Must:1,Might:2,Not:3},Hdt=Qr();function U7r(t){Hdt(t).datasetMap=qt()}function Wdt(t,e,r){var n={},i=Nge(e);if(!i||!t)return n;var a=[],o=[],s=e.ecModel,l=Hdt(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,d,h;t=t.slice(),fe(t,function(m,v){var y=yr(m)?m:t[v]={name:m};y.type==="ordinal"&&d==null&&(d=v,h=g(y)),n[y.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});fe(t,function(m,v){var y=m.name,b=g(m);if(d==null){var x=f.valueWayDim;p(n[y],x,b),p(o,x,b),f.valueWayDim+=b}else if(d===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 Xdt(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 d=o==null||!n?r:W7r(n,o);if(d=d||r,!(!d||!d.length)){var h=d[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%d.length,h}}function Y7r(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var rY,Q8,Kdt,Zdt="\0_ec_inner",q7r=1,zge=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=tht(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,tht(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"?Kdt(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;U7r(this),fe(r,function(h,f){h!=null&&(pn.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(h):Gr(i[f],h,!0))}),u&&u.each(function(h,f){pn.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),pn.topologicalTravel(s,pn.getAllClassMainTypes(),d,this);function d(h){var f=Q7r(this,h,ji(r[h])),p=a.get(h),g=p?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=Cct(p,f,g);r8r(m,h,pn),i[h]=null,a.set(h,null),o.set(h,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=h==="series",O=pn.getClass(h,w.keyInfo.subType,!C);if(!O)return;if(h==="tooltip"){if(x)return;x=!0}if(S&&S.constructor===O)S.name=w.keyInfo.name,S.mergeOption(T,this),S.optionUpdated(T,!1);else{var E=lt({componentIndex:A},w.keyInfo);S=new O(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[h]=v,a.set(h,y),o.set(h,b),h==="series"&&rY(this)}this._seriesIndices||rY(this)},e.prototype.getOption=function(){var r=lr(this.option);return fe(r,function(n,i){if(pn.hasClass(i)){for(var a=ji(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!x8(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[Zdt],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 r$r(t,e){return t.join(",")===e.join(",")}var mg=fe,H8=yr,rht=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Uge(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=rht.length;r0?r[o-1].seriesModel:null)}),h$r(r)}})}function h$r(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,d,h){var f=o.get(e.stackedDimension,h);if(isNaN(f))return i;var p,g;s?g=o.getRawIndex(h):p=o.get(e.stackedByDimension,h);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=dS(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var nY=function(){function t(e){this.data=e.data||(e.sourceFormat===hg?{}:[]),this.sourceFormat=e.sourceFormat||uut,this.seriesLayoutBy=e.seriesLayoutBy||fg,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};fht=(e={},e[Ll+"_"+fg]={pure:!0,appendData:a},e[Ll+"_"+CS]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Qh]={pure:!0,appendData:a},e[hg]={pure:!0,appendData:function(o){var s=this._data;fe(o,function(l,u){for(var d=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)d.push(l[h])})}},e[Gh]={appendData:a},e[Hx]={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 h5(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function wht(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function q8(t){return new x$r(t)}var x$r=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=d(this._modBy),s=this._modDataCount||0,l=d(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function d(b){return!(b>=1)&&(b=1),b}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=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&&(h||p1&&n>0?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},A$r=function(){function t(e,r){if(!Vn(r)){var n="";si(n)}this._opFn=Tht[e],this._rvalFloat=Fm(r)}return t.prototype.evaluate=function(e){return Vn(e)?this._opFn(e,this._rvalFloat):this._opFn(Fm(e),this._rvalFloat)},t}(),Cht=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:Fm(e),i=Vn(r)?r:Fm(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}(),S$r=function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=Fm(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=Fm(e)===this._rvalFloat)}return this._isEQ?r:!r},t}();function T$r(t,e){return t==="eq"||t==="ne"?new S$r(t==="eq",e):Kt(Tht,t)?new A$r(t,e):null}function kht(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?I$r:P$r}function N$r(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Lht(t,e,r,n,i){var a=Dht[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}),d=0;dy[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=h&&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=h&&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=h&&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),d,h,f,p=new(f5(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var g=1;gd&&(d=h,f=w)}_>0&&_s&&(m=s-d);for(var v=0;vg&&(g=b,p=d+v)}var x=this.getRawIndex(h),w=this.getRawIndex(p);hd-g&&(l=d-g,s.length=l);for(var m=0;mh[1]&&(h[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[d]=[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 Xx(r[a],this._dimensions[a])}jge={arrayRows:e,objectRows:function(r,n,i,a){return Xx(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Xx(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Mht=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(oY(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var d=r[0];d.prepareSource(),u=d.getSource(),s=u.data,l=u.sourceFormat,a=[d._getVersionSign()]}else s=o.get("data",!0),l=Du(s)?Hx:Gh,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},p=Jt(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=Jt(h.sourceHeader,f.sourceHeader),m=Jt(h.dimensions,f.dimensions),v=p!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=v?[Qge(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=[Qge(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&&Pht(a)}var o,s=[],l=[];return fe(e,function(u){u.prepareSource();var d=u.getSource(i||0),h="";i!=null&&!d&&Pht(h),s.push(d),l.push(u._getVersionSign())}),n?o=L$r(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[f$r(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;rr:i+d+g>r){d?(s||l)&&(m?(s||(s=l,l="",u=0,d=u),a.push(s),o.push(d-u),l+=p,u+=g,s="",d=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(d),s=p,d=g)):m?(a.push(l),o.push(u),l=p,u=g):(a.push(p),o.push(g));continue}d+=g,m?(l+=p,u+=g):(l&&(s+=l,l="",u=0),s+=p)}return l&&(s+=l),s&&(a.push(s),o.push(d)),a.length===1&&(d+=i),{accumWidth:d,lines:a,linesWidths:o}}function zct(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(Uct,B_(r,o,i),oS(n,s,a),o,s),pr.intersect(e,Uct,null,Vct);var l=Vct.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=B_(l.x,l.width,i,!0),t.baseY=oS(l.y,l.height,a,!0)}}var Uct=new pr(0,0,0,0),Vct={outIntersectRect:{},clamp:!0};function wpe(t){return t!=null?t+="":t=""}function P8r(t){var e=wpe(t.text),r=t.font,n=Im(Mm(r),e),i=m8(r);return Ape(t,n,i,null)}function Ape(t,e,r,n){var i=new pr(B_(t.x||0,e,t.textAlign),oS(t.y||0,r,t.textBaseline),e,r),a=n??(Gct(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Gct(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var Spe="__zr_style_"+Math.round(Math.random()*10),yS={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},mW={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};yS[Spe]=!0;var Qct=["z","z2","invisible"],N8r=["invisible"],rp=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(vW[0]=Ope(i)*r+t,vW[1]=kpe(i)*n+e,yW[0]=Ope(a)*r+t,yW[1]=kpe(a)*n+e,u(s,vW,yW),d(l,vW,yW),i=i%bS,i<0&&(i=i+bS),a=a%bS,a<0&&(a=a+bS),i>a&&!o?a+=bS:ii&&(bW[0]=Ope(p)*r+t,bW[1]=kpe(p)*n+e,u(s,bW,s),d(l,bW,l))}var na={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},xS=[],wS=[],Vm=[],Ux=[],Gm=[],Qm=[],Epe=Math.min,_pe=Math.max,AS=Math.cos,SS=Math.sin,Ey=Math.abs,Rpe=Math.PI,Vx=Rpe*2,Dpe=typeof Float32Array<"u",A8=[];function Lpe(t){var e=Math.round(t/Rpe*1e8)/1e8;return e%2*Rpe}function wW(t,e){var r=Lpe(t[0]);r<0&&(r+=Vx);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=Vx?i=r+Vx:e&&r-i>=Vx?i=r-Vx:!e&&r>i?i=r+(Vx-Lpe(r-i)):e&&r0&&(this._ux=Ey(n/KH/e)||0,this._uy=Ey(n/KH/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(na.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=Ey(e-this._xi),i=Ey(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(na.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(na.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(na.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(),A8[0]=i,A8[1]=a,wW(A8,o),i=A8[0],a=A8[1];var s=a-i;return this.addData(na.A,e,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,o),this._xi=AS(a)*n+e,this._yi=SS(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(na.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(na.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)&&Dpe&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sd.length&&(this._expandData(),d=this.data);for(var h=0;h0&&(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(){Vm[0]=Vm[1]=Gm[0]=Gm[1]=Number.MAX_VALUE,Ux[0]=Ux[1]=Qm[0]=Qm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Ey(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,o=y);break}case na.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],S=e[f++],T=e[f++];m=U6r(a,o,w,A,v,y,S,T,10),a=S,o=T;break}case na.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=G6r(a,o,w,A,v,y,10),a=v,o=y;break}case na.A:var C=e[f++],O=e[f++],E=e[f++],_=e[f++],P=e[f++],L=e[f++],R=L+P;f+=1,g&&(s=AS(P)*E+C,l=SS(P)*_+O),m=_pe(E,_)*Epe(Vx,Math.abs(L)),a=AS(R)*E+C,o=SS(R)*_+O;break;case na.R:{s=a=e[f++],l=o=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case na.Z:{var b=s-a,x=l-o;m=Math.sqrt(b*b+x*x),a=s,o=l;break}}m>=0&&(u[h++]=m,d+=m)}return this._pathLen=d,d},t.prototype.rebuildPath=function(e,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,d,h,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 na.M:s=u=n[S++],l=d=n[S++],e.moveTo(u,d);break;case na.L:{h=n[S++],f=n[S++];var O=Ey(h-u),E=Ey(f-d);if(O>i||E>a){if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+h*P,d*(1-P)+f*P);break e}v+=_}e.lineTo(h,f),u=h,d=f,x=0}else{var L=O*O+E*E;L>x&&(w=h,A=f,x=L)}break}case na.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)/_;Nx(u,R,M,N,P,xS),Nx(d,D,I,F,P,wS),e.bezierCurveTo(xS[1],wS[1],xS[2],wS[2],xS[3],wS[3]);break e}v+=_}e.bezierCurveTo(R,D,M,I,N,F),u=N,d=F;break}case na.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)/_;s8(u,R,M,P,xS),s8(d,D,I,P,wS),e.quadraticCurveTo(xS[1],wS[1],xS[2],wS[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,I),u=M,d=I;break}case na.A:var B=n[S++],V=n[S++],z=n[S++],U=n[S++],G=n[S++],H=n[S++],j=n[S++],q=!n[S++],ne=z>U?z:U,X=Ey(z-U)>.001,J=G+H,ee=!1;if(p){var _=g[y++];v+_>b&&(J=G+H*(b-v)/_,ee=!0),v+=_}if(X&&e.ellipse?e.ellipse(B,V,z,U,j,G,J,q):e.arc(B,V,ne,G,J,q),ee)break e;C&&(s=AS(G)*z+B,l=SS(G)*U+V),u=AS(J)*z+B,d=SS(J)*U+V;break;case na.R:s=u=n[S],l=d=n[S+1],h=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(h,f),e.lineTo(h+Epe(ie,te),f),ie-=te,ie>0&&e.lineTo(h+te,f+Epe(ie,pe)),ie-=pe,ie>0&&e.lineTo(h+_pe(te-ie,0),f+pe),ie-=te,ie>0&&e.lineTo(h,f+_pe(pe-ie,0));break e}v+=_}e.rect(h,f,te,pe);break;case na.Z:if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+s*P,d*(1-P)+l*P);break e}v+=_}e.closePath(),u=s,d=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=na,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function Gx(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+h&&d>n+h&&d>a+h&&d>s+h||dt+h&&u>r+h&&u>i+h&&u>o+h||ue+u&&l>n+u&&l>a+u||lt+u&&s>r+u&&s>i+u||sr||d+ui&&(i+=S8);var f=Math.atan2(l,s);return f<0&&(f+=S8),f>=n&&f<=i||f+S8>=n&&f+S8<=i}function _y(t,e,r,n,i,a){if(a>e&&a>n||ai?s:0}var Qx=Hm.CMD,TS=Math.PI*2,G8r=1e-4;function Q8r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&H8r(),p=nl(e,n,a,s,np[0]),f>1&&(g=nl(e,n,a,s,np[1]))),f===2?ve&&s>n&&s>a||s=0&&u<=1){for(var d=0,h=Rl(e,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Lu[0]=-l,Lu[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=TS-1e-4){n=0,i=TS;var d=a?1:-1;return o>=Lu[0]+t&&o<=Lu[1]+t?d:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=TS,i+=TS);for(var f=0,p=0;p<2;p++){var g=Lu[p];if(g+t>o){var m=Math.atan2(s,g),d=a?1:-1;m<0&&(m=TS+m),(m>=n&&m<=i||m+TS>=n&&m+TS<=i)&&(m>Math.PI/2&&m1&&(r||(s+=_y(l,u,d,h,n,i))),v&&(l=a[g],u=a[g+1],d=l,h=u),m){case Qx.M:d=a[g++],h=a[g++],l=d,u=h;break;case Qx.L:if(r){if(Gx(l,u,a[g],a[g+1],e,n,i))return!0}else s+=_y(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case Qx.C:if(r){if(U8r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=W8r(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 Qx.Q:if(r){if(qct(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=Y8r(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case Qx.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?(d=f,h=p):s+=_y(l,u,f,p,n,i);var C=(n-y)*w/x+y;if(r){if(V8r(y,b,w,A,A+S,T,e,C,i))return!0}else s+=q8r(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 Qx.R:d=l=a[g++],h=u=a[g++];var O=a[g++],E=a[g++];if(f=d+O,p=h+E,r){if(Gx(d,h,f,h,e,n,i)||Gx(f,h,f,p,e,n,i)||Gx(f,p,d,p,e,n,i)||Gx(d,p,d,h,e,n,i))return!0}else s+=_y(f,h,f,p,n,i),s+=_y(d,p,d,h,n,i);break;case Qx.Z:if(r){if(Gx(l,u,d,h,e,n,i))return!0}else s+=_y(l,u,d,h,n,i);l=d,u=h;break}}return!r&&!Q8r(u,h)&&(s+=_y(l,u,d,h,n,i)||0),s!==0}function j8r(t,e,r){return Xct(t,0,!1,e,r)}function X8r(t,e,r,n){return Xct(t,e,!0,r,n)}var AW=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},yS),K8r={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},mW.style)},Mpe=ky.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?Yfe:n>.2?xNr:qfe}else if(r)return qfe}return Yfe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if($t(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=d8(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&R_)&&(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 d=this.strokeContainThreshold;u=Math.max(u,d??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)),X8r(s,l/u,r,n)))return!0}if(this.hasFill())return j8r(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=R_,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&R_)},e.prototype.createStyle=function(r){return XN(AW,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!==nW){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 d={},h=En(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+d>i&&(h=u+d,u*=i/h,d*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+d>a&&(h=s+d,s*=a/h,d*=a/h),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+d,n+a),d!==0&&t.arc(r+d,n+a-d,d,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 Q_=Math.round;function SW(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&&(Q_(n*2)===Q_(i*2)&&(t.x1=t.x2=Vh(n,s,!0)),Q_(a*2)===Q_(o*2)&&(t.y1=t.y2=Vh(a,s,!0))),t}}function Kct(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=Vh(n,s,!0),t.y=Vh(i,s,!0),t.width=Math.max(Vh(n+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Vh(i+o,s,!1)-t.y,o===0?0:1)),t}}function Vh(t,e,r){if(!e)return t;var n=Q_(t*2);return(n+Q_(e))%2===0?n/2:(n+(r?1:-1))/2}var nBr=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),iBr={},nn=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new nBr},e.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=Kct(iBr,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?rBr(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 Zct={fill:"#000"},Jct=2,Wm={},aBr={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},mW.style)},$n=function(t){ya(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Zct,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),O-=R.width,P-=R.width,L--;for(_+=(d-(_-v)-(b-P)-O)/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 d=r.verticalAlign,h=a+i/2;d==="top"?h=a+r.height/2:d==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&Ipe(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(o=sut(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(G_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=out("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),S=aut("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Jct,w=!0,y.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,v.y=h,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||gy,v.opacity=$d(u.opacity,n.opacity,1),rut(v,u),S&&(v.lineWidth=$d(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(Ape(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,d=r.borderColor,h=l&&l.image,f=l&&!h,p=r.borderRadius,g=this,m,v;if(f||r.lineHeight||u&&d){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(h){v=this._getOrCreateChild(il),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&&d){var b=m.style;b.lineWidth=u,b.stroke=d,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=$d(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return nut(r)&&(n=[r.fontStyle,r.fontWeight,tut(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Bh(n)||r.textFont||r.font},e}(rp),oBr={left:!0,right:1,center:1},sBr={top:1,bottom:1,middle:1},eut=["fontStyle","fontWeight","fontSize","fontFamily"];function tut(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?efe+"px":t+"px"}function rut(t,e){for(var r=0;r=0,a=!1;if(t instanceof yn){var o=mut(t),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Y_(s)||Y_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=lt({},n),u=lt({},u),u.fill=s):!Y_(u.fill)&&Y_(s)?(a=!0,n=lt({},n),u=lt({},u),u.fill=UH(s)):!Y_(u.stroke)&&Y_(l)&&(a||(n=lt({},n),u=lt({},u)),u.stroke=UH(l)),n.style=u}}if(n&&n.z2==null){a||(n=lt({},n));var d=t.z2EmphasisLift;n.z2=t.z2+(d??W_)}return n}function gBr(t,e,r){if(r&&r.z2==null){r=lt({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??uBr)}return r}function mBr(t,e,r){var n=Nr(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:fBr(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 Upe(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return pBr(this,t,e,r);if(t==="blur")return mBr(this,t,r);if(t==="select")return gBr(this,t,r)}return r}function OS(t){t.stateProxy=Upe;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Upe),r&&(r.stateProxy=Upe)}function wut(t,e){!kut(t,e)&&!t.__highByOuter&&Ry(t,vut)}function Aut(t,e){!kut(t,e)&&!t.__highByOuter&&Ry(t,yut)}function Dy(t,e){t.__highByOuter|=1<<(e||0),Ry(t,vut)}function Ly(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ry(t,yut)}function Sut(t){Ry(t,zpe)}function Vpe(t){Ry(t,but)}function Tut(t){Ry(t,dBr)}function Cut(t){Ry(t,hBr)}function kut(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Out(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var o=Npe(a),s=fut(t,a),l=i==="series";!l&&n.push(s),o.isBlured&&(s.group.traverse(function(u){but(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,d){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Wx(t,e,r){ES(t,!0),Ry(t,OS),Wpe(t,e,r)}function ABr(t){ES(t,!1)}function Ea(t,e,r,n){n?ABr(t):Wx(t,e,r)}function Wpe(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var _ut=["emphasis","blur","select"],SBr={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Is(t,e,r,n){r=r||"itemStyle";for(var i=0;i<_ut.length;i++){var a=_ut[i],o=e.getModel([a,r]),s=t.ensureState(a);s.style=n?n(o):o[SBr[r]]()}}function ES(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function k8(t){return!!(t&&t.__highDownDispatcher)}function TBr(t,e,r){var n=Cr(t);n.componentMainType=e.mainType,n.componentIndex=e.componentIndex,n.componentHighDownName=r}function CBr(t){var e=gut[t];return e==null&&put<=32&&(e=gut[t]=put++),e}function Ype(t){var e=t.type;return e===kW||e===$pe||e===OW}function Rut(t){var e=t.type;return e===kS||e===CW}function kBr(t){var e=mut(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var q_=Hm.CMD,OBr=[[],[],[]],Dut=Math.sqrt,EBr=Math.atan2;function Lut(t,e){if(e){var r=t.data,n=t.len(),i,a,o,s,l,u,d=q_.M,h=q_.C,f=q_.L,p=q_.R,g=q_.A,m=q_.Q;for(o=0,s=0;o1&&(o*=qpe(g),s*=qpe(g));var m=(i===a?-1:1)*qpe((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+DW(h)*v-RW(h)*y,x=(e+n)/2+RW(h)*v+DW(h)*y,w=Iut([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=Iut(A,S);if(jpe(A,S)<=-1&&(T=O8),jpe(A,S)>=1&&(T=0),T<0){var C=Math.round(T/O8*1e6)/1e6;T=O8*2+C%2*O8}d.addData(u,b,x,o,s,w,T,h,a)}var _Br=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,RBr=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function DBr(t){var e=new Hm;if(!t)return e;var r=0,n=0,i=r,a=n,o,s=Hm.CMD,l=t.match(_Br);if(!l)return e;for(var u=0;uR*R+D*D&&(C=E,O=_),{cx:C,cy:O,x0:-d,y0:-h,x1:C*(i/A-1),y1:O*(i/A-1)}}function $Br(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 FBr(t,e){var r,n=R8(e.r,0),i=R8(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 d=e.cx,h=e.cy,f=!!e.clockwise,p=Uut(u-l),g=p>Kpe&&p%Kpe;if(g>pg&&(p=g),!(n>pg))t.moveTo(d,h);else if(p>Kpe-pg)t.moveTo(d+n*j_(l),h+n*_S(l)),t.arc(d,h,n,l,u,!f),i>pg&&(t.moveTo(d+i*j_(u),h+i*_S(u)),t.arc(d,h,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,O=void 0,E=void 0,_=void 0,P=void 0,L=void 0,R=void 0,D=n*j_(l),M=n*_S(l),I=i*j_(u),N=i*_S(u),F=p>pg;if(F){var B=e.cornerRadius;B&&(r=$Br(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=Uut(n-i)/2;if(x=jm(V,y),w=jm(V,b),A=jm(V,m),S=jm(V,v),O=T=R8(x,w),E=C=R8(A,S),(T>pg||C>pg)&&(_=n*j_(u),P=n*_S(u),L=i*j_(l),R=i*_S(l),ppg){var X=jm(y,O),J=jm(b,O),ee=LW(L,R,D,M,n,X,f),te=LW(_,P,I,N,n,J,f);t.moveTo(d+ee.cx+ee.x0,h+ee.cy+ee.y0),O0&&t.arc(d+ee.cx,h+ee.cy,X,qc(ee.y0,ee.x0),qc(ee.y1,ee.x1),!f),t.arc(d,h,n,qc(ee.cy+ee.y1,ee.cx+ee.x1),qc(te.cy+te.y1,te.cx+te.x1),!f),J>0&&t.arc(d+te.cx,h+te.cy,J,qc(te.y1,te.x1),qc(te.y0,te.x0),!f))}else t.moveTo(d+D,h+M),t.arc(d,h,n,l,u,!f);if(!(i>pg)||!F)t.lineTo(d+I,h+N);else if(E>pg){var X=jm(m,E),J=jm(v,E),ee=LW(I,N,_,P,i,-J,f),te=LW(D,M,L,R,i,-X,f);t.lineTo(d+ee.cx+ee.x0,h+ee.cy+ee.y0),E0&&t.arc(d+ee.cx,h+ee.cy,J,qc(ee.y0,ee.x0),qc(ee.y1,ee.x1),!f),t.arc(d,h,i,qc(ee.cy+ee.y1,ee.cx+ee.x1),qc(te.cy+te.y1,te.cx+te.x1),f),X>0&&t.arc(d+te.cx,h+te.cy,X,qc(te.y1,te.x1),qc(te.y0,te.x0),!f))}else t.lineTo(d+I,h+N),t.arc(d,h,i,u,l,f)}t.closePath()}}}var zBr=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}(),pc=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new zBr},e.prototype.buildPath=function(r,n){FBr(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(yn);pc.prototype.type="sector";var UBr=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),X_=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new UBr},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);X_.prototype.type="ring";function VBr(t,e,r,n){var i=[],a=[],o=[],s=[],l,u,d,h;if(n){d=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,p=t.length;f=2){if(n){var a=VBr(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],d=i[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],d[0],d[1])}}else{t.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;sLS[1]){if(a=!1,Il.negativeSize||n)return a;var l=MW(LS[0]-DS[1]),u=MW(DS[0]-LS[1]);Jpe(l,u)>PW.len()&&(l=u||!Il.bidirectional)&&(wr.scale(IW,s,-u*i),Il.useDir&&Il.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 h=d.duration,f=d.delay,p=d.easing,g={duration:h,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){ege("update",t,e,r,n,i,a)}function ua(t,e,r,n,i,a){ege("enter",t,e,r,n,i,a)}function J_(t){if(!t.__zr)return!0;for(var e=0;eao(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function tdt(t){return!t.isGroup}function n7r(t){return t.shape!=null}function I8(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){tdt(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return n7r(o)&&(s.shape=lr(o.shape)),s}var a=n(t);e.traverse(function(o){if(tdt(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 ige(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 rdt(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 nR(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 il(n)):tR(t.replace("path://",""),n,r,"center")}function P8(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=age(p,g,d,h)/f;return!(v<0||v>1)}function age(t,e,r,n){return t*n-r*e}function i7r(t){return t<=1e-6&&t>=-1e-6}function IS(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]),idt(t,Na,"x","width",3,1,i&&i[0]||0),idt(t,Na,"y","height",0,2,i&&i[1]||0)),t}var Na=[0,0,0,0];function idt(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 Iy(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(d){Kt(s,d)||(s[d]=l[d],s.$vars.push(d))});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 oge(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function qx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=o),oe&&(r=e=0),{min:r,max:e}}function zW(t,e,r){odt(t,e,r,-1/0)}function odt(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 jx(t,e){return Gr(Gr({},t,!0),e,!0)}const m7r={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:". "}}}},v7r={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 QW="ZH",gge="EN",oR=gge,HW={},mge={},mdt=Dn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||oR).toUpperCase();return t.indexOf(QW)>-1?QW:oR}():oR;function vge(t,e){t=t.toUpperCase(),mge[t]=new bn(e),HW[t]=e}function y7r(t){if($t(t)){var e=HW[t.toUpperCase()]||{};return t===QW||t===gge?lr(e):Gr(lr(e),lr(HW[oR]),!1)}else return Gr(lr(t),lr(HW[oR]),!1)}function yge(t){return mge[t]}function b7r(){return mge[oR]}vge(gge,m7r),vge(QW,v7r);var bge=null;function x7r(t){bge||(bge=t)}function Ho(){return bge}function vdt(t,e){var r=Ho(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function WW(t){var e=t.brk;return e?e.breaks:[]}function YW(t){var e=t.brk;return e?e.hasBreaks():!1}var xge=1e3,wge=xge*60,$8=wge*60,op=$8*24,ydt=op*365,w7r={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})/},qW={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},A7r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",jW="{yyyy}-{MM}-{dd}",bdt={year:"{yyyy}",month:"{yyyy}-{MM}",day:jW,hour:jW+" "+qW.hour,minute:jW+" "+qW.minute,second:jW+" "+qW.second,millisecond:A7r},Wh=["year","month","day","hour","minute","second","millisecond"],S7r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function T7r(t){return!$t(t)&&!ur(t)?C7r(t):t}function C7r(t){t=t||{};var e={},r=!0;return fe(Wh,function(n){r&&(r=t[n]==null)}),fe(Wh,function(n,i){var a=t[n];e[n]={};for(var o=null,s=i;s>=0;s--){var l=Wh[s],u=yr(a)&&!ft(a)?a[l]:a,d=void 0;ft(u)?(d=u.slice(),o=d[0]||""):$t(u)?(o=u,d=[o]):(o==null?o=qW[n]:w7r[l].test(o)||(o=e[l][l][0]+" "+o),d=[o],r&&(d[1]="{primary|"+o+"}")),e[n][l]=d}}),e}function Iu(t,e){return t+="","0000".substr(0,e-t.length)+t}function F8(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 k7r(t){return t===F8(t)}function O7r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function z8(t,e,r,n){var i=$m(t),a=i[xdt(r)](),o=i[Age(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Sge(r)](),u=i["get"+(r?"UTC":"")+"Day"](),d=i[Tge(r)](),h=(d-1)%12+1,f=i[Cge(r)](),p=i[kge(r)](),g=i[Oge(r)](),m=d>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof bn?n:yge(n||mdt)||b7r(),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,Iu(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,x[o-1]).replace(/{MMM}/g,w[o-1]).replace(/{MM}/g,Iu(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Iu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Iu(d,2)).replace(/{H}/g,d+"").replace(/{hh}/g,Iu(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Iu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Iu(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Iu(g,3)).replace(/{S}/g,g+"")}function E7r(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 d=sR(t.value,i);a=r[d][d][0]}}return z8(new Date(t.value),a,i,n)}function sR(t,e){var r=$m(t),n=r[Age(e)]()+1,i=r[Sge(e)](),a=r[Tge(e)](),o=r[Cge(e)](),s=r[kge(e)](),l=r[Oge(e)](),u=l===0,d=u&&s===0,h=d&&o===0,f=h&&a===0,p=f&&i===1,g=p&&n===1;return g?"year":p?"month":f?"day":h?"hour":d?"minute":u?"second":"millisecond"}function XW(t,e,r){switch(e){case"year":t[wdt(r)](0);case"month":t[Adt(r)](1);case"day":t[Sdt(r)](0);case"hour":t[Tdt(r)](0);case"minute":t[Cdt(r)](0);case"second":t[kdt(r)](0)}return t}function xdt(t){return t?"getUTCFullYear":"getFullYear"}function Age(t){return t?"getUTCMonth":"getMonth"}function Sge(t){return t?"getUTCDate":"getDate"}function Tge(t){return t?"getUTCHours":"getHours"}function Cge(t){return t?"getUTCMinutes":"getMinutes"}function kge(t){return t?"getUTCSeconds":"getSeconds"}function Oge(t){return t?"getUTCMilliseconds":"getMilliseconds"}function _7r(t){return t?"setUTCFullYear":"setFullYear"}function wdt(t){return t?"setUTCMonth":"setMonth"}function Adt(t){return t?"setUTCDate":"setDate"}function Sdt(t){return t?"setUTCHours":"setHours"}function Tdt(t){return t?"setUTCMinutes":"setMinutes"}function Cdt(t){return t?"setUTCSeconds":"setSeconds"}function kdt(t){return t?"setUTCMilliseconds":"setMilliseconds"}function R7r(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(!lpe(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 _ge(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 lR=qN;function Rge(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(d){return d&&Bh(d)?d:"-"}function a(d){return tp(d)}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?$m(t):t;if(isNaN(+l)){if(s)return"-"}else return z8(l,n,r)}if(e==="ordinal")return CH(t)?i(t):Vn(t)&&a(t)?t+"":"-";var u=Fm(t);return a(u)?Ege(u):CH(t)?i(t):typeof t=="boolean"?t+"":"-"}var Odt=["a","b","c","d","e","f","g"],Dge=function(t,e){return"{"+t+(e??"")+"}"};function Lge(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 D7r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd +yyyy`);var n=$m(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"](),d=n[i+"Seconds"](),h=n[i+"Milliseconds"]();return t=t.replace("MM",Iu(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Iu(a%100+"",2)).replace("dd",Iu(s,2)).replace("d",s).replace("hh",Iu(l,2)).replace("h",l).replace("mm",Iu(u,2)).replace("m",u).replace("ss",Iu(d,2)).replace("s",d).replace("SSS",Iu(h,3)),t}function L7r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function $S(t,e){return e=e||"transparent",$t(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function KW(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var ZW={},Mge={},cR=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n(ZW),this._normalMasterList=n(Mge);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"){ZW[e]=r;return}Mge[e]=r},t.get=function(e){return Mge[e]||ZW[e]},t}();function M7r(t){return!!ZW[t]}var I7r=1,Rdt=2;function P7r(t){Ddt.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var Ddt=qt();function Ldt(t){var e=t.getShallow("coord",!0),r=I7r;if(e==null){var n=Ddt.get(t.type);n&&n.getCoord2&&(r=Rdt,e=n.getCoord2(t))}return{coord:e,from:r}}var uR=0,JW=1,Mdt=2;function Idt(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=uR;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=JW,a||(i=uR)):n==="box"&&(i=Mdt,!a&&!M7r(r)&&(i=uR))}return{coordSysType:r,kind:i}}function U8(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Idt(e),o=a.kind,s=a.coordSysType;if(i&&o!==JW&&(o=JW,s=r),o===uR||s!==r)return uR;var l=n(r,e);return l?(o===JW?e.coordinateSystem=l:e.boxCoordinateSystem=l,o):uR}var Pdt=function(t,e){var r=e.getReferringComponents(t,xo).models[0];return r&&r.coordinateSystem},eY=fe,Ndt=["left","right","top","bottom","width","height"],FS=[["width","left","right"],["height","top","bottom"]];function Ige(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 d=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),p,g;if(t==="horizontal"){var m=d.width+(f?-f.x+d.x:0);p=a+m,p>n||l.newline?(a=0,p=m,o+=s+r,s=d.height):s=Math.max(s,d.height)}else{var v=d.height+(f?-f.y+d.y:0);g=o+v,g>i||l.newline?(a+=s+r,o=0,g=v,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=p+r:o=g+r)})}var zS=Ige;Kr(Ige,"vertical"),Kr(Ige,"horizontal");function Bdt(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 N7r(t,e){var r=Ns(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===V8.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===Rdt?r.refPoint:[Gt(s[0],i.width)+i.x,Gt(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function $dt(t,e){var r=N7r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var o=Gt(n.width,e.getWidth()),s=Gt(n.height,e.getHeight()),l=Math.min(o,s),u=Gt(a[0],l/2),d=Gt(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:d,viewRect:n}}function ba(t,e,r){r=lR(r||0);var n=e.width,i=e.height,a=Gt(t.left,n),o=Gt(t.top,i),s=Gt(t.right,n),l=Gt(t.bottom,i),u=Gt(t.width,n),d=Gt(t.height,i),h=r[2]+r[0],f=r[1]+r[3],p=t.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(d)&&(d=i-l-h-o),p!=null&&(isNaN(u)&&isNaN(d)&&(p>n/i?u=n*.8:d=i*.8),isNaN(u)&&(u=p*d),isNaN(d)&&(d=u/p)),isNaN(a)&&(a=n-s-u-f),isNaN(o)&&(o=i-l-d-h),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-d/2-r[0];break;case"bottom":o=i-d-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(d)&&(d=i-h-o-(l||0));var g=new pr((e.x||0)+a+r[3],(e.y||0)+o+r[0],u,d);return g.margin=r,g}function Fdt(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 h;for(var v=0;v=0;l--)s=Gr(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return U_(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){return Bdt(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);Mct(pn,bn),pW(pn),p7r(pn),g7r(pn,F7r);function F7r(t){var e=[];return fe(pn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return Um(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 VS in Wo)if(Wo.hasOwnProperty(VS)){var Udt=Wo[VS];VS==="theme"?tt.darkColor.theme=Wo.theme.slice():VS==="highlight"?tt.darkColor.highlight="rgba(255,231,130,0.4)":VS.indexOf("accent")===0?tt.darkColor[VS]=Ty(Udt,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):tt.darkColor[VS]=Ty(Udt,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 Vdt="";typeof navigator<"u"&&(Vdt=navigator.platform||"");var dR="rgba(0, 0, 0, 0.2)",Gdt=tt.color.theme[0],z7r=Ty(Gdt,null,null,.9);const Qdt={darkMode:"auto",colorBy:"series",color:tt.color.theme,gradientColor:[z7r,Gdt],aria:{decal:{decals:[{color:dR,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:dR,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:dR,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:dR,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:dR,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:dR,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Vdt.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 mc={Must:1,Might:2,Not:3},Hdt=Qr();function U7r(t){Hdt(t).datasetMap=qt()}function Wdt(t,e,r){var n={},i=Nge(e);if(!i||!t)return n;var a=[],o=[],s=e.ecModel,l=Hdt(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,d,h;t=t.slice(),fe(t,function(m,v){var y=yr(m)?m:t[v]={name:m};y.type==="ordinal"&&d==null&&(d=v,h=g(y)),n[y.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});fe(t,function(m,v){var y=m.name,b=g(m);if(d==null){var x=f.valueWayDim;p(n[y],x,b),p(o,x,b),f.valueWayDim+=b}else if(d===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 Xdt(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 d=o==null||!n?r:W7r(n,o);if(d=d||r,!(!d||!d.length)){var h=d[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%d.length,h}}function Y7r(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var rY,Q8,Kdt,Zdt="\0_ec_inner",q7r=1,zge=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=tht(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,tht(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"?Kdt(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;U7r(this),fe(r,function(h,f){h!=null&&(pn.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(h):Gr(i[f],h,!0))}),u&&u.each(function(h,f){pn.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),pn.topologicalTravel(s,pn.getAllClassMainTypes(),d,this);function d(h){var f=Q7r(this,h,ji(r[h])),p=a.get(h),g=p?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=Cct(p,f,g);r8r(m,h,pn),i[h]=null,a.set(h,null),o.set(h,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=h==="series",O=pn.getClass(h,w.keyInfo.subType,!C);if(!O)return;if(h==="tooltip"){if(x)return;x=!0}if(S&&S.constructor===O)S.name=w.keyInfo.name,S.mergeOption(T,this),S.optionUpdated(T,!1);else{var E=lt({componentIndex:A},w.keyInfo);S=new O(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[h]=v,a.set(h,y),o.set(h,b),h==="series"&&rY(this)}this._seriesIndices||rY(this)},e.prototype.getOption=function(){var r=lr(this.option);return fe(r,function(n,i){if(pn.hasClass(i)){for(var a=ji(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!x8(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[Zdt],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 r$r(t,e){return t.join(",")===e.join(",")}var mg=fe,H8=yr,rht=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Uge(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=rht.length;r0?r[o-1].seriesModel:null)}),h$r(r)}})}function h$r(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,d,h){var f=o.get(e.stackedDimension,h);if(isNaN(f))return i;var p,g;s?g=o.getRawIndex(h):p=o.get(e.stackedByDimension,h);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=dS(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var nY=function(){function t(e){this.data=e.data||(e.sourceFormat===hg?{}:[]),this.sourceFormat=e.sourceFormat||uut,this.seriesLayoutBy=e.seriesLayoutBy||fg,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};fht=(e={},e[Ll+"_"+fg]={pure:!0,appendData:a},e[Ll+"_"+CS]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Qh]={pure:!0,appendData:a},e[hg]={pure:!0,appendData:function(o){var s=this._data;fe(o,function(l,u){for(var d=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)d.push(l[h])})}},e[Gh]={appendData:a},e[Hx]={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 hR(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function wht(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function q8(t){return new x$r(t)}var x$r=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=d(this._modBy),s=this._modDataCount||0,l=d(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function d(b){return!(b>=1)&&(b=1),b}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=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&&(h||p1&&n>0?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},A$r=function(){function t(e,r){if(!Vn(r)){var n="";si(n)}this._opFn=Tht[e],this._rvalFloat=Fm(r)}return t.prototype.evaluate=function(e){return Vn(e)?this._opFn(e,this._rvalFloat):this._opFn(Fm(e),this._rvalFloat)},t}(),Cht=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:Fm(e),i=Vn(r)?r:Fm(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}(),S$r=function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=Fm(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=Fm(e)===this._rvalFloat)}return this._isEQ?r:!r},t}();function T$r(t,e){return t==="eq"||t==="ne"?new S$r(t==="eq",e):Kt(Tht,t)?new A$r(t,e):null}function kht(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?I$r:P$r}function N$r(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Lht(t,e,r,n,i){var a=Dht[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}),d=0;dy[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=h&&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=h&&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=h&&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),d,h,f,p=new(fR(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var g=1;gd&&(d=h,f=w)}_>0&&_s&&(m=s-d);for(var v=0;vg&&(g=b,p=d+v)}var x=this.getRawIndex(h),w=this.getRawIndex(p);hd-g&&(l=d-g,s.length=l);for(var m=0;mh[1]&&(h[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[d]=[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 Xx(r[a],this._dimensions[a])}jge={arrayRows:e,objectRows:function(r,n,i,a){return Xx(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Xx(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Mht=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(oY(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var d=r[0];d.prepareSource(),u=d.getSource(),s=u.data,l=u.sourceFormat,a=[d._getVersionSign()]}else s=o.get("data",!0),l=Du(s)?Hx:Gh,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},p=Jt(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=Jt(h.sourceHeader,f.sourceHeader),m=Jt(h.dimensions,f.dimensions),v=p!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=v?[Qge(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=[Qge(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&&Pht(a)}var o,s=[],l=[];return fe(e,function(u){u.prepareSource();var d=u.getSource(i||0),h="";i!=null&&!d&&Pht(h),s.push(d),l.push(u._getVersionSign())}),n?o=L$r(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[f$r(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=Fht(i);a>=e&&(e=a+ +(n&&(!a||Kge(i)&&!i.noHeader)))}),e}return 0}function z$r(t,e,r,n){var i=e.noHeader,a=V$r(Fht(e)),o=[],s=e.blocks||[];dc(!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 d=new Cht(u[l],null);s.sort(function(m,v){return d.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}fe(s,function(m,v){var y=e.valueFormatter,b=$ht(m)(y?lt(lt({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&o.push(b)});var h=t.renderMode==="richText"?o.join(a.richText):Zge(n,o.join(""),i?r:a.html);if(i)return h;var f=Rge(e.header,"ordinal",t.useUTC),p=Bht(n,t.renderMode).nameStyle,g=Nht(n);return t.renderMode==="richText"?Uht(t,f,p)+a.richText+h:Zge(n,'
'+Wc(f)+"
"+h,r)}function U$r(t,e,r,n){var i=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,d=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 h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||tt.color.secondary,i),f=a?"":Rge(l,"ordinal",u),p=e.valueType,g=o?[]:d(e.value,e.rawDataIndex),m=!s||!a,v=!s&&a,y=Bht(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(s?"":h)+(a?"":Uht(t,f,b))+(o?"":H$r(t,g,m,v,x)):Zge(n,(s?"":h)+(a?"":G$r(f,!s,b))+(o?"":Q$r(g,m,v,x)),r)}}function zht(t,e,r,n,i,a){if(t){var o=$ht(t),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function V$r(t){return{html:$$r[t],richText:F$r[t]}}function Zge(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Nht(t);return'
'+e+n+"
"}function G$r(t,e,r){var n=e?"margin-left:2px":"";return''+Wc(t)+""}function Q$r(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 Wc(o)}).join("  ")+""}function Uht(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function H$r(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 Vht(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return $S(n)}function Ght(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Jge=function(){function t(){this.richTextStyles={},this._nextStyleNameId=cpe()}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=_dt({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=Vht(e,r),d,h,f,p;if(o>1||l&&!o){var g=W$r(s,e,r,a,u);d=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);p=d=h5(i,r,a[0]),h=m.type}else p=d=l?s[0]:s;var v=upe(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:!Bh(x),value:d,valueType:h,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function W$r(t,e,r,n,i){var a=e.getData(),o=qf(t,function(h,f,p){var g=a.getDimensionInfo(p);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?fe(n,function(h){d(h5(a,r,h),h)}):fe(t,d);function d(h,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(o?u.push(fs("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:h,valueType:p.type})):(s.push(h),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Kx=Qr();function sY(t,e){return t.getName(e)||t.getId(e)}var lY="__universalTransitionEnabled",Pi=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=q8({count:q$r,reset:j$r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Kx(this).sourceManager=new Mht(this);a.prepareSource();var o=this.getInitialData(r,i);Wht(o,this),this.dataTask.context.data=o,Kx(this).dataBeforeProcessed=o,Hht(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=G8(this),a=i?US(r):{},o=this.subType;pn.hasClass(o)&&(o+="Series"),Gr(r,n.getTheme().get(this.subType)),Gr(r,this.getDefaultOption()),fS(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Xm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Gr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=G8(this);i&&Xm(this.option,r,i);var a=Kx(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Wht(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Kx(this).dataBeforeProcessed=o,Hht(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Du(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=A,f=w,p=0),w===f&&(d[p++]=v))}return d.length=p,d},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=$ge.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[sY(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[lY])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,d=0;d0&&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);Go(Pi,aY),Go(Pi,$ge),Mct(Pi,pn);function Hht(t){var e=t.name;upe(t)||(t.name=Y$r(t)||e)}function Y$r(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 q$r(t){return t.model.getRawData().count()}function j$r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),X$r}function X$r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Wht(t,e){fe(k_(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Kr(K$r,e))})}function K$r(t,e){var r=eme(t);return r&&r.setOutputEnd((e||this).count()),e}function eme(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 Ki=function(){function t(){this.group=new gr,this.uid=BS("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}();mpe(Ki),pW(Ki);function YS(){var t=Qr();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 Yht=Qr(),Z$r=YS(),Ei=function(){function t(){this.group=new gr,this.uid=BS("viewChart"),this.renderTask=q8({plan:J$r,reset:eFr}),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&&jht(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&jht(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){qx(this.group,e)},t.markUpdateMethod=function(e,r){Yht(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function qht(t,e,r){t&&k8(t)&&(e==="emphasis"?Dy:Ly)(t,r)}function jht(t,e,r){var n=pS(t,e),i=e&&e.highlightKey!=null?CBr(e.highlightKey):null;n!=null?fe(ji(n),function(a){qht(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){qht(a,r,i)})}mpe(Ei),pW(Ei);function J$r(t){return Z$r(t.model)}function eFr(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=i&&Yht(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,i),tFr[l]}var tFr={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)}}},cY="\0__throttleOriginMethod",Xht="\0__throttleRate",Kht="\0__throttleType";function uY(t,e,r){var n,i=0,a=0,o=null,s,l,u,d;e=e||0;function h(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(p){d=p},f}function p5(t,e,r,n){var i=t[e];if(i){var a=i[cY]||i,o=i[Kht],s=i[Xht];if(s!==r||o!==n){if(r==null||!n)return t[e]=a;i=t[e]=uY(a,r,n==="debounce"),i[cY]=a,i[Kht]=n,i[Xht]=r}return i}}function j8(t,e){var r=t[e];r&&r[cY]&&(r.clear&&r.clear(),t[e]=r[cY])}var Zht=Qr(),Jht={itemStyle:vS(gdt,!0),lineStyle:vS(pdt,!0)},rFr={lineStyle:"stroke",itemStyle:"fill"};function eft(t,e){var r=t.visualStyleMapper||Jht[e];return r||(console.warn("Unknown style type '"+e+"'."),Jht.itemStyle)}function tft(t,e){var r=t.visualDrawType||rFr[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var nFr={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=eft(t,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=tft(t,n),u=o[l],d=ur(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||d||h){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)&&d)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=lt({},o);v[l]=d(m),p.setItemVisual(g,"style",v)}}}},X8=new bn,iFr={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=eft(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){X8.option=l[n];var u=i(X8),d=o.ensureUniqueItemVisual(s,"style");lt(d,u),X8.option.decal&&(o.setItemVisual(s,"decal",X8.option.decal),X8.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},aFr={performRawSeries:!0,overallReset:function(t){var e=qt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Zht(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),o=Zht(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=tft(r,s);a.each(function(u){var d=a.getRawIndex(u);i[d]=u}),n.each(function(u){var d=i[u],h=a.getItemVisual(d,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(d,"style"),p=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(p,o,g)}})}})}},dY=Math.PI;function oFr(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 D8({shape:{startAngle:-dY/2,endAngle:-dY/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:dY*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:dY*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),d=t.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:d}),a.setShape({x:u-l,y:d-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var rft=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):Dct(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="";dc(!(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 d=o._stageTaskMap.get(l.uid),h=d.seriesTaskMap,f=d.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 h&&h.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(d):l?n.eachRawSeriesByType(l,d):u&&u(n,i).each(d);function d(h){var f=h.uid,p=s.set(f,o&&o.get(f)||q8({plan:dFr,reset:hFr,count:pFr}));p.context={model:h,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,p)}},t.prototype._createOverallStageTask=function(e,r,n,i){var a=this,o=r.overallTask=r.overallTask||q8({reset:sFr});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=qt(),u=e.seriesType,d=e.getTargetSeries,h=e.dirtyOnOverallProgress,f=!1,p="";dc(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):d?d(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,q8({reset:lFr,onDirty:uFr})));y.context={model:m,dirtyOnOverallProgress:h},y.agent=o,y.__block=h,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:gFr(e)}),e.uid=BS("stageHandler"),r&&(e.visualType=r),e},t}();function sFr(t){t.overallReset(t.ecModel,t.api,t.payload)}function lFr(t){return t.dirtyOnOverallProgress&&cFr}function cFr(){this.agent.dirty(),this.getDownstream().dirty()}function uFr(){this.agent&&this.agent.dirty()}function dFr(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function hFr(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ji(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?vt(e,function(r,n){return nft(n)}):fFr}var fFr=nft(0);function nft(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,d=!0)}}s.hasOwnProperty(u)&&(n[u]=l,d=!0),d||(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 d(l,o,"mainType")&&d(l,o,"subType")&&d(l,o,"index","componentIndex")&&d(l,o,"name")&&d(l,o,"id")&&d(u,a,"name")&&d(u,a,"dataIndex")&&d(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,i,a));function d(h,f,p,g){return h[p]==null||f[g||p]===h[p]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),tme=["symbol","symbolSize","symbolRotate","symbolOffset"],cft=tme.concat(["symbolKeepAspect"]),vFr={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&&XS(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function nme(t,e,r){for(var n=e.type==="radial"?NFr(t,e,r):PFr(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 ime(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&$Fr(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 FFr=new Hm(!0);function mY(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function vft(t){return typeof t=="string"&&t!=="none"}function vY(t){var e=t.fill;return e!=null&&e!=="none"}function yft(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 bft(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 ame(t,e,r){var n=ype(e.image,e.__image,r);if(gW(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)*KN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function zFr(t,e,r,n,i){var a,o=mY(r),s=vY(r),l=r.strokePercent,u=l<1,d=!e.path;(!e.silent||u)&&d&&e.createPathProxy();var h=e.path||FFr,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?nme(t,p,T):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?nme(t,g,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?ame(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(S=f||!e.__canvasStrokePattern?ame(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();h.setScale(C[0],C[1],e.segmentIgnoreThreshold);var O,E;t.setLineDash&&r.lineDash&&(a=ime(e),O=a[0],E=a[1]);var _=!0;(d||f&R_)&&(h.setDPR(t.dpr),u?h.setContext(null):(h.setContext(t),_=!1),h.reset(),e.buildPath(h,e.shape,n),h.toStatic(),e.pathUpdated()),_&&h.rebuildPath(t,u?l:1),O&&(t.setLineDash(O),t.lineDashOffset=E),n?(i.batchFill=s,i.batchStroke=o):r.strokeFirst?(o&&bft(t,r),s&&yft(t,r)):(s&&yft(t,r),o&&bft(t,r)),O&&t.setLineDash([])}function UFr(t,e,r){var n=e.__image=ype(r.image,e.__image,e,e.onload);if(!(!n||!gW(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,d=r.sy||0;t.drawImage(n,u,d,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,d=r.sy,h=o-u,f=s-d;t.drawImage(n,u,d,h,f,i,a,o,s)}else t.drawImage(n,i,a,o,s)}}function VFr(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||gy,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=ime(e),a=n[0],o=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(mY(r)&&t.strokeText(i,r.x,r.y),vY(r)&&t.fillText(i,r.x,r.y)):(vY(r)&&t.fillText(i,r.x,r.y),mY(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var xft=["shadowBlur","shadowOffsetX","shadowOffsetY"],wft=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Aft(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Pu(t,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?yS.opacity:o}(n||e.blend!==r.blend)&&(a||(Pu(t,i),a=!0),t.globalCompositeOperation=e.blend||yS.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[Bs]){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[Bs]=!0,S5(this),!this._model||n){var l=new Z7r(this._api),u=this._theme,d=this._model=new zge;d.scheduler=this._scheduler,d.ssr=this._ssr,d.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},bme);var h={seriesTransition:s,optionChanged:!0};if(i)this[Pl]={silent:a,updateParams:h},this[Bs]=!1,this.getZr().wakeUp();else{try{ZS(this),Ny.update.call(this,null,h)}catch(f){throw this[Pl]=null,this[Bs]=!1,f}this._ssr||this._zr.flush(),this[Pl]=null,this[Bs]=!1,w5.call(this,a),A5.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Bs]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Pl]&&(a==null&&(a=this[Pl].silent),o=this[Pl].updateParams,this[Pl]=null),this[Bs]=!0,S5(this);try{this._updateTheme(r),i.setTheme(this._theme),ZS(this),Ny.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Bs]=!1,s}this[Bs]=!1,w5.call(this,a),A5.call(this,a)}}},e.prototype._updateTheme=function(r){$t(r)&&(r=Zft[r]),r&&(r=lr(r),r&&lht(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 d=o._componentsMap[u.__viewId];d.group.ignore||(a.push(d),d.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(kY[i]){var l=s,u=s,d=-s,h=-s,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();fe(JS,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),d=o(S.right,d),h=o(S.bottom,h),f.push({dom:A,left:S.left,top:S.top})}}),l*=p,u*=p,d*=p,h*=p;var g=d-l,m=h-u,v=rl.createCanvas(),y=rpe(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 il({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 wY(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return wY(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return wY(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=z_(i,r);return fe(o,function(s,l){l.indexOf("Models")>=0&&fe(s,function(u){var d=u.coordinateSystem;if(d&&d.containPoint)a=a||!!d.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(r,n){var i=this._model,a=z_(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?rme(s,l,n):J8(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(f9r,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,d=i==="globalout";if(d?u={}:l&&qS(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 h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var p=h&&f!=null&&s.getComponent(h,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(vme,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),bFr(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&&Oct(this.getDom(),wme,"");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 JS[n.id]},e.prototype.resize=function(r){if(!this[Bs]){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[Pl]&&(a==null&&(a=this[Pl].silent),i=!0,this[Pl]=null),this[Bs]=!0,S5(this);try{i&&ZS(this),Ny.update.call(this,{type:"resize",animation:lt({duration:0},r&&r.animation)})}catch(o){throw this[Bs]=!1,o}this[Bs]=!1,w5.call(this,a),A5.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(),!!xme[r]){var i=xme[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=mme[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!TY[r.type]&&this._model){if(this[Bs]){this._pendingActions.push(r);return}var i=n.silent;fme.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Dn.browser.weChat&&this._throttledZrFlush(),w5.call(this,i),A5.call(this,i)}},e.prototype.updateLabelLayout=function(){lp.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(){ZS=function(h){AFr(h._model);var f=h._scheduler;f.restorePipelines(h._zr,h._model),f.prepareStageTasks(),dme(h,!0),dme(h,!1),f.plan()},dme=function(h,f){for(var p=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,v=f?h._componentsMap:h._chartsMap,y=h._zr,b=h._api,x=0;xJt(f.get("hoverLayerThreshold"),Qdt.hoverLayerThreshold)&&!Dn.node&&!Dn.worker;(h._usingTHL||v)&&(f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var b=h._chartsMap[y.__viewId];b.__alive&&b.eachRendered(function(x){var w=x.states.emphasis;w&&w.hoverLayer!==e5&&(w.hoverLayer=v?Kut:Xut)})}}),h._usingTHL=v)}}function s(h,f){var p=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=p)})}function l(h,f){if(!h.preventAutoZ){var p=PS(h);f.eachRendered(function(g){return zW(g,p.z,p.zlevel),!0})}}function u(h,f){f.eachRendered(function(p){if(!J_(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 d(h,f){var p=h.getModel("stateAnimation"),g=h.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(J_(y))return;if(y instanceof yn&&kBr(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)}})}jft=function(h){return new(function(f){nt(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},p.prototype.enterEmphasis=function(g,m){Dy(g,m),cp(h)},p.prototype.leaveEmphasis=function(g,m){Ly(g,m),cp(h)},p.prototype.enterBlur=function(g){Sut(g),cp(h)},p.prototype.leaveBlur=function(g){Vpe(g),cp(h)},p.prototype.enterSelect=function(g){Tut(g),cp(h)},p.prototype.leaveSelect=function(g){Cut(g),cp(h)},p.prototype.getModel=function(){return h.getModel()},p.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},p.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},p.prototype.getECUpdateCycleVersion=function(){return h[bY]},p.prototype.usingTHL=function(){return h._usingTHL},p}(hut))(h)},Xft=function(h){function f(p,g){for(var m=0;m=0)){ipt.push(r);var o=rft.wrapStageHandler(r,i);o.__prio=e,o.__raw=r,t.push(o)}}function Ome(t,e){xme[t]=e}function S9r(t){Xst({createCanvas:t})}function apt(t,e,r){var n=fft("registerMap");n&&n(t,e,r)}function T9r(t){var e=fft("getMap");return e&&e(t)}var opt=D$r;Zx(lme,nFr),Zx(yY,iFr),Zx(yY,aFr),Zx(lme,vFr),Zx(yY,yFr),Zx(Bft,XFr),Tme(lht),Cme(r9r,u$r),Ome("default",oFr),vg({type:kS,event:kS,update:kS},no),vg({type:CW,event:CW,update:CW},no),vg({type:kW,event:Fpe,update:kW,action:no,refineEvent:Eme,publishNonRefinedEvent:!0}),vg({type:$pe,event:Fpe,update:$pe,action:no,refineEvent:Eme,publishNonRefinedEvent:!0}),vg({type:OW,event:Fpe,update:OW,action:no,refineEvent:Eme,publishNonRefinedEvent:!0});function Eme(t,e,r,n){return{eventContent:{selected:wBr(r),isFromClick:e.isFromClick||!1}}}Sme("default",{}),Sme("dark",lft);var C9r={},spt=[],k9r={registerPreprocessor:Tme,registerProcessor:Cme,registerPostInit:ept,registerPostUpdate:tpt,registerUpdateLifecycle:OY,registerAction:vg,registerCoordinateSystem:rpt,registerLayout:npt,registerVisual:Zx,registerTransform:opt,registerLoading:Ome,registerMap:apt,registerImpl:xFr,PRIORITY:$ft,ComponentModel:pn,ComponentView:Ki,SeriesModel:Pi,ChartView:Ei,registerComponentModel:function(t){pn.registerClass(t)},registerComponentView:function(t){Ki.registerClass(t)},registerSeriesModel:function(t){Pi.registerClass(t)},registerChartView:function(t){Ei.registerClass(t)},registerCustomSeries:function(t,e){gft(t,e)},registerSubTypeDefaulter:function(t,e){pn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){uct(t,e)}};function Xr(t){if(ft(t)){fe(t,function(e){Xr(e)});return}Nr(spt,t)>=0||(spt.push(t),ur(t)&&(t={install:t}),t.install(k9r))}function eB(t){return t==null?0:t.length||1}function lpt(t){return t}var By=function(){function t(e,r,n,i,a,o){this._old=e,this._new=r,this._oldKeyGetter=n||lpt,this._newKeyGetter=i||lpt,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 d=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(d,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(d,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(d,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(d,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(d,u),i[l]=null;else if(h>1)for(var p=0;p1)for(var s=0;s30}var tB=yr,Jx=vt,L9r=typeof Int32Array>"u"?Array:Int32Array,M9r="e\0\0",fpt=-1,I9r=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],P9r=["_approximateExtent"],ppt,RY,rB,nB,Dme,iB,Lme,Xc=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;upt(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={},d=0;d=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Gh;if(l&&!i.pure)for(var u=[],d=e;d0},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():tB(a)&&(a=lt({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,tB(r)?lt(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){tB(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;Ppe(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)),Dme(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(kH(arguments)))})},t.internalField=function(){ppt=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 L9r(o.categories.length);for(var l=0;l1&&(l+="__ec__"+d),i[r]=l}}}(),t}();function N9r(t,e){return T5(t,e).dimensions}function T5(t,e){Gge(t)||(t=Hge(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=qt(),a=[],o=B9r(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&hpt(o),l=n===t.dimensionsDefine,u=l?dpt(t):Rme(n),d=e.encodeDefine;!d&&e.encodeDefaulter&&(d=e.encodeDefaulter(t,o));for(var h=qt(d),f=new _ht(o),p=0;p0&&(O.name=O.name+(E-1))}),new cpt({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function B9r(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 $9r(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 F9r=function(){function t(e){this.coordSysDims=[],this.axisMap=qt(),this.categoryAxisMap=qt(),this.coordSysName=e}return t}();function z9r(t){var e=t.get("coordinateSystem"),r=new F9r(e),n=U9r[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var U9r={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),C5(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),C5(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),C5(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),C5(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),C5(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),d=o[l];r.set(d,u),C5(u)&&(n.set(d,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 C5(t){return t.get("type")==="category"}function gpt(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;V9r(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,d,h,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),!d&&g(w)&&(!p||w.coordDim!=="x"&&w.coordDim!=="angle")&&(!i||i===w.coordDim)&&(d=w))}),d&&!n&&!u&&(n=!0),d){h="__\0ecstackresult_"+t.id,f="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var m=d.coordDim,v=d.type,y=0;fe(a,function(w){w.coordDim===m&&y++});var b={name:h,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(h,v)),o.appendCalculationDimension(b),o.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:d&&d.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function V9r(t){return!upt(t.schema)}function $y(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Mme(t,e){return $y(t,e)?t.getCalculationInfo("stackResultDimension"):e}function G9r(t,e){var r=t.get("coordinateSystem"),n=c5.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=EY(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Q9r(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 Km(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=Hge(t)):(i=n.getSource(),a=i.sourceFormat===Gh);var o=z9r(e),s=G9r(e,o),l=r.useEncodeDefaulter,u=ur(l)?l:l?Kr(Wdt,s,e):null,d={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=T5(i,d),f=Q9r(h.dimensions,r.createInvertedIndices,o),p=a?null:n.getSharedDataStore(h),g=gpt(e,{schema:h,store:p}),m=new Xc(h,e);m.setCalculationInfo(g);var v=f!=null&&H9r(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 H9r(t){if(t.sourceFormat===Gh){var e=W9r(t.data||[]);return!ft(F_(e))}}function W9r(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Gd].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){ypt(this._extents,Gd,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Gd].slice()),ypt(n,t,e,r)},freeze:function(){}};function ypt(t,e,r,n){gS(r,n)&&(t[e][0]=r,t[e][1]=n)}function bpt(t){return MY(t)||k5(t)}function MY(t){return t.type==="interval"}function lB(t){return t.type==="time"}function k5(t){return t.type==="log"}function Kc(t){return t.type==="ordinal"}function Z9r(t){var e=cW(t),r=cS(10,e),n=Nm(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Yn(n*r,-e)}function eT(t){return Bm(t)+2}function IY(t,e){return uS(t)/uS(e)}function $me(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,d,h){r({value:u,offInterval:d},h)}}var cB=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,Pme(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new aB({})),ft(i)&&(i=new aB({categories:vt(i,function(o){return yr(o)?o.value:o})})),n._ordinalMeta=i;var a=Ime(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,Nme(n),n}return e.parse=function(r){return r==null?r=NaN:$t(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=Nm(r),r},e.prototype.getTicks=function(){var r=[];return wpt(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(h.push({value:m}),m=Yn(m+i,s),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Yn(m+y*i,s))}if(h.length>0&&m===h[h.length-1].value)break;if(h.length>f)return[]}var b=h.length?h[h.length-1].value:o[1];return a[1]>b&&h.push({value:r.expandToNicedExtent?Yn(b+i,s):a[1]}),d&&l.pruneTicksByBreak(r.pruneByBreak,h,u.breaks,function(x){return x.value},n.interval,a),d&&r.breakTicks!=="none"&&l.addBreaksToTicks(h,u.breaks,a),h},e.prototype.getMinorTicks=function(r){return Fme(this,r,WW(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=Bm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Yn(r.value,i,!0);return Ege(a)},e.type="interval",e}(yg);yg.registerClass(ew);var ezr=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 rzr(t){var e=30*op;return t/=e,t>6?6:t>3?3:t>2?2:1}function nzr(t){return t/=$8,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Tpt(t,e){return t/=e?wge:xge,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function izr(t){return rn(uW(t,!0),1)}function azr(t,e,r){var n=Math.max(0,Nr(Wh,e)-1);return XW(new Date(t),Wh[n],r).getTime()}function ozr(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 szr(t,e,r,n,i,a){var o=3e3,s=S7r,l=0;function u(M,I,N,F,B,V,z){for(var U=ozr(B,M),G=I,H=new Date(G);Go));)if(H[B](H[F]()+M),G=H.getTime(),a){var j=a.calcNiceTickMultiple(G,U);j>0&&(H[B](H[F]()+j*M),G=H.getTime())}z.push({value:G,notAdd:G>n[1]})}function d(M,I,N){var F=[],B=!I.length;if(!Spt(F8(M),n[0],n[1],r)){B&&(I=[{value:azr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(G,z,U,H,j,q,F),M==="year"&&N.length>1&&V===0&&N.unshift({value:N[0].value-G})}}for(var V=0;V=n[0]&&w<=n[1]&&p++)}var A=i/e;if(p>A*1.5&&g>A/1.5||(h.push(b),p>A||t===s[m]))break}f=[]}}}for(var S=oi(vt(h,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=NY.length,u=Math.min(ezr(NY,a,0,l),l-1),d=NY[u][1],h=NY[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:d,minLevelUnit:h})};yg.registerClass(Apt);var BY=0,$Y=1,czr=2,Cpt=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=ew.parse,n.base=r.logBase||10;var i=[],a=[],o=n._lookup={from:i,to:a};i[BY]=i[$Y]=a[BY]=a[$Y]=NaN,Pme(n,e.mapperMethods);var s=Ho(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},czr,u),n.powStub=new ew({breakParsed:u.original}),n.intervalStub=new ew({breakParsed:u.transformed}),Nme(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(d){var h=d.value,f=$me(h,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,d,WW(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return Fme(this,r,WW(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(IY(r,this.base))},scale:function(r){return $me(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=IY(r,this.base),n&&n.depth===Fy?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return kpt.depth=i,Opt.lookup=this._lookup,$me(i===Fy?r:this.intervalStub.transformOut(r,kpt),this.base,Opt)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Gd,r,n)},setExtent2:function(r,n,i){if(!(!gS(n,i)||n<=0||i<=0)){var a=Ept,o=Ept;if(r===Gd){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[BY]=n,a[$Y]=i);var l=this.base;this.intervalStub.setExtent2(r,o[BY]=IY(n,l),o[$Y]=IY(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return gS(n[0],n[1])&&tp(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}(yg);yg.registerClass(Cpt);var kpt={},Opt={},Ept=[],_pt={value:1,category:1,time:1,log:1},Rpt=Qr();function uB(t){var e=t.get("type");return(e==null||!Kt(_pt,e)&&!yg.getClass(e))&&(e="value"),e}function O5(t,e,r){var n=Ho(),i;switch(n&&(i=Dpt(t,e,r)),e){case"category":return new cB({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:fc()});case"time":return new Apt({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new Cpt({logBase:t.get("logBase"),breakOption:i});case"value":return new ew({breakOption:i});default:return new(yg.getClass(e)||ew)({})}}function uzr(t,e,r){var n=t.getExtentUnsafe(Gd,null),i=n[0],a=n[1];return gS(i,a)?i===e||a===e?hzr:ie?dzr:zme:zme}var dzr=1,hzr=2,zme=3;function fzr(t){Rpt(t).noOnMyZero=!0}function pzr(t){return Rpt(t).noOnMyZero}function dB(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=T7r(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(FY(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(FY(t,i),a,o)}}else return function(i){return t.scale.getLabel(i)}}}function FY(t,e){var r=t.scale;return Kc(r)?r.getLabel(e):e.value}function Ume(t){var e=t.get("interval");return e??"auto"}function gzr(t){return t.type==="category"&&Ume(t.getLabelModel())===0}function mzr(t,e){var r={};return fe(t.mapDimensionsAll(e),function(n){r[Mme(t,n)]=!0}),En(r)}function E5(t){return t==="middle"||t==="center"}function hB(t){return t.getShallow("show")}function Dpt(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ho()||!r||!vzr(e)?void 0:n}function vzr(t){return t!=="category"}function Lpt(t,e,r,n,i,a){var o=k5(t),s=o?t.intervalStub:t;if(s.setExtent(n[0],n[1]),o){var l=t.powStub,u={depth:Fy},d=t.transformOut(n[0],u),h=t.transformOut(n[1],u),f=J9r(r,n);e[0]&&!f[0]&&(d=i[0]),e[1]&&!f[1]&&(h=i[1]),l.setExtent(d,h)}s.setConfig(a)}function _5(t,e){return Kc(t)?t.getRawOrdinalNumber(e.value):e.value}function fB(t,e){return Kc(t)&&!!e.get("boundaryGap")}var R5=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),yzr=V_(),zY="|&",D5=Qr(),Mpt=-2,bzr=-1,xzr=Qr();function Vme(t,e){var r=t.model,n=D5(m5(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function wzr(t,e){return Ppt(Vme(t,e))}function Azr(t,e){var r=[];return Ipt(t.model.ecModel,function(n){for(var i=0;i0&&h[1]>0&&!f[0]&&(h[0]=0),h[0]<0&&h[1]<0&&!f[1]&&(h[1]=0));var w=!1;h[0]>h[1]&&(h.reverse(),w=!0);var A=pB(e,r.get("startValue",!0)),S=A!=null;!tp(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),tp(A)&&(S||!b||x)&&(Ah[1]&&!f[1]&&(h[1]=A,f[1]=!0));var T=this._i={scale:e,dataMM:d,noZoomEffMM:h,zoomMM:[],fixMM:f,zoomFixMM:[!1,!1],startValue:A,isBlank:y,incl0:x,tggAxInv:w,ctnShp:a};Fpt(T,h)}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),Fpt(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 Fpt(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),hW(e))}function pB(t,e){return e==null?null:uc(e)?NaN:t.parse(e)}function Rzr(t,e){var r;if(Kc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[zpt(r[0]),zpt(r[1])]}function zpt(t){return Pm(typeof t=="boolean"?0:t,1)||0}function Upt(t){var e=Ozr(t.scale);return e.extent||(e.extent=fc()),e}function Dzr(t,e){Upt(t).dimIdxInCoord=e.get(t.dim)}function nT(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||Lzr(r,t,i,n,e)}function Lzr(t,e,r,n,i){var a=Upt(e),o=a.extent,s=!1;Szr(e,function(d){if(d.boxCoordinateSystem){var h=Ldt(d).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(h)){var p=h[f];p!=null&&!ft(p)&&gpe(o,t.parse(p))}}}else if(d.coordinateSystem){var g=d.getData();if(g){var m=t.getFilter?t.getFilter():null;fe(mzr(g,r),function(v){c8r(o,g.getApproximateExtent(v,m))})}d.__requireStartValue&&d.__requireStartValue(e)&&(s=!0)}});var l=Izr(t,e,n),u=new $pt(t,n,o,s,l);Vpt(t,u,i),a.extent=null}function Mzr(t,e){var r=t.scale;Vpt(r,new $pt(r,t.model,e,!1,!1),_zr)}function Vpt(t,e,r){t.rawExtentInfo=e,e.from=r}function VY(t,e){Yme.set(t,e)}var Yme=qt();function Gpt(t,e,r,n,i){t.rawExtentInfo||Mzr({scale:t,model:e},i||fc());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 Izr(t,e,r){var n=fB(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Npt(e,function(o){a=!!Yme.get(o)||a}),a}function Pzr(t,e,r,n){if(r.ctnShp){var i;if(Npt(t,function(s){var l=Yme.get(s);if(l){var u=l(t,n);u&&(i=i||[0,0],_ct(i,u[0]),Rct(i,u[1]),fzr(t))}}),!!i){var a=e.getExtent();if(Kc(e))t.onBand||e.setExtent2(oB,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(oB,o[0],o[1])}}}}function Qpt(t,e){var r=k5(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,o=n.getExtent(),s=xpt(o,i,e.rawExtentResult);n.setExtent(s[0],s[1]),s=n.getExtent();var l=r?Bzr(n,e):Nzr(n,e),u=l.intervalPrecision,d=l.interval,h=e.userInterval;h!=null&&(l.interval=h,l.intervalPrecision=eT(h)),i[0]||(s[0]=Yn(ep(s[0]/d)*d,u)),i[1]||(s[1]=Yn(lS(s[1]/d)*d,u)),h!=null&&(l.niceExtent=s.slice()),Lpt(t,i,o,s,a,l)}function Nzr(t,e){var r=PY(e.splitNumber,5),n=LY(t),i=e.minInterval,a=e.maxInterval,o=uW(n/r,!0);i!=null&&oa&&(o=a);var s=eT(o),l=t.getExtent(),u=[Yn(lS(l[0]/o)*o,s),Yn(ep(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function Bzr(t,e){var r=PY(e.splitNumber,10),n=t.getExtent(),i=LY(t),a=rn(ope(i),1),o=r/i*a;o<=.5&&(a*=10);var s=eT(a),l=[Yn(lS(n[0]/a)*a,s),Yn(ep(n[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function M5(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Hpt(e,r,n,i,null)}function Hpt(t,e,r,n,i){var a=Gpt(t,e,n,r,i),o=MY(t)||lB(t);Wpt(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&&Pzr(r,t,a,n)}function Wpt(t,e){$zr[t.type](t,e)}var $zr={interval:Qpt,log:Qpt,time:lzr,ordinal:no};function Fzr(t){return Km(null,t)}var zzr={isDimensionStacked:$y,enableDataStack:gpt,getStackedDimension:Mme};function Uzr(t,e){var r=e;e instanceof bn||(r=new bn(e));var n=uB(r),i=O5(r,n,!1);return t[1]i&&(n=o,i=l)}if(n)return Yzr(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"?qpt(s.exterior,i,a,r):fe(s.points,function(l){qpt(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 Xme(t,e){return t=jzr(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 Xpt(o[0],o.slice(1)));break;case"MultiPolygon":fe(i.coordinates,function(l){l[0]&&a.push(new Xpt(l[0],l.slice(1)))});break;case"LineString":a.push(new Kpt([i.coordinates]));break;case"MultiLineString":a.push(new Kpt(i.coordinates))}var s=new Zpt(n[e||"name"],a,n.cp);return s.properties=n,s})}const Xzr=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:y8,asc:Dl,getPercentWithPrecision:GNr,getPixelPrecision:VNr,getPrecision:Bm,getPrecisionSafe:gct,isNumeric:lpe,isRadianAroundZero:hS,linearMap:Zn,nice:uW,numericToNumber:Fm,parseDate:$m,parsePercent:Gt,quantile:dW,quantity:ope,quantityExponent:cW,reformIntervals:spe,remRadian:ape,round:UNr},Symbol.toStringTag,{value:"Module"})),Kzr=Object.freeze(Object.defineProperty({__proto__:null,format:z8,parse:$m,roundTime:XW},Symbol.toStringTag,{value:"Module"})),Zzr=Object.freeze(Object.defineProperty({__proto__:null,Arc:D8,BezierCurve:K_,BoundingRect:pr,Circle:qm,CompoundPath:L8,Ellipse:E8,Group:gr,Image:il,IncrementalDisplayable:Yut,Line:Qo,LinearGradient:RS,Polygon:gc,Polyline:Ml,RadialGradient:Zpe,Rect:nn,Ring:X_,Sector:pc,Text:$n,clipPointsByRect:ige,clipRectByRect:rdt,createIcon:n5,extendPath:Jut,extendShape:Zut,getShapeClass:M8,getTransform:MS,initProps:ua,makeImage:rge,makePath:t5,mergePath:Hh,registerShape:ap,resizePath:nge,updateProps:qn},Symbol.toStringTag,{value:"Module"})),Jzr=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Ege,capitalFirst:L7r,encodeHTML:Wc,formatTime:D7r,formatTpl:Lge,getTextRect:R7r,getTooltipMarker:_dt,normalizeCssArray:l5,toCamelCase:_ge,truncateText:k8r},Symbol.toStringTag,{value:"Module"})),eUr=Object.freeze(Object.defineProperty({__proto__:null,bind:Wt,clone:lr,curry:Kr,defaults:mr,each:fe,extend:lt,filter:oi,indexOf:Nr,inherits:afe,isArray:ft,isFunction:ur,isObject:yr,isString:$t,map:vt,merge:Gr,reduce:qf},Symbol.toStringTag,{value:"Module"}));var tUr=Qr(),gB=Qr(),bg={estimate:1,determine:2};function GY(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function rUr(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(egt(r,n),function(i,a){return{formattedLabel:dB(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?iUr(t,e):oUr(t)}function nUr(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:egt(i,n)}:t.type==="category"?aUr(t,e):{ticks:n.getTicks(r)}}function egt(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)}),fW(n,f8r,null),Dl(n),vt(n,function(i){return{value:i}})}function iUr(t,e){var r=t.getLabelModel(),n=tgt(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function tgt(t,e,r){var n=lUr(t),i=Ume(e),a=r.kind===bg.estimate;if(!a){var o=ngt(n,i);if(o)return o}var s,l;ur(i)?s=QY(t,i,!1):(l=i==="auto"?cUr(t,r):i,s=QY(t,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Kme(n,i,u),!0}):Kme(n,i,u),u}function aUr(t,e){var r=sUr(t),n=Ume(e),i=ngt(r,n);if(i)return i;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=QY(t,n,!0);else if(n==="auto"){var s=tgt(t,t.getLabelModel(),GY(bg.determine));o=s.labelCategoryInterval,a=vt(s.labels,function(l){return l.tick})}else o=n,a=QY(t,o,!0);return Kme(r,n,{ticks:a,tickCategoryInterval:o})}function oUr(t){var e=t.scale.getTicks(),r=dB(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var sUr=rgt("axisTick"),lUr=rgt("axisLabel");function rgt(t){return function(r){return gB(r)[t]||(gB(r)[t]={list:[]})}}function ngt(t,e){for(var r=0;rd&&(u=Math.max(1,Math.floor(l/d)));for(var h=s[0],f=t.dataToCoord(h+1)-t.dataToCoord(h),p=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,v=0;h<=s[1];h+=u){var y=0,b=0,x=JH(i({value:h}),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===bg.estimate)return e.out.noPxChangeTryDetermine.push(Wt(dUr,null,t,S,l)),S;var T=igt(t,S,l);return T??S}function dUr(t,e,r){return igt(t,e,r)==null}function igt(t,e,r){var n=tUr(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 hUr(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 QY(t,e,r){var n=dB(t),i=t.scale,a=[],o=ur(e);return wpt(i,o?0:e,function(s,l){var u=i.getLabel(s);if(o){var d=!!e(s.value,u);if(s.offInterval=!d,!d&&!l)return}a.push(r?s:{formattedLabel:n(s),rawLabel:u,tick:s})}),a}var fUr=.8;function vc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,o=X9r(n);tp(o)||(o=NaN);var s=t.getExtent(),l=ao(s[1]-s[0]);return Kc(n)?pUr(r,t,o,l):i&&gUr(r,t,o,l,i),a!=null&&(r.w=tp(r.w)?rn(a,r.w):a),r}function pUr(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 gUr(t,e,r,n,i){var a=!1,o=-1/0;fe(i.key?[wzr(e,i.key)]:Azr(e,i.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===Mpt&&(a=!0))}),tp(r)&&r>0&&tp(o)?(t.w=n/r*o,t.w2=o):a&&(t.w=n*fUr,t.w2=t.w*r/n)}var agt=[0,1],up=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,agt,ogt(this),r)},t.prototype.coordToData=function(e,r){var n=Zn(e,ogt(this),agt,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=nUr(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(s){return{coord:this.dataToCoord(_5(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=mUr(this,i,a);return vt(i,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},t.prototype.getMinorTicksCoords=function(){if(Kc(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||GY(bg.determine),rUr(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 vc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||GY(bg.determine),uUr(this,e)},t}();function ogt(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 mUr(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=vc(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 vUr(t){var e=pn.extend(t);return pn.registerClass(e),e}function yUr(t){var e=Ki.extend(t);return Ki.registerClass(e),e}function bUr(t){var e=Pi.extend(t);return Pi.registerClass(e),e}function xUr(t){var e=Ei.extend(t);return Ei.registerClass(e),e}var mB=Math.PI*2,aT=Hm.CMD,wUr=["top","right","bottom","left"];function AUr(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 SUr(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 d=o*r+t,h=s*r+e;if(Math.abs(n-i)%mB<1e-4)return l[0]=d,l[1]=h,u-r;if(a){var f=n;n=Uh(i),i=Uh(f)}else n=Uh(n),i=Uh(i);n>i&&(i+=mB);var p=Math.atan2(s,o);if(p<0&&(p+=mB),p>=n&&p<=i||p+mB>=n&&p+mB<=i)return l[0]=d,l[1]=h,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,wg.fromArray(t[0]),da.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Zm,wg,da),wr.sub(Jm,qo,da);var r=Zm.len(),n=Jm.len();if(!(r<.001||n<.001)){Zm.scale(1/r),Jm.scale(1/n);var i=Zm.dot(Jm),a=Math.cos(e);if(a1&&wr.copy(Nu,qo),Nu.toArray(t[1])}}}}function kUr(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,wg.fromArray(t[0]),da.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Zm,da,wg),wr.sub(Jm,qo,da);var n=Zm.len(),i=Jm.len();if(!(n<.001||i<.001)){Zm.scale(1/n),Jm.scale(1/i);var a=Zm.dot(e),o=Math.cos(r);if(a=l)wr.copy(Nu,qo);else{Nu.scaleAndAdd(Jm,s/Math.tan(Math.PI/2-d));var h=qo.x!==da.x?(Nu.x-da.x)/(qo.x-da.x):(Nu.y-da.y)/(qo.y-da.y);if(isNaN(h))return;h<0?wr.copy(Nu,da):h>1&&wr.copy(Nu,qo)}Nu.toArray(t[1])}}}}function Zme(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 OUr(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=yy(n[0],n[1]),a=yy(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=e8([],n[1],n[0],o/i),l=e8([],n[1],n[2],o/a),u=e8([],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 d=1;d0){w(E*O,0,a);var _=E+T;_<0&&A(-_*O,1)}else A(-T*O,1)}}function w(T,C,O){T!==0&&(d=!0);for(var E=C;E0)for(var _=0;_0;_--){var D=O[_-1]*R;w(-D,_,a)}}}function S(T){var C=T<0?-1:1;T=Math.abs(T);for(var O=Math.ceil(T/(a-1)),E=0;E0?w(O,0,E+1):w(-O,a-E-1,a),T-=O,T<=0)return}return d}function RUr(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),!i5(n).valueAnimation){var h=Jt(n.style.opacity,1);n.style.opacity=0,ua(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};XY(p,u,KY),XY(p,n.states.select,KY)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};XY(g,u,KY),XY(g,n.states.emphasis,KY)}fdt(n,l,d,r,r)}if(i&&!i.ignore&&!i.invisible){var a=MUr(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}(),o0e=Qr();function PUr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=o0e(r).labelManager;i||(i=o0e(r).labelManager=new IUr),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=o0e(r).labelManager;fe(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var s0e=Math.sin,l0e=Math.cos,vgt=Math.PI,oT=Math.PI*2,NUr=180/vgt,ygt=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,d=!l,h=Math.abs(u),f=$x(h-oT)||(d?u>=oT:-u>=oT),p=u>0?u%oT:u%oT+oT,g=!1;f?g=!0:$x(h)?g=!1:g=p>=vgt==!!d;var m=e+n*l0e(o),v=r+i*s0e(o);this._start&&this._add("M",m,v);var y=Math.round(a*NUr);if(f){var b=1/this._p,x=(d?1:-1)*(oT-b);this._add("A",n,i,y,1,+d,e+n*l0e(o+x),r+i*s0e(o+x)),b>.01&&this._add("A",n,i,y,0,+d,m,v)}else{var w=e+n*l0e(s),A=r+i*s0e(s);this._add("A",n,i,y,+g,+d,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 d=[],h=this._p,f=1;f"}function HUr(t){return""}function d0e(t,e){e=e||{};var r=e.newline?` +`];function fs(t,e){return e.type=t,e}function Kge(t){return t.type==="section"}function $ht(t){return Kge(t)?z$r:U$r}function Fht(t){if(Kge(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return fe(t.blocks,function(i){var a=Fht(i);a>=e&&(e=a+ +(n&&(!a||Kge(i)&&!i.noHeader)))}),e}return 0}function z$r(t,e,r,n){var i=e.noHeader,a=V$r(Fht(e)),o=[],s=e.blocks||[];dc(!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 d=new Cht(u[l],null);s.sort(function(m,v){return d.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}fe(s,function(m,v){var y=e.valueFormatter,b=$ht(m)(y?lt(lt({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&o.push(b)});var h=t.renderMode==="richText"?o.join(a.richText):Zge(n,o.join(""),i?r:a.html);if(i)return h;var f=Rge(e.header,"ordinal",t.useUTC),p=Bht(n,t.renderMode).nameStyle,g=Nht(n);return t.renderMode==="richText"?Uht(t,f,p)+a.richText+h:Zge(n,'
'+Wc(f)+"
"+h,r)}function U$r(t,e,r,n){var i=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,d=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 h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||tt.color.secondary,i),f=a?"":Rge(l,"ordinal",u),p=e.valueType,g=o?[]:d(e.value,e.rawDataIndex),m=!s||!a,v=!s&&a,y=Bht(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(s?"":h)+(a?"":Uht(t,f,b))+(o?"":H$r(t,g,m,v,x)):Zge(n,(s?"":h)+(a?"":G$r(f,!s,b))+(o?"":Q$r(g,m,v,x)),r)}}function zht(t,e,r,n,i,a){if(t){var o=$ht(t),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function V$r(t){return{html:$$r[t],richText:F$r[t]}}function Zge(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Nht(t);return'
'+e+n+"
"}function G$r(t,e,r){var n=e?"margin-left:2px":"";return''+Wc(t)+""}function Q$r(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 Wc(o)}).join("  ")+""}function Uht(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function H$r(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 Vht(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return $S(n)}function Ght(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Jge=function(){function t(){this.richTextStyles={},this._nextStyleNameId=cpe()}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=_dt({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=Vht(e,r),d,h,f,p;if(o>1||l&&!o){var g=W$r(s,e,r,a,u);d=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);p=d=hR(i,r,a[0]),h=m.type}else p=d=l?s[0]:s;var v=upe(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:!Bh(x),value:d,valueType:h,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function W$r(t,e,r,n,i){var a=e.getData(),o=qf(t,function(h,f,p){var g=a.getDimensionInfo(p);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?fe(n,function(h){d(hR(a,r,h),h)}):fe(t,d);function d(h,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(o?u.push(fs("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:h,valueType:p.type})):(s.push(h),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Kx=Qr();function sY(t,e){return t.getName(e)||t.getId(e)}var lY="__universalTransitionEnabled",Pi=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=q8({count:q$r,reset:j$r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Kx(this).sourceManager=new Mht(this);a.prepareSource();var o=this.getInitialData(r,i);Wht(o,this),this.dataTask.context.data=o,Kx(this).dataBeforeProcessed=o,Hht(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=G8(this),a=i?US(r):{},o=this.subType;pn.hasClass(o)&&(o+="Series"),Gr(r,n.getTheme().get(this.subType)),Gr(r,this.getDefaultOption()),fS(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Xm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Gr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=G8(this);i&&Xm(this.option,r,i);var a=Kx(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Wht(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Kx(this).dataBeforeProcessed=o,Hht(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Du(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=A,f=w,p=0),w===f&&(d[p++]=v))}return d.length=p,d},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=$ge.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[sY(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[lY])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,d=0;d0&&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);Go(Pi,aY),Go(Pi,$ge),Mct(Pi,pn);function Hht(t){var e=t.name;upe(t)||(t.name=Y$r(t)||e)}function Y$r(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 q$r(t){return t.model.getRawData().count()}function j$r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),X$r}function X$r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Wht(t,e){fe(k_(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Kr(K$r,e))})}function K$r(t,e){var r=eme(t);return r&&r.setOutputEnd((e||this).count()),e}function eme(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 Ki=function(){function t(){this.group=new gr,this.uid=BS("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}();mpe(Ki),pW(Ki);function YS(){var t=Qr();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 Yht=Qr(),Z$r=YS(),Ei=function(){function t(){this.group=new gr,this.uid=BS("viewChart"),this.renderTask=q8({plan:J$r,reset:eFr}),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&&jht(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&jht(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){qx(this.group,e)},t.markUpdateMethod=function(e,r){Yht(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function qht(t,e,r){t&&k8(t)&&(e==="emphasis"?Dy:Ly)(t,r)}function jht(t,e,r){var n=pS(t,e),i=e&&e.highlightKey!=null?CBr(e.highlightKey):null;n!=null?fe(ji(n),function(a){qht(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){qht(a,r,i)})}mpe(Ei),pW(Ei);function J$r(t){return Z$r(t.model)}function eFr(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=i&&Yht(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,i),tFr[l]}var tFr={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)}}},cY="\0__throttleOriginMethod",Xht="\0__throttleRate",Kht="\0__throttleType";function uY(t,e,r){var n,i=0,a=0,o=null,s,l,u,d;e=e||0;function h(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(p){d=p},f}function pR(t,e,r,n){var i=t[e];if(i){var a=i[cY]||i,o=i[Kht],s=i[Xht];if(s!==r||o!==n){if(r==null||!n)return t[e]=a;i=t[e]=uY(a,r,n==="debounce"),i[cY]=a,i[Kht]=n,i[Xht]=r}return i}}function j8(t,e){var r=t[e];r&&r[cY]&&(r.clear&&r.clear(),t[e]=r[cY])}var Zht=Qr(),Jht={itemStyle:vS(gdt,!0),lineStyle:vS(pdt,!0)},rFr={lineStyle:"stroke",itemStyle:"fill"};function eft(t,e){var r=t.visualStyleMapper||Jht[e];return r||(console.warn("Unknown style type '"+e+"'."),Jht.itemStyle)}function tft(t,e){var r=t.visualDrawType||rFr[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var nFr={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=eft(t,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=tft(t,n),u=o[l],d=ur(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||d||h){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)&&d)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=lt({},o);v[l]=d(m),p.setItemVisual(g,"style",v)}}}},X8=new bn,iFr={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=eft(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){X8.option=l[n];var u=i(X8),d=o.ensureUniqueItemVisual(s,"style");lt(d,u),X8.option.decal&&(o.setItemVisual(s,"decal",X8.option.decal),X8.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},aFr={performRawSeries:!0,overallReset:function(t){var e=qt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Zht(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),o=Zht(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=tft(r,s);a.each(function(u){var d=a.getRawIndex(u);i[d]=u}),n.each(function(u){var d=i[u],h=a.getItemVisual(d,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(d,"style"),p=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(p,o,g)}})}})}},dY=Math.PI;function oFr(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 D8({shape:{startAngle:-dY/2,endAngle:-dY/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:dY*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:dY*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),d=t.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:d}),a.setShape({x:u-l,y:d-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var rft=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):Dct(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="";dc(!(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 d=o._stageTaskMap.get(l.uid),h=d.seriesTaskMap,f=d.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 h&&h.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(d):l?n.eachRawSeriesByType(l,d):u&&u(n,i).each(d);function d(h){var f=h.uid,p=s.set(f,o&&o.get(f)||q8({plan:dFr,reset:hFr,count:pFr}));p.context={model:h,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,p)}},t.prototype._createOverallStageTask=function(e,r,n,i){var a=this,o=r.overallTask=r.overallTask||q8({reset:sFr});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=qt(),u=e.seriesType,d=e.getTargetSeries,h=e.dirtyOnOverallProgress,f=!1,p="";dc(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):d?d(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,q8({reset:lFr,onDirty:uFr})));y.context={model:m,dirtyOnOverallProgress:h},y.agent=o,y.__block=h,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:gFr(e)}),e.uid=BS("stageHandler"),r&&(e.visualType=r),e},t}();function sFr(t){t.overallReset(t.ecModel,t.api,t.payload)}function lFr(t){return t.dirtyOnOverallProgress&&cFr}function cFr(){this.agent.dirty(),this.getDownstream().dirty()}function uFr(){this.agent&&this.agent.dirty()}function dFr(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function hFr(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ji(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?vt(e,function(r,n){return nft(n)}):fFr}var fFr=nft(0);function nft(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,d=!0)}}s.hasOwnProperty(u)&&(n[u]=l,d=!0),d||(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 d(l,o,"mainType")&&d(l,o,"subType")&&d(l,o,"index","componentIndex")&&d(l,o,"name")&&d(l,o,"id")&&d(u,a,"name")&&d(u,a,"dataIndex")&&d(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,i,a));function d(h,f,p,g){return h[p]==null||f[g||p]===h[p]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),tme=["symbol","symbolSize","symbolRotate","symbolOffset"],cft=tme.concat(["symbolKeepAspect"]),vFr={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&&XS(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function nme(t,e,r){for(var n=e.type==="radial"?NFr(t,e,r):PFr(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 ime(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&$Fr(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 FFr=new Hm(!0);function mY(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function vft(t){return typeof t=="string"&&t!=="none"}function vY(t){var e=t.fill;return e!=null&&e!=="none"}function yft(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 bft(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 ame(t,e,r){var n=ype(e.image,e.__image,r);if(gW(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)*KN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function zFr(t,e,r,n,i){var a,o=mY(r),s=vY(r),l=r.strokePercent,u=l<1,d=!e.path;(!e.silent||u)&&d&&e.createPathProxy();var h=e.path||FFr,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?nme(t,p,T):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?nme(t,g,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?ame(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(S=f||!e.__canvasStrokePattern?ame(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();h.setScale(C[0],C[1],e.segmentIgnoreThreshold);var O,E;t.setLineDash&&r.lineDash&&(a=ime(e),O=a[0],E=a[1]);var _=!0;(d||f&R_)&&(h.setDPR(t.dpr),u?h.setContext(null):(h.setContext(t),_=!1),h.reset(),e.buildPath(h,e.shape,n),h.toStatic(),e.pathUpdated()),_&&h.rebuildPath(t,u?l:1),O&&(t.setLineDash(O),t.lineDashOffset=E),n?(i.batchFill=s,i.batchStroke=o):r.strokeFirst?(o&&bft(t,r),s&&yft(t,r)):(s&&yft(t,r),o&&bft(t,r)),O&&t.setLineDash([])}function UFr(t,e,r){var n=e.__image=ype(r.image,e.__image,e,e.onload);if(!(!n||!gW(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,d=r.sy||0;t.drawImage(n,u,d,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,d=r.sy,h=o-u,f=s-d;t.drawImage(n,u,d,h,f,i,a,o,s)}else t.drawImage(n,i,a,o,s)}}function VFr(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||gy,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=ime(e),a=n[0],o=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(mY(r)&&t.strokeText(i,r.x,r.y),vY(r)&&t.fillText(i,r.x,r.y)):(vY(r)&&t.fillText(i,r.x,r.y),mY(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var xft=["shadowBlur","shadowOffsetX","shadowOffsetY"],wft=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Aft(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Pu(t,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?yS.opacity:o}(n||e.blend!==r.blend)&&(a||(Pu(t,i),a=!0),t.globalCompositeOperation=e.blend||yS.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[Bs]){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[Bs]=!0,SR(this),!this._model||n){var l=new Z7r(this._api),u=this._theme,d=this._model=new zge;d.scheduler=this._scheduler,d.ssr=this._ssr,d.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},bme);var h={seriesTransition:s,optionChanged:!0};if(i)this[Pl]={silent:a,updateParams:h},this[Bs]=!1,this.getZr().wakeUp();else{try{ZS(this),Ny.update.call(this,null,h)}catch(f){throw this[Pl]=null,this[Bs]=!1,f}this._ssr||this._zr.flush(),this[Pl]=null,this[Bs]=!1,wR.call(this,a),AR.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Bs]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Pl]&&(a==null&&(a=this[Pl].silent),o=this[Pl].updateParams,this[Pl]=null),this[Bs]=!0,SR(this);try{this._updateTheme(r),i.setTheme(this._theme),ZS(this),Ny.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Bs]=!1,s}this[Bs]=!1,wR.call(this,a),AR.call(this,a)}}},e.prototype._updateTheme=function(r){$t(r)&&(r=Zft[r]),r&&(r=lr(r),r&&lht(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 d=o._componentsMap[u.__viewId];d.group.ignore||(a.push(d),d.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(kY[i]){var l=s,u=s,d=-s,h=-s,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();fe(JS,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),d=o(S.right,d),h=o(S.bottom,h),f.push({dom:A,left:S.left,top:S.top})}}),l*=p,u*=p,d*=p,h*=p;var g=d-l,m=h-u,v=rl.createCanvas(),y=rpe(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 il({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 wY(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return wY(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return wY(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=z_(i,r);return fe(o,function(s,l){l.indexOf("Models")>=0&&fe(s,function(u){var d=u.coordinateSystem;if(d&&d.containPoint)a=a||!!d.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(r,n){var i=this._model,a=z_(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?rme(s,l,n):J8(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(f9r,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,d=i==="globalout";if(d?u={}:l&&qS(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 h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var p=h&&f!=null&&s.getComponent(h,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(vme,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),bFr(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&&Oct(this.getDom(),wme,"");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 JS[n.id]},e.prototype.resize=function(r){if(!this[Bs]){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[Pl]&&(a==null&&(a=this[Pl].silent),i=!0,this[Pl]=null),this[Bs]=!0,SR(this);try{i&&ZS(this),Ny.update.call(this,{type:"resize",animation:lt({duration:0},r&&r.animation)})}catch(o){throw this[Bs]=!1,o}this[Bs]=!1,wR.call(this,a),AR.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(),!!xme[r]){var i=xme[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=mme[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!TY[r.type]&&this._model){if(this[Bs]){this._pendingActions.push(r);return}var i=n.silent;fme.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Dn.browser.weChat&&this._throttledZrFlush(),wR.call(this,i),AR.call(this,i)}},e.prototype.updateLabelLayout=function(){lp.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(){ZS=function(h){AFr(h._model);var f=h._scheduler;f.restorePipelines(h._zr,h._model),f.prepareStageTasks(),dme(h,!0),dme(h,!1),f.plan()},dme=function(h,f){for(var p=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,v=f?h._componentsMap:h._chartsMap,y=h._zr,b=h._api,x=0;xJt(f.get("hoverLayerThreshold"),Qdt.hoverLayerThreshold)&&!Dn.node&&!Dn.worker;(h._usingTHL||v)&&(f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var b=h._chartsMap[y.__viewId];b.__alive&&b.eachRendered(function(x){var w=x.states.emphasis;w&&w.hoverLayer!==eR&&(w.hoverLayer=v?Kut:Xut)})}}),h._usingTHL=v)}}function s(h,f){var p=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=p)})}function l(h,f){if(!h.preventAutoZ){var p=PS(h);f.eachRendered(function(g){return zW(g,p.z,p.zlevel),!0})}}function u(h,f){f.eachRendered(function(p){if(!J_(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 d(h,f){var p=h.getModel("stateAnimation"),g=h.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(J_(y))return;if(y instanceof yn&&kBr(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)}})}jft=function(h){return new(function(f){nt(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},p.prototype.enterEmphasis=function(g,m){Dy(g,m),cp(h)},p.prototype.leaveEmphasis=function(g,m){Ly(g,m),cp(h)},p.prototype.enterBlur=function(g){Sut(g),cp(h)},p.prototype.leaveBlur=function(g){Vpe(g),cp(h)},p.prototype.enterSelect=function(g){Tut(g),cp(h)},p.prototype.leaveSelect=function(g){Cut(g),cp(h)},p.prototype.getModel=function(){return h.getModel()},p.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},p.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},p.prototype.getECUpdateCycleVersion=function(){return h[bY]},p.prototype.usingTHL=function(){return h._usingTHL},p}(hut))(h)},Xft=function(h){function f(p,g){for(var m=0;m=0)){ipt.push(r);var o=rft.wrapStageHandler(r,i);o.__prio=e,o.__raw=r,t.push(o)}}function Ome(t,e){xme[t]=e}function S9r(t){Xst({createCanvas:t})}function apt(t,e,r){var n=fft("registerMap");n&&n(t,e,r)}function T9r(t){var e=fft("getMap");return e&&e(t)}var opt=D$r;Zx(lme,nFr),Zx(yY,iFr),Zx(yY,aFr),Zx(lme,vFr),Zx(yY,yFr),Zx(Bft,XFr),Tme(lht),Cme(r9r,u$r),Ome("default",oFr),vg({type:kS,event:kS,update:kS},no),vg({type:CW,event:CW,update:CW},no),vg({type:kW,event:Fpe,update:kW,action:no,refineEvent:Eme,publishNonRefinedEvent:!0}),vg({type:$pe,event:Fpe,update:$pe,action:no,refineEvent:Eme,publishNonRefinedEvent:!0}),vg({type:OW,event:Fpe,update:OW,action:no,refineEvent:Eme,publishNonRefinedEvent:!0});function Eme(t,e,r,n){return{eventContent:{selected:wBr(r),isFromClick:e.isFromClick||!1}}}Sme("default",{}),Sme("dark",lft);var C9r={},spt=[],k9r={registerPreprocessor:Tme,registerProcessor:Cme,registerPostInit:ept,registerPostUpdate:tpt,registerUpdateLifecycle:OY,registerAction:vg,registerCoordinateSystem:rpt,registerLayout:npt,registerVisual:Zx,registerTransform:opt,registerLoading:Ome,registerMap:apt,registerImpl:xFr,PRIORITY:$ft,ComponentModel:pn,ComponentView:Ki,SeriesModel:Pi,ChartView:Ei,registerComponentModel:function(t){pn.registerClass(t)},registerComponentView:function(t){Ki.registerClass(t)},registerSeriesModel:function(t){Pi.registerClass(t)},registerChartView:function(t){Ei.registerClass(t)},registerCustomSeries:function(t,e){gft(t,e)},registerSubTypeDefaulter:function(t,e){pn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){uct(t,e)}};function Xr(t){if(ft(t)){fe(t,function(e){Xr(e)});return}Nr(spt,t)>=0||(spt.push(t),ur(t)&&(t={install:t}),t.install(k9r))}function eB(t){return t==null?0:t.length||1}function lpt(t){return t}var By=function(){function t(e,r,n,i,a,o){this._old=e,this._new=r,this._oldKeyGetter=n||lpt,this._newKeyGetter=i||lpt,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 d=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(d,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(d,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(d,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(d,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(d,u),i[l]=null;else if(h>1)for(var p=0;p1)for(var s=0;s30}var tB=yr,Jx=vt,L9r=typeof Int32Array>"u"?Array:Int32Array,M9r="e\0\0",fpt=-1,I9r=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],P9r=["_approximateExtent"],ppt,RY,rB,nB,Dme,iB,Lme,Xc=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;upt(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={},d=0;d=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Gh;if(l&&!i.pure)for(var u=[],d=e;d0},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():tB(a)&&(a=lt({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,tB(r)?lt(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){tB(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;Ppe(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)),Dme(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(kH(arguments)))})},t.internalField=function(){ppt=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 L9r(o.categories.length);for(var l=0;l1&&(l+="__ec__"+d),i[r]=l}}}(),t}();function N9r(t,e){return TR(t,e).dimensions}function TR(t,e){Gge(t)||(t=Hge(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=qt(),a=[],o=B9r(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&hpt(o),l=n===t.dimensionsDefine,u=l?dpt(t):Rme(n),d=e.encodeDefine;!d&&e.encodeDefaulter&&(d=e.encodeDefaulter(t,o));for(var h=qt(d),f=new _ht(o),p=0;p0&&(O.name=O.name+(E-1))}),new cpt({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function B9r(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 $9r(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 F9r=function(){function t(e){this.coordSysDims=[],this.axisMap=qt(),this.categoryAxisMap=qt(),this.coordSysName=e}return t}();function z9r(t){var e=t.get("coordinateSystem"),r=new F9r(e),n=U9r[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var U9r={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),CR(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),CR(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),CR(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),CR(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),CR(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),d=o[l];r.set(d,u),CR(u)&&(n.set(d,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 CR(t){return t.get("type")==="category"}function gpt(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;V9r(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,d,h,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),!d&&g(w)&&(!p||w.coordDim!=="x"&&w.coordDim!=="angle")&&(!i||i===w.coordDim)&&(d=w))}),d&&!n&&!u&&(n=!0),d){h="__\0ecstackresult_"+t.id,f="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var m=d.coordDim,v=d.type,y=0;fe(a,function(w){w.coordDim===m&&y++});var b={name:h,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(h,v)),o.appendCalculationDimension(b),o.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:d&&d.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function V9r(t){return!upt(t.schema)}function $y(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Mme(t,e){return $y(t,e)?t.getCalculationInfo("stackResultDimension"):e}function G9r(t,e){var r=t.get("coordinateSystem"),n=cR.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=EY(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Q9r(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 Km(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=Hge(t)):(i=n.getSource(),a=i.sourceFormat===Gh);var o=z9r(e),s=G9r(e,o),l=r.useEncodeDefaulter,u=ur(l)?l:l?Kr(Wdt,s,e):null,d={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=TR(i,d),f=Q9r(h.dimensions,r.createInvertedIndices,o),p=a?null:n.getSharedDataStore(h),g=gpt(e,{schema:h,store:p}),m=new Xc(h,e);m.setCalculationInfo(g);var v=f!=null&&H9r(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 H9r(t){if(t.sourceFormat===Gh){var e=W9r(t.data||[]);return!ft(F_(e))}}function W9r(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Gd].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){ypt(this._extents,Gd,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Gd].slice()),ypt(n,t,e,r)},freeze:function(){}};function ypt(t,e,r,n){gS(r,n)&&(t[e][0]=r,t[e][1]=n)}function bpt(t){return MY(t)||kR(t)}function MY(t){return t.type==="interval"}function lB(t){return t.type==="time"}function kR(t){return t.type==="log"}function Kc(t){return t.type==="ordinal"}function Z9r(t){var e=cW(t),r=cS(10,e),n=Nm(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Yn(n*r,-e)}function eT(t){return Bm(t)+2}function IY(t,e){return uS(t)/uS(e)}function $me(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,d,h){r({value:u,offInterval:d},h)}}var cB=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,Pme(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new aB({})),ft(i)&&(i=new aB({categories:vt(i,function(o){return yr(o)?o.value:o})})),n._ordinalMeta=i;var a=Ime(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,Nme(n),n}return e.parse=function(r){return r==null?r=NaN:$t(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=Nm(r),r},e.prototype.getTicks=function(){var r=[];return wpt(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(h.push({value:m}),m=Yn(m+i,s),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Yn(m+y*i,s))}if(h.length>0&&m===h[h.length-1].value)break;if(h.length>f)return[]}var b=h.length?h[h.length-1].value:o[1];return a[1]>b&&h.push({value:r.expandToNicedExtent?Yn(b+i,s):a[1]}),d&&l.pruneTicksByBreak(r.pruneByBreak,h,u.breaks,function(x){return x.value},n.interval,a),d&&r.breakTicks!=="none"&&l.addBreaksToTicks(h,u.breaks,a),h},e.prototype.getMinorTicks=function(r){return Fme(this,r,WW(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=Bm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Yn(r.value,i,!0);return Ege(a)},e.type="interval",e}(yg);yg.registerClass(ew);var ezr=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 rzr(t){var e=30*op;return t/=e,t>6?6:t>3?3:t>2?2:1}function nzr(t){return t/=$8,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Tpt(t,e){return t/=e?wge:xge,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function izr(t){return rn(uW(t,!0),1)}function azr(t,e,r){var n=Math.max(0,Nr(Wh,e)-1);return XW(new Date(t),Wh[n],r).getTime()}function ozr(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 szr(t,e,r,n,i,a){var o=3e3,s=S7r,l=0;function u(M,I,N,F,B,V,z){for(var U=ozr(B,M),G=I,H=new Date(G);Go));)if(H[B](H[F]()+M),G=H.getTime(),a){var j=a.calcNiceTickMultiple(G,U);j>0&&(H[B](H[F]()+j*M),G=H.getTime())}z.push({value:G,notAdd:G>n[1]})}function d(M,I,N){var F=[],B=!I.length;if(!Spt(F8(M),n[0],n[1],r)){B&&(I=[{value:azr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(G,z,U,H,j,q,F),M==="year"&&N.length>1&&V===0&&N.unshift({value:N[0].value-G})}}for(var V=0;V=n[0]&&w<=n[1]&&p++)}var A=i/e;if(p>A*1.5&&g>A/1.5||(h.push(b),p>A||t===s[m]))break}f=[]}}}for(var S=oi(vt(h,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=NY.length,u=Math.min(ezr(NY,a,0,l),l-1),d=NY[u][1],h=NY[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:d,minLevelUnit:h})};yg.registerClass(Apt);var BY=0,$Y=1,czr=2,Cpt=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=ew.parse,n.base=r.logBase||10;var i=[],a=[],o=n._lookup={from:i,to:a};i[BY]=i[$Y]=a[BY]=a[$Y]=NaN,Pme(n,e.mapperMethods);var s=Ho(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},czr,u),n.powStub=new ew({breakParsed:u.original}),n.intervalStub=new ew({breakParsed:u.transformed}),Nme(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(d){var h=d.value,f=$me(h,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,d,WW(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return Fme(this,r,WW(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(IY(r,this.base))},scale:function(r){return $me(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=IY(r,this.base),n&&n.depth===Fy?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return kpt.depth=i,Opt.lookup=this._lookup,$me(i===Fy?r:this.intervalStub.transformOut(r,kpt),this.base,Opt)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Gd,r,n)},setExtent2:function(r,n,i){if(!(!gS(n,i)||n<=0||i<=0)){var a=Ept,o=Ept;if(r===Gd){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[BY]=n,a[$Y]=i);var l=this.base;this.intervalStub.setExtent2(r,o[BY]=IY(n,l),o[$Y]=IY(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return gS(n[0],n[1])&&tp(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}(yg);yg.registerClass(Cpt);var kpt={},Opt={},Ept=[],_pt={value:1,category:1,time:1,log:1},Rpt=Qr();function uB(t){var e=t.get("type");return(e==null||!Kt(_pt,e)&&!yg.getClass(e))&&(e="value"),e}function OR(t,e,r){var n=Ho(),i;switch(n&&(i=Dpt(t,e,r)),e){case"category":return new cB({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:fc()});case"time":return new Apt({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new Cpt({logBase:t.get("logBase"),breakOption:i});case"value":return new ew({breakOption:i});default:return new(yg.getClass(e)||ew)({})}}function uzr(t,e,r){var n=t.getExtentUnsafe(Gd,null),i=n[0],a=n[1];return gS(i,a)?i===e||a===e?hzr:ie?dzr:zme:zme}var dzr=1,hzr=2,zme=3;function fzr(t){Rpt(t).noOnMyZero=!0}function pzr(t){return Rpt(t).noOnMyZero}function dB(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=T7r(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(FY(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(FY(t,i),a,o)}}else return function(i){return t.scale.getLabel(i)}}}function FY(t,e){var r=t.scale;return Kc(r)?r.getLabel(e):e.value}function Ume(t){var e=t.get("interval");return e??"auto"}function gzr(t){return t.type==="category"&&Ume(t.getLabelModel())===0}function mzr(t,e){var r={};return fe(t.mapDimensionsAll(e),function(n){r[Mme(t,n)]=!0}),En(r)}function ER(t){return t==="middle"||t==="center"}function hB(t){return t.getShallow("show")}function Dpt(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ho()||!r||!vzr(e)?void 0:n}function vzr(t){return t!=="category"}function Lpt(t,e,r,n,i,a){var o=kR(t),s=o?t.intervalStub:t;if(s.setExtent(n[0],n[1]),o){var l=t.powStub,u={depth:Fy},d=t.transformOut(n[0],u),h=t.transformOut(n[1],u),f=J9r(r,n);e[0]&&!f[0]&&(d=i[0]),e[1]&&!f[1]&&(h=i[1]),l.setExtent(d,h)}s.setConfig(a)}function _R(t,e){return Kc(t)?t.getRawOrdinalNumber(e.value):e.value}function fB(t,e){return Kc(t)&&!!e.get("boundaryGap")}var RR=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),yzr=V_(),zY="|&",DR=Qr(),Mpt=-2,bzr=-1,xzr=Qr();function Vme(t,e){var r=t.model,n=DR(mR(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function wzr(t,e){return Ppt(Vme(t,e))}function Azr(t,e){var r=[];return Ipt(t.model.ecModel,function(n){for(var i=0;i0&&h[1]>0&&!f[0]&&(h[0]=0),h[0]<0&&h[1]<0&&!f[1]&&(h[1]=0));var w=!1;h[0]>h[1]&&(h.reverse(),w=!0);var A=pB(e,r.get("startValue",!0)),S=A!=null;!tp(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),tp(A)&&(S||!b||x)&&(Ah[1]&&!f[1]&&(h[1]=A,f[1]=!0));var T=this._i={scale:e,dataMM:d,noZoomEffMM:h,zoomMM:[],fixMM:f,zoomFixMM:[!1,!1],startValue:A,isBlank:y,incl0:x,tggAxInv:w,ctnShp:a};Fpt(T,h)}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),Fpt(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 Fpt(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),hW(e))}function pB(t,e){return e==null?null:uc(e)?NaN:t.parse(e)}function Rzr(t,e){var r;if(Kc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[zpt(r[0]),zpt(r[1])]}function zpt(t){return Pm(typeof t=="boolean"?0:t,1)||0}function Upt(t){var e=Ozr(t.scale);return e.extent||(e.extent=fc()),e}function Dzr(t,e){Upt(t).dimIdxInCoord=e.get(t.dim)}function nT(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||Lzr(r,t,i,n,e)}function Lzr(t,e,r,n,i){var a=Upt(e),o=a.extent,s=!1;Szr(e,function(d){if(d.boxCoordinateSystem){var h=Ldt(d).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(h)){var p=h[f];p!=null&&!ft(p)&&gpe(o,t.parse(p))}}}else if(d.coordinateSystem){var g=d.getData();if(g){var m=t.getFilter?t.getFilter():null;fe(mzr(g,r),function(v){c8r(o,g.getApproximateExtent(v,m))})}d.__requireStartValue&&d.__requireStartValue(e)&&(s=!0)}});var l=Izr(t,e,n),u=new $pt(t,n,o,s,l);Vpt(t,u,i),a.extent=null}function Mzr(t,e){var r=t.scale;Vpt(r,new $pt(r,t.model,e,!1,!1),_zr)}function Vpt(t,e,r){t.rawExtentInfo=e,e.from=r}function VY(t,e){Yme.set(t,e)}var Yme=qt();function Gpt(t,e,r,n,i){t.rawExtentInfo||Mzr({scale:t,model:e},i||fc());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 Izr(t,e,r){var n=fB(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Npt(e,function(o){a=!!Yme.get(o)||a}),a}function Pzr(t,e,r,n){if(r.ctnShp){var i;if(Npt(t,function(s){var l=Yme.get(s);if(l){var u=l(t,n);u&&(i=i||[0,0],_ct(i,u[0]),Rct(i,u[1]),fzr(t))}}),!!i){var a=e.getExtent();if(Kc(e))t.onBand||e.setExtent2(oB,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(oB,o[0],o[1])}}}}function Qpt(t,e){var r=kR(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,o=n.getExtent(),s=xpt(o,i,e.rawExtentResult);n.setExtent(s[0],s[1]),s=n.getExtent();var l=r?Bzr(n,e):Nzr(n,e),u=l.intervalPrecision,d=l.interval,h=e.userInterval;h!=null&&(l.interval=h,l.intervalPrecision=eT(h)),i[0]||(s[0]=Yn(ep(s[0]/d)*d,u)),i[1]||(s[1]=Yn(lS(s[1]/d)*d,u)),h!=null&&(l.niceExtent=s.slice()),Lpt(t,i,o,s,a,l)}function Nzr(t,e){var r=PY(e.splitNumber,5),n=LY(t),i=e.minInterval,a=e.maxInterval,o=uW(n/r,!0);i!=null&&oa&&(o=a);var s=eT(o),l=t.getExtent(),u=[Yn(lS(l[0]/o)*o,s),Yn(ep(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function Bzr(t,e){var r=PY(e.splitNumber,10),n=t.getExtent(),i=LY(t),a=rn(ope(i),1),o=r/i*a;o<=.5&&(a*=10);var s=eT(a),l=[Yn(lS(n[0]/a)*a,s),Yn(ep(n[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function MR(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Hpt(e,r,n,i,null)}function Hpt(t,e,r,n,i){var a=Gpt(t,e,n,r,i),o=MY(t)||lB(t);Wpt(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&&Pzr(r,t,a,n)}function Wpt(t,e){$zr[t.type](t,e)}var $zr={interval:Qpt,log:Qpt,time:lzr,ordinal:no};function Fzr(t){return Km(null,t)}var zzr={isDimensionStacked:$y,enableDataStack:gpt,getStackedDimension:Mme};function Uzr(t,e){var r=e;e instanceof bn||(r=new bn(e));var n=uB(r),i=OR(r,n,!1);return t[1]i&&(n=o,i=l)}if(n)return Yzr(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"?qpt(s.exterior,i,a,r):fe(s.points,function(l){qpt(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 Xme(t,e){return t=jzr(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 Xpt(o[0],o.slice(1)));break;case"MultiPolygon":fe(i.coordinates,function(l){l[0]&&a.push(new Xpt(l[0],l.slice(1)))});break;case"LineString":a.push(new Kpt([i.coordinates]));break;case"MultiLineString":a.push(new Kpt(i.coordinates))}var s=new Zpt(n[e||"name"],a,n.cp);return s.properties=n,s})}const Xzr=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:y8,asc:Dl,getPercentWithPrecision:GNr,getPixelPrecision:VNr,getPrecision:Bm,getPrecisionSafe:gct,isNumeric:lpe,isRadianAroundZero:hS,linearMap:Zn,nice:uW,numericToNumber:Fm,parseDate:$m,parsePercent:Gt,quantile:dW,quantity:ope,quantityExponent:cW,reformIntervals:spe,remRadian:ape,round:UNr},Symbol.toStringTag,{value:"Module"})),Kzr=Object.freeze(Object.defineProperty({__proto__:null,format:z8,parse:$m,roundTime:XW},Symbol.toStringTag,{value:"Module"})),Zzr=Object.freeze(Object.defineProperty({__proto__:null,Arc:D8,BezierCurve:K_,BoundingRect:pr,Circle:qm,CompoundPath:L8,Ellipse:E8,Group:gr,Image:il,IncrementalDisplayable:Yut,Line:Qo,LinearGradient:RS,Polygon:gc,Polyline:Ml,RadialGradient:Zpe,Rect:nn,Ring:X_,Sector:pc,Text:$n,clipPointsByRect:ige,clipRectByRect:rdt,createIcon:nR,extendPath:Jut,extendShape:Zut,getShapeClass:M8,getTransform:MS,initProps:ua,makeImage:rge,makePath:tR,mergePath:Hh,registerShape:ap,resizePath:nge,updateProps:qn},Symbol.toStringTag,{value:"Module"})),Jzr=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Ege,capitalFirst:L7r,encodeHTML:Wc,formatTime:D7r,formatTpl:Lge,getTextRect:R7r,getTooltipMarker:_dt,normalizeCssArray:lR,toCamelCase:_ge,truncateText:k8r},Symbol.toStringTag,{value:"Module"})),eUr=Object.freeze(Object.defineProperty({__proto__:null,bind:Wt,clone:lr,curry:Kr,defaults:mr,each:fe,extend:lt,filter:oi,indexOf:Nr,inherits:afe,isArray:ft,isFunction:ur,isObject:yr,isString:$t,map:vt,merge:Gr,reduce:qf},Symbol.toStringTag,{value:"Module"}));var tUr=Qr(),gB=Qr(),bg={estimate:1,determine:2};function GY(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function rUr(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(egt(r,n),function(i,a){return{formattedLabel:dB(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?iUr(t,e):oUr(t)}function nUr(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:egt(i,n)}:t.type==="category"?aUr(t,e):{ticks:n.getTicks(r)}}function egt(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)}),fW(n,f8r,null),Dl(n),vt(n,function(i){return{value:i}})}function iUr(t,e){var r=t.getLabelModel(),n=tgt(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function tgt(t,e,r){var n=lUr(t),i=Ume(e),a=r.kind===bg.estimate;if(!a){var o=ngt(n,i);if(o)return o}var s,l;ur(i)?s=QY(t,i,!1):(l=i==="auto"?cUr(t,r):i,s=QY(t,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Kme(n,i,u),!0}):Kme(n,i,u),u}function aUr(t,e){var r=sUr(t),n=Ume(e),i=ngt(r,n);if(i)return i;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=QY(t,n,!0);else if(n==="auto"){var s=tgt(t,t.getLabelModel(),GY(bg.determine));o=s.labelCategoryInterval,a=vt(s.labels,function(l){return l.tick})}else o=n,a=QY(t,o,!0);return Kme(r,n,{ticks:a,tickCategoryInterval:o})}function oUr(t){var e=t.scale.getTicks(),r=dB(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var sUr=rgt("axisTick"),lUr=rgt("axisLabel");function rgt(t){return function(r){return gB(r)[t]||(gB(r)[t]={list:[]})}}function ngt(t,e){for(var r=0;rd&&(u=Math.max(1,Math.floor(l/d)));for(var h=s[0],f=t.dataToCoord(h+1)-t.dataToCoord(h),p=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,v=0;h<=s[1];h+=u){var y=0,b=0,x=JH(i({value:h}),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===bg.estimate)return e.out.noPxChangeTryDetermine.push(Wt(dUr,null,t,S,l)),S;var T=igt(t,S,l);return T??S}function dUr(t,e,r){return igt(t,e,r)==null}function igt(t,e,r){var n=tUr(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 hUr(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 QY(t,e,r){var n=dB(t),i=t.scale,a=[],o=ur(e);return wpt(i,o?0:e,function(s,l){var u=i.getLabel(s);if(o){var d=!!e(s.value,u);if(s.offInterval=!d,!d&&!l)return}a.push(r?s:{formattedLabel:n(s),rawLabel:u,tick:s})}),a}var fUr=.8;function vc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,o=X9r(n);tp(o)||(o=NaN);var s=t.getExtent(),l=ao(s[1]-s[0]);return Kc(n)?pUr(r,t,o,l):i&&gUr(r,t,o,l,i),a!=null&&(r.w=tp(r.w)?rn(a,r.w):a),r}function pUr(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 gUr(t,e,r,n,i){var a=!1,o=-1/0;fe(i.key?[wzr(e,i.key)]:Azr(e,i.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===Mpt&&(a=!0))}),tp(r)&&r>0&&tp(o)?(t.w=n/r*o,t.w2=o):a&&(t.w=n*fUr,t.w2=t.w*r/n)}var agt=[0,1],up=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,agt,ogt(this),r)},t.prototype.coordToData=function(e,r){var n=Zn(e,ogt(this),agt,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=nUr(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(s){return{coord:this.dataToCoord(_R(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=mUr(this,i,a);return vt(i,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},t.prototype.getMinorTicksCoords=function(){if(Kc(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||GY(bg.determine),rUr(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 vc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||GY(bg.determine),uUr(this,e)},t}();function ogt(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 mUr(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=vc(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 vUr(t){var e=pn.extend(t);return pn.registerClass(e),e}function yUr(t){var e=Ki.extend(t);return Ki.registerClass(e),e}function bUr(t){var e=Pi.extend(t);return Pi.registerClass(e),e}function xUr(t){var e=Ei.extend(t);return Ei.registerClass(e),e}var mB=Math.PI*2,aT=Hm.CMD,wUr=["top","right","bottom","left"];function AUr(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 SUr(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 d=o*r+t,h=s*r+e;if(Math.abs(n-i)%mB<1e-4)return l[0]=d,l[1]=h,u-r;if(a){var f=n;n=Uh(i),i=Uh(f)}else n=Uh(n),i=Uh(i);n>i&&(i+=mB);var p=Math.atan2(s,o);if(p<0&&(p+=mB),p>=n&&p<=i||p+mB>=n&&p+mB<=i)return l[0]=d,l[1]=h,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,wg.fromArray(t[0]),da.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Zm,wg,da),wr.sub(Jm,qo,da);var r=Zm.len(),n=Jm.len();if(!(r<.001||n<.001)){Zm.scale(1/r),Jm.scale(1/n);var i=Zm.dot(Jm),a=Math.cos(e);if(a1&&wr.copy(Nu,qo),Nu.toArray(t[1])}}}}function kUr(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,wg.fromArray(t[0]),da.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Zm,da,wg),wr.sub(Jm,qo,da);var n=Zm.len(),i=Jm.len();if(!(n<.001||i<.001)){Zm.scale(1/n),Jm.scale(1/i);var a=Zm.dot(e),o=Math.cos(r);if(a=l)wr.copy(Nu,qo);else{Nu.scaleAndAdd(Jm,s/Math.tan(Math.PI/2-d));var h=qo.x!==da.x?(Nu.x-da.x)/(qo.x-da.x):(Nu.y-da.y)/(qo.y-da.y);if(isNaN(h))return;h<0?wr.copy(Nu,da):h>1&&wr.copy(Nu,qo)}Nu.toArray(t[1])}}}}function Zme(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 OUr(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=yy(n[0],n[1]),a=yy(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=e8([],n[1],n[0],o/i),l=e8([],n[1],n[2],o/a),u=e8([],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 d=1;d0){w(E*O,0,a);var _=E+T;_<0&&A(-_*O,1)}else A(-T*O,1)}}function w(T,C,O){T!==0&&(d=!0);for(var E=C;E0)for(var _=0;_0;_--){var D=O[_-1]*R;w(-D,_,a)}}}function S(T){var C=T<0?-1:1;T=Math.abs(T);for(var O=Math.ceil(T/(a-1)),E=0;E0?w(O,0,E+1):w(-O,a-E-1,a),T-=O,T<=0)return}return d}function RUr(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),!iR(n).valueAnimation){var h=Jt(n.style.opacity,1);n.style.opacity=0,ua(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};XY(p,u,KY),XY(p,n.states.select,KY)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};XY(g,u,KY),XY(g,n.states.emphasis,KY)}fdt(n,l,d,r,r)}if(i&&!i.ignore&&!i.invisible){var a=MUr(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}(),o0e=Qr();function PUr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=o0e(r).labelManager;i||(i=o0e(r).labelManager=new IUr),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=o0e(r).labelManager;fe(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var s0e=Math.sin,l0e=Math.cos,vgt=Math.PI,oT=Math.PI*2,NUr=180/vgt,ygt=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,d=!l,h=Math.abs(u),f=$x(h-oT)||(d?u>=oT:-u>=oT),p=u>0?u%oT:u%oT+oT,g=!1;f?g=!0:$x(h)?g=!1:g=p>=vgt==!!d;var m=e+n*l0e(o),v=r+i*s0e(o);this._start&&this._add("M",m,v);var y=Math.round(a*NUr);if(f){var b=1/this._p,x=(d?1:-1)*(oT-b);this._add("A",n,i,y,1,+d,e+n*l0e(o+x),r+i*s0e(o+x)),b>.01&&this._add("A",n,i,y,0,+d,m,v)}else{var w=e+n*l0e(s),A=r+i*s0e(s);this._add("A",n,i,y,+g,+d,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 d=[],h=this._p,f=1;f"}function HUr(t){return""}function d0e(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 QUr(o,s)+(o!=="style"?Wc(l):l||"")+(a?""+r+vt(a,function(u){return n(u)}).join(r)+r:"")+HUr(o)}return n(t)}function WUr(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(d){var h=e[l][u][d];return d==="d"&&(h='path("'+h+'")'),d+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function h0e(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Sgt(t,e,r,n){return ol("svg","root",{width:t,height:e,xmlns:bgt,"xmlns:xlink":xgt,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var YUr=0;function Tgt(){return YUr++}var Cgt={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"},sT="transform-origin";function qUr(t,e,r){var n=lt({},t.shape);lt(n,e),t.buildPath(r,n);var i=new ygt;return i.reset(Qlt(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function jUr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[sT]=r+"px "+n+"px")}var XUr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function kgt(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function KUr(t,e,r){var n=t.shape.paths,i={},a,o;if(fe(n,function(l){var u=h0e(r.zrId);u.animation=!0,ZY(l,{},u,!0);var d=u.cssAnims,h=u.cssNodes,f=En(d),p=f.length;if(p){o=f[p-1];var g=d[o];for(var m in g){var v=g[m];i[m]=i[m]||{d:""},i[m].d+=v.d||""}for(var y in h){var b=h[y].animation;b.indexOf(o)>=0&&(a=b)}}}),!!a){e.d=!1;var s=kgt(i,r);return a.replace(o,s)}}function Ogt(t){return $t(t)?Cgt[t]?"cubic-bezier("+Cgt[t]+")":Efe(t)?t:"":""}function ZY(t,e,r,n){var i=t.animators,a=i.length,o=[];if(t instanceof L8){var s=KUr(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var q=kgt(T,r);return q+" "+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-"+Tgt();r.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function ZUr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};Egt(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=UH(l))}var u=i.lineWidth;if(u){var d=!i.strokeNoScale&&t.transform?t.transform[0]:1;u=u/d}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),Egt(n,e,r)}}function Egt(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+Tgt(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var vB=Math.round;function _gt(t){return t&&$t(t.src)}function Rgt(t){return t&&ur(t.toDataURL)}function f0e(t,e,r,n){UUr(function(i,a){var o=i==="fill"||i==="stroke";o&&Glt(a)?Ngt(e,t,i,n):o&&Ife(a)?Bgt(r,t,i,n):t[i]=a,o&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),aVr(r,t,n)}function p0e(t,e){var r=dct(e);r&&(r.each(function(n,i){n!=null&&(t[(wgt+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[wgt+"silent"]="true"))}function Dgt(t){return $x(t[0]-1)&&$x(t[1])&&$x(t[2])&&$x(t[3]-1)}function JUr(t){return $x(t[4])&&$x(t[5])}function g0e(t,e,r){if(e&&!(JUr(e)&&Dgt(e))){var n=1e4;t.transform=Dgt(e)?"translate("+vB(e[4]*n)/n+" "+vB(e[5]*n)/n+")":eNr(e)}}function Lgt(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.";dc(f,v),dc(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):d&&(L=1,R/=a.height)),E.attrs.width=L,E.attrs.height=R,P&&(P.setAttribute("width",L),P.setAttribute("height",R))}},b=ype(g,null,t,function(E){l||y(S,E),y(h,E)});b&&b.width&&b.height&&(f=f||b.width,p=p||b.height)}h=ol("image","img",{href:g,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(h=lr(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var x,w;l?x=w=1:u?(w=1,x=o.width/a.width):d?(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=Hlt(i);A&&(o.patternTransform=A);var S=ol("pattern","",o,[h]),T=d0e(S),C=n.patternCache,O=C[T];O||(O=n.zrId+"-p"+n.patternIdx++,C[T]=O,o.id=O,S=n.defs[O]=ol("pattern",O,o,[h])),e[r]=QH(O)}}function oVr(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]=ol("clipPath",a,o,[Igt(t,r)])}e["clip-path"]=QH(a)}function $gt(t){return document.createTextNode(t)}function lT(t,e,r){t.insertBefore(e,r)}function Fgt(t,e){t.removeChild(e)}function zgt(t,e){t.appendChild(e)}function Ugt(t){return t.parentNode}function Vgt(t){return t.nextSibling}function m0e(t,e){t.textContent=e}var Ggt=58,sVr=120,lVr=ol("","");function v0e(t){return t===void 0}function t0(t){return t!==void 0}function cVr(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 yB(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function bB(t){var e,r=t.children,n=t.tag;if(t0(n)){var i=t.elm=Agt(n);if(y0e(lVr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Qgt(t,g,r,i,l)):JY(t,e,n,a))}function I5(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(y0e(t,e),v0e(e.text)?t0(n)&&t0(i)?n!==i&&uVr(r,n,i):t0(i)?(t0(t.text)&&m0e(r,""),Qgt(r,null,i,0,i.length-1)):t0(n)?JY(r,n,0,n.length-1):t0(t.text)&&m0e(r,""):t.text!==e.text&&(t0(n)&&JY(r,n,0,n.length-1),m0e(r,e.text)))}function dVr(t,e){if(yB(t,e))I5(t,e);else{var r=t.elm,n=Ugt(r);bB(e),n!==null&&(lT(n,e.elm,Vgt(r)),JY(n,[t],0,0))}return e}var hVr=0,fVr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=pVr(),this.storage=r,this._opts=n=lt({},n),this.root=e,this._id="zr"+hVr++,this._oldVNode=Sgt(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=Agt("svg");y0e(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",dVr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Pgt(e,h0e(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=h0e(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=gVr(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=ol("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(ol("defs","defs",{},u)),e.animation){var d=WUr(a.cssNodes,a.cssAnims,{newline:!0});if(d){var h=ol("style","stl",{},[],d);o.push(h)}}return Sgt(n,i,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},d0e(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,d=0;d=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 h=Wgt(this),f=h.startIdx;f=0)&&(o=!0)}),!(!o&&!a.__dirty)){var s=n._opts.useDirtyRect&&!b0e(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 d=a.zlevel===l.zl&&a.zlevel2===l.zl2?n._backgroundColor:null;a.clear(!1,d,s)}eq(a,function(h){var f=n._paintPerCursor(a,h,e,s,u);i=i&&f})}},tq),Dn.wxa&&Zc(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=b0e(e),u=l&&rl.getTime(),d=r.drawIdx,h=r.notClearIdx,f=h>=0?Math.min(h,d):d;f15){f++;break}}}}b5(s,o),r.drawIdx=Math.max(f,d)},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=cT,r=0);var a=A0e(this._i,e)[r];return a||(a=jgt("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Gr(a,this._layerConfig[e],!0),(n||i&&e!==cT)&&(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])&&yVr(e)){for(var d=s.length,h=0;h0&&(u=A0e(a,s[h-1].zl)[s[h-1].zl2]),s.splice(h,0,{zl:r,zl2:n}),A0e(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 Zc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Zc(this._i,function(n,i){e.call(r,n,i)},xB)},t.prototype.eachOtherLayer=function(e,r){return Zc(this._i,function(n,i){e.call(r,n,i)},S0e)},t.prototype.getLayers=function(){var e={};return Zc(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;(b0e(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=y5(a,0,i),r=y5(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Zc(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(cT).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[cT][0].dom;var r=new Ygt("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;Zc(this._i,function(h){h.__builtin__?n.drawImage(h.dom,0,0,i,a):h.renderToCanvas&&(n.save(),h.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}(Pi);function P5(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=h5(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 wB=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=CVr,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(){Dy(this.childAt(0))},e.prototype.downplay=function(){Ly(this.childAt(0))},e.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},e.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},e.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),d=o!==this._symbolType,h=a&&a.disableAnimation;if(d){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};h?p.attr(g):qn(p,g,s,n),ip(p)}if(this._updateCommon(r,n,l,i,a),d){var p=this.childAt(0);if(!h){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)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,d,h,f,p,g,m,v,y;if(a&&(u=a.emphasisItemStyle,d=a.blurItemStyle,h=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(),h=b.getModel(["select","itemStyle"]).getItemStyle(),d=b.getModel(["blur","itemStyle"]).getItemStyle(),f=x.get("focus"),p=x.get("blurScope"),g=x.get("disabled"),m=Ps(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=jS(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 il){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 O=r.getItemVisual(n,"liftZ"),E=this._z2;O!=null?E==null&&(this._z2=s.z2,s.z2+=O):E!=null&&(s.z2=E,this._z2=null);var _=o&&o.useNameLabel;al(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:P,inheritColor:T,defaultOpacity:S.opacity});function P(D){return _?r.getName(D):P5(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=s.ensureState("emphasis");L.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=d;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&&Yx(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Yx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return v5(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(gr);function CVr(t,e){this.parent.drift(t,e)}function rq(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 Jgt(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function emt(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:Ps(e),cursorStyle:e.get("cursor")}}function tmt(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 AB=function(){function t(e){this.group=new gr,this._SymbolCtor=e||wB}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Jgt(r);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=emt(e),u={disableAnimation:s},d=r.getSymbolPoint||function(h){return e.getItemLayout(h)};a||n.removeAll(),e.diff(a).add(function(h){var f=d(h);rq(e,f,h,r)&&tmt(o,e,h,l,u,f,n)}).update(function(h,f){var p=a.getItemGraphicEl(f),g=d(h);if(!rq(e,g,h,r)){n.remove(p);return}var m=e.getItemVisual(h,"symbol")||"circle",v=p&&p.getSymbolType&&p.getSymbolType();if(!p||v&&v!==m)n.remove(p),p=new o(e,h,l,u),p.setPosition(g);else{p.updateData(e,h,l,u);var y={x:g[0],y:g[1]};s?p.attr(y):qn(p,y,i)}n.add(p),e.setItemGraphicEl(h,p)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=d,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 nmt(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 dp(t,e){return!isFinite(t)||!isFinite(e)}var OVr=typeof Float32Array!==H_?Float32Array:void 0,EVr=typeof Float64Array!==H_?Float64Array:void 0;function r0(t){return T0e({ctor:OVr},t).arr}function T0e(t,e){var r=t.arr,n=t.ctor;if(e>y8&&(e=y8),!r||t.typed&&r.length=i||m<0)break;if(dp(y,b)){if(l){m+=a;continue}break}if(m===r)t[a>0?"moveTo":"lineTo"](y,b),h=y,f=b;else{var x=y-u,w=b-d;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||dp(S,T))p=y,g=b;else{E=S-u,_=T-d;var R=y-u,D=S-y,M=b-d,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),O=F/(F+N),p=y-E*o*(1-O),g=b-_*o*(1-O),P=y+E*o*O,L=b+_*o*O,P=tw(P,rw(S,y)),L=tw(L,rw(T,b)),P=rw(P,tw(S,y)),L=rw(L,tw(T,b)),E=P-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=tw(p,rw(u,y)),g=tw(g,rw(d,b)),p=rw(p,tw(u,y)),g=rw(g,tw(d,b)),E=y-p,_=b-g,P=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(h,f,p,g,y,b),h=P,f=L}else t.lineTo(y,b)}u=y,d=b,m+=a}return v}var imt=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),DVr=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 imt},e.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&dp(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[h++],g=a[h++],m=a[h++],v=a[h++],y=a[h++],b=a[h++];var A=u?BH(s,p,m,y,r,d):BH(l,g,v,b,r,d);if(A>0)for(var S=0;S=0){var w=u?nl(l,g,v,b,T):nl(s,p,m,y,T);return u?[r,w]:[w,r]}}s=y,l=b;break}}},e}(yn),LVr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(imt),amt=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 LVr},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&&dp(i[s*2-2],i[s*2-1]);s--);for(;o=0,a=t.fill||tt.color.neutral99;pmt(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){pmt(s,s)}),n}function pmt(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 gmt(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 PVr(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}}),d=u.length,h=a.outerColors.slice();d&&u[0].coord>u[d-1].coord&&(u.reverse(),h.reverse());var f=IVr(u,i==="x"?r.getWidth():r.getHeight()),p=f.length;if(!p&&d)return u[0].coord<0?h[1]?h[1]:u[d-1].color:h[0]?h[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:h[1]||"transparent"}),f.unshift({offset:p?f[0].offset:.5,color:h[0]||"transparent"});var b=new RS(0,0,0,0,f,!0);return b[i]=m,b[i+"2"]=v,b}}}function NVr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&BVr(a,e))){var o=e.mapDimension(a.dim),s={};return fe(a.getViewLabels(),function(l){l.tick.offInterval||(s[_5(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function BVr(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 $Vr(t){for(var e=t.length/2;e>0&&dp(t[e*2-2],t[e*2-1]);e--);return e-1}function bmt(t,e){return[t[e*2],t[e*2+1]]}function FVr(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 xmt(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=ymt(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=ymt(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:T}),Is(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,Ea(m,M,I,N)}var G=this._changePolyState;s.eachItemGraphicEl(function(X){X&&(X.onHoverStateChange=G)}),this._polyline.onHoverStateChange=G,this._data=s,this._coordSys=a,this._stackedOnPoints=A,this._points=d,this._step=E,this._valueOrigin=x;var H=r.get("triggerEvent"),j=r.get("triggerLineEvent"),q=j===!0||H===!0||H==="line",ne=j===!0||H===!0||H==="area";this.packEventData(r,g,q),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=pS(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 d=l[s*2],h=l[s*2+1];if(dp(d,h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(d,h))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new wB(o,s),u.x=d,u.y=h,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 Ei.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=pS(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 Ei.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;_W(this._polyline,r),n&&_W(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new DVr({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 amt({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,d=u.get("animationDuration");ur(d)&&(d=d(null));var h=u.get("animationDelay")||0,f=ur(h)?h(null):h;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(h)?h(g):d*T+f,O=m.getSymbolPath(),E=O.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}),O.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(xmt(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 d=$Vr(l);d>=0&&(al(s,Ps(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:d,defaultText:function(h,f,p){return p!=null?Zgt(o,p):P5(o,h)},enableTextSetter:!0},zVr(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,d=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=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=FVr(h,w,T),O=C.range,E=O[1]-O[0],_=void 0;if(E>=1){if(E>1&&!p){var P=bmt(h,O[0]);u.attr({x:P[0]+A,y:P[1]+S}),o&&(_=f.getRawValue(O[0]))}else{var P=d.getPointOn(w,T);P&&u.attr({x:P[0]+A,y:P[1]+S});var L=f.getRawValue(O[0]),R=f.getRawValue(O[1]);o&&(_=Ect(i,g,L,R,C.t))}a.lastFrameIndex=O[0]}else{var D=r===1||a.lastFrameIndex>0?O[0]:0,P=bmt(h,D);o&&(_=f.getRawValue(D)),u.attr({x:P[0]+A,y:P[1]+S})}if(o){var M=i5(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,d=this._polygon,h=r.hostModel,f=RVr(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=nw(f.stackedOnCurrent,f.current,i,o,l),p=nw(f.current,null,i,o,l),v=nw(f.stackedOnNext,f.next,i,o,l),m=nw(f.next,null,i,o,l)),vmt(p,m)>3e3||d&&vmt(g,v)>3e3){u.stopAnimation(),u.setShape({points:m}),d&&(d.stopAnimation(),d.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,h),d&&(d.setShape({points:p,stackedOnPoints:g}),d.stopAnimation(),qn(d,{shape:{stackedOnPoints:v}},h),u.shape.points!==d.shape.points&&(d.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),d=l.getExtent(),h=n.getDevicePixelRatio(),f=Math.abs(d[1]-d[0])*(h||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=VVr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,GVr))}}}}}function QVr(t){t.registerChartView(UVr),t.registerSeriesModel(TVr),t.registerLayout(kB("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,wmt("line"))}var Amt=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}(up),O0e=null;function HVr(t){O0e||(O0e=t)}function OB(){return O0e}var nq="expandAxisBreak",Smt="collapseAxisBreak",Tmt="toggleAxisBreak",E0e="axisbreakchanged",WVr={type:nq,event:E0e,update:"update",refineEvent:_0e},YVr={type:Smt,event:E0e,update:"update",refineEvent:_0e},qVr={type:Tmt,event:E0e,update:"update",refineEvent:_0e};function _0e(t,e,r,n){var i=[];return fe(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function jVr(t){t.registerAction(WVr,e),t.registerAction(YVr,e),t.registerAction(qVr,e);function e(r,n){var i=[],a=z_(n,r);function o(s,l){fe(a[s],function(u){var d=u.updateAxisBreaks(r);fe(d.breaks,function(h){var f;i.push(mr((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var iw=Math.PI,XVr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],KVr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],hT=Qr(),Cmt=Qr(),kmt=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 ZVr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),o=[],s,l=D0e(t.axisName)&&E5(t.nameLocation);fe(n,function(g){var m=e0(g);if(!(!m||m.label.ignore)){o.push(m);var v=a.transGroup;l&&(v.transform?Fh(EB,v.transform):ZA(EB),m.transform&&$h(EB,EB,m.transform),pr.copy(iq,m.localRect),iq.applyTransform(EB),s?s.union(iq):pr.copy(s=new pr(0,0,0,0),iq))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",d=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-d)-Math.abs(m.label[u]-d)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1])-f;s.union(new pr(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var EB=Oa(),iq=new pr(0,0,0,0),Omt=function(t,e,r,n,i,a){if(E5(t.nameLocation)){var o=a.stOccupiedRect;o&&Emt(_Ur({},o,a.transGroup.transform),n,i)}else _mt(a.labelInfoList,a.dirVec,n,i)};function Emt(t,e,r){var n=new wr;jY(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&r0e(e,n)}function _mt(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,o=t.length;a0?"top":"bottom",a="center"):hS(i-iw)?(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}(),JVr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],eGr={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,d=[l[0],0],h=[l[1],0],f=d[0]>h[0];u&&(io(d,d,u),io(h,h,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"])&&YW(n.axis.scale))OB().buildAxisBreakLine(n,i,a,g);else{var m=new Qo(lt({shape:{x1:d[0],y1:d[1],x2:h[0],y2:h[1]}},g));r5(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=jS(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((d[0]-h[0])*(d[0]-h[0])+(d[1]-h[1])*(d[1]-h[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,O=f?h:d;T.attr({rotation:A.rotate,x:O[0]+C*Math.cos(t.rotation),y:O[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=Lmt(e,i,s);l&&Rmt(t,e,r,n,i,a,o,bg.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,o,s){var l=Lmt(e,i,s);l&&Rmt(t,e,r,n,i,a,o,bg.determine);var u=iGr(t,i,a,n);nGr(t,e.labelLayoutList,u),aGr(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(D0e(u)){var d=t.nameLocation,h=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);d==="start"?(v.x=g[0]-m*p,y.x=-m):d==="end"?(v.x=g[1]+m*p,y.x=m):(v.x=(g[0]+g[1])/2,v.y=t.labelOffset+h*p,y.y=h);var b=Oa();y.transform(Ay(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*iw/180);var w,A;E5(d)?w=$u.innerTextLayout(t.rotation,x??t.rotation,h):(w=tGr(t.rotation,d,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,O=Hc(t.raw.nameTruncateMaxWidth,T.maxWidth,A),E=s.nameMarginLevel||0,_=new $n({x:v.x,y:v.y,rotation:w.rotation,silent:$u.isLabelSilent(n),style:Xi(f,{text:u,font:S,overflow:"truncate",width:O,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(Iy({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var P=$u.makeAxisEventDataBase(n);P.targetType="axisName",P.name=u,Cr(_).eventData=P}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=e0({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:E5(d)?XVr[E]:KVr[E]});if(l.nameLocation=d,i.add(_),_.decomposeTransform(),t.shouldNameMoveOverlap&&L){var R=r.ensureRecord(n);r.resolveAxisNameOverlap(t,r,n,L,y,R)}}}};function Rmt(t,e,r,n,i,a,o,s){Mmt(e)||oGr(t,e,i,s,n,o);var l=e.labelLayoutList;sGr(t,n,l,a),uGr(n,t.rotation,l);var u=t.optionHideOverlap;rGr(n,l,u),u&&ggt(oi(l,function(d){return d&&!d.label.ignore})),ZVr(t,r,n,l)}function tGr(t,e,r,n){var i=ape(r-t),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return hS(i-iw/2)?(o=l?"bottom":"top",a="center"):hS(i-iw*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iiw/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function rGr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(gzr(n))return;function a(u,d,h){var f=e0(e[d]),p=e0(e[h]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=hT(f.label).labelInfo.tick;if(lB(g)&&m.notNice||Kc(g)&&m.offInterval){B5(f.label);return}}if(u===!1||f.suggestIgnore){B5(f.label);return}if(p.suggestIgnore){B5(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=n0e({marginForce:y},f),p=n0e({marginForce:y},p)}jY(f,p,null,{touchThreshold:v})&&B5(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 nGr(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}T0e(fT,p);var g=0;f(function(x,w,A){for(var S=0,T=A.count();S0&&b0?Mpt:bzr,r.serUids=n}var fT=T0e({ctor:EVr},50);function oq(t){return function(e,r){var n=vc(e,{fromStat:{key:t}});if(tp(n.w2))return[-n.w2/2,n.w2/2]}}function pT(t){return t+zY}function gT(t,e){return t+zY+e}function L0e(t){return mGr(),{liPosMinGap:!Kc(t.scale)}}var n0="bar",_B="pictorialBar";function Imt(t,e,r,n){Hme(t,{key:e,seriesType:r,coordSysType:n,getMetrics:L0e})}function Pmt(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Nmt={left:0,right:0,top:0,bottom:0},sq=["25%","25%"],Ag="cartesian2d",yGr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=US(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Xm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Xm(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:Nmt,outerBoundsContain:"all",outerBoundsClampWidth:sq[0],outerBoundsClampHeight:sq[1],backgroundColor:tt.color.transparent,borderWidth:1,borderColor:tt.color.neutral30},e}(pn),bGr=V_(),M0e="__ec_stack_";function Bmt(t){return t.get("stack")||M0e+t.seriesIndex}function xGr(t){if(Kc(t.axis.scale)){for(var e=vc(t.axis),r=[],n=0;nx&&(x=b),x!==d&&(v.width=x,r-=x+u*x,n--)}}),d=(r-l)/(n+(n-1)*u),d=rn(d,0);var h=0,f;fe(o,function(m){var v=s[m];v.width||(v.width=d),f=v,h+=v.width*(1+u)}),f&&(h-=f.width*u);var p={},g=-h/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 Fmt(t){return{seriesType:t,overallReset:function(e){var r=gT(t,Ag);Gme(e,r,function(n){var i=wGr(n,t);tT(n,r,function(a){var o=i.columnMap[Bmt(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function zmt(t){return{seriesType:t,plan:YS(),reset:function(e){if(dGr(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),d=r.getCalculationInfo("stackResultDimension"),h=$y(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Pmt(a))),g=Umt(e),m=e.get("barMinHeight")||0,v=d&&r.getDimensionIndex(d),y=r.getLayout("size"),b=r.getLayout("offset");return{progress:function(x,w){for(var A=x.count,S=g&&r0(A*3),T=g&&l&&r0(A*3),C=g&&r0(A),O=n.master.getRect(),E=f?O.width:O.height,_,P=w.getStore(),L=0;(_=x.next())!=null;){var R=P.get(h?v:o,_),D=P.get(s,_),M=p,I=void 0;h&&(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]);h&&(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"),d=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+d/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}(Pi);Pi.registerClass(RB);var TGr=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 Km(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=Dct(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."+n0,e.dependencies=["grid","polar"],e.defaultOption=jx(RB.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}(RB),CGr=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}(),lq=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 CGr},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,d=n.startAngle,h=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?h-dMath.PI/2&&ds)return!0;s=h}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){My(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=n0,e}(Ei),Gmt={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=I0e(e.x,t.x),s=P0e(e.x+e.width,i),l=I0e(e.y,t.y),u=P0e(e.y+e.height,a),d=si?s:o,e.y=h&&l>a?u:l,e.width=d?0:s-o,e.height=h?0:u-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),d||h},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=P0e(e.r,t.r),a=I0e(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}},Qmt={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 d=u.shape,h=i?"height":"width";d[h]=0}return u},polar:function(t,e,r,n,i,a,o,s,l){var u=!i&&l?lq:pc,d=new u({shape:n,z2:1});d.name="item";var h=qmt(i);if(d.calculateTextPosition=kGr(h,{isRoundCap:u===lq}),a){var f=d.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(s?qn:ua)(d,{shape:g},a)}return d}};function _Gr(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 Hmt(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 d=e?t.baseAxis.model:null;(o?qn:ua)(r,{shape:u},d,i)}function Wmt(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 LGr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function qmt(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 jmt(t,e,r,n,i,a,o,s){var l=e.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var d=t.shape,h=i0(n.getModel("itemStyle"),d,!0);lt(d,h),t.setShape(d)}}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?BGr(i,a.coordinateSystem):$Gr(i,a.coordinateSystem),g=Ps(n);al(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:P5(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,OGr(t,v==="outside"?p:v,qmt(o),n.get(["label","rotate"]))}hdt(m,g,a.getRawValue(r),function(b){return Zgt(e,b)});var y=n.getModel(["emphasis"]);Ea(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Is(t,n),LGr(i)&&(t.style.fill="none",t.style.stroke="none",fe(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function MGr(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 IGr=function(){function t(){}return t}(),Xmt=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 IGr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,d=0;d=0?r:null},30,!1);function PGr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,o=t.largeDataIndices,s=[],l=[],u=t.barWidth,d=0,h=a.length/3;d=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[d]}return-1}function Jmt(t,e,r){if(dT(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 NGr(t,e,r){var n=t.type==="polar"?pc:nn;return new n({shape:Jmt(e,r,t),silent:!0,z2:0})}function BGr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function $Gr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function FGr(t){t.registerChartView(EGr),t.registerSeriesModel(TGr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Fmt(n0)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,zmt(n0)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,wmt(n0)),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)})}),Vmt(t)}function DB(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}(),aw="pie",zGr=Qr(),e0t=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 F5(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 $5(this,{coordDimensions:["value"],encodeDefaulter:Kr(Pge,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=zGr(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=mct(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){fS(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."+aw,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}(Pi);P7r({fullType:e0t.type,getCoord2:function(t){return t.getShallow("center")}});var UGr=Math.PI/180;function t0t(t,e,r,n,i,a,o,s,l,u){if(t.length<2)return;function d(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)}n0t(a,n)}}}function n0t(t,e){i0t.rect=t,fgt(i0t,e,GGr)}var GGr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},i0t={};function N0e(t){return t.position==="center"}function QGr(t){var e=t.getData(),r=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*UGr,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,d=s.x,h=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,O=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=Gt(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=Gt(F,u);var B=N.get("length2");if(B=Gt(B,u),Math.abs(C.endAngle-C.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,Oe=0,Ee=P.get("rotate");if(Vn(Ee))Oe=Ee*(Ce/180);else if(L==="center")Oe=0;else if(Ee==="radial"||Ee===!0){var ue=z<0?-V+Ce:-V;Oe=ue}else if(Ee==="tangential"||Ee==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var he=Math.atan2(z,U);he<0&&(he=Ce*2+he);var xe=U>0;xe&&Ee!=="tangential-noflip"&&(he=Ce+he),Oe=he-Ce}if(a=!!Oe,O.x=G,O.y=H,O.rotation=Oe,O.setStyle({verticalAlign:"middle"}),ne){O.setStyle({align:q});var ze=O.states.select;ze&&(ze.x+=O.x,ze.y+=O.y)}else{var ge=new pr(0,0,0,0);n0t(ge,O),r.push({label:O,labelLine:E,position:L,len:F,len2:B,minTurnAngle:N.get("minTurnAngle"),maxSurfaceAngle:N.get("maxSurfaceAngle"),surfaceNormal:new wr(z,U),linePoints:j,textAlign:q,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:I,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:O.style.width})}T.setTextConfig({inside:ne})}}),!a&&t.get("avoidLabelOverlap")&&VGr(r,n,i,l,u,f,d,h);for(var m=0;mN?(B=R+T*N/2,V=B):(B=R+O,V=F-O),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 d=o.getItemLayout(0),h=1;isNaN(d&&d.startAngle)&&h=a.r0}},e.type=aw,e}(Ei);function jGr(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 XGr(t){t.registerChartView(qGr),t.registerSeriesModel(e0t),dft(aw,t.registerAction),t.registerLayout(HGr),t.registerProcessor(DB(aw)),t.registerProcessor(jGr(aw))}var KGr=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 Km(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}(Pi),s0t=4,ZGr=function(){function t(){}return t}(),JGr=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 ZGr},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 d=u*2,h=a[d]-s/2,f=a[d+1]-l/2;if(r>=h&&n>=f&&r<=h+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,d=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),tQr=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,B0e(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(),zm(n),B0e(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=kB("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(B0e(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 eQr:new AB,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}(Ei);function B0e(t){return{clipShape:lmt(t)}}var $0e=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);Go($0e,R5);var l0t={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"}},rQr=Gr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},l0t),F0e=Gr({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}}},l0t),nQr=Gr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},F0e),iQr=mr({logBase:10},F0e);const c0t={category:rQr,value:F0e,time:nQr,log:iQr};function z5(t,e,r,n){fe(_pt,function(i,a){var o=Gr(Gr({},c0t[a],!0),n,!0),s=function(l){nt(u,l);function u(){var d=l!==null&&l.apply(this,arguments)||this;return d.type=e+"Axis."+a,d}return u.prototype.mergeDefaultAndTheme=function(d,h){var f=G8(this),p=f?US(d):{},g=h.getTheme();Gr(d,g.get(a+"Axis")),Gr(d,this.getDefaultOption()),d.type=u0t(d),f&&Xm(d,p,f)},u.prototype.optionUpdated=function(){var d=this.option;d.type==="category"&&(this.__ordinalMeta=aB.createByAxisModel(this))},u.prototype.getCategories=function(d){var h=this.option;if(h.type==="category")return d?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(d){var h=OB();return h?h.updateModelAxisBreak(this,d):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",u0t)}function u0t(t){return t.type||(t.data?"category":"value")}var aQr=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}(),fq=["x","y"];function d0t(t){return(t.type==="interval"||t.type==="time")&&!YW(t)}var oQr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Ag,r.dimensions=fq,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!d0t(r)||!d0t(n))){var i=DY(r,null),a=DY(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 d=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-i[0]*d,p=o[1]-a[0]*h,g=this._transform=[d,0,0,h,f,p];this._invTransform=Fh([],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}(aQr);function h0t(t,e){var r=t.scale,n=t.model,i=Gpt(r,n,n.ecModel,t,null),a=k5(r),o=k5(e)?e.intervalStub:e,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),d=o.getTicks({expandToNicedExtent:!0}),h=u.length-1,f,p,g;if(h===1)f=p=0,g=1;else if(h===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]?(O=T[1],R(function(){if(N(),L=Yn(P-E*g,_),D(),C<=T[0])return!0})):R(function(){L=Yn(lS(T[0]/E)*E,_),P=Yn(ep(T[1]/E)*E,_);var z=Nm((P-L)/E);if(z<=g){var U=g-z,G=void 0,H=i.incl0||a;if(H&&T[0]===0)G=[0,U];else if(H&&T[1]===0)G=[U,0];else{var j=ep(U/2);G=U%2===0?[j,j]:C+O=T[1])return!0}})}Lpt(r,w,S,[C,O],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,P]})}var f0t=[[3,1],[0,2]],sQr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=fq,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){nT(o,L5);var s=o.scale;Kc(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function i(o){for(var s=En(o),l=[],u=s.length-1;u>=0;u--){var d=o[+s[u]];d.__alignTo?l.push(d):M5(d)}fe(l,function(h){cQr(h,h.__alignTo)?M5(h):h0t(h,h.__alignTo.scale)})}i(n.x),i(n.y);var a={};fe(n.x,function(o){p0t(n,"y",o,a)}),fe(n.y,function(o){p0t(n,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Ns(e,r),a=this._rect=ba(e.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(z0e(o,a),!n){var u=hQr(a,s,o,l,r),d=void 0;if(l)U0e?(U0e(this._axesList,a),z0e(o,a)):d=y0t(a.clone(),"axisLabel",null,a,o,u,i);else{var h=fQr(e,a,i),f=h.outerBoundsRect,p=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(d=y0t(f,p,g,a,o,u,i))}b0t(a,o,bg.determine,null,d,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]];bpt(a.scale)&&Dpt(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 cQr(t,e){return YW(t.scale)||YW(e.scale)||e.scale.getTicks().length<2}function uQr(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 z0e(t,e){fe(t.x,function(r){return v0t(r,e.x,e.width)}),fe(t.y,function(r){return v0t(r,e.y,e.height)})}function v0t(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),uQr(t,e)}var U0e;function dQr(t){U0e=t}function y0t(t,e,r,n,i,a,o){b0t(n,i,bg.estimate,e,!1,o);var s=[0,0,0,0];u(0),u(1),d(n,0,NaN),d(n,1,NaN);var l=my(s,function(f){return f>0})==null;return IS(n,s,!0,!0,r),z0e(i,n),l;function u(f){fe(i[Mr[f]],function(p){if(hB(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!uc(p)&&p>1e-4&&(f/=p),f}}function hQr(t,e,r,n,i){var a=new kmt(pQr);return fe(r,function(o){return fe(o,function(s){if(hB(s.model)){var l=!n;s.axisBuilder=fGr(t,e,s.model,i,a,l)}})}),a}function b0t(t,e,r,n,i,a){var o=r===bg.determine;fe(e,function(u){return fe(u,function(d){hB(d.model)&&(pGr(d.axisBuilder,t,d.model),d.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,d){return fe(u,function(h){hB(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[d]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function fQr(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)||Nmt,r.refContainer));var a=t.get("outerBoundsContain",!0),o;a==null||a==="auto"||Nr(["all","axisLabel"],a)<0?o="all":o=a;var s=[lW(Jt(t.get("outerBoundsClampWidth",!0),sq[0]),e.width),lW(Jt(t.get("outerBoundsClampHeight",!0),sq[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var pQr=function(t,e,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";Omt(t,e,r,n,i,a),E5(t.nameLocation)||fe(e.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&_mt(s.labelInfoList,s.dirVec,n,i)})};function gQr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return mQr(r,t,e),r.seriesInvolved&&yQr(r,t),r}function mQr(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=LB(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var d=s.model,h=d.getModel("tooltip",n);if(fe(s.getAxes(),Kr(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",p=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.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&&!Q0e(x))){y==null&&(y=x.get("triggerTooltip")),x=v?vQr(b,h,i,e,v,y):x;var A=x.get("snap"),S=x.get("triggerEmphasis"),T=LB(b.model),C=y||A||b.type==="category",O=t.axesInfo[T]={key:T,axis:b,coordSys:s,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:S,involveSeries:C,snap:A,useHandle:Q0e(x),seriesModels:[],linkGroup:null};u[T]=O,t.seriesInvolved=t.seriesInvolved||C;var E=bQr(a,b);if(E!=null){var _=o[E]||(o[E]={axesInfo:{}});_.axesInfo[T]=O,_.mapper=a[E].mapper,O.linkGroup=_}}}})}function vQr(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 d=o.get(["label","show"]);if(u.show=d??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&mr(u,h.textStyle)}}return t.model.getModel("axisPointer",new bn(l,r,n))}function yQr(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[LB(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 bQr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function xQr(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=Q0e(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 EQr=Qr();function O0t(t,e,r,n){if(t instanceof Amt){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=Kc(t.scale)?vc(t).w:null;return s?E0t(r,o,u,n):_Qr(t,e,r,n,o,l)}function E0t(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 _Qr(t,e,r,n,i,a){var o=EQr(t);o.items||(o.items=[]);var s=o.items,l=_0t(s,e,r,n,i,a,1),u=_0t(s,e,r,n,i,a,-1),d=Math.abs(l-r)i/2||h&&f>h/2-n?E0t(r,i,h,n):(s.push({fixedCoord:e,floatCoord:d,r:n}),d)}function _0t(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=Gr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:o,axisTick:s,axisLabel:l,name:m.text,showName:d,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if($t(h)){var b=y.name;y.name=h.replace("{value}",b??"")}else ur(h)&&(y.name=h(y.name,y));var x=new bn(y,null,this.ecModel);return Go(x,R5.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=BS("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=R0t,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:tt.color.axisLabel},boundaryGap:[0,0],splitNumber:D0t,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Gr({lineStyle:{color:tt.color.neutral20}},IB.axisLine),axisLabel:mq(IB.axisLabel,!1),axisTick:mq(IB.axisTick,!1),splitLine:mq(IB.splitLine,!0),splitArea:mq(IB.splitArea,!0),indicator:[]},e}(pn),$Qr=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 $u(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"),d=o.get("show"),h=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,d=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:d,originX:s,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(I0t(this._zr,"globalPan")||NB(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)&&(wy(a.event),a.__ecRoamConsumed=!0,N0t(r,n,i,a,o))},e}(jf);function NB(t){return t.__ecRoamConsumed}var qQr=Qr();function vq(t){var e=qQr(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function BB(t,e,r,n){for(var i=vq(t),a=i.roam,o=a[e]=a[e]||[],s=0;s=4&&(d={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(d&&s!=null&&l!=null&&(h=Y0t(d,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var p=i;i=new gr,i.add(p),p.scaleX=p.scaleY=h.scale,p.x=h.x,p.y=h.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:d,viewBoxTransform:h,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 d=q0e[s];if(d&&Kt(q0e,s)){l=d.call(this,e,r);var h=e.getAttribute("name");if(h){var f={name:h,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=z0t[s];if(p&&Kt(z0t,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 G_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});hp(r,n),Yh(e,n,this._defsUsePending,!1,!1),ZQr(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(){q0e={g:function(e,r){var n=new gr;return hp(r,n),Yh(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new nn;return hp(r,n),Yh(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 qm;return hp(r,n),Yh(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 Qo;return hp(r,n),Yh(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 E8;return hp(r,n),Yh(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=G0t(n));var a=new gc({shape:{points:i||[]},silent:!0});return hp(r,a),Yh(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=G0t(n));var a=new Ml({shape:{points:i||[]},silent:!0});return hp(r,a),Yh(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new il;return hp(r,n),Yh(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),Yh(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),Yh(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=Fut(n);return hp(r,i),Yh(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),z0t={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 RS(e,r,n,i);return U0t(t,a),V0t(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 Zpe(e,r,n);return U0t(t,i),V0t(t,i),i}};function U0t(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function V0t(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={};W0t(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=Yc(o),u=l&&l[3];u&&(l[3]*=Sy(s),o=Jf(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 G0t(t){for(var e=wq(t),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=wq(o);switch(i=i||Oa(),s){case"translate":cg(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":RH(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ay(i,i,-parseFloat(l[0])*j0e,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*j0e);$h(i,[1,0,u,1,0,0],i);break;case"skewY":var d=Math.tan(parseFloat(l[0])*j0e);$h(i,[1,d,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 H0t=/([^\s:;]+)\s*:\s*([^:;]+)/g;function W0t(t,e,r){var n=t.getAttribute("style");if(n){H0t.lastIndex=0;for(var i;(i=H0t.exec(n))!=null;){var a=i[1],o=Kt(bq,a)?bq[a]:null;o&&(e[o]=i[2]);var s=Kt(xq,a)?xq[a]:null;s&&(r[s]=i[2])}}}function iHr(t,e,r){for(var n=0;n<$0t.length;n++){var i=$0t[n],a=t.getAttribute(i);a!=null&&(e[bq[i]]=a)}for(var n=0;n1e-6;UB[0]=o?(i[0]-n.x)/a:i[0],UB[1]=o?(i[1]-n.y)/a:i[1],io(UB,UB,t.mtRawInv);var s=_Hr(t,UB);cvt(e,s,a),fe(r,function(l){l!==e&&cvt(l,s.slice(),a)})}var UB=[];function cvt(t,e,r){var n=t.option;n.center=e,n.zoom=r}function ive(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 uvt(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[a0].scaleX||1)}function Rq(t,e,r,n,i,a,o,s){var l=_q(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(d,h,f){return!i||i.contain(h,f)}}});function u(d){var h=t.mainType,f=cge(mr({type:hvt(h,t.subType,dut)},d));s&&(f.componentType=h),f[h+"Id"]=t.id,e.dispatchAction(f)}r.off("pan").off("zoom").on("pan",function(d){a&&a("pan"),u({dx:d.dx,dy:d.dy})}).on("zoom",function(d){a&&a("zoom"),u({zoom:d.scale,originX:d.originX,originY:d.originY})})}function dvt(t){return function(e,r,n){return ave.copy(t.getBoundingRect()),ave.applyTransform(t.getComputedTransform()),ave.contain(r,n)}}var ave=new pr(0,0,0,0);function ove(t,e,r){var n=hvt(e,r,dut);t.registerAction({type:n,event:n,update:"none"},function(i,a,o){a.eachComponent(hpe(i,e,r),function(s){ivt(i,s),avt(i,s,a,o)})})}function hvt(t,e,r){return(t!==Ym?t:e==="map"?"geo":e)+r}function fvt(t){return t.zoom!=null}function sve(t,e,r,n,i,a,o){var s=new Aq(null,lvt(t.ecModel,e));return kq(s,r,n,i,a),o?Oq(s,o.x,o.y,o.width,o.height):Oq(s,r,n,i,a),J0e(s,t),s}var lve=["rect","circle","line","ellipse","polygon","polyline","path"],DHr=qt(lve),LHr=qt(lve.concat(["g"])),MHr=qt(lve.concat(["g"])),pvt=Qr();function Dq(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function gvt(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var mvt=function(){function t(e){var r=this.group=new gr,n=this._transformGroup=new gr;r.add(n),this.uid=BS("ec_map_draw"),this._controller=new vT(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();V5(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===e&&(s=m.getData())});var l=e.coordinateSystem,u=l.view,d=this._regionsGroup,h=this._transformGroup,f=!d.childAt(0)||a,p;l.shouldClip()?(p=K0e(null,u),this.group.setClipPath(new nn({shape:p.clone()}))):this.group.removeClipPath(),ow(h,wT,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),Rq(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,d,n,i)},t.prototype.__updateOnOwnRoam=function(e){ow(this._transformGroup,wT,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,o){var s=this._regionsGroupByName=qt(),l=qt(),u=this._regionsGroup,d=n.projection,h=d&&d.stream,f=Fx(zB(null,e,xT));function p(v,y){return y&&(v=y(v)),v&&io([],v,f)}function g(v){for(var y=[],b=!h&&d&&d.project,x=0;x=0)&&(d=t);var h=o?{normal:{align:"center",verticalAlign:"middle"}}:null;al(r,Ps(i),{labelFetcher:d,labelDataIndex:u,defaultText:n},h);var f=r.getTextContent();if(f&&(pvt(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 bvt(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 xvt(t,e,r,n,i){e||Iy({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function wvt(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")),V5(t)&&TBr(e,t,r),a}function Avt(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 Lq(this)?this.coordinateSystem.view:null},e.type="series."+AT,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}(Pi);function Svt(t){return t.indexOf("i")===0}function Lq(t){return VB(t.seriesGroup)===t&&!t.getHostGeoModel()}function VB(t){return t.f[0]}function cve(t,e){var r={};return t.eachRawSeriesByType(AT,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 PHr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=AT,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):Lq(r)?(s=s||(this._mapDraw=new mvt(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;Lq(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,d=new qm({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:W_+1)});if(!u){var h=VB(r.seriesGroup).getData(),f=n.getName(o),p=h.indexOfName(f),g=n.getItemModel(o),m=g.getModel("label"),v=h.getItemGraphicEl(p);al(d,Ps(g),{labelFetcher:{getFormattedLabel:function(y,b){return r.getFormattedLabel(p,b)}},defaultText:f}),d.disableLabelAnimation=!0,m.get("position")||d.setTextConfig({position:"bottom"}),v.onHoverStateChange=function(y){_W(d,y)}}i.add(d)}}})},e.type=AT,e}(Ei),NHr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},Tvt=["lng","lat"],Cvt=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=Tvt,a.type="geo",a._nameCoordMap=qt(),a.name=r;var o=i.projection,s=Uy.load(n,i.nameMap,i.nameProperty),l=Uy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=s.regions,d=NHr[l.type];a._clip=i.clip;var h=o?!1:d.invertLongitute;a.view=new Aq(h,lvt(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=Fdt(t,w,v)}Oq(r,w.x,w.y,w.width,w.height),J0e(r,t)}function BHr(t,e){fe(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var $Hr=function(){function t(){this.dimensions=Tvt}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 Cvt(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=Ovt,l.resize(a,r)}),e.eachSeries(function(a){U8({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var o=a.subType===AT?a.getHostGeoModel():a.getReferringComponents("geo",xo).models[0];return o&&o.coordinateSystem},allowNotFound:!0})}),fe(cve(e,!0),function(a,o){if(Svt(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),d=new Cvt(u,u,lt({nameMap:TH(l),api:r,ecModel:e},i(s))),h;fe(a.r,function(f){h=Jt(h,f.get("scaleLimit"))}),n.push(d),d.resize=Ovt,d.resize(s,r),fe(a.r,function(f){f.coordinateSystem=d,BHr(d,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 jHr(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){KHr(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=ZHr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function XHr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Rvt(t){return arguments.length?t:tWr}function GB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function KHr(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 ZHr(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,d=o.hierNode.modifier,h=s.hierNode.modifier;s=uve(s),a=dve(a),s&&a;){i=uve(i),o=dve(o),i.hierNode.ancestor=t;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(eWr(JHr(s,t,r),t,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,d+=o.hierNode.modifier}s&&!uve(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!dve(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-d,r=t)}return r}function uve(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function dve(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function JHr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function eWr(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 tWr(t,e){return t.parentNode===e.parentNode?1:2}var fp=Qr();function Dvt(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,Lvt(e,r,t),fe(r,function(n){fe(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,Kr(rWr,t))})}),e.wrapMethod("cloneShallow",Kr(iWr,t)),fe(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,Kr(nWr,t))}),dc(r[e.dataType]===e)}function rWr(t,e){if(sWr(this)){var r=lt({},fp(this).datas);r[this.dataType]=e,Lvt(e,r,t)}else hve(e,this.dataType,fp(this).mainData,t);return e}function nWr(t,e){return t.struct&&t.struct.update(),e}function iWr(t,e){return fe(fp(e).datas,function(r,n){r!==e&&hve(r.cloneShallow(),n,e,t)}),e}function aWr(t){var e=fp(this).mainData;return t==null||e==null?e:fp(e).datas[t]}function oWr(){var t=fp(this).mainData;return t==null?[{data:t}]:vt(En(fp(t).datas),function(e){return{type:e,data:fp(t).datas[e]}})}function sWr(t){return fp(t).mainData===t}function Lvt(t,e,r){fp(t).datas={},fe(e,function(n,i){hve(n,i,t,r)})}function hve(t,e,r,n){fp(r).datas[e]=t,fp(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=aWr,t.getLinkedDataAll=oWr}var lWr=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 Mvt(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function pve(t,e){var r=Mvt(t);return Nr(r,e)>=0}function Mq(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 ST="tree",uWr=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=fve.createTree(n,this,s);function s(h){h.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(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,d=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=d}),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=Mq(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+ST,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}(Pi),dWr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),hWr=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 dWr},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,d=u==="TB"||u==="BT"?0:1,h=1-d,f=Gt(n.forkPosition,1),p=[];p[d]=o[d],p[h]=o[h]+(l[h]-o[h])*f,r.moveTo(o[0],o[1]),r.lineTo(p[0],p[1]),r.moveTo(s[0],s[1]),p[d]=s[d],r.lineTo(p[0],p[1]),p[d]=l[d],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"),O=C.get("rotate"),E=O*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:C.get("position")||T,rotation:O==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),L=P==="relative"?k_(o.getAncestorsIndices(),o.getDescendantIndices()):P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;L&&(Cr(r).focus=L),pWr(i,o,d,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===T8||_W(r.__edge,R)}})}function pWr(t,e,r,n,i,a,o,s){var l=e.getModel(),u=t.get("edgeShape"),d=t.get("layout"),h=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 K_({shape:gve(d,h,f,i,i)})),qn(m,{shape:gve(d,h,f,a,o)},t));else if(u==="polyline"&&d==="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 mWr(t,e){t.eachSeriesByType("tree",function(r){vWr(r,e)})}function vWr(t,e){var r=Ns(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=Rvt(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,o=n.height,s=Rvt());var l=t.getData().tree.root,u=l.children[0];if(u){qHr(l),gWr(u,jHr,s),l.hierNode.modifier=-u.hierNode.prelim,HB(u,XHr);var d=u,h=u,f=u;HB(u,function(w){var A=w.getLayout().x;Ah.getLayout().x&&(h=w),w.depth>f.depth&&(f=w)});var p=d===h?1:s(d,h)/2,g=p-d.getLayout().x,m=0,v=0,y=0,b=0;if(i==="radial")m=a/(h.getLayout().x+p+g),v=o/(f.depth-1||1),HB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=GB(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/(h.getLayout().x+p+g),m=a/(f.depth-1||1),HB(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/(h.getLayout().x+p+g),v=o/(f.depth-1||1),HB(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 yWr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:Ym,subType:ST,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),ove(t,Ym,ST)}var bWr=Ms(ST,xWr);function xWr(t){t.eachSeriesByType(ST,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 wWr(t){t.registerChartView(fWr),t.registerSeriesModel(uWr),t.registerLayout(mWr),t.registerVisual(bWr),yWr(t)}var Fvt=["treemapZoomToNode","treemapRender","treemapMove"];function AWr(t){for(var e=0;e1;)a=a.parentNode;var o=Fge(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var SWr=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};Uvt(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new bn({itemStyle:o},this,n);a=r.levels=TWr(a,n);var l=vt(a||[],function(h){return new bn(h,s,n)},this),u=fve.createTree(i,this,d);function d(h){h.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=Mq(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(){zvt(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}(Pi);function Uvt(t){var e=0;fe(t.children,function(n){Uvt(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 TWr(t,e){var r=ji(e.get("color")),n=ji(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"),d=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||d&&d!=="none")&&(a=!0)});var o=t[0]||(t[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),t}}var CWr=8,Vvt=8,mve=5,kWr=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"),d=l.getModel(["itemStyle","textStyle"]),h=Ns(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,h);this._prepare(n,p,u),this._renderContent(e,p,g,s,l,u,d,i),tY(o,f,h)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=Ls(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+CWr*2,r.emptyItemWidth);r.totalWidth+=s+Vvt,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,d=r.emptyItemWidth,h=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-d,b=d,x=null);var w=new gc({shape:{points:OWr(u,0,b,h,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new $n({style:Xi(o,{text:x})}),textConfig:{position:"inside"},z2:W_*1e4,onclick:Kr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=Xi(s,{text:x}),w.ensureState("emphasis").style=g,Ea(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),EWr(w,e,y),u+=b+Vvt}},t.prototype.remove=function(){this.group.removeAll()},t}();function OWr(t,e,r,n,i,a){var o=[[i?t:t-mve,e],[t+r,e],[t+r,e+n],[i?t:t-mve,e+n]];return!a&&o.splice(2,0,[t+r+mve,e+n/2]),!i&&o.push([t,e+n/2]),o}function EWr(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&&Mq(r,e)}}var _Wr=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 FWr(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?WB(u*n/l,l/(u*i)):1/0}function Hvt(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]],d=e?t.area/e:0;(i||d>r[l[o]])&&(d=r[l[o]]);for(var h=0,f=t.length;hy8&&(d=y8),i=l}dKvt||Math.abs(r.dy)>Kvt)){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),d=o.layoutInfo,h=qvt(d,l),f=h*a;f=jvt(f,o);var p=f/h;n-=d.x,i-=d.y;var g=Oa();cg(g,g,[-n,-i]),RH(g,g,[p,p]),cg(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),d=l.get("target",!0)||"blank";u&&KW(u,d)}}}}},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 kWr(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(pve(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=YB(),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}(Ei);function YB(){return{nodeGroup:[],background:[],content:[]}}function WWr(t,e,r,n,i,a,o,s,l,u){if(!o)return;var d=o.getLayout(),h=t.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!d||!d.isInView)return;var p=d.width,g=d.height,m=d.borderWidth,v=d.invisible,y=o.getRawIndex(),b=s&&s.getRawIndex(),x=o.viewChildren,w=d.upperHeight,A=x&&x.length,S=f.getModel("itemStyle"),T=f.getModel(["emphasis","itemStyle"]),C=f.getModel(["blur","itemStyle"]),O=f.getModel(["select","itemStyle"]),E=S.get("borderRadius")||0,_=H("nodeGroup",yve);if(!_)return;if(l.add(_),_.x=d.x||0,_.y=d.y||0,_.markRedraw(),Pq(_).nodeWidth=p,Pq(_).nodeHeight=g,d.isAboveViewRoot)return _;var P=H("background",Xvt,u,GWr);P&&B(_,P,A&&d.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)k8(_)&&ES(_,!1),P&&(ES(P,!M),h.setItemGraphicEl(o.dataIndex,P),Wpe(P,I,D));else{var N=H("content",Xvt,u,QWr);N&&V(_,N),P.disableMorphing=!0,P&&k8(P)&&ES(P,!1),ES(_,!M),h.setItemGraphicEl(o.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),Wpe(_,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=eyt(S);ie.fill=pe;var Ce=TT(T);Ce.fill=T.get("borderColor");var Oe=TT(C);Oe.fill=C.get("borderColor");var Ee=TT(O);if(Ee.fill=O.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=Oe,X.ensureState("select").style=Ee,OS(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=eyt(S);Ce.fill=ie,Ce.decal=pe.decal;var Oe=TT(T),Ee=TT(C),ue=TT(O);U(X,ie,pe.opacity,null),X.setStyle(Ce),X.ensureState("emphasis").style=Oe,X.ensureState("blur").style=Ee,X.ensureState("select").style=ue,OS(X)}ne.add(X)}function z(ne){!ne.invisible&&a.push(ne)}function U(ne,X,J,ee){var te=f.getModel(ee?Jvt:Zvt),pe=Ls(f.get("name"),null),ie=te.getShallow("show");al(ne,Ps(f,ee?Jvt:Zvt),{defaultText:ie?pe:null,inheritColor:X,defaultOpacity:J,labelFetcher:t,labelDataIndex:o.dataIndex});var Ce=ne.getTextContent();if(Ce){var Oe=Ce.style,Ee=qN(Oe.padding||0);ee&&(ne.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var he=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);(Oe.width!==he||Oe.height!==xe)&&Ce.setStyle({width:he,height:xe})},Oe.truncateMinChar=2,Oe.lineOverflow="truncate",G(Oe,ee,d);var ue=Ce.getState("emphasis");G(ue?ue.style:null,ee,d)}}function G(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 H(ne,X,J,ee){var te=b!=null&&r[ne][b],pe=i[ne];return te?(r[ne][b]=null,j(pe,te)):v||(te=new X,te instanceof rp&&(te.z2=YWr(J,ee)),q(pe,te)),e[ne][y]=te}function j(ne,X){var J=ne[y]={};X instanceof yve?(J.oldX=X.x,J.oldY=X.y):J.oldShape=lt({},X.shape)}function q(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 YWr(t,e){return t*VWr+e}var qB=fe,qWr=yr,Nq=-1,sl=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=KWr[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(bve(i),jWr(i)):r==="category"?i.categories?XWr(i):bve(i,!0):(dc(r!=="linear"||i.dataExtent),bve(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&&qB(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(qWr(e)){var r=[];qB(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 bve(t,e){var r=t.visual,n=[];yr(r)?qB(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]),ryt(t,n)}function Bq(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:xve([0,1])}}function tyt(t){var e=this.option.visual;return e[Math.round(Zn(t,[0,1],[0,e.length-1],!0))]||{}}function jB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function XB(t){var e=this.option.visual;return e[this.option.loop&&t!==Nq?t%e.length:t]}function CT(){return this.option.visual[0]}function xve(t){return{linear:function(e){return Zn(e,t,this.option.visual,!0)},category:XB,piecewise:function(e,r){var n=wve.call(this,r);return n==null&&(n=Zn(e,t,this.option.visual,!0)),n},fixed:CT}}function wve(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=sl.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function ryt(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Yc(r);return n||[0,0,0,1]})),e}var KWr={linear:function(t){return Zn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=sl.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??Nq},fixed:no};function $q(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=nYr(i,l,m,v,g,n);iyt(m,y,r,n)}})}}}function eYr(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 ayt(t){var e=Ave(t,"color");if(e){var r=Ave(t,"colorAlpha"),n=Ave(t,"colorSaturation");return n&&(e=Ty(e,null,null,n)),r&&(e=u8(e,r)),e}}function tYr(t,e){return e!=null?Ty(e,null,null,t):null}function Ave(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function rYr(t,e,r,n,i,a){if(!(!a||!a.length)){var o=Sve(e,"color")||i.color!=null&&i.color!=="none"&&(Sve(e,"colorAlpha")||Sve(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 d=e.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(d==="index"||d==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new sl(h);return nyt(f).drColorMappingBy=d,f}}}function Sve(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function nYr(t,e,r,n,i,a){var o=lt({},e);if(i){var s=i.type,l=s==="color"&&nyt(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 iYr(t){t.registerSeriesModel(SWr),t.registerChartView(HWr),t.registerVisual(JWr),t.registerLayout(IWr),AWr(t)}function G5(t){return"_EC_"+t}var aYr=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[G5(e)]){var i=new kT(e,r);return i.hostGraph=this,this.nodes.push(i),n[G5(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[G5(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 kT||(e=i[G5(e)]),r instanceof kT||(r=i[G5(r)]),!(!e||!r)){var o=e.id+"-"+r.id,s=new oyt(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 kT&&(e=e.id),r instanceof kT&&(r=r.id);var n=this._edgesMap;return this._directed?n[e+"-"+r]:n[e+"-"+r]||n[r+"-"+e]},t.prototype.eachNode=function(e,r){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(r,n[a],a)},t.prototype.eachEdge=function(e,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(r,n[a],a)},t.prototype.breadthFirstTraverse=function(e,r,n,i){if(r instanceof kT||(r=this._nodesMap[G5(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}(),oyt=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(h)&&(e.set(h,!0),n.push(d.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 syt(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)}}}Go(kT,syt("hostGraph","data")),Go(oyt,syt("hostGraph","edgeData"));function Tve(t,e,r,n,i){for(var a=new aYr(n),o=0;o "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=Km(t,r);else{var m=c5.get(p),v=m?m.dimensions||[]:[];Nr(v,"value")<0&&v.concat(["value"]);var y=T5(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new Xc(y,r),g.initData(t)}var b=new Xc(["value"],r);return b.initData(l,s),i&&i(g,b),Dvt({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Cve="-->",Fq=function(t){return t.get("autoCurveness")||null},lyt=function(t,e){var r=Fq(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 h=Qht({series:this,dataIndex:r,multipleSeries:n});return h},e.prototype._updateCategoriesData=function(){var r=vt(this.option.categories||[],function(i){return i.value!=null?i:lt({value:0},i)}),n=new Xc(["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 nvt(r)&&r},e.type="series."+Fu,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}(Pi);function zq(t){return t instanceof Array||(t=[t,t]),t}var dYr=Ms(Fu,hYr);function hYr(t){t.eachSeriesByType(Fu,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=zq(e.get("edgeSymbol")),a=zq(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=zq(s.getShallow("symbol",!0)),d=zq(s.getShallow("symbolSize",!0)),h=s.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(o,"style");switch(lt(f,h),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]),d[0]&&l.setVisual("fromSymbolSize",d[0]),d[1]&&l.setVisual("toSymbolSize",d[1])})})}function uyt(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=$d(r.getModel().get(["lineStyle","curveness"]),-Ove(r,e,n,!0),0),a=_m(r.node1.getLayout()),o=_m(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 fYr=Ms(Fu,pYr);function pYr(t,e){t.eachSeriesByType(Fu,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]);h[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+d[0],a.y=-f[1]*b+d[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+d[0],a.y=d[1]+O,g=w[0]<0?"right":"left",a.originX=-y*T,a.originY=-O;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+O,g="center",a.originY=-O;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*T+h[0],a.y=h[1]+O,g=w[0]>=0?"right":"left",a.originX=y*T,a.originY=-O;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(gr),Nve=function(){function t(e){this.group=new gr,this._LineCtor=e||Pve}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=byt(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=byt(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!TYr(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=e5)}for(var a=e.start;a0}function byt(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:Ps(e)}}function xyt(t){return isNaN(t[0])||isNaN(t[1])}function Bve(t){return t&&!xyt(t[0])&&!xyt(t[1])}var $ve=[],Fve=[],zve=[],H5=Rl,Uve=Lx,wyt=Math.abs;function Ayt(t,e,r){for(var n=t[0],i=t[1],a=t[2],o=1/0,s,l=r*r,u=.1,d=.1;d<=.9;d+=.1){$ve[0]=H5(n[0],i[0],a[0],d),$ve[1]=H5(n[1],i[1],a[1],d);var h=wyt(Uve($ve,e)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function Vve(t,e){var r=[],n=s8,i=[[],[],[]],a=[[],[]],o=[];e/=2,t.eachEdge(function(s,l){var u=s.getLayout(),d=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[_m(u[0]),_m(u[1])],u[2]&&u.__original.push(_m(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]),d&&d!=="none"){var p=JB(s.node1),g=Ayt(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(h&&h!=="none"){var p=JB(s.node2),g=Ayt(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]),Dx(o,a[1],a[0]),KA(o,o),d&&d!=="none"){var p=JB(s.node1);OH(a[0],a[0],o,p*e)}if(h&&h!=="none"){var p=JB(s.node2);OH(a[1],a[1],o,-p*e)}hc(u[0],a[0]),hc(u[1],a[1])}})}var Syt=Qr();function CYr(t){if(t)return Syt(t).bridge}function Tyt(t,e){t&&(Syt(t).bridge=e)}var kYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Fu,r}return e.prototype.init=function(r,n){var i=new AB,a=new Nve,o=this.group,s=new gr;this._controller=new vT(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=_q(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 d=this._symbolDraw,h=this._lineDraw;o&&ow(l,a0,o,this._firstRender?null:r),Vve(r.getGraph(),ZB(r));var f=r.getData();d.updateData(f);var p=r.getEdgeData();h.updateData(p),this._updateNodeAndLinkScale(),o&&Rq(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 O=T.get(["emphasis","focus"]);O==="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){hyt(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=_q(n);!this._active||!a||(ow(this._mainGroup,a0,a,null),fvt(r)&&(this._updateNodeAndLinkScale(),Vve(n.getGraph(),ZB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=ZB(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(Vve(r.getGraph(),ZB(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=CYr(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(Tq(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(),d=new gr,h=new gr;s.add(h),s.add(d);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."+e7,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}(Pi),Cyt=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(),d=u.getModel("emphasis"),h=r.getItemLayout(n),f=lt(i0(u.getModel("itemStyle"),h,!0),h),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):qn(p,{shape:f},l,n);var g=lt(i0(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Is(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,p),Is(p,u,"itemStyle");var m=d.get("focus");Ea(this,m==="adjacency"?s.getAdjacentDataIndices():m,d.get("blurScope"),d.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),d=n.getModel("label");a.ignore=!d.get("show");var h=Ps(n),f=i.getVisual("style");al(a,h,{labelFetcher:{getFormattedLabel:function(b,x,w,A,S,T){return r.getFormattedLabel(b,x,"node",A,$d(S,h.normal&&h.normal.get("formatter"),n.get("name")),T)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var p=d.get("position")||"outside",g=d.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"?d.get("align")||"center":l>0?"left":"right",y=p!=="outside"?d.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}(pc),MYr=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(),d=l.node1.getModel(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),p=h.getModel("emphasis"),g=p.get("focus"),m=lt(i0(d.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}o?(v.setShape(m),kyt(v,l,r,f)):(ip(v),kyt(v,l,r,f),qn(v,{shape:m},s,i)),Ea(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),Is(v,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(yn);function kyt(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 d=t.shape,h=(d.s1[0]+d.s2[0])/2,f=(d.s1[1]+d.s2[1])/2,p=(d.t1[0]+d.t2[0])/2,g=(d.t1[1]+d.t2[1])/2;o.fill=new RS(h,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var IYr=Math.PI/180,PYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e7,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")*IYr;if(a.diff(o).add(function(d){var h=a.getItemLayout(d);if(h){var f=new Cyt(a,d,l);Cr(f).dataIndex=d,s.add(f)}}).update(function(d,h){var f=o.getItemGraphicEl(h),p=a.getItemLayout(d);if(!p){f&&My(f,r,h);return}f?f.updateData(a,d,l):f=new Cyt(a,d,l),s.add(f)}).remove(function(d){var h=o.getItemGraphicEl(d);h&&My(h,r,d)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=Gt(u[0],i.getWidth()),this.group.originY=Gt(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 MYr(i,a,l,n);Cr(u).dataIndex=l,s.add(u)}).update(function(l,u){var d=o.getItemGraphicEl(u);d.updateData(i,a,l,n),s.add(d)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&My(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=e7,e}(Ei),Gve=Math.PI/180,NYr=Ms(e7,BYr);function BYr(t,e){t.eachSeriesByType(e7,function(r){$Yr(r,e)})}function $Yr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var o=$dt(t,e),s=o.cx,l=o.cy,u=o.r,d=o.r0,h=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];wW(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)){h*T>=Math.abs(w)&&(h=Math.max(0,(Math.abs(w)-f*T)/T)),(h+f)*T>=Math.abs(w)&&(f=(Math.abs(w)-h*T)/T);var O=(w-h*T*v)/C,E=0,_=0,P=0;n.eachNode(function(N){var F=S[N.dataIndex]||0,B=O*(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:d,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),I[N.dataIndex]=M,M+=(F+h)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=O*(C?F:1)*v,V=N.node1.dataIndex,z=I[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),G=z+U*v,H=[s+d*Math.cos(z),l+d*Math.sin(z)],j=[s+d*Math.cos(G),l+d*Math.sin(G)],q=N.node2.dataIndex,ne=I[q]||0,X=Math.abs((N.node2.getLayout().ratio||1)*B),J=ne+X*v,ee=[s+d*Math.cos(ne),l+d*Math.sin(ne)],te=[s+d*Math.cos(J),l+d*Math.sin(J)];N.setLayout({s1:H,s2:j,sStartAngle:z,sEndAngle:G,t1:ee,t2:te,tStartAngle:ne,tEndAngle:J,cx:s,cy:l,r:d,value:F,clockwise:m}),I[V]=G,I[q]=J})}}}function FYr(t){t.registerChartView(PYr),t.registerSeriesModel(LYr),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,NYr),t.registerProcessor(DB("chord"))}var zYr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),UYr=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 zYr},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),d=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,d),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,d)},e}(yn);function VYr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=Gt(r[0],e.getWidth()),s=Gt(r[1],e.getHeight()),l=Gt(t.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Uq(t,e){var r=t==null?"":t+"";return e&&($t(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var 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.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=VYr(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,d=-r.get("endAngle")/180*Math.PI,h=r.getModel("axisLine"),f=h.get("roundCap"),p=f?lq:pc,g=h.get("show"),m=h.getModel("lineStyle"),v=m.get("width"),y=[u,d];wW(y,!l),u=y[0],d=y[1];for(var b=d-u,x=u,w=[],A=0;g&&A=O&&(E===0?0:a[E-1][0])Math.PI/2&&(G+=Math.PI)):U==="tangential"?G=-C-Math.PI/2:Vn(U)&&(G=U*Math.PI/180),G===0?h.add(new $n({style:Xi(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})):h.add(new $n({style:Xi(x,{text:F,x:V,y:z,verticalAlign:"middle",align:"center"},{inheritColor:B}),silent:!0,originX:V,originY:z,rotation:G}))}if(b.get("show")&&M!==w){var I=b.get("distance");I=I?I+d:d;for(var H=0;H<=A;H++){R=Math.cos(C),D=Math.sin(C);var j=new Qo({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"&&j.setStyle({stroke:a((M+H/A)/w)}),h.add(j),C+=E}C-=E}else C+=O}},e.prototype._renderPointer=function(r,n,i,a,o,s,l,u,d){var h=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=Gt(L.get("width"),o.r),D=Gt(L.get("length"),o.r),M=r.get(["pointer","icon"]),I=L.get("offsetCenter"),N=Gt(I[0],o.r),F=Gt(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 UYr({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 O(E,_){var P=v.get("roundCap"),L=P?lq:pc,R=v.get("overlap"),D=R?v.get("width"):d/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),h.add(P),b.setItemGraphicEl(E,P)}if(y){var L=O(E,s),R=v.get("clip");ua(L,{shape:{endAngle:Zn(_,S,T,R)}},r),h.add(L),Ppe(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),h.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],I=M?M.shape.endAngle:s,N=O(E,I),F=v.get("clip");qn(N,{shape:{endAngle:Zn(P,S,T,F)}},r),h.add(N),Ppe(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 il){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,Is(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,Is(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"),d=Yo(s,n.cx-o/2+Gt(l[0],n.r),n.cy-o/2+Gt(l[1],n.r),o,o,null,u);d.z2=i.get("showAbove")?1:0,d.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(d)}},e.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),d=+r.get("min"),h=+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,[d,h],[0,1],!0)),S=b.getModel("title");if(S.get("show")){var T=S.get("offsetCenter"),C=o.cx+Gt(T[0],o.r),O=o.cy+Gt(T[1],o.r),E=p[y];E.attr({z2:v?0:2,style:Xi(S,{x:C,y:O,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+Gt(P[0],o.r),R=o.cy+Gt(P[1],o.r),D=Gt(_.get("width"),o.r),M=Gt(_.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:Xi(_,{x:L,y:R,text:Uq(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:I})}),hdt(E,{normal:_},x,function(B){return Uq(B,N)}),m&&fdt(E,y,l,r,{getFormattedLabel:function(B,V,z,U,G,H){return Uq(H?H.interpolatedValue:x,N)}}),w.add(E)}f.add(w)}),this.group.add(f),this._titleEls=p,this._detailEls=g},e.type="gauge",e}(Ei),QYr=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 $5(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}(Pi);function HYr(t){t.registerChartView(GYr),t.registerSeriesModel(QYr)}var W5="funnel",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.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new F5(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return $5(this,{coordDimensions:["value"],encodeDefaulter:Kr(Pge,this)})},e.prototype._defaultLabelLine=function(r){fS(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."+W5,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}(Pi),YYr=["itemStyle","opacity"],qYr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=i,o=new Ml,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"),d=s.get(YYr);d=d??1,i||ip(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:d}},o,n)):qn(a,{style:{opacity:d},shape:{points:l.points}},o,n),Is(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),d=u.label,h=r.getItemVisual(n,"style"),f=h.fill;al(o,Ps(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:d.textAlign,verticalAlign:d.verticalAlign}});var p=l.getModel("label"),g=p.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!d.inside,insideStroke:m,outsideFill:m});var v=d.linePoints;a.setShape({points:v}),i.textGuideLineConfig={anchor:v?new wr(v[0][0],v[0][1]):null},qn(o,{style:{x:d.x,y:d.y}},s,n),o.attr({rotation:d.rotation,originX:d.x,originY:d.y,z2:10}),Jme(i,e0e(l),{stroke:f})},e}(gc),jYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=W5,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 qYr(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var d=o.getItemGraphicEl(u);d.updateData(a,l),s.add(d),a.setItemGraphicEl(l,d)}).remove(function(l){var u=o.getItemGraphicEl(l);My(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=W5,e}(Ei);function XYr(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,h="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,h="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,h="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,h="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,h="center"):(y=m+x,f=y+5,h="top")):o==="rightBottom"?(m=u[2][0],v=u[2][1],r?(b=v+x,p=b+5,h="center"):(y=m+x,f=y+5,h="bottom")):o==="leftTop"?(m=u[0][0],v=r?u[0][1]:u[1][1],r?(b=v-x,p=b-5,h="center"):(y=m-x,f=y-5,h="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,h="center"):(y=m-x,f=y-5,h="right")):(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,r?(b=v+x,p=b+5,h="center"):(y=m+x,f=y+5,h="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:h,inside:d}})}var ZYr=Ms(W5,JYr);function JYr(t,e){t.eachSeriesByType(W5,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),o=Ns(r,e),s=ba(r.getBoxLayoutParams(),o.refContainer),l=Oyt(r),u=s.width,d=s.height,h=XYr(n,a),f=s.x,p=s.y,g=l?[Gt(r.get("minSize"),d),Gt(r.get("maxSize"),d)]:[Gt(r.get("minSize"),u),Gt(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:d,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+(d-N)/2;break;case"bottom":F=p+(d-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+=d,h=h.reverse());for(var T=0;Tfqr)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||!Hve(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 Hve(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var Vq="parallel",Wve=Vq,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(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(r){var n=this.option;r&&Gr(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=Wve,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),vqr=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}(up);function lw(t,e,r,n,i,a){t=t||0;var o=dS(r[1],-r[0]);if(i!=null&&(i=Y5(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(dS(e[1],-e[0]));s=Y5(s,[0,o]),i=a=Y5(s,[i,a]),n=0}e[0]=Y5(e[0],r),e[1]=Y5(e[1],r);var l=Yve(e,n);e[n]+=t;var u=i||0,d=r.slice();l.sign<0?d[0]=dS(d[0],u):d[1]=dS(d[1],-u),e[n]=Y5(e[n],d);var h;return h=Yve(e,n),i!=null&&(h.sign!==l.sign||h.spana&&(e[1-n]=dS(e[n],h.sign*a)),e}function Yve(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 Y5(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var yqr=function(){function t(e,r,n){this.type=Vq,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),d=uB(u),h=this._axesMap.set(o,new vqr(o,O5(u,d,!1),[0,0],d,l));h.onBand=fB(h.scale,u),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},t.prototype.update=function(e,r){fe(this.dimensions,function(n){var i=this._axesMap.get(n);nT(i,L5),M5(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=Ns(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,d=Gq(e.get("axisExpandWidth"),l),h=Gq(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&d>0&&s>0,p=e.get("axisExpandWindow"),g;if(p)g=Gq(p[1]-p[0],l),p[1]=p[0]+g;else{g=Gq(d*(h-1),l);var m=e.get("axisExpandCenter")||ep(u/2);p=[d*m-g/2],p[1]=p[0]+g}var v=(s-g)/(u-h);v<3&&(v=0);var y=[ep(Yn(p[0]/d,1))+1,lS(Yn(p[1]/d,1))-1],b=v/d*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:d,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?xqr:bqr)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},d={horizontal:sW/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=d[a],p=Oa();Ay(p,p,f),cg(p,p,h),this._axesLayout[o]={position:h,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(),d=n;da*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/d,l?lw(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 Gq(t,e){return Oi(rn(t,e[0]),e[1])}function bqr(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function xqr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,d;return t=0;i--)Dl(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;aCqr}function $yt(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Fyt(t,e,r,n){var i=new gr;return i.add(new nn({name:"main",style:tye(r),silent:!0,draggable:!0,cursor:"move",drift:Kr(Vyt,t,e,i,["n","s","w","e"]),ondragend:Kr(ET,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(Vyt,t,e,i,a),ondragend:Kr(ET,e,{isEnd:!0})}))}),i}function zyt(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=q5(i,kqr),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,d=r[0][1],h=r[1][1],f=d-a+i/2,p=h-a+i/2,g=d-o,m=h-s,v=g+i,y=m+i;Vy(t,e,"main",o,s,g,m),n.transformable&&(Vy(t,e,"w",l,u,a,y),Vy(t,e,"e",f,u,a,y),Vy(t,e,"n",l,u,v,a),Vy(t,e,"s",l,p,v,a),Vy(t,e,"nw",l,u,a,a),Vy(t,e,"ne",f,u,a,a),Vy(t,e,"sw",l,p,a,a),Vy(t,e,"se",f,p,a,a))}function eye(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(tye(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?rye(t,a[0]):Lqr(t,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Eqr[s]+"-resize":null})})}function Vy(t,e,r,n,i,a,o){var s=e.childOfName(r);s&&s.setShape(Iqr(nye(t,e,[[n,i],[n+a,i+o]])))}function tye(t){return mr({strokeNoScale:!0},t.brushStyle)}function Uyt(t,e,r,n){var i=[t7(t,r),t7(e,n)],a=[q5(t,r),q5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Dqr(t){return MS(t.group)}function rye(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=$W(r[e],Dqr(t));return n[i]}function Lqr(t,e){var r=[rye(t,e[0]),rye(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Vyt(t,e,r,n,i,a){var o=r.__brushOption,s=t.toRectRange(o.range),l=Gyt(e,i,a);fe(n,function(u){var d=Oqr[u];s[d[0]][d[1]]+=l[d[0]]}),o.range=t.fromRectRange(Uyt(s[0][0],s[1][0],s[0][1],s[1][1])),Xve(e,r),ET(e,{isEnd:!1})}function Mqr(t,e,r,n){var i=e.__brushOption.range,a=Gyt(t,r,n);fe(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Xve(t,e),ET(t,{isEnd:!1})}function Gyt(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 nye(t,e,r){var n=Byt(t,e);return n&&n!==OT?n.clipPath(r,t._transform):lr(r)}function Iqr(t){var e=t7(t[0][0],t[1][0]),r=t7(t[0][1],t[1][1]),n=q5(t[0][0],t[1][0]),i=q5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function Pqr(t,e,r){if(!(!t._brushType||Bqr(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=Zve(t,e,r);if(!t._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Qq={lineX:Yyt(0),lineY:Yyt(1),rect:{createCover:function(t,e){function r(n){return n}return Fyt({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=$yt(t);return Uyt(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){zyt(t,e,r,n)},updateCommon:eye,contain:aye},polygon:{createCover:function(t,e){var r=new gr;return r.add(new Ml({name:"main",style:tye(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new gc({name:"main",draggable:!0,drift:Kr(Mqr,t,e),ondragend:Kr(ET,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:nye(t,e,r)})},updateCommon:eye,contain:aye}};function Yyt(t){return{createCover:function(e,r){return Fyt({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=$yt(e),n=t7(r[0][t],r[1][t]),i=q5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,o=Byt(e,r);if(o!==OT&&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(),zyt(e,r,l,i)},updateCommon:eye,contain:aye}}function qyt(t){return t=oye(t),function(e){return ige(e,t)}}function jyt(t,e){return t=oye(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 Xyt(t,e,r){var n=oye(t);return function(i,a){return n.contain(a[0],a[1])&&!P0t(i,e,r)}}function oye(t){return pr.create(t)}var $qr=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 jve(n.getZr())).on("brush",Wt(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!Fqr(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=Uqr(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),d=u.width,h=r.axis.dim,f=l.getAxisLayout(h),p=lt({strokeContainThreshold:d},f),g=new $u(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,s,d,i),I8(o,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],d=Math.min(30,Math.abs(u)*.1),h=pr.create({x:l[0],y:-o/2,width:u,height:o});h.x-=d,h.width+=2*d,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:qyt(h),isTargetByCursor:Xyt(h,s,a),getLinearBrushOtherExtent:jyt(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(zqr(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}(Ki);function Fqr(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function zqr(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 Uqr(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var Vqr={type:"axisAreaSelect",event:"axisAreaSelected"};function Gqr(t){t.registerAction(Vqr,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 Qqr={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Kyt(t){t.registerComponentView(pqr),t.registerComponentModel(mqr),t.registerCoordinateSystem("parallel",Aqr),t.registerPreprocessor(uqr),t.registerComponentModel(qve),t.registerComponentView($qr),z5(t,"parallel",qve,Qqr),Gqr(t)}function Hqr(t){Xr(Kyt),t.registerChartView(rqr),t.registerSeriesModel(aqr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,cqr)}var Gy="sankey",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.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=Tve(a,i,this,!0,d);return u.data;function d(h,f){h.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 d=this.getGraph().getNodeByIndex(r),h=d.getLayout().value,f=this.getDataParams(r,i).data.name;return fs("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},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."+Gy,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}(Pi),Yqr=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}(),qqr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Yqr},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(){Dy(this)},e.prototype.downplay=function(){Ly(this)},e}(yn),jqr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Gy,r._mainGroup=new gr,r}return e.prototype.init=function(r,n){this._controller=new vT(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),o=this._mainGroup,s=r.layoutInfo,l=s.width,u=s.height,d=r.getData(),h=r.getData("edge"),f=r.get("orient");o.removeAll(),o.x=s.x,o.y=s.y,this._updateViewCoordSys(r,i),Rq(r,i,this._controller,dvt(o),null),a.eachEdge(function(p){var g=new qqr,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(),O=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=(O!=null?O*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=O!=null?O*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()),Zyt(g.style,f,p);var B=""+v.get("value"),V=Ps(v,"edgeLabel");al(g,V,{labelFetcher:{getFormattedLabel:function(G,H,j,q,ne,X){return r.getFormattedLabel(G,H,"edge",q,$d(ne,V.normal&&V.normal.get("formatter"),B),X)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");Is(g,v,"lineStyle",function(G){var H=G.getItemStyle();return Zyt(H,f,p),H}),o.add(g),h.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});al(w,Ps(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),Is(w,m),o.add(w),d.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"))}),d.eachItemGraphicEl(function(p,g){var m=d.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:d.getRawIndex(g),localX:this.shape.x/l,localY:this.shape.y/u})},p.draggable=!0,p.cursor="move")}),!this._data&&r.isAnimationEnabled()&&o.setClipPath(Xqr(o.getBoundingRect(),r,function(){o.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){ow(this.group,a0,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=sve(r,n,i.x,i.y,i.width,i.height);ow(this.group,a0,a,this._firstRender?null:r)},e.type=Gy,e}(Ei);function Zyt(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 RS(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function Xqr(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 Kqr=Ms(Gy,Zqr);function Zqr(t,e){t.eachSeriesByType(Gy,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Ns(r,e).refContainer,o=ba(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),d=u.nodes,h=u.edges;ejr(d);var f=oi(d,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");Jqr(d,h,n,i,s,l,p,g,m)})}function Jqr(t,e,r,n,i,a,o,s,l){tjr(t,e,r,i,a,s,l),ajr(t,e,a,i,n,o,s),pjr(t,s)}function ejr(t){fe(t,function(e){var r=uw(e.outEdges,Hq),n=uw(e.inEdges,Hq),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function tjr(t,e,r,n,i,a,o){for(var s=[],l=[],u=[],d=[],h=0,f=0;f=0;y&&v.depth>p&&(p=v.depth),m.setLayout({depth:y?v.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var b=0;bh-1?p:h-1;o&&o!=="left"&&rjr(t,o,a,T);var C=a==="vertical"?(i-r)/T:(n-r)/T;ijr(t,C,a)}function Jyt(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function rjr(t,e,r,n){if(e==="right"){for(var i=[],a=t,o=0;a.length;){for(var s=0;s0;a--)l*=.99,ljr(s,l,o),sye(s,i,r,n,o),fjr(s,l,o),sye(s,i,r,n,o)}function ojr(t,e){var r=[],n=e==="vertical"?"y":"x",i=fpe(t,function(a){return a.getLayout()[n]});return Dl(i.keys),fe(i.keys,function(a){r.push(i.buckets.get(a))}),r}function sjr(t,e,r,n,i,a){var o=1/0;fe(t,function(s){var l=s.length,u=0;fe(s,function(h){u+=h.getLayout().value});var d=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;d0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=d-e-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),d=s;for(var p=h-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[f]+e-d,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]}})}function ljr(t,e,r){fe(t.slice().reverse(),function(n){fe(n,function(i){if(i.outEdges.length){var a=uw(i.outEdges,cjr,r)/uw(i.outEdges,Hq);if(isNaN(a)){var o=i.outEdges.length;a=o?uw(i.outEdges,ujr,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-cw(i,r))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-cw(i,r))*e;i.setLayout({y:l},!0)}}})})}function cjr(t,e){return cw(t.node2,e)*t.getValue()}function ujr(t,e){return cw(t.node2,e)}function djr(t,e){return cw(t.node1,e)*t.getValue()}function hjr(t,e){return cw(t.node1,e)}function cw(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Hq(t){return t.getValue()}function uw(t,e,r){for(var n=0,i=t.length,a=-1;++ao&&(o=l)}),fe(n,function(s){var l=new sl({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),d=s.getModel().get(["itemStyle","color"]);d!=null?(s.setVisual("color",d),s.setVisual("style",{fill:d})):(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 vjr(t){t.registerChartView(jqr),t.registerSeriesModel(Wqr),t.registerLayout(Kqr),t.registerVisual(gjr),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:Ym,subType:Gy,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),ove(t,Ym,Gy)}var e1t=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 d=["x","y"],h=u==="horizontal"?0:1,f=this._baseAxisDim=d[h],p=d[1-h],g=[i,a],m=g[h].get("type"),v=g[1-h].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:EY(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:EY(v),dimsDef:x.slice()}];return $5(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:Kr(Wdt,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 Wq(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 _jr={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==Ll){var n="";si(n)}var i=Ejr(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Rjr(t){t.registerSeriesModel(t1t),t.registerChartView(yjr),t.registerLayout(Sjr),t.registerTransform(_jr),Ojr(t)}var dw="candlestick",i1t=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."+dw,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}(Pi);Go(i1t,e1t,!0);var Djr=["itemStyle","borderColor"],Ljr=["itemStyle","borderColor0"],Mjr=["itemStyle","borderColorDoji"],Ijr=["itemStyle","color"],Pjr=["itemStyle","color0"];function lye(t,e){return e.get(t>0?Ijr:Pjr)}function cye(t,e){return e.get(t===0?Mjr:t>0?Djr:Ljr)}var Njr={seriesType:dw,plan:YS(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=lye(s,o),l.stroke=cye(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");lt(u,l)}}}}}},Bjr=["color","borderColor"],$jr=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){qx(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(),d=s&&uT(l,!1,r);this._data||a.removeAll();var h=a1t(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=s?Wq(u,p):SB;if(g===CB)return;var m=uye(p,f,h,!0);ua(m,{shape:{points:p.ends}},r,f),N5(g===TB,m,d),dye(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?Wq(u,m):SB;if(v===CB){a.remove(g);return}g?(qn(g,{shape:{points:m.ends}},r,f),ip(g)):g=uye(m,f,h),dye(g,n,f,o),N5(v===TB,g,d),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(),o1t(r,this.group);var n=r.get("clip",!0)?uT(r.coordinateSystem,!1,r):null;N5(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o=a1t(n),s;(s=r.next())!=null;){var l=i.getItemLayout(s),u=uye(l,s,o);dye(u,i,s,a),u.incremental=zm(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){o1t(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),N5(!1,this.group,null),this._data=null},e.type=dw,e}(Ei),Fjr=function(){function t(){}return t}(),zjr=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 Fjr},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 uye(t,e,r,n){var i=t.ends;return new zjr({shape:{points:n?Ujr(i,r,t):i},z2:100})}function dye(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,Is(t,i);var o=e.getItemLayout(r).sign;fe(t.states,function(l,u){var d=i.getModel(u),h=lye(o,d),f=cye(o,d)||h,p=l.style||(l.style={});h&&(p.fill=h),f&&(p.stroke=f)});var s=i.getModel("emphasis");Ea(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function Ujr(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function a1t(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var Vjr=function(){function t(){}return t}(),hye=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 Vjr},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 G=z.slice(),H=z.slice();G[i]=BW(G[i]+n/2,1,!1),H[i]=BW(H[i]-n/2,1,!0),U?V.push(G,H):V.push(H,G)}function F(V,z,U){var G=I(V,U),H=I(z,U);return G[i]-=n/2,H[i]-=n/2,{x:G[0],y:G[1],width:a?n:H[0]-G[0],height:a?H[1]-G[1]:n}}function B(V){return V[i]=BW(V[i],1),V}}function g(m,v){for(var y=r0(m.count*4),b=0,x,w=[],A=[],S,T=v.getStore(),C=!!t.get(["itemStyle","borderColorDoji"]);(S=m.next())!=null;){var O=T.get(s,S),E=T.get(u,S),_=T.get(d,S),P=T.get(h,S),L=T.get(f,S);if(isNaN(O)||isNaN(P)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=s1t(T,S,E,_,d,C),w[i]=O,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 s1t(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 Wjr(t,e){var r=t.getBaseAxis(),n=vc(r,{fromStat:{key:pT(dw)},min:1}).w,i=Gt(Jt(t.get("barMaxWidth"),n),n),a=Gt(Jt(t.get("barMinWidth"),1),n),o=t.get("barWidth");return o!=null?Gt(o,n):rn(Oi(n/2,i),a)}function Yjr(t){Qjr(t,function(){var e=pT(dw);Hme(t,{key:e,seriesType:dw,getMetrics:L0e}),VY(e,oq(e))})}function qjr(t){t.registerChartView($jr),t.registerSeriesModel(i1t),t.registerPreprocessor(Gjr),t.registerVisual(Njr),t.registerLayout(Hjr),Yjr(t)}function l1t(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 jjr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=new wB(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)/d*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ur(h)?f=h(i):f=h,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 yy(r.__p1,r.__cp1)+yy(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=Rl,d=Ofe;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<=1?d(n[0],a[0],i[0],o):d(i[0],a[0],n[0],1-o),f=r.__t<=1?d(n[1],a[1],i[1],o):d(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-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 d=(n-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];r.x=h[0]*(1-d)+d*f[0],r.y=h[1]*(1-d)+d*f[1];var p=r.__t<=1?f[0]-h[0]:h[0]-f[0],g=r.__t<=1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},e}(u1t),eXr=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),tXr=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 eXr},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+h)/2-(d-f)*a,g=(d+f)/2-(h-u)*a;r.quadraticCurveTo(p,g,h,f)}else r.lineTo(h,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 h=a[u++],f=a[u++],p=1;p0){var v=(h+g)/2-(f-m)*o,y=(f+m)/2-(g-h)*o;if(qct(h,f,v,y,g,m,s,r,n))return l}else if(Gx(h,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}(),h1t={seriesType:"lines",plan:YS(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,d=i.start;d0&&d&&u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),o.updateData(a);var h=r.get("clip",!0)&&uT(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):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(),zm(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=h1t.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 rXr:new Nve(o?a?Jjr:d1t:a?u1t:Pve),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=uge(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}(Ei),iXr=typeof Uint32Array>"u"?Array:Uint32Array,aXr=typeof Float64Array>"u"?Array:Float64Array;function f1t(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),TH([i,r[0],r[1]])}))}var oXr=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||[],f1t(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(f1t(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=k_(this._flatCoords,n.flatCoords),this._flatCoordsOffset=k_(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}(Pi);function Yq(t){return t instanceof Array||(t=[t,t]),t}var sXr={seriesType:"lines",reset:function(t){var e=Yq(t.get("symbol")),r=Yq(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=Yq(s.getShallow("symbol",!0)),u=Yq(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 lXr(t){t.registerChartView(nXr),t.registerSeriesModel(oXr),t.registerLayout(h1t),t.registerVisual(sXr)}var cXr=256,uXr=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=rl.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"),d=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),p=e.length;h.width=r,h.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),h},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=rl.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 dXr(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 fXr=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()):cmt(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&&(cmt(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){qx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=dT(s,"cartesian2d"),u=dT(s,"matrix"),d,h,f,p;if(l){var g=s.getAxis("x"),m=s.getAxis("y");d=vc(g).w+.5,h=vc(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=Ps(r),T=r.getModel("emphasis"),C=T.get("focus"),O=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]-d/2,y:I[1]-h/2,width:d,height:h},style:R})}else if(u){var N=s.dataToLayout([y.get(_[0],P),y.get(_[1],P)]).rect;if(uc(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(uc(N.x)||uc(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"),O=V.get("blurScope"),E=V.get("disabled"),S=Ps(B)}L.shape.r=A;var z=r.getRawValue(P),U="-";z&&z[2]!=null&&(U=z[2]+""),al(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,O,E),L.incremental=zm(r,o),o&&(L.states.emphasis.hoverLayer=e5),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 uXr;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var d=r.getViewRect().clone(),h=r.getRoamTransform();d.applyTransform(h);var f=Math.max(d.x,0),p=Math.max(d.y,0),g=Math.min(d.width+d.x,a.getWidth()),m=Math.min(d.height+d.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,O){var E=r.dataToPoint([T,C]);return E[0]-=f,E[1]-=p,E.push(O),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?hXr(w,i.option.range):dXr(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 il({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Ei),pXr=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 Km(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=c5.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}(Pi);function gXr(t){t.registerChartView(fXr),t.registerSeriesModel(pXr)}var mXr=["itemStyle","borderWidth"],p1t=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pye=new qm,vXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=_B,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(),d=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:d,valueDim:p1t[+d],categoryDim:p1t[1-+d]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=w1t(o,g),v=g1t(o,g,m,f),y=A1t(o,f,v);o.setItemGraphicEl(g,y),a.add(y),C1t(y,f,v)}}).update(function(g,m){var v=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(v);return}var y=w1t(o,g),b=g1t(o,g,y,f),x=T1t(o,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),o.setItemGraphicEl(g,null),v=null),v?TXr(v,f,b):v=A1t(o,f,b,!0),o.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),C1t(v,f,b)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&S1t(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?uT(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){S1t(a,Cr(o).dataIndex,r,o)}):i.removeAll()},e.type=_B,e}(Ei);function g1t(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,d=r.get("symbolPatternSize")||2,h=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:d,rotation:u,animationModel:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};yXr(r,a,i,n,f),bXr(t,e,i,a,o,f.boundingLength,f.pxSign,d,n,f),xXr(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=jS(r.get("symbolOffset"),p);return wXr(r,p,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function yXr(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),d;if(ft(o)){var h=[gye(s,o[0])-l,gye(s,o[1])-l];h[1]=0?1:-1:d>0?1:-1}function gye(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function bXr(t,e,r,n,i,a,o,s,l,u){var d=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),p=t.getItemVisual(e,"symbolSize"),g;ft(p)?g=p.slice():p==null?g=["100%","100%"]:g=[p,p],g[h.index]=Gt(g[h.index],f),g[d.index]=Gt(g[d.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[d.index]*=(l.isHorizontal?-1:1)*o}function xXr(t,e,r,n,i){var a=t.get(mXr)||0;a&&(pye.attr({scaleX:e[0],scaleY:e[1],rotation:r}),pye.updateTransform(),a/=pye.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function wXr(t,e,r,n,i,a,o,s,l,u,d,h){var f=d.categoryDim,p=d.valueDim,g=h.pxSign,m=Math.max(e[p.index]+s,0),v=m;if(n){var y=Math.abs(l),b=Hc(t.get("symbolMargin"),"15%")+"",x=!1;b.lastIndexOf("!")===b.length-1&&(x=!0,b=b.slice(0,b.length-1));var w=Gt(b,e[p.index]),A=Math.max(m+w*2,0),S=x?0:w*2,T=lpe(n),C=T?n:k1t((y+S)/A),O=y-C*m;w=O/2/(x?C:Math.max(C-1,1)),A=m+w*2,S=x?0:w*2,!T&&n!=="fixed"&&(C=u?k1t((Math.abs(u)+S)/A):0),v=C*A-S,h.repeatTimes=C,h.symbolMargin=w}var E=g*(v/2),_=h.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=h.bundlePosition=[];P[f.index]=r[f.xy],P[p.index]=r[p.xy];var L=h.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=h.clipShape={};R[f.xy]=-r[f.xy],R[f.wh]=d.ecSize[f.wh],R[p.xy]=0,R[p.wh]=r[p.wh]}function m1t(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 v1t(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,d=0,h=a[e.valueDim.index]+o+r.symbolMargin*2;for(mye(t,function(m){m.__pictorialAnimationIndex=d,m.__pictorialRepeatTimes=u,d0:y<0)&&(b=u-1-m),v[l.index]=h*(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 y1t(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?j5(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=m1t(r),i.add(a),j5(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 b1t(t,e,r){var n=lt({},e.barRectShape),i=t.__pictorialBarRect;i?j5(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 x1t(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],NS[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function w1t(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=AXr,r.isAnimationEnabled=SXr,r}function AXr(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function SXr(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function A1t(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?v1t(i,e,r):y1t(i,e,r),b1t(i,r,n),x1t(i,e,r,n),i.__pictorialShapeStr=T1t(t,r),i.__pictorialSymbolMeta=r,i}function TXr(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?v1t(t,e,r,!0):y1t(t,e,r,!0),b1t(t,r,!0),x1t(t,e,r,!0)}function S1t(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];mye(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),fe(a,function(o){Yx(o,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function T1t(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function mye(t,e,r){fe(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function j5(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&NS[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function C1t(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"),d=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");mye(t,function(m){if(m instanceof il){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,al(g,Ps(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:P5(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),Ea(t,d,h,a.get("disabled"))}function k1t(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var CXr=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."+_B,e.dependencies=["grid"],e.defaultOption=jx(RB.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}(RB);function kXr(t){t.registerChartView(vXr),t.registerSeriesModel(CXr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Fmt(_B)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,zmt(_B)),Vmt(t)}var vye=2,X5="themeRiver",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.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new F5(Wt(this.getData,this),Wt(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=fpe(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=h)}return{y0:i,max:a}}function MXr(t){t.registerChartView(EXr),t.registerSeriesModel(OXr),t.registerLayout(RXr),t.registerProcessor(DB(X5))}var IXr=2,PXr=4,E1t=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;o.z2=IXr,o.textConfig={inside:!0},Cr(o).seriesIndex=n.seriesIndex;var s=new $n({z2:PXr,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"),d=n.getLayout(),h=lt({},d);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=x5(p,o));var g=i0(l.getModel("itemStyle"),h,!0);lt(h,g),fe(Mu,function(b){var x=s.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=i0(w,h);A&&(x.shape=A)}),r?(s.setShape(h),s.shape.r=d.r0,ua(s,{shape:{r:d.r}},i,n.dataIndex)):(qn(s,{shape:h},i),ip(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"?k_(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),d=Math.sin(l),h=this,f=h.getTextContent(),p=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)R&&!hS(M-R)&&M0?(o.virtualPiece?o.virtualPiece.updateData(!1,b,r,n,i):(o.virtualPiece=new E1t(b,r,n,i),d.add(o.virtualPiece)),x.piece.off("click"),o.virtualPiece.on("click",function(w){o._rootToNode(x.parentNode)})):o.virtualPiece&&(d.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 d=l.get("target",!0)||"_blank";KW(u,d)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:yye,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=_T,e}(Ei),zXr=Ms(_T,UXr);function UXr(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=zH(s,(n.depth-1)/(a-1)*.5)),s}t.eachSeriesByType(_T,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 D1t=Math.PI/180,VXr=Ms(_T,GXr);function GXr(t,e){t.eachSeriesByType(_T,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=Gt(n[0],a),u=Gt(n[1],o),d=Gt(i[0],s/2),h=Gt(i[1],s/2),f=-r.get("startAngle")*D1t,p=r.get("minAngle")*D1t,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&L1t(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=(h-d)/(S||1),C=r.get("clockwise"),O=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&&O?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(eKr,t)}}}function rKr(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 nKr(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 I1t={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},P1t=En(I1t);qf(ky,function(t,e){return t[e]=1,t},{}),ky.join(", ");var qq=["","style","shape","extra"],K5=Qr();function bye(t,e,r,n,i){var a=t+"Animation",o=Z_(t,n,i)||{},s=K5(e).userDuring;return o.duration>0&&(o.during=s?Wt(lKr,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),lt(o,r[a]),o}function jq(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=K5(t),u=e.style;l.userDuring=e.during;var d={},h={};if(uKr(t,e,h),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else aKr(t,e,i||0,r,d);N1t(t,e),u?t.dirty():t.markRedraw()}function N1t(t,e){for(var r=K5(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function oKr(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof rp&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof yn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var s0={},sKr={setTransform:function(t,e){return s0.el[t]=e,this},getTransform:function(t){return s0.el[t]},setShape:function(t,e){var r=s0.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=s0.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=s0.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=s0.el.style;if(e)return e[t]},setExtra:function(t,e){var r=s0.el.extra||(s0.el.extra={});return r[t]=e,this},getExtra:function(t){var e=s0.el.extra;if(e)return e[t]}};function lKr(){var t=this,e=t.el;if(e){var r=K5(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}s0.el=e,n(sKr)}}function B1t(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]={}),RT(l))lt(o,a);else for(var u=ji(l),d=0;d=0){!o&&(o=n[t]={});for(var p=En(a),d=0;d=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=d);var I=e.getItemVisual(M,"style"),N=I&&I.fill,F=I&&I.opacity,B=x(M,hw).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:$t(N)?N:tt.color.neutral99},z=w(M,hw),U=Xi(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,hw),P5(e,M)):null;var G=GW(z,V,!1);return E(D,B),B=fmt(B,U,G),D&&O(B,D),B.legacy=!0,B}function C(D,M){M==null&&(M=d);var I=x(M,Hy).getItemStyle(),N=w(M,Hy),F=Xi(N,null,null,!0,!0);F.text=N.getShallow("show")?$d(t.getFormattedLabel(M,Hy),t.getFormattedLabel(M,hw),P5(e,M)):null;var B=GW(N,null,!0);return E(D,I),I=fmt(I,F,B),D&&O(I,D),I.legacy=!0,I}function O(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=d),Kt(M1t,D)){var I=e.getItemVisual(M,"style");return I?I[M1t[D]]:null}if(Kt(WXr,D))return e.getItemVisual(M,D)}function P(D){if(o.type==="cartesian2d"){var M=o.getBaseAxis();return xGr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return hge(D,r)}}function wKr(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 _ye(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&&V1t(e,n,i)&&(o=Nr(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Oye(n),s&&vKr(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),pp.normal.cfg=pp.normal.conOpt=pp.emphasis.cfg=pp.emphasis.conOpt=pp.blur.cfg=pp.blur.conOpt=pp.select.cfg=pp.select.conOpt=null,pp.isLegacy=!1,SKr(u,r,n,i,l,pp),AKr(u,r,n,i,l),Eye(t,u,r,n,pp,i,l),Kt(n,"info")&&(Qy(u).info=n.info);for(var d=0;d=0?a.replaceAt(u,o):a.add(u),u}function V1t(t,e,r){var n=Qy(t),i=e.type,a=e.shape,o=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&EKr(a)&&W1t(a)!==n.customPathData||i==="image"&&Kt(o,"image")&&o.image!==n.customImagePath}function AKr(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&&V1t(o,a,n)&&(o=null),o||(o=Oye(a),t.setClipPath(o)),Eye(null,o,e,a,null,n,i)}}function SKr(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){G1t(r,null,a),G1t(r,Hy,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 d=t.getTextContent();if(o===!1)d&&t.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},d?d.clearStates():(d=Oye(o),t.setTextContent(d)),Eye(null,d,e,o,null,n,i);for(var h=o&&o.style,f=0;f=d;p--){var g=e.childAt(p);CKr(e,g,i)}}}function CKr(t,e,r){e&&Xq(e,Qy(t).option,r)}function kKr(t){new By(t.oldChildren,t.newChildren,Q1t,Q1t,t).add(H1t).update(H1t).remove(OKr).execute()}function Q1t(t,e){var r=t&&t.name;return r??gKr+e}function H1t(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 OKr(t){var e=this.context,r=e.oldChildren[t];r&&Xq(r,Qy(r).option,e.seriesModel)}function W1t(t){return t&&(t.pathData||t.d)}function EKr(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function _Kr(t){t.registerChartView(yKr),t.registerSeriesModel(YXr)}var DT=Qr(),Y1t=lr,Lye=Wt,Mye=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 d=u.graphicKey;d!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=d;var h=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(q1t,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}K1t(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&&vc(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=DT(e).pointerEl=new NS[a.type](Y1t(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=DT(e).labelEl=new $n(Y1t(r.label));e.add(a),X1t(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=DT(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=DT(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),X1t(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=n5(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){wy(u.event)},onmousedown:Lye(this._onHandleDragMove,this,0,0),drift:Lye(this._onHandleDragMove,this),ondragend:Lye(this._onHandleDragEnd,this)}),n.add(i)),K1t(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,p5(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){q1t(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Iye(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(Iye(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Iye(i)),DT(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),j8(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 q1t(t,e,r,n){j1t(DT(r).lastProp,n)||(DT(r).lastProp=n,e?qn(r,n,t):(r.stopAnimation(),r.attr(n)))}function j1t(t,e){if(yr(t)&&yr(e)){var r=!0;return fe(e,function(n,i){r=r&&j1t(t[i],n)}),!!r}else return t===e}function X1t(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Iye(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function K1t(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 Pye(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 Z1t(t,e,r,n,i){var a=r.get("value"),o=J1t(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=l5(s.get("padding")||0),u=s.getFont(),d=JH(o,u),h=i.position,f=d.width+l[1]+l[3],p=d.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=p),m==="middle"&&(h[1]-=p/2),RKr(h,f,p,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:Xi(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function RKr(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 J1t(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:FY(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};fe(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,h=u&&u.getDataParams(d);h&&s.seriesData.push(h)}),$t(o)?a=o.replace("{value}",a):ur(o)&&(a=o(s))}return a}function Nye(t,e,r){var n=Oa();return Ay(n,n,r.rotation),cg(n,n,r.position),gg([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function ebt(t,e,r,n,i,a){var o=$u.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Z1t(e,n,i,a,{position:Nye(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Bye(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function tbt(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function rbt(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function $ye(t,e,r){return vc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function Fye(t,e,r){return[rn(Oi(e[0],e[1]),t-r/2),Oi(t+r/2,rn(e[0],e[1]))]}var DKr=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"),d=s.getGlobalExtent(),h=nbt(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var p=Pye(a),g=LKr[u](s,f,d,h,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=aq(l.getRect(),i);ebt(n,r,m,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=aq(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Nye(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=nbt(s,o).getOtherAxis(o).getGlobalExtent(),d=o.dim==="x"?0:1,h=[r.x,r.y];h[d]+=n[d],h[d]=Oi(l[1],h[d]),h[d]=rn(l[0],h[d]);var f=(u[1]+u[0])/2,p=[f,f];p[d]=h[d];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:p,tooltipOption:g[d]}},e}(Mye);function nbt(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var LKr={line:function(t,e,r,n){var i=Bye([e,n[0]],[e,n[1]],ibt(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=$ye(t,i,a),s=n[1]-n[0],l=Fye(e,r,o),u=l[0],d=l[1];return{type:"Rect",shape:tbt([u,n[0]],[d-u,s],ibt(t))}}};function ibt(t){return t.dim==="x"?0:1}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.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),Wy=Qr(),IKr=fe;function abt(t,e,r){if(!Dn.node){var n=e.getZr();Wy(n).records||(Wy(n).records={}),PKr(n,e);var i=Wy(n).records[t]||(Wy(n).records[t]={});i.handler=r}}function PKr(t,e){if(Wy(t).initialized)return;Wy(t).initialized=!0,r("click",Kr(zye,"click")),r("mousemove",Kr(zye,"mousemove")),r("mousewheel",Kr(zye,"mousewheel")),r("globalout",BKr);function r(n,i){t.on(n,function(a){var o=$Kr(e);IKr(Wy(t).records,function(s){s&&i(s,a,o.dispatchAction)}),NKr(o.pendings,e)})}}function NKr(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 BKr(t,e,r){t.handler("leave",null,r)}function zye(t,e,r,n){e.handler(t,r,n)}function $Kr(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 Uye(t,e){if(!Dn.node){var r=e.getZr(),n=(Wy(r).records||{})[t];n&&(Wy(r).records[t]=null)}}var FKr=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";abt("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){Uye("axisPointer",n)},e.prototype.dispose=function(r,n){Uye("axisPointer",n)},e.type="axisPointer",e}(Ki);function obt(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=pS(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(),d=l.getOtherAxis(u),h=d.dim,f=u.dim,p=h==="x"||h==="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 sbt=Qr();function zKr(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){Jq(i)&&(i=obt({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Jq(i),u=a.axesInfo,d=s.axesInfo,h=n==="leave"||Jq(i),f={},p={},g={list:[],map:{}},m={showPointer:Kr(VKr,p),showTooltip:Kr(GKr,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=YKr(u,w);if(!h&&x&&(!u||T)){var C=T&&T.value;C==null&&!l&&(C=S.pointToData(i)),C!=null&&lbt(w,C,m,!1,f)}})});var v={};return fe(d,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,cbt(w),cbt(y)))),v[y.key]=T}})}),fe(v,function(y,b){lbt(d[b],y,m,!0,f)}),QKr(p,d,f),HKr(g,i,t,o),WKr(d,o,r),f}}function lbt(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=UKr(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 UKr(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 d=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(d,t,r);f=p.dataIndices,h=p.nestestValue}else{if(f=l.indicesOfNearest(n,d[0],t,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(d[0],f[0])}if(tp(h)){var g=t-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),fe(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function VKr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function GKr(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=LB(l),d=t.map[u];d||(d=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(d)),d.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 QKr(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 HKr(t,e,r,n){if(Jq(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 WKr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=sbt(n)[i]||{},o=sbt(n)[i]={};fe(t,function(d,h){var f=d.axisPointerModel.option;f.status==="show"&&d.triggerEmphasis&&fe(f.seriesDataIndices,function(p){o[p.seriesIndex+"|"+p.dataIndex]=p})});var s=[],l=[];function u(d){return{seriesIndex:d.seriesIndex,dataIndex:d.dataIndex}}fe(a,function(d,h){!o[h]&&l.push(u(d))}),fe(o,function(d,h){!a[h]&&s.push(u(d))}),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 YKr(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 cbt(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 Jq(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function r7(t){mT.registerAxisPointerClass("CartesianAxisPointer",DKr),t.registerComponentModel(MKr),t.registerComponentView(FKr),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=gQr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},zKr)}function qKr(t){Xr(k0t),Xr(r7)}var jKr=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(),d=l.getOtherAxis(s).getExtent(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=Pye(a),g=KKr[f](s,l,h,u,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),v=XKr(n,i,a,l,m);Z1t(r,i,a,o,v)},e}(Mye);function XKr(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,d,h;if(a.dim==="radius"){var f=Oa();Ay(f,f,s),cg(f,f,[n.cx,n.cy]),u=gg([o,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=$u.innerTextLayout(s,p*Math.PI/180,-1);d=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var v=n.cx,y=n.cy;d=Math.abs(u[0]-v)/m<.3?"center":u[0]>v?"left":"right",h=Math.abs(u[1]-y)/m<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:d,verticalAlign:h}}var KKr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:Bye(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=$ye(t,a,o),u;if(t.dim==="angle")u=rbt(e.cx,e.cy,i[0],i[1],(-r-l/2)*s,(-r+l/2)*s);else{var d=Fye(r,n,l),h=d[0],f=d[1];u=rbt(e.cx,e.cy,h,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},l0="polar",ubt=l0,ZKr=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=l0,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(pn),Vye=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);Go(Vye,R5);var JKr=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}(Vye),eZr=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}(Vye),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}(up);Gye.prototype.dataToRadius=up.prototype.dataToCoord,Gye.prototype.radiusToData=up.prototype.coordToData;var tZr=Qr(),Qye=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),d=JH(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(d.height,7),f=h/u;isNaN(f)&&(f=1/0);var p=Math.max(0,Math.floor(f)),g=tZr(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}(up);Qye.prototype.dataToAngle=up.prototype.dataToCoord,Qye.prototype.angleToData=up.prototype.coordToData;var dbt=["radius","angle"],rZr=function(){function t(e){this.dimensions=dbt,this.type=l0,this.cx=0,this.cy=0,this._radiusAxis=new Gye,this._angleAxis=new Qye,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,d=us;)u+=d*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,d=l-this.cy,h=u*u+d*d,f=this.r,p=this.r0;return f!==p&&h-o<=f*f&&h+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=hbt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=hbt(r);return i===this?this.pointToData(n):null},t}();function hbt(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function nZr(t,e,r){var n=e.get("center"),i=Ns(e,r).refContainer;t.cx=Gt(n[0],i.width)+i.x,t.cy=Gt(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=[Gt(s[0],o),Gt(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function iZr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(nT(n,L5),nT(i,L5),M5(n),M5(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 aZr(t){return t.mainType==="angleAxis"}function fbt(t,e){var r;if(t.type=uB(e),t.scale=O5(e,t.type,!1),t.onBand=fB(t.scale,e),t.inverse=e.get("inverse"),aZr(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 oZr={dimensions:dbt,create:function(t,e){var r=[];return t.eachComponent(ubt,function(n,i){var a=new rZr(i+"");a.update=iZr;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");fbt(o,l),fbt(s,u),nZr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===l0){var i=n.getReferringComponents(ubt,xo).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(rT(a.getRadiusAxis(),n,l0),rT(a.getAngleAxis(),n,l0))}}),r}},sZr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function ej(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 tj(t){var e=t.getRadiusAxis();return e.inverse?0:1}function pbt(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 lZr=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(d){if(!d.tick.offInterval){d=lr(d);var h=i.scale;d.coord=i.dataToCoord(_5(h,d.tick)),u.push(d)}}),pbt(u),pbt(s),fe(sZr,function(d){r.get([d,"show"])&&(!i.scale.isBlank()||d==="axisLine")&&cZr[d](this.group,r,a,s,l,o,u)},this)}},e.type="angleAxis",e}(mT),cZr={axisLine:function(t,e,r,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),d=tj(r),h=d?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new NS[p]({shape:{cx:r.cx,cy:r.cy,r:a[d],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new X_({shape:{cx:r.cx,cy:r.cy,r:a[d],r0:a[h]},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[tj(r)],u=vt(n,function(d){return new Qo({shape:ej(r,[l,l+s],d.coord)})});t.add(Hh(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[tj(r)],d=[],h=0;hy?"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:$u.isLabelSilent(e),style:Xi(p,{x:v[0],y:v[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:x,verticalAlign:w})});if(t.add(S),Iy({el:S,componentModel:e,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return S.isTruncated},value:h.rawLabel,tickIndex:f}}),d){var T=$u.makeAxisEventDataBase(e);T.targetType="axisLabel",T.value=h.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 d=[],h=0;h=0?"p":"n",O=x;y&&(n[a][T]||(n[a][T]={p:x,n:x}),O=n[a][T][C]);var E=void 0,_=void 0,P=void 0,L=void 0;if(d.dim==="radius"){var R=d.dataToCoord(S)-x,D=t.dataToCoord(T);ao(R)=L})}}function yZr(t,e){var r=gT(e,l0),n=vc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,o="20%",s="30%",l={};tT(t,r,function(v){var y=gbt(v);l[y]||a++,l[y]=l[y]||{width:0,maxWidth:0};var b=Gt(v.get("barWidth"),n),x=Gt(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={},d=Gt(o,n),h=Gt(s,1),f=(i-d)/(a+(a-1)*h);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=vbt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=vbt(r);return i===this?this.pointToData(n):null},t}();function vbt(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function _Zr(t,e){var r=[];return t.eachComponent(W0e,function(n,i){var a=new EZr(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")===kQr){var i=n.getReferringComponents(W0e,xo).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&rT(a.getAxis(),n,pq)}}),r}var RZr={create:_Zr,dimensions:mbt},ybt=["x","y"],DZr=["width","height"],LZr=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=rj(s),d=nj(l,u),h=nj(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=Pye(a),m=MZr[p](s,f,d,h,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=Hye(i);ebt(n,r,v,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=Hye(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Nye(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=rj(o),u=nj(s,l),d=[r.x,r.y];d[l]+=n[l],d[l]=Math.min(u[1],d[l]),d[l]=Math.max(u[0],d[l]);var h=nj(s,1-l),f=(h[1]+h[0])/2,p=[f,f];return p[l]=d[l],{x:d[0],y:d[1],rotation:r.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(Mye),MZr={line:function(t,e,r,n){var i=Bye([e,n[0]],[e,n[1]],rj(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=$ye(t,i,a),s=n[1]-n[0],l=Fye(e,r,o),u=l[0],d=l[1];return{type:"Rect",shape:tbt([u,n[0]],[d-u,s],rj(t))}}};function rj(t){return t.isHorizontal()?0:1}function nj(t,e){var r=t.getRect();return[r[ybt[e]],r[ybt[e]]+r[DZr[e]]]}var IZr=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}(Ki);function PZr(t){Xr(r7),mT.registerAxisPointerClass("SingleAxisPointer",LZr),t.registerComponentView(IZr),t.registerComponentView(CZr),t.registerComponentModel(gq),z5(t,"single",gq,gq.defaultOption),t.registerCoordinateSystem("single",RZr)}var NZr=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=US(r);t.prototype.init.apply(this,arguments),bbt(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),bbt(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 bbt(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 B7r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Xm(t,e,{type:"box",ignoreSize:i})}var BZr=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 d=a.dataToCalendarLayout([u],!1).tl,h=new nn({shape:{x:d[0],y:d[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},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"]),d=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var p=h.date;p.setMonth(p.getMonth()+1),h=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,d,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,d,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 Ml({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),d=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=d.tl,s[2*u.day+1]=d[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(r,n){return $t(r)&&r?Edt(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 d=0;return(a==="left"||a==="right")&&(d=Math.PI/2),{rotation:d,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]],d=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,p={top:[d,u[f][1]],bottom:[d,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},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:Xi(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],d=r[1];return i==="horizontal"?(d=d+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:d,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"),d=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||$t(s))&&(s&&(n=yge(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=d==="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/Wye)-Math.floor(r[0].time/Wye)+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 d=Math.floor((i+r[0].day+6)/7),h=n?-d+1:d-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:d,nthWeek:h,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){U8({targetModel:a,coordSysType:"calendar",coordSysProvider:Pdt})}),n},t.dimensions=["time","value"],t}();function Yye(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function FZr(t){t.registerComponentModel(NZr),t.registerComponentView(BZr),t.registerCoordinateSystem("calendar",$Zr)}var Yy={level:1,leaf:2,nonLeaf:3},qy={none:0,all:1,body:2,corner:3};function qye(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 xbt(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 wbt(t,e,r,n,i){Abt(t[0],e,i,r,n,0),Abt(t[1],e,i,r,n,1)}function Abt(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?(Sbt(t,e,s,u,i,a,0),l>1&&Sbt(t,e,s,u,i,a,l-1)):t[0]=t[1]=NaN,u){var d=-i[Mr[1-a]].getLocatorCount(a),h=i[Mr[a]].getLocatorCount(a)-1;r===qy.body?d=rn(0,d):r===qy.corner&&(h=Oi(-1,h)),h=e[0]&&t[0]<=e[1]}function kbt(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 VZr(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 Obt(t,e,r,n){var i=qye(e[n][0],r,n),a=qye(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 n7(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function GZr(t){return t&&(t.type===Yy.leaf||t.type===Yy.nonLeaf)?t:null}function aj(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var Ebt=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=QZr(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 zx;for(o.resetLayoutIterator(A,n);A.next();)S(A.item);for(a.resetLayoutIterator(A,n);A.next();)S(A.item);function S(T){uc(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 Nbt(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;uj(n.rect,t,n.id,n.span,e),uj(n.rect,1-t,n.id,n.span,e),n.type===Yy.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[_o[t]])}}function Bbt(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;uj(i,0,a,n,e),uj(i,1,a,n,e)}})}function uj(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 nJr(t,e,r){var n=lW(t,r[_o[e]]);return e1e(n,r[_o[e]])}function e1e(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function t1e(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var yc={inBody:1,inCorner:2,outside:3},c0={x:null,y:null,point:[]};function $bt(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)),d=o.shouldShow()?o.getUnitLayoutInfo(e,-1):null,h=t.point[e]=n[e];if(!l&&!d){t[Mr[e]]=yc.outside;return}if(i===qy.body){l?(t[Mr[e]]=yc.inBody,h=Oi(s.xy+s.wh,rn(l.xy,h)),t.point[e]=h):t[Mr[e]]=yc.outside;return}else if(i===qy.corner){d?(t[Mr[e]]=yc.inCorner,h=Oi(d.xy+d.wh,rn(u.xy,h)),t.point[e]=h):t[Mr[e]]=yc.outside;return}var f=l?l.xy:d?d.xy+d.wh:NaN,p=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){t[Mr[e]]=yc.outside;return}h=g}t.point[e]=h,t[Mr[e]]=f<=h&&h<=g?yc.inBody:p<=h&&h<=f?yc.inCorner:yc.outside}function Fbt(t,e,r,n){var i=1-r;if(t[Mr[r]]!==yc.outside)for(n[Mr[r]].resetCellIterator(Jye);Jye.next();){var a=Jye.item;if(Ubt(t.point[r],a.rect,r)&&Ubt(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function zbt(t,e,r,n){if(t[Mr[r]]!==yc.outside){var i=t[Mr[r]]===yc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(cj,r);cj.next();)if(iJr(t.point[r],cj.item)){e[r]=cj.item.id[Mr[r]];return}}}function iJr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function Ubt(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[_o[r]]}function aJr(t){t.registerComponentModel(qZr),t.registerComponentView(JZr),t.registerCoordinateSystem("matrix",rJr)}function oJr(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 Vbt(t,e){var r;return fe(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function sJr(t,e,r){var n=lt({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Gr(i,n,!0),Xm(i,n,{ignoreSize:!0}),zdt(r,i),dj(r,i),dj(r,i,"shape"),dj(r,i,"style"),dj(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var Gbt=["transition","enterFrom","leaveTo"],lJr=Gbt.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function dj(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?Gbt:lJr,i=0;i=0;d--){var h=i[d],f=Ls(h.id,null),p=f!=null?o.get(f):null;if(p){var g=p.parent,y=gp(g),b=g===a?{width:s,height:l}:{width:y.width,height:y.height},x={},w=tY(p,h,b,null,{hv:h.hv,boundingMode:h.bounding},x);if(!gp(p).isNew&&w){for(var A=h.transition,S={},T=0;T=0)?S[C]=O:p[C]=O}qn(p,S,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){hj(i,gp(i).option,n,r._lastGraphicModel)}),this._elMap=qt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Ki);function r1e(t){var e=Kt(Qbt,t)?Qbt[t]:M8(t),r=new e({});return gp(r).type=t,r}function Hbt(t,e,r,n){var i=r1e(r);return e.add(i),n.set(t,i),gp(i).id=t,gp(i).isNew=!0,i}function hj(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){hj(a,e,r,n)}),Xq(t,e,n),r.removeKey(gp(t).id))}function Wbt(t,e,r,n){t.isGroup||fe([["cursor",rp.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 hJr(t){return t=lt({},t),fe(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Ndt),function(e){delete t[e]}),t}function fJr(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 pJr(t){t.registerComponentModel(uJr),t.registerComponentView(dJr),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 Ybt=["x","y","radius","angle","single"],gJr=Qr(),mJr=["cartesian2d","polar","singleAxis"];function vJr(t){var e=t.get("coordinateSystem");return Nr(mJr,e)>=0}function pw(t){return t+"Axis"}function yJr(t,e){var r=qt(),n=[],i=qt();t.eachComponent({mainType:"dataZoom",query:e},function(d){i.get(d.uid)||s(d)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(d){!i.get(d.uid)&&l(d)&&(s(d),a=!0)}function s(d){i.set(d.uid,!0),n.push(d),u(d)}function l(d){var h=!1;return d.eachTargetAxis(function(f,p){var g=r.get(f);g&&g[p]&&(h=!0)}),h}function u(d){d.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function qbt(t){var e=t.ecModel,r={infoList:[],infoMap:qt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(pw(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 jbt(t){var e=gJr(mft(t));return e.axisProxyMap||(e.axisProxyMap=qt())}function fj(t){if(t)return jbt(t.ecModel).get(t.uid)}function bJr(t,e){jbt(t.ecModel).set(t.uid,e)}function Xbt(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?fj(r.model):null}var n1e=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}(),a7=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=Kbt(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=Kbt(r);Gr(this.option,r,!0),Gr(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(Ybt,function(i){var a=this.getReferringComponents(pw(i),o8r);if(a.specified){n=!0;var o=new n1e;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(d){return d.get("orient",!0)===n}});l(s,"single")}function l(u,d){var h=u[0];if(h){var f=new n1e;if(f.add(h.componentIndex),r.set(d,f),a=!1,d==="x"||d==="y"){var p=h.getReferringComponents("grid",xo).models[0];p&&fe(u,function(g){h.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",xo).models[0]&&f.add(g.componentIndex)})}}}a&&fe(Ybt,function(u){if(a){var d=i.findComponents({mainType:pw(u),filter:function(f){return f.get("type",!0)==="category"}});if(d[0]){var h=new n1e;h.add(d[0].componentIndex),r.set(u,h),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(pw(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 fj(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(pw(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 fj(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(d,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(d,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}(),SJr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(pw(o),s);i(o,s,l,a)})})}var r=[];e(function(i,a,o,s){if(!fj(o)){var l=new AJr(i,a,s,t);r.push(l),bJr(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=Xbt(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 TJr(t){t.registerAction("dataZoom",function(e,r){var n=yJr(r,e);fe(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var CJr=V_();function a1e(t){CJr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,SJr),TJr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function kJr(t){t.registerComponentModel(xJr),t.registerComponentView(wJr),a1e(t)}var u0=function(){function t(){}return t}(),Zbt={};function J5(t,e){Zbt[t]=e}function Jbt(t){return Zbt[t]}var OJr=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=Jbt(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Gr(r,i[n]),i[n]=null),Gr(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 ext(t,e){var r=l5(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 EJr=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")||{},d=this._features||(this._features=qt()),h=[];fe(u,function(b,x){h.push(x)}),new By(this._featureNames||[],h).add(f).update(f).remove(Kr(f,null)).execute(),this._featureNames=oi(h,function(b){return d.hasKey(b)});function f(b,x){var w=b!=null&&x==null,A=b!=null&&x!=null,S=b==null,T=w||A?h[b]:h[x],C=u[T],O=w||A?new bn(C,r,n):null,E=O&&O.get("show"),_;if(w){if(!E)return;if(_Jr(T))_={onclick:O.option.onclick,featureName:T};else{var P=Jbt(T);if(!P)return;_=new P}d.set(T,_)}else _=d.get(T);if(S||!E){txt(_)&&_.dispose&&_.dispose(n,i),d.removeKey(T);return}a&&a.newTitle!=null&&a.featureName===T&&(C.title=a.newTitle),w&&(_.uid=BS("toolbox-feature")),_.model=O,_.ecModel=n,_.api=i,p(O,_,T),O.setIconStatus=function(L,R){var D=this.option,M=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[L]=R,M[L]&&(R==="emphasis"?Dy:Ly)(M[L])},txt(_)&&_.render&&_.render(O,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),S=b.getModel(["emphasis","iconStyle"]),T=x instanceof u0&&x.getIcons?x.getIcons():b.get("icon"),C=b.get("title")||{},O,E;$t(T)?(O={},O[w]=T):O=T,$t(C)?(E={},E[w]=C):E=C;var _=b.iconPaths={};fe(O,function(P,L){var R=n5(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:hge({fontStyle:S.get("textFontStyle"),fontFamily:S.get("textFontFamily"),fontSize:S.get("textFontSize"),fontWeight:S.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),Iy({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"?Dy:Ly)(R),o.add(R),R.on("click",Wt(x.onclick,x,n,i,L)),_[L]=R})}var g=Ns(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=ba(m,g,v);zS(r.get("orient"),o,r.get("itemGap"),y.width,y.height),tY(o,m,g,v),o.add(ext(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={}),O=JH(x,$n.makeFont(C)),E=b.x+o.x,_=b.y+o.y+s,P=!1;_+O.height>i.getHeight()&&(A.position="top",P=!0);var L=P?-5-O.height:s+10;E+O.width/2>i.getWidth()?(A.position=["100%",L],C.align="right"):E-O.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 u0&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.dispose=function(r,n){fe(this._features,function(i){i&&i instanceof u0&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Ki);function _Jr(t){return t.indexOf("my")===0}function txt(t){return t instanceof u0}var RJr=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 d=document.createElement("a");d.download=a+"."+s,d.target="_blank",d.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(h)}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}(u0),rxt="__ec_magicType_stack__",DJr=[["line","bar"],["stack"]],LJr=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(nxt[i]){var s={series:[]},l=function(h){var f=h.subType,p=h.id,g=nxt[i](f,p,h,a);g&&(mr(g,h.option),s.series.push(g));var m=h.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=h.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(DJr,function(h){Nr(h,i)>=0&&fe(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,d=i;i==="stack"&&(u=Gr({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(d="tiled")),n.dispatchAction({type:"changeMagicType",currentType:d,newOption:s,newTitle:u,featureName:"magicType"})}},e}(u0),nxt={line:function(t,e,r,n){if(t==="bar")return Gr({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 Gr({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")===rxt;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Gr({id:e,stack:i?"":rxt},n.get(["option","stack"])||{},!0)}};vg({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var pj=new Array(60).join("-"),eR=" ";function MJr(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=gGr(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 IJr(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(eR)],d=0;d"].join(n)}function h0e(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Sgt(t,e,r,n){return ol("svg","root",{width:t,height:e,xmlns:bgt,"xmlns:xlink":xgt,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var YUr=0;function Tgt(){return YUr++}var Cgt={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"},sT="transform-origin";function qUr(t,e,r){var n=lt({},t.shape);lt(n,e),t.buildPath(r,n);var i=new ygt;return i.reset(Qlt(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function jUr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[sT]=r+"px "+n+"px")}var XUr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function kgt(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function KUr(t,e,r){var n=t.shape.paths,i={},a,o;if(fe(n,function(l){var u=h0e(r.zrId);u.animation=!0,ZY(l,{},u,!0);var d=u.cssAnims,h=u.cssNodes,f=En(d),p=f.length;if(p){o=f[p-1];var g=d[o];for(var m in g){var v=g[m];i[m]=i[m]||{d:""},i[m].d+=v.d||""}for(var y in h){var b=h[y].animation;b.indexOf(o)>=0&&(a=b)}}}),!!a){e.d=!1;var s=kgt(i,r);return a.replace(o,s)}}function Ogt(t){return $t(t)?Cgt[t]?"cubic-bezier("+Cgt[t]+")":Efe(t)?t:"":""}function ZY(t,e,r,n){var i=t.animators,a=i.length,o=[];if(t instanceof L8){var s=KUr(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var q=kgt(T,r);return q+" "+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-"+Tgt();r.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function ZUr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};Egt(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=UH(l))}var u=i.lineWidth;if(u){var d=!i.strokeNoScale&&t.transform?t.transform[0]:1;u=u/d}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),Egt(n,e,r)}}function Egt(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+Tgt(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var vB=Math.round;function _gt(t){return t&&$t(t.src)}function Rgt(t){return t&&ur(t.toDataURL)}function f0e(t,e,r,n){UUr(function(i,a){var o=i==="fill"||i==="stroke";o&&Glt(a)?Ngt(e,t,i,n):o&&Ife(a)?Bgt(r,t,i,n):t[i]=a,o&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),aVr(r,t,n)}function p0e(t,e){var r=dct(e);r&&(r.each(function(n,i){n!=null&&(t[(wgt+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[wgt+"silent"]="true"))}function Dgt(t){return $x(t[0]-1)&&$x(t[1])&&$x(t[2])&&$x(t[3]-1)}function JUr(t){return $x(t[4])&&$x(t[5])}function g0e(t,e,r){if(e&&!(JUr(e)&&Dgt(e))){var n=1e4;t.transform=Dgt(e)?"translate("+vB(e[4]*n)/n+" "+vB(e[5]*n)/n+")":eNr(e)}}function Lgt(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.";dc(f,v),dc(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):d&&(L=1,R/=a.height)),E.attrs.width=L,E.attrs.height=R,P&&(P.setAttribute("width",L),P.setAttribute("height",R))}},b=ype(g,null,t,function(E){l||y(S,E),y(h,E)});b&&b.width&&b.height&&(f=f||b.width,p=p||b.height)}h=ol("image","img",{href:g,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(h=lr(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var x,w;l?x=w=1:u?(w=1,x=o.width/a.width):d?(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=Hlt(i);A&&(o.patternTransform=A);var S=ol("pattern","",o,[h]),T=d0e(S),C=n.patternCache,O=C[T];O||(O=n.zrId+"-p"+n.patternIdx++,C[T]=O,o.id=O,S=n.defs[O]=ol("pattern",O,o,[h])),e[r]=QH(O)}}function oVr(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]=ol("clipPath",a,o,[Igt(t,r)])}e["clip-path"]=QH(a)}function $gt(t){return document.createTextNode(t)}function lT(t,e,r){t.insertBefore(e,r)}function Fgt(t,e){t.removeChild(e)}function zgt(t,e){t.appendChild(e)}function Ugt(t){return t.parentNode}function Vgt(t){return t.nextSibling}function m0e(t,e){t.textContent=e}var Ggt=58,sVr=120,lVr=ol("","");function v0e(t){return t===void 0}function t0(t){return t!==void 0}function cVr(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 yB(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function bB(t){var e,r=t.children,n=t.tag;if(t0(n)){var i=t.elm=Agt(n);if(y0e(lVr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Qgt(t,g,r,i,l)):JY(t,e,n,a))}function IR(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(y0e(t,e),v0e(e.text)?t0(n)&&t0(i)?n!==i&&uVr(r,n,i):t0(i)?(t0(t.text)&&m0e(r,""),Qgt(r,null,i,0,i.length-1)):t0(n)?JY(r,n,0,n.length-1):t0(t.text)&&m0e(r,""):t.text!==e.text&&(t0(n)&&JY(r,n,0,n.length-1),m0e(r,e.text)))}function dVr(t,e){if(yB(t,e))IR(t,e);else{var r=t.elm,n=Ugt(r);bB(e),n!==null&&(lT(n,e.elm,Vgt(r)),JY(n,[t],0,0))}return e}var hVr=0,fVr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=pVr(),this.storage=r,this._opts=n=lt({},n),this.root=e,this._id="zr"+hVr++,this._oldVNode=Sgt(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=Agt("svg");y0e(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",dVr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Pgt(e,h0e(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=h0e(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=gVr(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=ol("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(ol("defs","defs",{},u)),e.animation){var d=WUr(a.cssNodes,a.cssAnims,{newline:!0});if(d){var h=ol("style","stl",{},[],d);o.push(h)}}return Sgt(n,i,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},d0e(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,d=0;d=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 h=Wgt(this),f=h.startIdx;f=0)&&(o=!0)}),!(!o&&!a.__dirty)){var s=n._opts.useDirtyRect&&!b0e(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 d=a.zlevel===l.zl&&a.zlevel2===l.zl2?n._backgroundColor:null;a.clear(!1,d,s)}eq(a,function(h){var f=n._paintPerCursor(a,h,e,s,u);i=i&&f})}},tq),Dn.wxa&&Zc(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=b0e(e),u=l&&rl.getTime(),d=r.drawIdx,h=r.notClearIdx,f=h>=0?Math.min(h,d):d;f15){f++;break}}}}bR(s,o),r.drawIdx=Math.max(f,d)},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=cT,r=0);var a=A0e(this._i,e)[r];return a||(a=jgt("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Gr(a,this._layerConfig[e],!0),(n||i&&e!==cT)&&(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])&&yVr(e)){for(var d=s.length,h=0;h0&&(u=A0e(a,s[h-1].zl)[s[h-1].zl2]),s.splice(h,0,{zl:r,zl2:n}),A0e(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 Zc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Zc(this._i,function(n,i){e.call(r,n,i)},xB)},t.prototype.eachOtherLayer=function(e,r){return Zc(this._i,function(n,i){e.call(r,n,i)},S0e)},t.prototype.getLayers=function(){var e={};return Zc(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;(b0e(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=yR(a,0,i),r=yR(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Zc(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(cT).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[cT][0].dom;var r=new Ygt("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;Zc(this._i,function(h){h.__builtin__?n.drawImage(h.dom,0,0,i,a):h.renderToCanvas&&(n.save(),h.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}(Pi);function PR(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=hR(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 wB=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=CVr,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(){Dy(this.childAt(0))},e.prototype.downplay=function(){Ly(this.childAt(0))},e.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},e.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},e.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),d=o!==this._symbolType,h=a&&a.disableAnimation;if(d){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};h?p.attr(g):qn(p,g,s,n),ip(p)}if(this._updateCommon(r,n,l,i,a),d){var p=this.childAt(0);if(!h){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)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,d,h,f,p,g,m,v,y;if(a&&(u=a.emphasisItemStyle,d=a.blurItemStyle,h=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(),h=b.getModel(["select","itemStyle"]).getItemStyle(),d=b.getModel(["blur","itemStyle"]).getItemStyle(),f=x.get("focus"),p=x.get("blurScope"),g=x.get("disabled"),m=Ps(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=jS(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 il){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 O=r.getItemVisual(n,"liftZ"),E=this._z2;O!=null?E==null&&(this._z2=s.z2,s.z2+=O):E!=null&&(s.z2=E,this._z2=null);var _=o&&o.useNameLabel;al(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:P,inheritColor:T,defaultOpacity:S.opacity});function P(D){return _?r.getName(D):PR(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=s.ensureState("emphasis");L.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=d;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&&Yx(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Yx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return vR(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(gr);function CVr(t,e){this.parent.drift(t,e)}function rq(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 Jgt(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function emt(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:Ps(e),cursorStyle:e.get("cursor")}}function tmt(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 AB=function(){function t(e){this.group=new gr,this._SymbolCtor=e||wB}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Jgt(r);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=emt(e),u={disableAnimation:s},d=r.getSymbolPoint||function(h){return e.getItemLayout(h)};a||n.removeAll(),e.diff(a).add(function(h){var f=d(h);rq(e,f,h,r)&&tmt(o,e,h,l,u,f,n)}).update(function(h,f){var p=a.getItemGraphicEl(f),g=d(h);if(!rq(e,g,h,r)){n.remove(p);return}var m=e.getItemVisual(h,"symbol")||"circle",v=p&&p.getSymbolType&&p.getSymbolType();if(!p||v&&v!==m)n.remove(p),p=new o(e,h,l,u),p.setPosition(g);else{p.updateData(e,h,l,u);var y={x:g[0],y:g[1]};s?p.attr(y):qn(p,y,i)}n.add(p),e.setItemGraphicEl(h,p)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=d,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 nmt(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 dp(t,e){return!isFinite(t)||!isFinite(e)}var OVr=typeof Float32Array!==H_?Float32Array:void 0,EVr=typeof Float64Array!==H_?Float64Array:void 0;function r0(t){return T0e({ctor:OVr},t).arr}function T0e(t,e){var r=t.arr,n=t.ctor;if(e>y8&&(e=y8),!r||t.typed&&r.length=i||m<0)break;if(dp(y,b)){if(l){m+=a;continue}break}if(m===r)t[a>0?"moveTo":"lineTo"](y,b),h=y,f=b;else{var x=y-u,w=b-d;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||dp(S,T))p=y,g=b;else{E=S-u,_=T-d;var R=y-u,D=S-y,M=b-d,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),O=F/(F+N),p=y-E*o*(1-O),g=b-_*o*(1-O),P=y+E*o*O,L=b+_*o*O,P=tw(P,rw(S,y)),L=tw(L,rw(T,b)),P=rw(P,tw(S,y)),L=rw(L,tw(T,b)),E=P-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=tw(p,rw(u,y)),g=tw(g,rw(d,b)),p=rw(p,tw(u,y)),g=rw(g,tw(d,b)),E=y-p,_=b-g,P=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(h,f,p,g,y,b),h=P,f=L}else t.lineTo(y,b)}u=y,d=b,m+=a}return v}var imt=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),DVr=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 imt},e.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&dp(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[h++],g=a[h++],m=a[h++],v=a[h++],y=a[h++],b=a[h++];var A=u?BH(s,p,m,y,r,d):BH(l,g,v,b,r,d);if(A>0)for(var S=0;S=0){var w=u?nl(l,g,v,b,T):nl(s,p,m,y,T);return u?[r,w]:[w,r]}}s=y,l=b;break}}},e}(yn),LVr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(imt),amt=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 LVr},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&&dp(i[s*2-2],i[s*2-1]);s--);for(;o=0,a=t.fill||tt.color.neutral99;pmt(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){pmt(s,s)}),n}function pmt(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 gmt(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 PVr(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}}),d=u.length,h=a.outerColors.slice();d&&u[0].coord>u[d-1].coord&&(u.reverse(),h.reverse());var f=IVr(u,i==="x"?r.getWidth():r.getHeight()),p=f.length;if(!p&&d)return u[0].coord<0?h[1]?h[1]:u[d-1].color:h[0]?h[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:h[1]||"transparent"}),f.unshift({offset:p?f[0].offset:.5,color:h[0]||"transparent"});var b=new RS(0,0,0,0,f,!0);return b[i]=m,b[i+"2"]=v,b}}}function NVr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&BVr(a,e))){var o=e.mapDimension(a.dim),s={};return fe(a.getViewLabels(),function(l){l.tick.offInterval||(s[_R(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function BVr(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 $Vr(t){for(var e=t.length/2;e>0&&dp(t[e*2-2],t[e*2-1]);e--);return e-1}function bmt(t,e){return[t[e*2],t[e*2+1]]}function FVr(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 xmt(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=ymt(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=ymt(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:T}),Is(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,Ea(m,M,I,N)}var G=this._changePolyState;s.eachItemGraphicEl(function(X){X&&(X.onHoverStateChange=G)}),this._polyline.onHoverStateChange=G,this._data=s,this._coordSys=a,this._stackedOnPoints=A,this._points=d,this._step=E,this._valueOrigin=x;var H=r.get("triggerEvent"),j=r.get("triggerLineEvent"),q=j===!0||H===!0||H==="line",ne=j===!0||H===!0||H==="area";this.packEventData(r,g,q),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=pS(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 d=l[s*2],h=l[s*2+1];if(dp(d,h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(d,h))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new wB(o,s),u.x=d,u.y=h,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 Ei.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=pS(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 Ei.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;_W(this._polyline,r),n&&_W(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new DVr({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 amt({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,d=u.get("animationDuration");ur(d)&&(d=d(null));var h=u.get("animationDelay")||0,f=ur(h)?h(null):h;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(h)?h(g):d*T+f,O=m.getSymbolPath(),E=O.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}),O.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(xmt(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 d=$Vr(l);d>=0&&(al(s,Ps(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:d,defaultText:function(h,f,p){return p!=null?Zgt(o,p):PR(o,h)},enableTextSetter:!0},zVr(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,d=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=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=FVr(h,w,T),O=C.range,E=O[1]-O[0],_=void 0;if(E>=1){if(E>1&&!p){var P=bmt(h,O[0]);u.attr({x:P[0]+A,y:P[1]+S}),o&&(_=f.getRawValue(O[0]))}else{var P=d.getPointOn(w,T);P&&u.attr({x:P[0]+A,y:P[1]+S});var L=f.getRawValue(O[0]),R=f.getRawValue(O[1]);o&&(_=Ect(i,g,L,R,C.t))}a.lastFrameIndex=O[0]}else{var D=r===1||a.lastFrameIndex>0?O[0]:0,P=bmt(h,D);o&&(_=f.getRawValue(D)),u.attr({x:P[0]+A,y:P[1]+S})}if(o){var M=iR(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,d=this._polygon,h=r.hostModel,f=RVr(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=nw(f.stackedOnCurrent,f.current,i,o,l),p=nw(f.current,null,i,o,l),v=nw(f.stackedOnNext,f.next,i,o,l),m=nw(f.next,null,i,o,l)),vmt(p,m)>3e3||d&&vmt(g,v)>3e3){u.stopAnimation(),u.setShape({points:m}),d&&(d.stopAnimation(),d.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,h),d&&(d.setShape({points:p,stackedOnPoints:g}),d.stopAnimation(),qn(d,{shape:{stackedOnPoints:v}},h),u.shape.points!==d.shape.points&&(d.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),d=l.getExtent(),h=n.getDevicePixelRatio(),f=Math.abs(d[1]-d[0])*(h||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=VVr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,GVr))}}}}}function QVr(t){t.registerChartView(UVr),t.registerSeriesModel(TVr),t.registerLayout(kB("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,wmt("line"))}var Amt=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}(up),O0e=null;function HVr(t){O0e||(O0e=t)}function OB(){return O0e}var nq="expandAxisBreak",Smt="collapseAxisBreak",Tmt="toggleAxisBreak",E0e="axisbreakchanged",WVr={type:nq,event:E0e,update:"update",refineEvent:_0e},YVr={type:Smt,event:E0e,update:"update",refineEvent:_0e},qVr={type:Tmt,event:E0e,update:"update",refineEvent:_0e};function _0e(t,e,r,n){var i=[];return fe(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function jVr(t){t.registerAction(WVr,e),t.registerAction(YVr,e),t.registerAction(qVr,e);function e(r,n){var i=[],a=z_(n,r);function o(s,l){fe(a[s],function(u){var d=u.updateAxisBreaks(r);fe(d.breaks,function(h){var f;i.push(mr((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var iw=Math.PI,XVr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],KVr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],hT=Qr(),Cmt=Qr(),kmt=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 ZVr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),o=[],s,l=D0e(t.axisName)&&ER(t.nameLocation);fe(n,function(g){var m=e0(g);if(!(!m||m.label.ignore)){o.push(m);var v=a.transGroup;l&&(v.transform?Fh(EB,v.transform):ZA(EB),m.transform&&$h(EB,EB,m.transform),pr.copy(iq,m.localRect),iq.applyTransform(EB),s?s.union(iq):pr.copy(s=new pr(0,0,0,0),iq))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",d=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-d)-Math.abs(m.label[u]-d)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1])-f;s.union(new pr(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var EB=Oa(),iq=new pr(0,0,0,0),Omt=function(t,e,r,n,i,a){if(ER(t.nameLocation)){var o=a.stOccupiedRect;o&&Emt(_Ur({},o,a.transGroup.transform),n,i)}else _mt(a.labelInfoList,a.dirVec,n,i)};function Emt(t,e,r){var n=new wr;jY(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&r0e(e,n)}function _mt(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,o=t.length;a0?"top":"bottom",a="center"):hS(i-iw)?(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}(),JVr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],eGr={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,d=[l[0],0],h=[l[1],0],f=d[0]>h[0];u&&(io(d,d,u),io(h,h,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"])&&YW(n.axis.scale))OB().buildAxisBreakLine(n,i,a,g);else{var m=new Qo(lt({shape:{x1:d[0],y1:d[1],x2:h[0],y2:h[1]}},g));rR(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=jS(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((d[0]-h[0])*(d[0]-h[0])+(d[1]-h[1])*(d[1]-h[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,O=f?h:d;T.attr({rotation:A.rotate,x:O[0]+C*Math.cos(t.rotation),y:O[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=Lmt(e,i,s);l&&Rmt(t,e,r,n,i,a,o,bg.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,o,s){var l=Lmt(e,i,s);l&&Rmt(t,e,r,n,i,a,o,bg.determine);var u=iGr(t,i,a,n);nGr(t,e.labelLayoutList,u),aGr(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(D0e(u)){var d=t.nameLocation,h=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);d==="start"?(v.x=g[0]-m*p,y.x=-m):d==="end"?(v.x=g[1]+m*p,y.x=m):(v.x=(g[0]+g[1])/2,v.y=t.labelOffset+h*p,y.y=h);var b=Oa();y.transform(Ay(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*iw/180);var w,A;ER(d)?w=$u.innerTextLayout(t.rotation,x??t.rotation,h):(w=tGr(t.rotation,d,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,O=Hc(t.raw.nameTruncateMaxWidth,T.maxWidth,A),E=s.nameMarginLevel||0,_=new $n({x:v.x,y:v.y,rotation:w.rotation,silent:$u.isLabelSilent(n),style:Xi(f,{text:u,font:S,overflow:"truncate",width:O,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(Iy({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var P=$u.makeAxisEventDataBase(n);P.targetType="axisName",P.name=u,Cr(_).eventData=P}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=e0({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:ER(d)?XVr[E]:KVr[E]});if(l.nameLocation=d,i.add(_),_.decomposeTransform(),t.shouldNameMoveOverlap&&L){var R=r.ensureRecord(n);r.resolveAxisNameOverlap(t,r,n,L,y,R)}}}};function Rmt(t,e,r,n,i,a,o,s){Mmt(e)||oGr(t,e,i,s,n,o);var l=e.labelLayoutList;sGr(t,n,l,a),uGr(n,t.rotation,l);var u=t.optionHideOverlap;rGr(n,l,u),u&&ggt(oi(l,function(d){return d&&!d.label.ignore})),ZVr(t,r,n,l)}function tGr(t,e,r,n){var i=ape(r-t),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return hS(i-iw/2)?(o=l?"bottom":"top",a="center"):hS(i-iw*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iiw/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function rGr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(gzr(n))return;function a(u,d,h){var f=e0(e[d]),p=e0(e[h]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=hT(f.label).labelInfo.tick;if(lB(g)&&m.notNice||Kc(g)&&m.offInterval){BR(f.label);return}}if(u===!1||f.suggestIgnore){BR(f.label);return}if(p.suggestIgnore){BR(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=n0e({marginForce:y},f),p=n0e({marginForce:y},p)}jY(f,p,null,{touchThreshold:v})&&BR(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 nGr(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}T0e(fT,p);var g=0;f(function(x,w,A){for(var S=0,T=A.count();S0&&b0?Mpt:bzr,r.serUids=n}var fT=T0e({ctor:EVr},50);function oq(t){return function(e,r){var n=vc(e,{fromStat:{key:t}});if(tp(n.w2))return[-n.w2/2,n.w2/2]}}function pT(t){return t+zY}function gT(t,e){return t+zY+e}function L0e(t){return mGr(),{liPosMinGap:!Kc(t.scale)}}var n0="bar",_B="pictorialBar";function Imt(t,e,r,n){Hme(t,{key:e,seriesType:r,coordSysType:n,getMetrics:L0e})}function Pmt(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Nmt={left:0,right:0,top:0,bottom:0},sq=["25%","25%"],Ag="cartesian2d",yGr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=US(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Xm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Xm(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:Nmt,outerBoundsContain:"all",outerBoundsClampWidth:sq[0],outerBoundsClampHeight:sq[1],backgroundColor:tt.color.transparent,borderWidth:1,borderColor:tt.color.neutral30},e}(pn),bGr=V_(),M0e="__ec_stack_";function Bmt(t){return t.get("stack")||M0e+t.seriesIndex}function xGr(t){if(Kc(t.axis.scale)){for(var e=vc(t.axis),r=[],n=0;nx&&(x=b),x!==d&&(v.width=x,r-=x+u*x,n--)}}),d=(r-l)/(n+(n-1)*u),d=rn(d,0);var h=0,f;fe(o,function(m){var v=s[m];v.width||(v.width=d),f=v,h+=v.width*(1+u)}),f&&(h-=f.width*u);var p={},g=-h/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 Fmt(t){return{seriesType:t,overallReset:function(e){var r=gT(t,Ag);Gme(e,r,function(n){var i=wGr(n,t);tT(n,r,function(a){var o=i.columnMap[Bmt(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function zmt(t){return{seriesType:t,plan:YS(),reset:function(e){if(dGr(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),d=r.getCalculationInfo("stackResultDimension"),h=$y(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Pmt(a))),g=Umt(e),m=e.get("barMinHeight")||0,v=d&&r.getDimensionIndex(d),y=r.getLayout("size"),b=r.getLayout("offset");return{progress:function(x,w){for(var A=x.count,S=g&&r0(A*3),T=g&&l&&r0(A*3),C=g&&r0(A),O=n.master.getRect(),E=f?O.width:O.height,_,P=w.getStore(),L=0;(_=x.next())!=null;){var R=P.get(h?v:o,_),D=P.get(s,_),M=p,I=void 0;h&&(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]);h&&(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"),d=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+d/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}(Pi);Pi.registerClass(RB);var TGr=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 Km(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=Dct(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."+n0,e.dependencies=["grid","polar"],e.defaultOption=jx(RB.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}(RB),CGr=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}(),lq=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 CGr},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,d=n.startAngle,h=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?h-dMath.PI/2&&ds)return!0;s=h}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){My(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=n0,e}(Ei),Gmt={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=I0e(e.x,t.x),s=P0e(e.x+e.width,i),l=I0e(e.y,t.y),u=P0e(e.y+e.height,a),d=si?s:o,e.y=h&&l>a?u:l,e.width=d?0:s-o,e.height=h?0:u-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),d||h},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=P0e(e.r,t.r),a=I0e(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}},Qmt={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 d=u.shape,h=i?"height":"width";d[h]=0}return u},polar:function(t,e,r,n,i,a,o,s,l){var u=!i&&l?lq:pc,d=new u({shape:n,z2:1});d.name="item";var h=qmt(i);if(d.calculateTextPosition=kGr(h,{isRoundCap:u===lq}),a){var f=d.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(s?qn:ua)(d,{shape:g},a)}return d}};function _Gr(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 Hmt(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 d=e?t.baseAxis.model:null;(o?qn:ua)(r,{shape:u},d,i)}function Wmt(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 LGr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function qmt(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 jmt(t,e,r,n,i,a,o,s){var l=e.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var d=t.shape,h=i0(n.getModel("itemStyle"),d,!0);lt(d,h),t.setShape(d)}}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?BGr(i,a.coordinateSystem):$Gr(i,a.coordinateSystem),g=Ps(n);al(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:PR(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,OGr(t,v==="outside"?p:v,qmt(o),n.get(["label","rotate"]))}hdt(m,g,a.getRawValue(r),function(b){return Zgt(e,b)});var y=n.getModel(["emphasis"]);Ea(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Is(t,n),LGr(i)&&(t.style.fill="none",t.style.stroke="none",fe(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function MGr(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 IGr=function(){function t(){}return t}(),Xmt=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 IGr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,d=0;d=0?r:null},30,!1);function PGr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,o=t.largeDataIndices,s=[],l=[],u=t.barWidth,d=0,h=a.length/3;d=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[d]}return-1}function Jmt(t,e,r){if(dT(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 NGr(t,e,r){var n=t.type==="polar"?pc:nn;return new n({shape:Jmt(e,r,t),silent:!0,z2:0})}function BGr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function $Gr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function FGr(t){t.registerChartView(EGr),t.registerSeriesModel(TGr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Fmt(n0)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,zmt(n0)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,wmt(n0)),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)})}),Vmt(t)}function DB(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}(),aw="pie",zGr=Qr(),e0t=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 FR(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 $R(this,{coordDimensions:["value"],encodeDefaulter:Kr(Pge,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=zGr(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=mct(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){fS(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."+aw,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}(Pi);P7r({fullType:e0t.type,getCoord2:function(t){return t.getShallow("center")}});var UGr=Math.PI/180;function t0t(t,e,r,n,i,a,o,s,l,u){if(t.length<2)return;function d(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)}n0t(a,n)}}}function n0t(t,e){i0t.rect=t,fgt(i0t,e,GGr)}var GGr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},i0t={};function N0e(t){return t.position==="center"}function QGr(t){var e=t.getData(),r=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*UGr,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,d=s.x,h=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,O=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=Gt(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=Gt(F,u);var B=N.get("length2");if(B=Gt(B,u),Math.abs(C.endAngle-C.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,Oe=0,Ee=P.get("rotate");if(Vn(Ee))Oe=Ee*(Ce/180);else if(L==="center")Oe=0;else if(Ee==="radial"||Ee===!0){var ue=z<0?-V+Ce:-V;Oe=ue}else if(Ee==="tangential"||Ee==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var he=Math.atan2(z,U);he<0&&(he=Ce*2+he);var xe=U>0;xe&&Ee!=="tangential-noflip"&&(he=Ce+he),Oe=he-Ce}if(a=!!Oe,O.x=G,O.y=H,O.rotation=Oe,O.setStyle({verticalAlign:"middle"}),ne){O.setStyle({align:q});var ze=O.states.select;ze&&(ze.x+=O.x,ze.y+=O.y)}else{var ge=new pr(0,0,0,0);n0t(ge,O),r.push({label:O,labelLine:E,position:L,len:F,len2:B,minTurnAngle:N.get("minTurnAngle"),maxSurfaceAngle:N.get("maxSurfaceAngle"),surfaceNormal:new wr(z,U),linePoints:j,textAlign:q,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:I,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:O.style.width})}T.setTextConfig({inside:ne})}}),!a&&t.get("avoidLabelOverlap")&&VGr(r,n,i,l,u,f,d,h);for(var m=0;mN?(B=R+T*N/2,V=B):(B=R+O,V=F-O),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 d=o.getItemLayout(0),h=1;isNaN(d&&d.startAngle)&&h=a.r0}},e.type=aw,e}(Ei);function jGr(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 XGr(t){t.registerChartView(qGr),t.registerSeriesModel(e0t),dft(aw,t.registerAction),t.registerLayout(HGr),t.registerProcessor(DB(aw)),t.registerProcessor(jGr(aw))}var KGr=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 Km(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}(Pi),s0t=4,ZGr=function(){function t(){}return t}(),JGr=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 ZGr},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 d=u*2,h=a[d]-s/2,f=a[d+1]-l/2;if(r>=h&&n>=f&&r<=h+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,d=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),tQr=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,B0e(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(),zm(n),B0e(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=kB("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(B0e(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 eQr:new AB,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}(Ei);function B0e(t){return{clipShape:lmt(t)}}var $0e=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);Go($0e,RR);var l0t={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"}},rQr=Gr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},l0t),F0e=Gr({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}}},l0t),nQr=Gr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},F0e),iQr=mr({logBase:10},F0e);const c0t={category:rQr,value:F0e,time:nQr,log:iQr};function zR(t,e,r,n){fe(_pt,function(i,a){var o=Gr(Gr({},c0t[a],!0),n,!0),s=function(l){nt(u,l);function u(){var d=l!==null&&l.apply(this,arguments)||this;return d.type=e+"Axis."+a,d}return u.prototype.mergeDefaultAndTheme=function(d,h){var f=G8(this),p=f?US(d):{},g=h.getTheme();Gr(d,g.get(a+"Axis")),Gr(d,this.getDefaultOption()),d.type=u0t(d),f&&Xm(d,p,f)},u.prototype.optionUpdated=function(){var d=this.option;d.type==="category"&&(this.__ordinalMeta=aB.createByAxisModel(this))},u.prototype.getCategories=function(d){var h=this.option;if(h.type==="category")return d?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(d){var h=OB();return h?h.updateModelAxisBreak(this,d):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",u0t)}function u0t(t){return t.type||(t.data?"category":"value")}var aQr=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}(),fq=["x","y"];function d0t(t){return(t.type==="interval"||t.type==="time")&&!YW(t)}var oQr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Ag,r.dimensions=fq,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!d0t(r)||!d0t(n))){var i=DY(r,null),a=DY(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 d=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-i[0]*d,p=o[1]-a[0]*h,g=this._transform=[d,0,0,h,f,p];this._invTransform=Fh([],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}(aQr);function h0t(t,e){var r=t.scale,n=t.model,i=Gpt(r,n,n.ecModel,t,null),a=kR(r),o=kR(e)?e.intervalStub:e,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),d=o.getTicks({expandToNicedExtent:!0}),h=u.length-1,f,p,g;if(h===1)f=p=0,g=1;else if(h===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]?(O=T[1],R(function(){if(N(),L=Yn(P-E*g,_),D(),C<=T[0])return!0})):R(function(){L=Yn(lS(T[0]/E)*E,_),P=Yn(ep(T[1]/E)*E,_);var z=Nm((P-L)/E);if(z<=g){var U=g-z,G=void 0,H=i.incl0||a;if(H&&T[0]===0)G=[0,U];else if(H&&T[1]===0)G=[U,0];else{var j=ep(U/2);G=U%2===0?[j,j]:C+O=T[1])return!0}})}Lpt(r,w,S,[C,O],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,P]})}var f0t=[[3,1],[0,2]],sQr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=fq,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){nT(o,LR);var s=o.scale;Kc(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function i(o){for(var s=En(o),l=[],u=s.length-1;u>=0;u--){var d=o[+s[u]];d.__alignTo?l.push(d):MR(d)}fe(l,function(h){cQr(h,h.__alignTo)?MR(h):h0t(h,h.__alignTo.scale)})}i(n.x),i(n.y);var a={};fe(n.x,function(o){p0t(n,"y",o,a)}),fe(n.y,function(o){p0t(n,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Ns(e,r),a=this._rect=ba(e.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(z0e(o,a),!n){var u=hQr(a,s,o,l,r),d=void 0;if(l)U0e?(U0e(this._axesList,a),z0e(o,a)):d=y0t(a.clone(),"axisLabel",null,a,o,u,i);else{var h=fQr(e,a,i),f=h.outerBoundsRect,p=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(d=y0t(f,p,g,a,o,u,i))}b0t(a,o,bg.determine,null,d,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]];bpt(a.scale)&&Dpt(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 cQr(t,e){return YW(t.scale)||YW(e.scale)||e.scale.getTicks().length<2}function uQr(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 z0e(t,e){fe(t.x,function(r){return v0t(r,e.x,e.width)}),fe(t.y,function(r){return v0t(r,e.y,e.height)})}function v0t(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),uQr(t,e)}var U0e;function dQr(t){U0e=t}function y0t(t,e,r,n,i,a,o){b0t(n,i,bg.estimate,e,!1,o);var s=[0,0,0,0];u(0),u(1),d(n,0,NaN),d(n,1,NaN);var l=my(s,function(f){return f>0})==null;return IS(n,s,!0,!0,r),z0e(i,n),l;function u(f){fe(i[Mr[f]],function(p){if(hB(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!uc(p)&&p>1e-4&&(f/=p),f}}function hQr(t,e,r,n,i){var a=new kmt(pQr);return fe(r,function(o){return fe(o,function(s){if(hB(s.model)){var l=!n;s.axisBuilder=fGr(t,e,s.model,i,a,l)}})}),a}function b0t(t,e,r,n,i,a){var o=r===bg.determine;fe(e,function(u){return fe(u,function(d){hB(d.model)&&(pGr(d.axisBuilder,t,d.model),d.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,d){return fe(u,function(h){hB(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[d]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function fQr(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)||Nmt,r.refContainer));var a=t.get("outerBoundsContain",!0),o;a==null||a==="auto"||Nr(["all","axisLabel"],a)<0?o="all":o=a;var s=[lW(Jt(t.get("outerBoundsClampWidth",!0),sq[0]),e.width),lW(Jt(t.get("outerBoundsClampHeight",!0),sq[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var pQr=function(t,e,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";Omt(t,e,r,n,i,a),ER(t.nameLocation)||fe(e.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&_mt(s.labelInfoList,s.dirVec,n,i)})};function gQr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return mQr(r,t,e),r.seriesInvolved&&yQr(r,t),r}function mQr(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=LB(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var d=s.model,h=d.getModel("tooltip",n);if(fe(s.getAxes(),Kr(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",p=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.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&&!Q0e(x))){y==null&&(y=x.get("triggerTooltip")),x=v?vQr(b,h,i,e,v,y):x;var A=x.get("snap"),S=x.get("triggerEmphasis"),T=LB(b.model),C=y||A||b.type==="category",O=t.axesInfo[T]={key:T,axis:b,coordSys:s,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:S,involveSeries:C,snap:A,useHandle:Q0e(x),seriesModels:[],linkGroup:null};u[T]=O,t.seriesInvolved=t.seriesInvolved||C;var E=bQr(a,b);if(E!=null){var _=o[E]||(o[E]={axesInfo:{}});_.axesInfo[T]=O,_.mapper=a[E].mapper,O.linkGroup=_}}}})}function vQr(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 d=o.get(["label","show"]);if(u.show=d??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&mr(u,h.textStyle)}}return t.model.getModel("axisPointer",new bn(l,r,n))}function yQr(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[LB(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 bQr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function xQr(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=Q0e(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 EQr=Qr();function O0t(t,e,r,n){if(t instanceof Amt){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=Kc(t.scale)?vc(t).w:null;return s?E0t(r,o,u,n):_Qr(t,e,r,n,o,l)}function E0t(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 _Qr(t,e,r,n,i,a){var o=EQr(t);o.items||(o.items=[]);var s=o.items,l=_0t(s,e,r,n,i,a,1),u=_0t(s,e,r,n,i,a,-1),d=Math.abs(l-r)i/2||h&&f>h/2-n?E0t(r,i,h,n):(s.push({fixedCoord:e,floatCoord:d,r:n}),d)}function _0t(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=Gr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:o,axisTick:s,axisLabel:l,name:m.text,showName:d,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if($t(h)){var b=y.name;y.name=h.replace("{value}",b??"")}else ur(h)&&(y.name=h(y.name,y));var x=new bn(y,null,this.ecModel);return Go(x,RR.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=BS("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=R0t,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:tt.color.axisLabel},boundaryGap:[0,0],splitNumber:D0t,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Gr({lineStyle:{color:tt.color.neutral20}},IB.axisLine),axisLabel:mq(IB.axisLabel,!1),axisTick:mq(IB.axisTick,!1),splitLine:mq(IB.splitLine,!0),splitArea:mq(IB.splitArea,!0),indicator:[]},e}(pn),$Qr=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 $u(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"),d=o.get("show"),h=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,d=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:d,originX:s,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(I0t(this._zr,"globalPan")||NB(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)&&(wy(a.event),a.__ecRoamConsumed=!0,N0t(r,n,i,a,o))},e}(jf);function NB(t){return t.__ecRoamConsumed}var qQr=Qr();function vq(t){var e=qQr(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function BB(t,e,r,n){for(var i=vq(t),a=i.roam,o=a[e]=a[e]||[],s=0;s=4&&(d={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(d&&s!=null&&l!=null&&(h=Y0t(d,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var p=i;i=new gr,i.add(p),p.scaleX=p.scaleY=h.scale,p.x=h.x,p.y=h.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:d,viewBoxTransform:h,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 d=q0e[s];if(d&&Kt(q0e,s)){l=d.call(this,e,r);var h=e.getAttribute("name");if(h){var f={name:h,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=z0t[s];if(p&&Kt(z0t,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 G_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});hp(r,n),Yh(e,n,this._defsUsePending,!1,!1),ZQr(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(){q0e={g:function(e,r){var n=new gr;return hp(r,n),Yh(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new nn;return hp(r,n),Yh(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 qm;return hp(r,n),Yh(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 Qo;return hp(r,n),Yh(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 E8;return hp(r,n),Yh(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=G0t(n));var a=new gc({shape:{points:i||[]},silent:!0});return hp(r,a),Yh(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=G0t(n));var a=new Ml({shape:{points:i||[]},silent:!0});return hp(r,a),Yh(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new il;return hp(r,n),Yh(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),Yh(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),Yh(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=Fut(n);return hp(r,i),Yh(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),z0t={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 RS(e,r,n,i);return U0t(t,a),V0t(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 Zpe(e,r,n);return U0t(t,i),V0t(t,i),i}};function U0t(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function V0t(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={};W0t(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=Yc(o),u=l&&l[3];u&&(l[3]*=Sy(s),o=Jf(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 G0t(t){for(var e=wq(t),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=wq(o);switch(i=i||Oa(),s){case"translate":cg(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":RH(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ay(i,i,-parseFloat(l[0])*j0e,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*j0e);$h(i,[1,0,u,1,0,0],i);break;case"skewY":var d=Math.tan(parseFloat(l[0])*j0e);$h(i,[1,d,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 H0t=/([^\s:;]+)\s*:\s*([^:;]+)/g;function W0t(t,e,r){var n=t.getAttribute("style");if(n){H0t.lastIndex=0;for(var i;(i=H0t.exec(n))!=null;){var a=i[1],o=Kt(bq,a)?bq[a]:null;o&&(e[o]=i[2]);var s=Kt(xq,a)?xq[a]:null;s&&(r[s]=i[2])}}}function iHr(t,e,r){for(var n=0;n<$0t.length;n++){var i=$0t[n],a=t.getAttribute(i);a!=null&&(e[bq[i]]=a)}for(var n=0;n1e-6;UB[0]=o?(i[0]-n.x)/a:i[0],UB[1]=o?(i[1]-n.y)/a:i[1],io(UB,UB,t.mtRawInv);var s=_Hr(t,UB);cvt(e,s,a),fe(r,function(l){l!==e&&cvt(l,s.slice(),a)})}var UB=[];function cvt(t,e,r){var n=t.option;n.center=e,n.zoom=r}function ive(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 uvt(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[a0].scaleX||1)}function Rq(t,e,r,n,i,a,o,s){var l=_q(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(d,h,f){return!i||i.contain(h,f)}}});function u(d){var h=t.mainType,f=cge(mr({type:hvt(h,t.subType,dut)},d));s&&(f.componentType=h),f[h+"Id"]=t.id,e.dispatchAction(f)}r.off("pan").off("zoom").on("pan",function(d){a&&a("pan"),u({dx:d.dx,dy:d.dy})}).on("zoom",function(d){a&&a("zoom"),u({zoom:d.scale,originX:d.originX,originY:d.originY})})}function dvt(t){return function(e,r,n){return ave.copy(t.getBoundingRect()),ave.applyTransform(t.getComputedTransform()),ave.contain(r,n)}}var ave=new pr(0,0,0,0);function ove(t,e,r){var n=hvt(e,r,dut);t.registerAction({type:n,event:n,update:"none"},function(i,a,o){a.eachComponent(hpe(i,e,r),function(s){ivt(i,s),avt(i,s,a,o)})})}function hvt(t,e,r){return(t!==Ym?t:e==="map"?"geo":e)+r}function fvt(t){return t.zoom!=null}function sve(t,e,r,n,i,a,o){var s=new Aq(null,lvt(t.ecModel,e));return kq(s,r,n,i,a),o?Oq(s,o.x,o.y,o.width,o.height):Oq(s,r,n,i,a),J0e(s,t),s}var lve=["rect","circle","line","ellipse","polygon","polyline","path"],DHr=qt(lve),LHr=qt(lve.concat(["g"])),MHr=qt(lve.concat(["g"])),pvt=Qr();function Dq(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function gvt(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var mvt=function(){function t(e){var r=this.group=new gr,n=this._transformGroup=new gr;r.add(n),this.uid=BS("ec_map_draw"),this._controller=new vT(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();VR(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===e&&(s=m.getData())});var l=e.coordinateSystem,u=l.view,d=this._regionsGroup,h=this._transformGroup,f=!d.childAt(0)||a,p;l.shouldClip()?(p=K0e(null,u),this.group.setClipPath(new nn({shape:p.clone()}))):this.group.removeClipPath(),ow(h,wT,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),Rq(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,d,n,i)},t.prototype.__updateOnOwnRoam=function(e){ow(this._transformGroup,wT,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,o){var s=this._regionsGroupByName=qt(),l=qt(),u=this._regionsGroup,d=n.projection,h=d&&d.stream,f=Fx(zB(null,e,xT));function p(v,y){return y&&(v=y(v)),v&&io([],v,f)}function g(v){for(var y=[],b=!h&&d&&d.project,x=0;x=0)&&(d=t);var h=o?{normal:{align:"center",verticalAlign:"middle"}}:null;al(r,Ps(i),{labelFetcher:d,labelDataIndex:u,defaultText:n},h);var f=r.getTextContent();if(f&&(pvt(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 bvt(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 xvt(t,e,r,n,i){e||Iy({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function wvt(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")),VR(t)&&TBr(e,t,r),a}function Avt(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 Lq(this)?this.coordinateSystem.view:null},e.type="series."+AT,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}(Pi);function Svt(t){return t.indexOf("i")===0}function Lq(t){return VB(t.seriesGroup)===t&&!t.getHostGeoModel()}function VB(t){return t.f[0]}function cve(t,e){var r={};return t.eachRawSeriesByType(AT,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 PHr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=AT,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):Lq(r)?(s=s||(this._mapDraw=new mvt(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;Lq(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,d=new qm({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:W_+1)});if(!u){var h=VB(r.seriesGroup).getData(),f=n.getName(o),p=h.indexOfName(f),g=n.getItemModel(o),m=g.getModel("label"),v=h.getItemGraphicEl(p);al(d,Ps(g),{labelFetcher:{getFormattedLabel:function(y,b){return r.getFormattedLabel(p,b)}},defaultText:f}),d.disableLabelAnimation=!0,m.get("position")||d.setTextConfig({position:"bottom"}),v.onHoverStateChange=function(y){_W(d,y)}}i.add(d)}}})},e.type=AT,e}(Ei),NHr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},Tvt=["lng","lat"],Cvt=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=Tvt,a.type="geo",a._nameCoordMap=qt(),a.name=r;var o=i.projection,s=Uy.load(n,i.nameMap,i.nameProperty),l=Uy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=s.regions,d=NHr[l.type];a._clip=i.clip;var h=o?!1:d.invertLongitute;a.view=new Aq(h,lvt(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=Fdt(t,w,v)}Oq(r,w.x,w.y,w.width,w.height),J0e(r,t)}function BHr(t,e){fe(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var $Hr=function(){function t(){this.dimensions=Tvt}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 Cvt(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=Ovt,l.resize(a,r)}),e.eachSeries(function(a){U8({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var o=a.subType===AT?a.getHostGeoModel():a.getReferringComponents("geo",xo).models[0];return o&&o.coordinateSystem},allowNotFound:!0})}),fe(cve(e,!0),function(a,o){if(Svt(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),d=new Cvt(u,u,lt({nameMap:TH(l),api:r,ecModel:e},i(s))),h;fe(a.r,function(f){h=Jt(h,f.get("scaleLimit"))}),n.push(d),d.resize=Ovt,d.resize(s,r),fe(a.r,function(f){f.coordinateSystem=d,BHr(d,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 jHr(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){KHr(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=ZHr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function XHr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Rvt(t){return arguments.length?t:tWr}function GB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function KHr(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 ZHr(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,d=o.hierNode.modifier,h=s.hierNode.modifier;s=uve(s),a=dve(a),s&&a;){i=uve(i),o=dve(o),i.hierNode.ancestor=t;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(eWr(JHr(s,t,r),t,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,d+=o.hierNode.modifier}s&&!uve(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!dve(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-d,r=t)}return r}function uve(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function dve(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function JHr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function eWr(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 tWr(t,e){return t.parentNode===e.parentNode?1:2}var fp=Qr();function Dvt(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,Lvt(e,r,t),fe(r,function(n){fe(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,Kr(rWr,t))})}),e.wrapMethod("cloneShallow",Kr(iWr,t)),fe(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,Kr(nWr,t))}),dc(r[e.dataType]===e)}function rWr(t,e){if(sWr(this)){var r=lt({},fp(this).datas);r[this.dataType]=e,Lvt(e,r,t)}else hve(e,this.dataType,fp(this).mainData,t);return e}function nWr(t,e){return t.struct&&t.struct.update(),e}function iWr(t,e){return fe(fp(e).datas,function(r,n){r!==e&&hve(r.cloneShallow(),n,e,t)}),e}function aWr(t){var e=fp(this).mainData;return t==null||e==null?e:fp(e).datas[t]}function oWr(){var t=fp(this).mainData;return t==null?[{data:t}]:vt(En(fp(t).datas),function(e){return{type:e,data:fp(t).datas[e]}})}function sWr(t){return fp(t).mainData===t}function Lvt(t,e,r){fp(t).datas={},fe(e,function(n,i){hve(n,i,t,r)})}function hve(t,e,r,n){fp(r).datas[e]=t,fp(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=aWr,t.getLinkedDataAll=oWr}var lWr=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 Mvt(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function pve(t,e){var r=Mvt(t);return Nr(r,e)>=0}function Mq(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 ST="tree",uWr=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=fve.createTree(n,this,s);function s(h){h.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(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,d=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=d}),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=Mq(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+ST,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}(Pi),dWr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),hWr=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 dWr},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,d=u==="TB"||u==="BT"?0:1,h=1-d,f=Gt(n.forkPosition,1),p=[];p[d]=o[d],p[h]=o[h]+(l[h]-o[h])*f,r.moveTo(o[0],o[1]),r.lineTo(p[0],p[1]),r.moveTo(s[0],s[1]),p[d]=s[d],r.lineTo(p[0],p[1]),p[d]=l[d],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"),O=C.get("rotate"),E=O*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:C.get("position")||T,rotation:O==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),L=P==="relative"?k_(o.getAncestorsIndices(),o.getDescendantIndices()):P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;L&&(Cr(r).focus=L),pWr(i,o,d,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===T8||_W(r.__edge,R)}})}function pWr(t,e,r,n,i,a,o,s){var l=e.getModel(),u=t.get("edgeShape"),d=t.get("layout"),h=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 K_({shape:gve(d,h,f,i,i)})),qn(m,{shape:gve(d,h,f,a,o)},t));else if(u==="polyline"&&d==="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 mWr(t,e){t.eachSeriesByType("tree",function(r){vWr(r,e)})}function vWr(t,e){var r=Ns(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=Rvt(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,o=n.height,s=Rvt());var l=t.getData().tree.root,u=l.children[0];if(u){qHr(l),gWr(u,jHr,s),l.hierNode.modifier=-u.hierNode.prelim,HB(u,XHr);var d=u,h=u,f=u;HB(u,function(w){var A=w.getLayout().x;Ah.getLayout().x&&(h=w),w.depth>f.depth&&(f=w)});var p=d===h?1:s(d,h)/2,g=p-d.getLayout().x,m=0,v=0,y=0,b=0;if(i==="radial")m=a/(h.getLayout().x+p+g),v=o/(f.depth-1||1),HB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=GB(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/(h.getLayout().x+p+g),m=a/(f.depth-1||1),HB(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/(h.getLayout().x+p+g),v=o/(f.depth-1||1),HB(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 yWr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:Ym,subType:ST,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),ove(t,Ym,ST)}var bWr=Ms(ST,xWr);function xWr(t){t.eachSeriesByType(ST,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 wWr(t){t.registerChartView(fWr),t.registerSeriesModel(uWr),t.registerLayout(mWr),t.registerVisual(bWr),yWr(t)}var Fvt=["treemapZoomToNode","treemapRender","treemapMove"];function AWr(t){for(var e=0;e1;)a=a.parentNode;var o=Fge(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var SWr=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};Uvt(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new bn({itemStyle:o},this,n);a=r.levels=TWr(a,n);var l=vt(a||[],function(h){return new bn(h,s,n)},this),u=fve.createTree(i,this,d);function d(h){h.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=Mq(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(){zvt(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}(Pi);function Uvt(t){var e=0;fe(t.children,function(n){Uvt(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 TWr(t,e){var r=ji(e.get("color")),n=ji(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"),d=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||d&&d!=="none")&&(a=!0)});var o=t[0]||(t[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),t}}var CWr=8,Vvt=8,mve=5,kWr=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"),d=l.getModel(["itemStyle","textStyle"]),h=Ns(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,h);this._prepare(n,p,u),this._renderContent(e,p,g,s,l,u,d,i),tY(o,f,h)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=Ls(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+CWr*2,r.emptyItemWidth);r.totalWidth+=s+Vvt,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,d=r.emptyItemWidth,h=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-d,b=d,x=null);var w=new gc({shape:{points:OWr(u,0,b,h,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new $n({style:Xi(o,{text:x})}),textConfig:{position:"inside"},z2:W_*1e4,onclick:Kr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=Xi(s,{text:x}),w.ensureState("emphasis").style=g,Ea(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),EWr(w,e,y),u+=b+Vvt}},t.prototype.remove=function(){this.group.removeAll()},t}();function OWr(t,e,r,n,i,a){var o=[[i?t:t-mve,e],[t+r,e],[t+r,e+n],[i?t:t-mve,e+n]];return!a&&o.splice(2,0,[t+r+mve,e+n/2]),!i&&o.push([t,e+n/2]),o}function EWr(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&&Mq(r,e)}}var _Wr=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 FWr(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?WB(u*n/l,l/(u*i)):1/0}function Hvt(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]],d=e?t.area/e:0;(i||d>r[l[o]])&&(d=r[l[o]]);for(var h=0,f=t.length;hy8&&(d=y8),i=l}dKvt||Math.abs(r.dy)>Kvt)){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),d=o.layoutInfo,h=qvt(d,l),f=h*a;f=jvt(f,o);var p=f/h;n-=d.x,i-=d.y;var g=Oa();cg(g,g,[-n,-i]),RH(g,g,[p,p]),cg(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),d=l.get("target",!0)||"blank";u&&KW(u,d)}}}}},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 kWr(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(pve(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=YB(),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}(Ei);function YB(){return{nodeGroup:[],background:[],content:[]}}function WWr(t,e,r,n,i,a,o,s,l,u){if(!o)return;var d=o.getLayout(),h=t.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!d||!d.isInView)return;var p=d.width,g=d.height,m=d.borderWidth,v=d.invisible,y=o.getRawIndex(),b=s&&s.getRawIndex(),x=o.viewChildren,w=d.upperHeight,A=x&&x.length,S=f.getModel("itemStyle"),T=f.getModel(["emphasis","itemStyle"]),C=f.getModel(["blur","itemStyle"]),O=f.getModel(["select","itemStyle"]),E=S.get("borderRadius")||0,_=H("nodeGroup",yve);if(!_)return;if(l.add(_),_.x=d.x||0,_.y=d.y||0,_.markRedraw(),Pq(_).nodeWidth=p,Pq(_).nodeHeight=g,d.isAboveViewRoot)return _;var P=H("background",Xvt,u,GWr);P&&B(_,P,A&&d.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)k8(_)&&ES(_,!1),P&&(ES(P,!M),h.setItemGraphicEl(o.dataIndex,P),Wpe(P,I,D));else{var N=H("content",Xvt,u,QWr);N&&V(_,N),P.disableMorphing=!0,P&&k8(P)&&ES(P,!1),ES(_,!M),h.setItemGraphicEl(o.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),Wpe(_,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=eyt(S);ie.fill=pe;var Ce=TT(T);Ce.fill=T.get("borderColor");var Oe=TT(C);Oe.fill=C.get("borderColor");var Ee=TT(O);if(Ee.fill=O.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=Oe,X.ensureState("select").style=Ee,OS(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=eyt(S);Ce.fill=ie,Ce.decal=pe.decal;var Oe=TT(T),Ee=TT(C),ue=TT(O);U(X,ie,pe.opacity,null),X.setStyle(Ce),X.ensureState("emphasis").style=Oe,X.ensureState("blur").style=Ee,X.ensureState("select").style=ue,OS(X)}ne.add(X)}function z(ne){!ne.invisible&&a.push(ne)}function U(ne,X,J,ee){var te=f.getModel(ee?Jvt:Zvt),pe=Ls(f.get("name"),null),ie=te.getShallow("show");al(ne,Ps(f,ee?Jvt:Zvt),{defaultText:ie?pe:null,inheritColor:X,defaultOpacity:J,labelFetcher:t,labelDataIndex:o.dataIndex});var Ce=ne.getTextContent();if(Ce){var Oe=Ce.style,Ee=qN(Oe.padding||0);ee&&(ne.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var he=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);(Oe.width!==he||Oe.height!==xe)&&Ce.setStyle({width:he,height:xe})},Oe.truncateMinChar=2,Oe.lineOverflow="truncate",G(Oe,ee,d);var ue=Ce.getState("emphasis");G(ue?ue.style:null,ee,d)}}function G(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 H(ne,X,J,ee){var te=b!=null&&r[ne][b],pe=i[ne];return te?(r[ne][b]=null,j(pe,te)):v||(te=new X,te instanceof rp&&(te.z2=YWr(J,ee)),q(pe,te)),e[ne][y]=te}function j(ne,X){var J=ne[y]={};X instanceof yve?(J.oldX=X.x,J.oldY=X.y):J.oldShape=lt({},X.shape)}function q(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 YWr(t,e){return t*VWr+e}var qB=fe,qWr=yr,Nq=-1,sl=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=KWr[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(bve(i),jWr(i)):r==="category"?i.categories?XWr(i):bve(i,!0):(dc(r!=="linear"||i.dataExtent),bve(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&&qB(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(qWr(e)){var r=[];qB(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 bve(t,e){var r=t.visual,n=[];yr(r)?qB(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]),ryt(t,n)}function Bq(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:xve([0,1])}}function tyt(t){var e=this.option.visual;return e[Math.round(Zn(t,[0,1],[0,e.length-1],!0))]||{}}function jB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function XB(t){var e=this.option.visual;return e[this.option.loop&&t!==Nq?t%e.length:t]}function CT(){return this.option.visual[0]}function xve(t){return{linear:function(e){return Zn(e,t,this.option.visual,!0)},category:XB,piecewise:function(e,r){var n=wve.call(this,r);return n==null&&(n=Zn(e,t,this.option.visual,!0)),n},fixed:CT}}function wve(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=sl.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function ryt(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Yc(r);return n||[0,0,0,1]})),e}var KWr={linear:function(t){return Zn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=sl.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??Nq},fixed:no};function $q(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=nYr(i,l,m,v,g,n);iyt(m,y,r,n)}})}}}function eYr(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 ayt(t){var e=Ave(t,"color");if(e){var r=Ave(t,"colorAlpha"),n=Ave(t,"colorSaturation");return n&&(e=Ty(e,null,null,n)),r&&(e=u8(e,r)),e}}function tYr(t,e){return e!=null?Ty(e,null,null,t):null}function Ave(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function rYr(t,e,r,n,i,a){if(!(!a||!a.length)){var o=Sve(e,"color")||i.color!=null&&i.color!=="none"&&(Sve(e,"colorAlpha")||Sve(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 d=e.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(d==="index"||d==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new sl(h);return nyt(f).drColorMappingBy=d,f}}}function Sve(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function nYr(t,e,r,n,i,a){var o=lt({},e);if(i){var s=i.type,l=s==="color"&&nyt(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 iYr(t){t.registerSeriesModel(SWr),t.registerChartView(HWr),t.registerVisual(JWr),t.registerLayout(IWr),AWr(t)}function GR(t){return"_EC_"+t}var aYr=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[GR(e)]){var i=new kT(e,r);return i.hostGraph=this,this.nodes.push(i),n[GR(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[GR(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 kT||(e=i[GR(e)]),r instanceof kT||(r=i[GR(r)]),!(!e||!r)){var o=e.id+"-"+r.id,s=new oyt(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 kT&&(e=e.id),r instanceof kT&&(r=r.id);var n=this._edgesMap;return this._directed?n[e+"-"+r]:n[e+"-"+r]||n[r+"-"+e]},t.prototype.eachNode=function(e,r){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(r,n[a],a)},t.prototype.eachEdge=function(e,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(r,n[a],a)},t.prototype.breadthFirstTraverse=function(e,r,n,i){if(r instanceof kT||(r=this._nodesMap[GR(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}(),oyt=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(h)&&(e.set(h,!0),n.push(d.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 syt(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)}}}Go(kT,syt("hostGraph","data")),Go(oyt,syt("hostGraph","edgeData"));function Tve(t,e,r,n,i){for(var a=new aYr(n),o=0;o "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=Km(t,r);else{var m=cR.get(p),v=m?m.dimensions||[]:[];Nr(v,"value")<0&&v.concat(["value"]);var y=TR(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new Xc(y,r),g.initData(t)}var b=new Xc(["value"],r);return b.initData(l,s),i&&i(g,b),Dvt({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Cve="-->",Fq=function(t){return t.get("autoCurveness")||null},lyt=function(t,e){var r=Fq(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 h=Qht({series:this,dataIndex:r,multipleSeries:n});return h},e.prototype._updateCategoriesData=function(){var r=vt(this.option.categories||[],function(i){return i.value!=null?i:lt({value:0},i)}),n=new Xc(["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 nvt(r)&&r},e.type="series."+Fu,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}(Pi);function zq(t){return t instanceof Array||(t=[t,t]),t}var dYr=Ms(Fu,hYr);function hYr(t){t.eachSeriesByType(Fu,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=zq(e.get("edgeSymbol")),a=zq(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=zq(s.getShallow("symbol",!0)),d=zq(s.getShallow("symbolSize",!0)),h=s.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(o,"style");switch(lt(f,h),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]),d[0]&&l.setVisual("fromSymbolSize",d[0]),d[1]&&l.setVisual("toSymbolSize",d[1])})})}function uyt(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=$d(r.getModel().get(["lineStyle","curveness"]),-Ove(r,e,n,!0),0),a=_m(r.node1.getLayout()),o=_m(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 fYr=Ms(Fu,pYr);function pYr(t,e){t.eachSeriesByType(Fu,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]);h[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+d[0],a.y=-f[1]*b+d[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+d[0],a.y=d[1]+O,g=w[0]<0?"right":"left",a.originX=-y*T,a.originY=-O;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+O,g="center",a.originY=-O;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*T+h[0],a.y=h[1]+O,g=w[0]>=0?"right":"left",a.originX=y*T,a.originY=-O;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(gr),Nve=function(){function t(e){this.group=new gr,this._LineCtor=e||Pve}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=byt(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=byt(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!TYr(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=eR)}for(var a=e.start;a0}function byt(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:Ps(e)}}function xyt(t){return isNaN(t[0])||isNaN(t[1])}function Bve(t){return t&&!xyt(t[0])&&!xyt(t[1])}var $ve=[],Fve=[],zve=[],HR=Rl,Uve=Lx,wyt=Math.abs;function Ayt(t,e,r){for(var n=t[0],i=t[1],a=t[2],o=1/0,s,l=r*r,u=.1,d=.1;d<=.9;d+=.1){$ve[0]=HR(n[0],i[0],a[0],d),$ve[1]=HR(n[1],i[1],a[1],d);var h=wyt(Uve($ve,e)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function Vve(t,e){var r=[],n=s8,i=[[],[],[]],a=[[],[]],o=[];e/=2,t.eachEdge(function(s,l){var u=s.getLayout(),d=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[_m(u[0]),_m(u[1])],u[2]&&u.__original.push(_m(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]),d&&d!=="none"){var p=JB(s.node1),g=Ayt(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(h&&h!=="none"){var p=JB(s.node2),g=Ayt(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]),Dx(o,a[1],a[0]),KA(o,o),d&&d!=="none"){var p=JB(s.node1);OH(a[0],a[0],o,p*e)}if(h&&h!=="none"){var p=JB(s.node2);OH(a[1],a[1],o,-p*e)}hc(u[0],a[0]),hc(u[1],a[1])}})}var Syt=Qr();function CYr(t){if(t)return Syt(t).bridge}function Tyt(t,e){t&&(Syt(t).bridge=e)}var kYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Fu,r}return e.prototype.init=function(r,n){var i=new AB,a=new Nve,o=this.group,s=new gr;this._controller=new vT(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=_q(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 d=this._symbolDraw,h=this._lineDraw;o&&ow(l,a0,o,this._firstRender?null:r),Vve(r.getGraph(),ZB(r));var f=r.getData();d.updateData(f);var p=r.getEdgeData();h.updateData(p),this._updateNodeAndLinkScale(),o&&Rq(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 O=T.get(["emphasis","focus"]);O==="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){hyt(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=_q(n);!this._active||!a||(ow(this._mainGroup,a0,a,null),fvt(r)&&(this._updateNodeAndLinkScale(),Vve(n.getGraph(),ZB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=ZB(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(Vve(r.getGraph(),ZB(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=CYr(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(Tq(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(),d=new gr,h=new gr;s.add(h),s.add(d);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."+e7,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}(Pi),Cyt=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(),d=u.getModel("emphasis"),h=r.getItemLayout(n),f=lt(i0(u.getModel("itemStyle"),h,!0),h),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):qn(p,{shape:f},l,n);var g=lt(i0(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Is(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,p),Is(p,u,"itemStyle");var m=d.get("focus");Ea(this,m==="adjacency"?s.getAdjacentDataIndices():m,d.get("blurScope"),d.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),d=n.getModel("label");a.ignore=!d.get("show");var h=Ps(n),f=i.getVisual("style");al(a,h,{labelFetcher:{getFormattedLabel:function(b,x,w,A,S,T){return r.getFormattedLabel(b,x,"node",A,$d(S,h.normal&&h.normal.get("formatter"),n.get("name")),T)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var p=d.get("position")||"outside",g=d.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"?d.get("align")||"center":l>0?"left":"right",y=p!=="outside"?d.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}(pc),MYr=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(),d=l.node1.getModel(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),p=h.getModel("emphasis"),g=p.get("focus"),m=lt(i0(d.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}o?(v.setShape(m),kyt(v,l,r,f)):(ip(v),kyt(v,l,r,f),qn(v,{shape:m},s,i)),Ea(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),Is(v,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(yn);function kyt(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 d=t.shape,h=(d.s1[0]+d.s2[0])/2,f=(d.s1[1]+d.s2[1])/2,p=(d.t1[0]+d.t2[0])/2,g=(d.t1[1]+d.t2[1])/2;o.fill=new RS(h,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var IYr=Math.PI/180,PYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e7,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")*IYr;if(a.diff(o).add(function(d){var h=a.getItemLayout(d);if(h){var f=new Cyt(a,d,l);Cr(f).dataIndex=d,s.add(f)}}).update(function(d,h){var f=o.getItemGraphicEl(h),p=a.getItemLayout(d);if(!p){f&&My(f,r,h);return}f?f.updateData(a,d,l):f=new Cyt(a,d,l),s.add(f)}).remove(function(d){var h=o.getItemGraphicEl(d);h&&My(h,r,d)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=Gt(u[0],i.getWidth()),this.group.originY=Gt(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 MYr(i,a,l,n);Cr(u).dataIndex=l,s.add(u)}).update(function(l,u){var d=o.getItemGraphicEl(u);d.updateData(i,a,l,n),s.add(d)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&My(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=e7,e}(Ei),Gve=Math.PI/180,NYr=Ms(e7,BYr);function BYr(t,e){t.eachSeriesByType(e7,function(r){$Yr(r,e)})}function $Yr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var o=$dt(t,e),s=o.cx,l=o.cy,u=o.r,d=o.r0,h=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];wW(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)){h*T>=Math.abs(w)&&(h=Math.max(0,(Math.abs(w)-f*T)/T)),(h+f)*T>=Math.abs(w)&&(f=(Math.abs(w)-h*T)/T);var O=(w-h*T*v)/C,E=0,_=0,P=0;n.eachNode(function(N){var F=S[N.dataIndex]||0,B=O*(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:d,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),I[N.dataIndex]=M,M+=(F+h)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=O*(C?F:1)*v,V=N.node1.dataIndex,z=I[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),G=z+U*v,H=[s+d*Math.cos(z),l+d*Math.sin(z)],j=[s+d*Math.cos(G),l+d*Math.sin(G)],q=N.node2.dataIndex,ne=I[q]||0,X=Math.abs((N.node2.getLayout().ratio||1)*B),J=ne+X*v,ee=[s+d*Math.cos(ne),l+d*Math.sin(ne)],te=[s+d*Math.cos(J),l+d*Math.sin(J)];N.setLayout({s1:H,s2:j,sStartAngle:z,sEndAngle:G,t1:ee,t2:te,tStartAngle:ne,tEndAngle:J,cx:s,cy:l,r:d,value:F,clockwise:m}),I[V]=G,I[q]=J})}}}function FYr(t){t.registerChartView(PYr),t.registerSeriesModel(LYr),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,NYr),t.registerProcessor(DB("chord"))}var zYr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),UYr=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 zYr},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),d=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,d),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,d)},e}(yn);function VYr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=Gt(r[0],e.getWidth()),s=Gt(r[1],e.getHeight()),l=Gt(t.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Uq(t,e){var r=t==null?"":t+"";return e&&($t(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var 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.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=VYr(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,d=-r.get("endAngle")/180*Math.PI,h=r.getModel("axisLine"),f=h.get("roundCap"),p=f?lq:pc,g=h.get("show"),m=h.getModel("lineStyle"),v=m.get("width"),y=[u,d];wW(y,!l),u=y[0],d=y[1];for(var b=d-u,x=u,w=[],A=0;g&&A=O&&(E===0?0:a[E-1][0])Math.PI/2&&(G+=Math.PI)):U==="tangential"?G=-C-Math.PI/2:Vn(U)&&(G=U*Math.PI/180),G===0?h.add(new $n({style:Xi(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})):h.add(new $n({style:Xi(x,{text:F,x:V,y:z,verticalAlign:"middle",align:"center"},{inheritColor:B}),silent:!0,originX:V,originY:z,rotation:G}))}if(b.get("show")&&M!==w){var I=b.get("distance");I=I?I+d:d;for(var H=0;H<=A;H++){R=Math.cos(C),D=Math.sin(C);var j=new Qo({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"&&j.setStyle({stroke:a((M+H/A)/w)}),h.add(j),C+=E}C-=E}else C+=O}},e.prototype._renderPointer=function(r,n,i,a,o,s,l,u,d){var h=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=Gt(L.get("width"),o.r),D=Gt(L.get("length"),o.r),M=r.get(["pointer","icon"]),I=L.get("offsetCenter"),N=Gt(I[0],o.r),F=Gt(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 UYr({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 O(E,_){var P=v.get("roundCap"),L=P?lq:pc,R=v.get("overlap"),D=R?v.get("width"):d/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),h.add(P),b.setItemGraphicEl(E,P)}if(y){var L=O(E,s),R=v.get("clip");ua(L,{shape:{endAngle:Zn(_,S,T,R)}},r),h.add(L),Ppe(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),h.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],I=M?M.shape.endAngle:s,N=O(E,I),F=v.get("clip");qn(N,{shape:{endAngle:Zn(P,S,T,F)}},r),h.add(N),Ppe(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 il){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,Is(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,Is(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"),d=Yo(s,n.cx-o/2+Gt(l[0],n.r),n.cy-o/2+Gt(l[1],n.r),o,o,null,u);d.z2=i.get("showAbove")?1:0,d.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(d)}},e.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),d=+r.get("min"),h=+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,[d,h],[0,1],!0)),S=b.getModel("title");if(S.get("show")){var T=S.get("offsetCenter"),C=o.cx+Gt(T[0],o.r),O=o.cy+Gt(T[1],o.r),E=p[y];E.attr({z2:v?0:2,style:Xi(S,{x:C,y:O,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+Gt(P[0],o.r),R=o.cy+Gt(P[1],o.r),D=Gt(_.get("width"),o.r),M=Gt(_.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:Xi(_,{x:L,y:R,text:Uq(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:I})}),hdt(E,{normal:_},x,function(B){return Uq(B,N)}),m&&fdt(E,y,l,r,{getFormattedLabel:function(B,V,z,U,G,H){return Uq(H?H.interpolatedValue:x,N)}}),w.add(E)}f.add(w)}),this.group.add(f),this._titleEls=p,this._detailEls=g},e.type="gauge",e}(Ei),QYr=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 $R(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}(Pi);function HYr(t){t.registerChartView(GYr),t.registerSeriesModel(QYr)}var WR="funnel",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.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new FR(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return $R(this,{coordDimensions:["value"],encodeDefaulter:Kr(Pge,this)})},e.prototype._defaultLabelLine=function(r){fS(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."+WR,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}(Pi),YYr=["itemStyle","opacity"],qYr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=i,o=new Ml,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"),d=s.get(YYr);d=d??1,i||ip(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:d}},o,n)):qn(a,{style:{opacity:d},shape:{points:l.points}},o,n),Is(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),d=u.label,h=r.getItemVisual(n,"style"),f=h.fill;al(o,Ps(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:d.textAlign,verticalAlign:d.verticalAlign}});var p=l.getModel("label"),g=p.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!d.inside,insideStroke:m,outsideFill:m});var v=d.linePoints;a.setShape({points:v}),i.textGuideLineConfig={anchor:v?new wr(v[0][0],v[0][1]):null},qn(o,{style:{x:d.x,y:d.y}},s,n),o.attr({rotation:d.rotation,originX:d.x,originY:d.y,z2:10}),Jme(i,e0e(l),{stroke:f})},e}(gc),jYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=WR,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 qYr(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var d=o.getItemGraphicEl(u);d.updateData(a,l),s.add(d),a.setItemGraphicEl(l,d)}).remove(function(l){var u=o.getItemGraphicEl(l);My(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=WR,e}(Ei);function XYr(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,h="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,h="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,h="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,h="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,h="center"):(y=m+x,f=y+5,h="top")):o==="rightBottom"?(m=u[2][0],v=u[2][1],r?(b=v+x,p=b+5,h="center"):(y=m+x,f=y+5,h="bottom")):o==="leftTop"?(m=u[0][0],v=r?u[0][1]:u[1][1],r?(b=v-x,p=b-5,h="center"):(y=m-x,f=y-5,h="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,h="center"):(y=m-x,f=y-5,h="right")):(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,r?(b=v+x,p=b+5,h="center"):(y=m+x,f=y+5,h="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:h,inside:d}})}var ZYr=Ms(WR,JYr);function JYr(t,e){t.eachSeriesByType(WR,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),o=Ns(r,e),s=ba(r.getBoxLayoutParams(),o.refContainer),l=Oyt(r),u=s.width,d=s.height,h=XYr(n,a),f=s.x,p=s.y,g=l?[Gt(r.get("minSize"),d),Gt(r.get("maxSize"),d)]:[Gt(r.get("minSize"),u),Gt(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:d,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+(d-N)/2;break;case"bottom":F=p+(d-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+=d,h=h.reverse());for(var T=0;Tfqr)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||!Hve(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 Hve(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var Vq="parallel",Wve=Vq,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(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(r){var n=this.option;r&&Gr(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=Wve,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),vqr=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}(up);function lw(t,e,r,n,i,a){t=t||0;var o=dS(r[1],-r[0]);if(i!=null&&(i=YR(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(dS(e[1],-e[0]));s=YR(s,[0,o]),i=a=YR(s,[i,a]),n=0}e[0]=YR(e[0],r),e[1]=YR(e[1],r);var l=Yve(e,n);e[n]+=t;var u=i||0,d=r.slice();l.sign<0?d[0]=dS(d[0],u):d[1]=dS(d[1],-u),e[n]=YR(e[n],d);var h;return h=Yve(e,n),i!=null&&(h.sign!==l.sign||h.spana&&(e[1-n]=dS(e[n],h.sign*a)),e}function Yve(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 YR(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var yqr=function(){function t(e,r,n){this.type=Vq,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),d=uB(u),h=this._axesMap.set(o,new vqr(o,OR(u,d,!1),[0,0],d,l));h.onBand=fB(h.scale,u),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},t.prototype.update=function(e,r){fe(this.dimensions,function(n){var i=this._axesMap.get(n);nT(i,LR),MR(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=Ns(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,d=Gq(e.get("axisExpandWidth"),l),h=Gq(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&d>0&&s>0,p=e.get("axisExpandWindow"),g;if(p)g=Gq(p[1]-p[0],l),p[1]=p[0]+g;else{g=Gq(d*(h-1),l);var m=e.get("axisExpandCenter")||ep(u/2);p=[d*m-g/2],p[1]=p[0]+g}var v=(s-g)/(u-h);v<3&&(v=0);var y=[ep(Yn(p[0]/d,1))+1,lS(Yn(p[1]/d,1))-1],b=v/d*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:d,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?xqr:bqr)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},d={horizontal:sW/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=d[a],p=Oa();Ay(p,p,f),cg(p,p,h),this._axesLayout[o]={position:h,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(),d=n;da*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/d,l?lw(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 Gq(t,e){return Oi(rn(t,e[0]),e[1])}function bqr(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function xqr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,d;return t=0;i--)Dl(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;aCqr}function $yt(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Fyt(t,e,r,n){var i=new gr;return i.add(new nn({name:"main",style:tye(r),silent:!0,draggable:!0,cursor:"move",drift:Kr(Vyt,t,e,i,["n","s","w","e"]),ondragend:Kr(ET,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(Vyt,t,e,i,a),ondragend:Kr(ET,e,{isEnd:!0})}))}),i}function zyt(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=qR(i,kqr),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,d=r[0][1],h=r[1][1],f=d-a+i/2,p=h-a+i/2,g=d-o,m=h-s,v=g+i,y=m+i;Vy(t,e,"main",o,s,g,m),n.transformable&&(Vy(t,e,"w",l,u,a,y),Vy(t,e,"e",f,u,a,y),Vy(t,e,"n",l,u,v,a),Vy(t,e,"s",l,p,v,a),Vy(t,e,"nw",l,u,a,a),Vy(t,e,"ne",f,u,a,a),Vy(t,e,"sw",l,p,a,a),Vy(t,e,"se",f,p,a,a))}function eye(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(tye(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?rye(t,a[0]):Lqr(t,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Eqr[s]+"-resize":null})})}function Vy(t,e,r,n,i,a,o){var s=e.childOfName(r);s&&s.setShape(Iqr(nye(t,e,[[n,i],[n+a,i+o]])))}function tye(t){return mr({strokeNoScale:!0},t.brushStyle)}function Uyt(t,e,r,n){var i=[t7(t,r),t7(e,n)],a=[qR(t,r),qR(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Dqr(t){return MS(t.group)}function rye(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=$W(r[e],Dqr(t));return n[i]}function Lqr(t,e){var r=[rye(t,e[0]),rye(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Vyt(t,e,r,n,i,a){var o=r.__brushOption,s=t.toRectRange(o.range),l=Gyt(e,i,a);fe(n,function(u){var d=Oqr[u];s[d[0]][d[1]]+=l[d[0]]}),o.range=t.fromRectRange(Uyt(s[0][0],s[1][0],s[0][1],s[1][1])),Xve(e,r),ET(e,{isEnd:!1})}function Mqr(t,e,r,n){var i=e.__brushOption.range,a=Gyt(t,r,n);fe(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Xve(t,e),ET(t,{isEnd:!1})}function Gyt(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 nye(t,e,r){var n=Byt(t,e);return n&&n!==OT?n.clipPath(r,t._transform):lr(r)}function Iqr(t){var e=t7(t[0][0],t[1][0]),r=t7(t[0][1],t[1][1]),n=qR(t[0][0],t[1][0]),i=qR(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function Pqr(t,e,r){if(!(!t._brushType||Bqr(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=Zve(t,e,r);if(!t._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Qq={lineX:Yyt(0),lineY:Yyt(1),rect:{createCover:function(t,e){function r(n){return n}return Fyt({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=$yt(t);return Uyt(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){zyt(t,e,r,n)},updateCommon:eye,contain:aye},polygon:{createCover:function(t,e){var r=new gr;return r.add(new Ml({name:"main",style:tye(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new gc({name:"main",draggable:!0,drift:Kr(Mqr,t,e),ondragend:Kr(ET,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:nye(t,e,r)})},updateCommon:eye,contain:aye}};function Yyt(t){return{createCover:function(e,r){return Fyt({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=$yt(e),n=t7(r[0][t],r[1][t]),i=qR(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,o=Byt(e,r);if(o!==OT&&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(),zyt(e,r,l,i)},updateCommon:eye,contain:aye}}function qyt(t){return t=oye(t),function(e){return ige(e,t)}}function jyt(t,e){return t=oye(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 Xyt(t,e,r){var n=oye(t);return function(i,a){return n.contain(a[0],a[1])&&!P0t(i,e,r)}}function oye(t){return pr.create(t)}var $qr=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 jve(n.getZr())).on("brush",Wt(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!Fqr(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=Uqr(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),d=u.width,h=r.axis.dim,f=l.getAxisLayout(h),p=lt({strokeContainThreshold:d},f),g=new $u(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,s,d,i),I8(o,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],d=Math.min(30,Math.abs(u)*.1),h=pr.create({x:l[0],y:-o/2,width:u,height:o});h.x-=d,h.width+=2*d,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:qyt(h),isTargetByCursor:Xyt(h,s,a),getLinearBrushOtherExtent:jyt(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(zqr(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}(Ki);function Fqr(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function zqr(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 Uqr(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var Vqr={type:"axisAreaSelect",event:"axisAreaSelected"};function Gqr(t){t.registerAction(Vqr,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 Qqr={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Kyt(t){t.registerComponentView(pqr),t.registerComponentModel(mqr),t.registerCoordinateSystem("parallel",Aqr),t.registerPreprocessor(uqr),t.registerComponentModel(qve),t.registerComponentView($qr),zR(t,"parallel",qve,Qqr),Gqr(t)}function Hqr(t){Xr(Kyt),t.registerChartView(rqr),t.registerSeriesModel(aqr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,cqr)}var Gy="sankey",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.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=Tve(a,i,this,!0,d);return u.data;function d(h,f){h.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 d=this.getGraph().getNodeByIndex(r),h=d.getLayout().value,f=this.getDataParams(r,i).data.name;return fs("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},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."+Gy,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}(Pi),Yqr=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}(),qqr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Yqr},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(){Dy(this)},e.prototype.downplay=function(){Ly(this)},e}(yn),jqr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Gy,r._mainGroup=new gr,r}return e.prototype.init=function(r,n){this._controller=new vT(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),o=this._mainGroup,s=r.layoutInfo,l=s.width,u=s.height,d=r.getData(),h=r.getData("edge"),f=r.get("orient");o.removeAll(),o.x=s.x,o.y=s.y,this._updateViewCoordSys(r,i),Rq(r,i,this._controller,dvt(o),null),a.eachEdge(function(p){var g=new qqr,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(),O=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=(O!=null?O*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=O!=null?O*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()),Zyt(g.style,f,p);var B=""+v.get("value"),V=Ps(v,"edgeLabel");al(g,V,{labelFetcher:{getFormattedLabel:function(G,H,j,q,ne,X){return r.getFormattedLabel(G,H,"edge",q,$d(ne,V.normal&&V.normal.get("formatter"),B),X)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");Is(g,v,"lineStyle",function(G){var H=G.getItemStyle();return Zyt(H,f,p),H}),o.add(g),h.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});al(w,Ps(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),Is(w,m),o.add(w),d.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"))}),d.eachItemGraphicEl(function(p,g){var m=d.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:d.getRawIndex(g),localX:this.shape.x/l,localY:this.shape.y/u})},p.draggable=!0,p.cursor="move")}),!this._data&&r.isAnimationEnabled()&&o.setClipPath(Xqr(o.getBoundingRect(),r,function(){o.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){ow(this.group,a0,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=sve(r,n,i.x,i.y,i.width,i.height);ow(this.group,a0,a,this._firstRender?null:r)},e.type=Gy,e}(Ei);function Zyt(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 RS(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function Xqr(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 Kqr=Ms(Gy,Zqr);function Zqr(t,e){t.eachSeriesByType(Gy,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Ns(r,e).refContainer,o=ba(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),d=u.nodes,h=u.edges;ejr(d);var f=oi(d,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");Jqr(d,h,n,i,s,l,p,g,m)})}function Jqr(t,e,r,n,i,a,o,s,l){tjr(t,e,r,i,a,s,l),ajr(t,e,a,i,n,o,s),pjr(t,s)}function ejr(t){fe(t,function(e){var r=uw(e.outEdges,Hq),n=uw(e.inEdges,Hq),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function tjr(t,e,r,n,i,a,o){for(var s=[],l=[],u=[],d=[],h=0,f=0;f=0;y&&v.depth>p&&(p=v.depth),m.setLayout({depth:y?v.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var b=0;bh-1?p:h-1;o&&o!=="left"&&rjr(t,o,a,T);var C=a==="vertical"?(i-r)/T:(n-r)/T;ijr(t,C,a)}function Jyt(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function rjr(t,e,r,n){if(e==="right"){for(var i=[],a=t,o=0;a.length;){for(var s=0;s0;a--)l*=.99,ljr(s,l,o),sye(s,i,r,n,o),fjr(s,l,o),sye(s,i,r,n,o)}function ojr(t,e){var r=[],n=e==="vertical"?"y":"x",i=fpe(t,function(a){return a.getLayout()[n]});return Dl(i.keys),fe(i.keys,function(a){r.push(i.buckets.get(a))}),r}function sjr(t,e,r,n,i,a){var o=1/0;fe(t,function(s){var l=s.length,u=0;fe(s,function(h){u+=h.getLayout().value});var d=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;d0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=d-e-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),d=s;for(var p=h-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[f]+e-d,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]}})}function ljr(t,e,r){fe(t.slice().reverse(),function(n){fe(n,function(i){if(i.outEdges.length){var a=uw(i.outEdges,cjr,r)/uw(i.outEdges,Hq);if(isNaN(a)){var o=i.outEdges.length;a=o?uw(i.outEdges,ujr,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-cw(i,r))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-cw(i,r))*e;i.setLayout({y:l},!0)}}})})}function cjr(t,e){return cw(t.node2,e)*t.getValue()}function ujr(t,e){return cw(t.node2,e)}function djr(t,e){return cw(t.node1,e)*t.getValue()}function hjr(t,e){return cw(t.node1,e)}function cw(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Hq(t){return t.getValue()}function uw(t,e,r){for(var n=0,i=t.length,a=-1;++ao&&(o=l)}),fe(n,function(s){var l=new sl({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),d=s.getModel().get(["itemStyle","color"]);d!=null?(s.setVisual("color",d),s.setVisual("style",{fill:d})):(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 vjr(t){t.registerChartView(jqr),t.registerSeriesModel(Wqr),t.registerLayout(Kqr),t.registerVisual(gjr),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:Ym,subType:Gy,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),ove(t,Ym,Gy)}var e1t=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 d=["x","y"],h=u==="horizontal"?0:1,f=this._baseAxisDim=d[h],p=d[1-h],g=[i,a],m=g[h].get("type"),v=g[1-h].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:EY(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:EY(v),dimsDef:x.slice()}];return $R(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:Kr(Wdt,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 Wq(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 _jr={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==Ll){var n="";si(n)}var i=Ejr(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Rjr(t){t.registerSeriesModel(t1t),t.registerChartView(yjr),t.registerLayout(Sjr),t.registerTransform(_jr),Ojr(t)}var dw="candlestick",i1t=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."+dw,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}(Pi);Go(i1t,e1t,!0);var Djr=["itemStyle","borderColor"],Ljr=["itemStyle","borderColor0"],Mjr=["itemStyle","borderColorDoji"],Ijr=["itemStyle","color"],Pjr=["itemStyle","color0"];function lye(t,e){return e.get(t>0?Ijr:Pjr)}function cye(t,e){return e.get(t===0?Mjr:t>0?Djr:Ljr)}var Njr={seriesType:dw,plan:YS(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=lye(s,o),l.stroke=cye(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");lt(u,l)}}}}}},Bjr=["color","borderColor"],$jr=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){qx(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(),d=s&&uT(l,!1,r);this._data||a.removeAll();var h=a1t(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=s?Wq(u,p):SB;if(g===CB)return;var m=uye(p,f,h,!0);ua(m,{shape:{points:p.ends}},r,f),NR(g===TB,m,d),dye(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?Wq(u,m):SB;if(v===CB){a.remove(g);return}g?(qn(g,{shape:{points:m.ends}},r,f),ip(g)):g=uye(m,f,h),dye(g,n,f,o),NR(v===TB,g,d),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(),o1t(r,this.group);var n=r.get("clip",!0)?uT(r.coordinateSystem,!1,r):null;NR(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o=a1t(n),s;(s=r.next())!=null;){var l=i.getItemLayout(s),u=uye(l,s,o);dye(u,i,s,a),u.incremental=zm(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){o1t(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),NR(!1,this.group,null),this._data=null},e.type=dw,e}(Ei),Fjr=function(){function t(){}return t}(),zjr=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 Fjr},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 uye(t,e,r,n){var i=t.ends;return new zjr({shape:{points:n?Ujr(i,r,t):i},z2:100})}function dye(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,Is(t,i);var o=e.getItemLayout(r).sign;fe(t.states,function(l,u){var d=i.getModel(u),h=lye(o,d),f=cye(o,d)||h,p=l.style||(l.style={});h&&(p.fill=h),f&&(p.stroke=f)});var s=i.getModel("emphasis");Ea(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function Ujr(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function a1t(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var Vjr=function(){function t(){}return t}(),hye=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 Vjr},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 G=z.slice(),H=z.slice();G[i]=BW(G[i]+n/2,1,!1),H[i]=BW(H[i]-n/2,1,!0),U?V.push(G,H):V.push(H,G)}function F(V,z,U){var G=I(V,U),H=I(z,U);return G[i]-=n/2,H[i]-=n/2,{x:G[0],y:G[1],width:a?n:H[0]-G[0],height:a?H[1]-G[1]:n}}function B(V){return V[i]=BW(V[i],1),V}}function g(m,v){for(var y=r0(m.count*4),b=0,x,w=[],A=[],S,T=v.getStore(),C=!!t.get(["itemStyle","borderColorDoji"]);(S=m.next())!=null;){var O=T.get(s,S),E=T.get(u,S),_=T.get(d,S),P=T.get(h,S),L=T.get(f,S);if(isNaN(O)||isNaN(P)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=s1t(T,S,E,_,d,C),w[i]=O,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 s1t(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 Wjr(t,e){var r=t.getBaseAxis(),n=vc(r,{fromStat:{key:pT(dw)},min:1}).w,i=Gt(Jt(t.get("barMaxWidth"),n),n),a=Gt(Jt(t.get("barMinWidth"),1),n),o=t.get("barWidth");return o!=null?Gt(o,n):rn(Oi(n/2,i),a)}function Yjr(t){Qjr(t,function(){var e=pT(dw);Hme(t,{key:e,seriesType:dw,getMetrics:L0e}),VY(e,oq(e))})}function qjr(t){t.registerChartView($jr),t.registerSeriesModel(i1t),t.registerPreprocessor(Gjr),t.registerVisual(Njr),t.registerLayout(Hjr),Yjr(t)}function l1t(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 jjr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=new wB(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)/d*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ur(h)?f=h(i):f=h,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 yy(r.__p1,r.__cp1)+yy(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=Rl,d=Ofe;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<=1?d(n[0],a[0],i[0],o):d(i[0],a[0],n[0],1-o),f=r.__t<=1?d(n[1],a[1],i[1],o):d(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-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 d=(n-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];r.x=h[0]*(1-d)+d*f[0],r.y=h[1]*(1-d)+d*f[1];var p=r.__t<=1?f[0]-h[0]:h[0]-f[0],g=r.__t<=1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},e}(u1t),eXr=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),tXr=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 eXr},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+h)/2-(d-f)*a,g=(d+f)/2-(h-u)*a;r.quadraticCurveTo(p,g,h,f)}else r.lineTo(h,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 h=a[u++],f=a[u++],p=1;p0){var v=(h+g)/2-(f-m)*o,y=(f+m)/2-(g-h)*o;if(qct(h,f,v,y,g,m,s,r,n))return l}else if(Gx(h,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}(),h1t={seriesType:"lines",plan:YS(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,d=i.start;d0&&d&&u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),o.updateData(a);var h=r.get("clip",!0)&&uT(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):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(),zm(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=h1t.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 rXr:new Nve(o?a?Jjr:d1t:a?u1t:Pve),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=uge(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}(Ei),iXr=typeof Uint32Array>"u"?Array:Uint32Array,aXr=typeof Float64Array>"u"?Array:Float64Array;function f1t(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),TH([i,r[0],r[1]])}))}var oXr=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||[],f1t(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(f1t(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=k_(this._flatCoords,n.flatCoords),this._flatCoordsOffset=k_(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}(Pi);function Yq(t){return t instanceof Array||(t=[t,t]),t}var sXr={seriesType:"lines",reset:function(t){var e=Yq(t.get("symbol")),r=Yq(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=Yq(s.getShallow("symbol",!0)),u=Yq(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 lXr(t){t.registerChartView(nXr),t.registerSeriesModel(oXr),t.registerLayout(h1t),t.registerVisual(sXr)}var cXr=256,uXr=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=rl.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"),d=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),p=e.length;h.width=r,h.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),h},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=rl.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 dXr(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 fXr=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()):cmt(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&&(cmt(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){qx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=dT(s,"cartesian2d"),u=dT(s,"matrix"),d,h,f,p;if(l){var g=s.getAxis("x"),m=s.getAxis("y");d=vc(g).w+.5,h=vc(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=Ps(r),T=r.getModel("emphasis"),C=T.get("focus"),O=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]-d/2,y:I[1]-h/2,width:d,height:h},style:R})}else if(u){var N=s.dataToLayout([y.get(_[0],P),y.get(_[1],P)]).rect;if(uc(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(uc(N.x)||uc(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"),O=V.get("blurScope"),E=V.get("disabled"),S=Ps(B)}L.shape.r=A;var z=r.getRawValue(P),U="-";z&&z[2]!=null&&(U=z[2]+""),al(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,O,E),L.incremental=zm(r,o),o&&(L.states.emphasis.hoverLayer=eR),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 uXr;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var d=r.getViewRect().clone(),h=r.getRoamTransform();d.applyTransform(h);var f=Math.max(d.x,0),p=Math.max(d.y,0),g=Math.min(d.width+d.x,a.getWidth()),m=Math.min(d.height+d.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,O){var E=r.dataToPoint([T,C]);return E[0]-=f,E[1]-=p,E.push(O),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?hXr(w,i.option.range):dXr(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 il({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Ei),pXr=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 Km(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=cR.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}(Pi);function gXr(t){t.registerChartView(fXr),t.registerSeriesModel(pXr)}var mXr=["itemStyle","borderWidth"],p1t=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pye=new qm,vXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=_B,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(),d=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:d,valueDim:p1t[+d],categoryDim:p1t[1-+d]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=w1t(o,g),v=g1t(o,g,m,f),y=A1t(o,f,v);o.setItemGraphicEl(g,y),a.add(y),C1t(y,f,v)}}).update(function(g,m){var v=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(v);return}var y=w1t(o,g),b=g1t(o,g,y,f),x=T1t(o,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),o.setItemGraphicEl(g,null),v=null),v?TXr(v,f,b):v=A1t(o,f,b,!0),o.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),C1t(v,f,b)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&S1t(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?uT(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){S1t(a,Cr(o).dataIndex,r,o)}):i.removeAll()},e.type=_B,e}(Ei);function g1t(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,d=r.get("symbolPatternSize")||2,h=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:d,rotation:u,animationModel:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};yXr(r,a,i,n,f),bXr(t,e,i,a,o,f.boundingLength,f.pxSign,d,n,f),xXr(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=jS(r.get("symbolOffset"),p);return wXr(r,p,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function yXr(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),d;if(ft(o)){var h=[gye(s,o[0])-l,gye(s,o[1])-l];h[1]=0?1:-1:d>0?1:-1}function gye(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function bXr(t,e,r,n,i,a,o,s,l,u){var d=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),p=t.getItemVisual(e,"symbolSize"),g;ft(p)?g=p.slice():p==null?g=["100%","100%"]:g=[p,p],g[h.index]=Gt(g[h.index],f),g[d.index]=Gt(g[d.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[d.index]*=(l.isHorizontal?-1:1)*o}function xXr(t,e,r,n,i){var a=t.get(mXr)||0;a&&(pye.attr({scaleX:e[0],scaleY:e[1],rotation:r}),pye.updateTransform(),a/=pye.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function wXr(t,e,r,n,i,a,o,s,l,u,d,h){var f=d.categoryDim,p=d.valueDim,g=h.pxSign,m=Math.max(e[p.index]+s,0),v=m;if(n){var y=Math.abs(l),b=Hc(t.get("symbolMargin"),"15%")+"",x=!1;b.lastIndexOf("!")===b.length-1&&(x=!0,b=b.slice(0,b.length-1));var w=Gt(b,e[p.index]),A=Math.max(m+w*2,0),S=x?0:w*2,T=lpe(n),C=T?n:k1t((y+S)/A),O=y-C*m;w=O/2/(x?C:Math.max(C-1,1)),A=m+w*2,S=x?0:w*2,!T&&n!=="fixed"&&(C=u?k1t((Math.abs(u)+S)/A):0),v=C*A-S,h.repeatTimes=C,h.symbolMargin=w}var E=g*(v/2),_=h.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=h.bundlePosition=[];P[f.index]=r[f.xy],P[p.index]=r[p.xy];var L=h.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=h.clipShape={};R[f.xy]=-r[f.xy],R[f.wh]=d.ecSize[f.wh],R[p.xy]=0,R[p.wh]=r[p.wh]}function m1t(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 v1t(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,d=0,h=a[e.valueDim.index]+o+r.symbolMargin*2;for(mye(t,function(m){m.__pictorialAnimationIndex=d,m.__pictorialRepeatTimes=u,d0:y<0)&&(b=u-1-m),v[l.index]=h*(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 y1t(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?jR(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=m1t(r),i.add(a),jR(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 b1t(t,e,r){var n=lt({},e.barRectShape),i=t.__pictorialBarRect;i?jR(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 x1t(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],NS[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function w1t(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=AXr,r.isAnimationEnabled=SXr,r}function AXr(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function SXr(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function A1t(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?v1t(i,e,r):y1t(i,e,r),b1t(i,r,n),x1t(i,e,r,n),i.__pictorialShapeStr=T1t(t,r),i.__pictorialSymbolMeta=r,i}function TXr(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?v1t(t,e,r,!0):y1t(t,e,r,!0),b1t(t,r,!0),x1t(t,e,r,!0)}function S1t(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];mye(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),fe(a,function(o){Yx(o,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function T1t(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function mye(t,e,r){fe(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function jR(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&NS[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function C1t(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"),d=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");mye(t,function(m){if(m instanceof il){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,al(g,Ps(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:PR(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),Ea(t,d,h,a.get("disabled"))}function k1t(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var CXr=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."+_B,e.dependencies=["grid"],e.defaultOption=jx(RB.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}(RB);function kXr(t){t.registerChartView(vXr),t.registerSeriesModel(CXr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Fmt(_B)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,zmt(_B)),Vmt(t)}var vye=2,XR="themeRiver",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.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new FR(Wt(this.getData,this),Wt(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=fpe(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=h)}return{y0:i,max:a}}function MXr(t){t.registerChartView(EXr),t.registerSeriesModel(OXr),t.registerLayout(RXr),t.registerProcessor(DB(XR))}var IXr=2,PXr=4,E1t=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;o.z2=IXr,o.textConfig={inside:!0},Cr(o).seriesIndex=n.seriesIndex;var s=new $n({z2:PXr,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"),d=n.getLayout(),h=lt({},d);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=xR(p,o));var g=i0(l.getModel("itemStyle"),h,!0);lt(h,g),fe(Mu,function(b){var x=s.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=i0(w,h);A&&(x.shape=A)}),r?(s.setShape(h),s.shape.r=d.r0,ua(s,{shape:{r:d.r}},i,n.dataIndex)):(qn(s,{shape:h},i),ip(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"?k_(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),d=Math.sin(l),h=this,f=h.getTextContent(),p=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)R&&!hS(M-R)&&M0?(o.virtualPiece?o.virtualPiece.updateData(!1,b,r,n,i):(o.virtualPiece=new E1t(b,r,n,i),d.add(o.virtualPiece)),x.piece.off("click"),o.virtualPiece.on("click",function(w){o._rootToNode(x.parentNode)})):o.virtualPiece&&(d.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 d=l.get("target",!0)||"_blank";KW(u,d)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:yye,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=_T,e}(Ei),zXr=Ms(_T,UXr);function UXr(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=zH(s,(n.depth-1)/(a-1)*.5)),s}t.eachSeriesByType(_T,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 D1t=Math.PI/180,VXr=Ms(_T,GXr);function GXr(t,e){t.eachSeriesByType(_T,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=Gt(n[0],a),u=Gt(n[1],o),d=Gt(i[0],s/2),h=Gt(i[1],s/2),f=-r.get("startAngle")*D1t,p=r.get("minAngle")*D1t,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&L1t(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=(h-d)/(S||1),C=r.get("clockwise"),O=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&&O?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(eKr,t)}}}function rKr(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 nKr(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 I1t={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},P1t=En(I1t);qf(ky,function(t,e){return t[e]=1,t},{}),ky.join(", ");var qq=["","style","shape","extra"],KR=Qr();function bye(t,e,r,n,i){var a=t+"Animation",o=Z_(t,n,i)||{},s=KR(e).userDuring;return o.duration>0&&(o.during=s?Wt(lKr,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),lt(o,r[a]),o}function jq(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=KR(t),u=e.style;l.userDuring=e.during;var d={},h={};if(uKr(t,e,h),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else aKr(t,e,i||0,r,d);N1t(t,e),u?t.dirty():t.markRedraw()}function N1t(t,e){for(var r=KR(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function oKr(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof rp&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof yn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var s0={},sKr={setTransform:function(t,e){return s0.el[t]=e,this},getTransform:function(t){return s0.el[t]},setShape:function(t,e){var r=s0.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=s0.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=s0.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=s0.el.style;if(e)return e[t]},setExtra:function(t,e){var r=s0.el.extra||(s0.el.extra={});return r[t]=e,this},getExtra:function(t){var e=s0.el.extra;if(e)return e[t]}};function lKr(){var t=this,e=t.el;if(e){var r=KR(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}s0.el=e,n(sKr)}}function B1t(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]={}),RT(l))lt(o,a);else for(var u=ji(l),d=0;d=0){!o&&(o=n[t]={});for(var p=En(a),d=0;d=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=d);var I=e.getItemVisual(M,"style"),N=I&&I.fill,F=I&&I.opacity,B=x(M,hw).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:$t(N)?N:tt.color.neutral99},z=w(M,hw),U=Xi(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,hw),PR(e,M)):null;var G=GW(z,V,!1);return E(D,B),B=fmt(B,U,G),D&&O(B,D),B.legacy=!0,B}function C(D,M){M==null&&(M=d);var I=x(M,Hy).getItemStyle(),N=w(M,Hy),F=Xi(N,null,null,!0,!0);F.text=N.getShallow("show")?$d(t.getFormattedLabel(M,Hy),t.getFormattedLabel(M,hw),PR(e,M)):null;var B=GW(N,null,!0);return E(D,I),I=fmt(I,F,B),D&&O(I,D),I.legacy=!0,I}function O(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=d),Kt(M1t,D)){var I=e.getItemVisual(M,"style");return I?I[M1t[D]]:null}if(Kt(WXr,D))return e.getItemVisual(M,D)}function P(D){if(o.type==="cartesian2d"){var M=o.getBaseAxis();return xGr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return hge(D,r)}}function wKr(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 _ye(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&&V1t(e,n,i)&&(o=Nr(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Oye(n),s&&vKr(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),pp.normal.cfg=pp.normal.conOpt=pp.emphasis.cfg=pp.emphasis.conOpt=pp.blur.cfg=pp.blur.conOpt=pp.select.cfg=pp.select.conOpt=null,pp.isLegacy=!1,SKr(u,r,n,i,l,pp),AKr(u,r,n,i,l),Eye(t,u,r,n,pp,i,l),Kt(n,"info")&&(Qy(u).info=n.info);for(var d=0;d=0?a.replaceAt(u,o):a.add(u),u}function V1t(t,e,r){var n=Qy(t),i=e.type,a=e.shape,o=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&EKr(a)&&W1t(a)!==n.customPathData||i==="image"&&Kt(o,"image")&&o.image!==n.customImagePath}function AKr(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&&V1t(o,a,n)&&(o=null),o||(o=Oye(a),t.setClipPath(o)),Eye(null,o,e,a,null,n,i)}}function SKr(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){G1t(r,null,a),G1t(r,Hy,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 d=t.getTextContent();if(o===!1)d&&t.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},d?d.clearStates():(d=Oye(o),t.setTextContent(d)),Eye(null,d,e,o,null,n,i);for(var h=o&&o.style,f=0;f=d;p--){var g=e.childAt(p);CKr(e,g,i)}}}function CKr(t,e,r){e&&Xq(e,Qy(t).option,r)}function kKr(t){new By(t.oldChildren,t.newChildren,Q1t,Q1t,t).add(H1t).update(H1t).remove(OKr).execute()}function Q1t(t,e){var r=t&&t.name;return r??gKr+e}function H1t(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 OKr(t){var e=this.context,r=e.oldChildren[t];r&&Xq(r,Qy(r).option,e.seriesModel)}function W1t(t){return t&&(t.pathData||t.d)}function EKr(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function _Kr(t){t.registerChartView(yKr),t.registerSeriesModel(YXr)}var DT=Qr(),Y1t=lr,Lye=Wt,Mye=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 d=u.graphicKey;d!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=d;var h=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(q1t,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}K1t(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&&vc(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=DT(e).pointerEl=new NS[a.type](Y1t(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=DT(e).labelEl=new $n(Y1t(r.label));e.add(a),X1t(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=DT(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=DT(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),X1t(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=nR(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){wy(u.event)},onmousedown:Lye(this._onHandleDragMove,this,0,0),drift:Lye(this._onHandleDragMove,this),ondragend:Lye(this._onHandleDragEnd,this)}),n.add(i)),K1t(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,pR(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){q1t(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Iye(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(Iye(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Iye(i)),DT(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),j8(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 q1t(t,e,r,n){j1t(DT(r).lastProp,n)||(DT(r).lastProp=n,e?qn(r,n,t):(r.stopAnimation(),r.attr(n)))}function j1t(t,e){if(yr(t)&&yr(e)){var r=!0;return fe(e,function(n,i){r=r&&j1t(t[i],n)}),!!r}else return t===e}function X1t(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Iye(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function K1t(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 Pye(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 Z1t(t,e,r,n,i){var a=r.get("value"),o=J1t(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=lR(s.get("padding")||0),u=s.getFont(),d=JH(o,u),h=i.position,f=d.width+l[1]+l[3],p=d.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=p),m==="middle"&&(h[1]-=p/2),RKr(h,f,p,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:Xi(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function RKr(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 J1t(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:FY(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};fe(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,h=u&&u.getDataParams(d);h&&s.seriesData.push(h)}),$t(o)?a=o.replace("{value}",a):ur(o)&&(a=o(s))}return a}function Nye(t,e,r){var n=Oa();return Ay(n,n,r.rotation),cg(n,n,r.position),gg([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function ebt(t,e,r,n,i,a){var o=$u.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Z1t(e,n,i,a,{position:Nye(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Bye(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function tbt(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function rbt(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function $ye(t,e,r){return vc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function Fye(t,e,r){return[rn(Oi(e[0],e[1]),t-r/2),Oi(t+r/2,rn(e[0],e[1]))]}var DKr=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"),d=s.getGlobalExtent(),h=nbt(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var p=Pye(a),g=LKr[u](s,f,d,h,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=aq(l.getRect(),i);ebt(n,r,m,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=aq(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Nye(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=nbt(s,o).getOtherAxis(o).getGlobalExtent(),d=o.dim==="x"?0:1,h=[r.x,r.y];h[d]+=n[d],h[d]=Oi(l[1],h[d]),h[d]=rn(l[0],h[d]);var f=(u[1]+u[0])/2,p=[f,f];p[d]=h[d];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:p,tooltipOption:g[d]}},e}(Mye);function nbt(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var LKr={line:function(t,e,r,n){var i=Bye([e,n[0]],[e,n[1]],ibt(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=$ye(t,i,a),s=n[1]-n[0],l=Fye(e,r,o),u=l[0],d=l[1];return{type:"Rect",shape:tbt([u,n[0]],[d-u,s],ibt(t))}}};function ibt(t){return t.dim==="x"?0:1}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.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),Wy=Qr(),IKr=fe;function abt(t,e,r){if(!Dn.node){var n=e.getZr();Wy(n).records||(Wy(n).records={}),PKr(n,e);var i=Wy(n).records[t]||(Wy(n).records[t]={});i.handler=r}}function PKr(t,e){if(Wy(t).initialized)return;Wy(t).initialized=!0,r("click",Kr(zye,"click")),r("mousemove",Kr(zye,"mousemove")),r("mousewheel",Kr(zye,"mousewheel")),r("globalout",BKr);function r(n,i){t.on(n,function(a){var o=$Kr(e);IKr(Wy(t).records,function(s){s&&i(s,a,o.dispatchAction)}),NKr(o.pendings,e)})}}function NKr(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 BKr(t,e,r){t.handler("leave",null,r)}function zye(t,e,r,n){e.handler(t,r,n)}function $Kr(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 Uye(t,e){if(!Dn.node){var r=e.getZr(),n=(Wy(r).records||{})[t];n&&(Wy(r).records[t]=null)}}var FKr=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";abt("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){Uye("axisPointer",n)},e.prototype.dispose=function(r,n){Uye("axisPointer",n)},e.type="axisPointer",e}(Ki);function obt(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=pS(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(),d=l.getOtherAxis(u),h=d.dim,f=u.dim,p=h==="x"||h==="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 sbt=Qr();function zKr(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){Jq(i)&&(i=obt({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Jq(i),u=a.axesInfo,d=s.axesInfo,h=n==="leave"||Jq(i),f={},p={},g={list:[],map:{}},m={showPointer:Kr(VKr,p),showTooltip:Kr(GKr,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=YKr(u,w);if(!h&&x&&(!u||T)){var C=T&&T.value;C==null&&!l&&(C=S.pointToData(i)),C!=null&&lbt(w,C,m,!1,f)}})});var v={};return fe(d,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,cbt(w),cbt(y)))),v[y.key]=T}})}),fe(v,function(y,b){lbt(d[b],y,m,!0,f)}),QKr(p,d,f),HKr(g,i,t,o),WKr(d,o,r),f}}function lbt(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=UKr(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 UKr(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 d=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(d,t,r);f=p.dataIndices,h=p.nestestValue}else{if(f=l.indicesOfNearest(n,d[0],t,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(d[0],f[0])}if(tp(h)){var g=t-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),fe(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function VKr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function GKr(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=LB(l),d=t.map[u];d||(d=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(d)),d.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 QKr(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 HKr(t,e,r,n){if(Jq(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 WKr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=sbt(n)[i]||{},o=sbt(n)[i]={};fe(t,function(d,h){var f=d.axisPointerModel.option;f.status==="show"&&d.triggerEmphasis&&fe(f.seriesDataIndices,function(p){o[p.seriesIndex+"|"+p.dataIndex]=p})});var s=[],l=[];function u(d){return{seriesIndex:d.seriesIndex,dataIndex:d.dataIndex}}fe(a,function(d,h){!o[h]&&l.push(u(d))}),fe(o,function(d,h){!a[h]&&s.push(u(d))}),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 YKr(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 cbt(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 Jq(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function r7(t){mT.registerAxisPointerClass("CartesianAxisPointer",DKr),t.registerComponentModel(MKr),t.registerComponentView(FKr),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=gQr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},zKr)}function qKr(t){Xr(k0t),Xr(r7)}var jKr=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(),d=l.getOtherAxis(s).getExtent(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=Pye(a),g=KKr[f](s,l,h,u,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),v=XKr(n,i,a,l,m);Z1t(r,i,a,o,v)},e}(Mye);function XKr(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,d,h;if(a.dim==="radius"){var f=Oa();Ay(f,f,s),cg(f,f,[n.cx,n.cy]),u=gg([o,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=$u.innerTextLayout(s,p*Math.PI/180,-1);d=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var v=n.cx,y=n.cy;d=Math.abs(u[0]-v)/m<.3?"center":u[0]>v?"left":"right",h=Math.abs(u[1]-y)/m<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:d,verticalAlign:h}}var KKr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:Bye(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=$ye(t,a,o),u;if(t.dim==="angle")u=rbt(e.cx,e.cy,i[0],i[1],(-r-l/2)*s,(-r+l/2)*s);else{var d=Fye(r,n,l),h=d[0],f=d[1];u=rbt(e.cx,e.cy,h,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},l0="polar",ubt=l0,ZKr=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=l0,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(pn),Vye=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);Go(Vye,RR);var JKr=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}(Vye),eZr=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}(Vye),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}(up);Gye.prototype.dataToRadius=up.prototype.dataToCoord,Gye.prototype.radiusToData=up.prototype.coordToData;var tZr=Qr(),Qye=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),d=JH(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(d.height,7),f=h/u;isNaN(f)&&(f=1/0);var p=Math.max(0,Math.floor(f)),g=tZr(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}(up);Qye.prototype.dataToAngle=up.prototype.dataToCoord,Qye.prototype.angleToData=up.prototype.coordToData;var dbt=["radius","angle"],rZr=function(){function t(e){this.dimensions=dbt,this.type=l0,this.cx=0,this.cy=0,this._radiusAxis=new Gye,this._angleAxis=new Qye,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,d=us;)u+=d*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,d=l-this.cy,h=u*u+d*d,f=this.r,p=this.r0;return f!==p&&h-o<=f*f&&h+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=hbt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=hbt(r);return i===this?this.pointToData(n):null},t}();function hbt(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function nZr(t,e,r){var n=e.get("center"),i=Ns(e,r).refContainer;t.cx=Gt(n[0],i.width)+i.x,t.cy=Gt(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=[Gt(s[0],o),Gt(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function iZr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(nT(n,LR),nT(i,LR),MR(n),MR(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 aZr(t){return t.mainType==="angleAxis"}function fbt(t,e){var r;if(t.type=uB(e),t.scale=OR(e,t.type,!1),t.onBand=fB(t.scale,e),t.inverse=e.get("inverse"),aZr(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 oZr={dimensions:dbt,create:function(t,e){var r=[];return t.eachComponent(ubt,function(n,i){var a=new rZr(i+"");a.update=iZr;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");fbt(o,l),fbt(s,u),nZr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===l0){var i=n.getReferringComponents(ubt,xo).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(rT(a.getRadiusAxis(),n,l0),rT(a.getAngleAxis(),n,l0))}}),r}},sZr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function ej(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 tj(t){var e=t.getRadiusAxis();return e.inverse?0:1}function pbt(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 lZr=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(d){if(!d.tick.offInterval){d=lr(d);var h=i.scale;d.coord=i.dataToCoord(_R(h,d.tick)),u.push(d)}}),pbt(u),pbt(s),fe(sZr,function(d){r.get([d,"show"])&&(!i.scale.isBlank()||d==="axisLine")&&cZr[d](this.group,r,a,s,l,o,u)},this)}},e.type="angleAxis",e}(mT),cZr={axisLine:function(t,e,r,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),d=tj(r),h=d?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new NS[p]({shape:{cx:r.cx,cy:r.cy,r:a[d],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new X_({shape:{cx:r.cx,cy:r.cy,r:a[d],r0:a[h]},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[tj(r)],u=vt(n,function(d){return new Qo({shape:ej(r,[l,l+s],d.coord)})});t.add(Hh(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[tj(r)],d=[],h=0;hy?"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:$u.isLabelSilent(e),style:Xi(p,{x:v[0],y:v[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:x,verticalAlign:w})});if(t.add(S),Iy({el:S,componentModel:e,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return S.isTruncated},value:h.rawLabel,tickIndex:f}}),d){var T=$u.makeAxisEventDataBase(e);T.targetType="axisLabel",T.value=h.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 d=[],h=0;h=0?"p":"n",O=x;y&&(n[a][T]||(n[a][T]={p:x,n:x}),O=n[a][T][C]);var E=void 0,_=void 0,P=void 0,L=void 0;if(d.dim==="radius"){var R=d.dataToCoord(S)-x,D=t.dataToCoord(T);ao(R)=L})}}function yZr(t,e){var r=gT(e,l0),n=vc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,o="20%",s="30%",l={};tT(t,r,function(v){var y=gbt(v);l[y]||a++,l[y]=l[y]||{width:0,maxWidth:0};var b=Gt(v.get("barWidth"),n),x=Gt(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={},d=Gt(o,n),h=Gt(s,1),f=(i-d)/(a+(a-1)*h);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=vbt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=vbt(r);return i===this?this.pointToData(n):null},t}();function vbt(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function _Zr(t,e){var r=[];return t.eachComponent(W0e,function(n,i){var a=new EZr(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")===kQr){var i=n.getReferringComponents(W0e,xo).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&rT(a.getAxis(),n,pq)}}),r}var RZr={create:_Zr,dimensions:mbt},ybt=["x","y"],DZr=["width","height"],LZr=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=rj(s),d=nj(l,u),h=nj(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=Pye(a),m=MZr[p](s,f,d,h,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=Hye(i);ebt(n,r,v,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=Hye(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Nye(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=rj(o),u=nj(s,l),d=[r.x,r.y];d[l]+=n[l],d[l]=Math.min(u[1],d[l]),d[l]=Math.max(u[0],d[l]);var h=nj(s,1-l),f=(h[1]+h[0])/2,p=[f,f];return p[l]=d[l],{x:d[0],y:d[1],rotation:r.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(Mye),MZr={line:function(t,e,r,n){var i=Bye([e,n[0]],[e,n[1]],rj(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=$ye(t,i,a),s=n[1]-n[0],l=Fye(e,r,o),u=l[0],d=l[1];return{type:"Rect",shape:tbt([u,n[0]],[d-u,s],rj(t))}}};function rj(t){return t.isHorizontal()?0:1}function nj(t,e){var r=t.getRect();return[r[ybt[e]],r[ybt[e]]+r[DZr[e]]]}var IZr=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}(Ki);function PZr(t){Xr(r7),mT.registerAxisPointerClass("SingleAxisPointer",LZr),t.registerComponentView(IZr),t.registerComponentView(CZr),t.registerComponentModel(gq),zR(t,"single",gq,gq.defaultOption),t.registerCoordinateSystem("single",RZr)}var NZr=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=US(r);t.prototype.init.apply(this,arguments),bbt(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),bbt(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 bbt(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 B7r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Xm(t,e,{type:"box",ignoreSize:i})}var BZr=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 d=a.dataToCalendarLayout([u],!1).tl,h=new nn({shape:{x:d[0],y:d[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},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"]),d=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var p=h.date;p.setMonth(p.getMonth()+1),h=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,d,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,d,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 Ml({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),d=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=d.tl,s[2*u.day+1]=d[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(r,n){return $t(r)&&r?Edt(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 d=0;return(a==="left"||a==="right")&&(d=Math.PI/2),{rotation:d,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]],d=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,p={top:[d,u[f][1]],bottom:[d,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},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:Xi(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],d=r[1];return i==="horizontal"?(d=d+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:d,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"),d=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||$t(s))&&(s&&(n=yge(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=d==="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/Wye)-Math.floor(r[0].time/Wye)+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 d=Math.floor((i+r[0].day+6)/7),h=n?-d+1:d-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:d,nthWeek:h,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){U8({targetModel:a,coordSysType:"calendar",coordSysProvider:Pdt})}),n},t.dimensions=["time","value"],t}();function Yye(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function FZr(t){t.registerComponentModel(NZr),t.registerComponentView(BZr),t.registerCoordinateSystem("calendar",$Zr)}var Yy={level:1,leaf:2,nonLeaf:3},qy={none:0,all:1,body:2,corner:3};function qye(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 xbt(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 wbt(t,e,r,n,i){Abt(t[0],e,i,r,n,0),Abt(t[1],e,i,r,n,1)}function Abt(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?(Sbt(t,e,s,u,i,a,0),l>1&&Sbt(t,e,s,u,i,a,l-1)):t[0]=t[1]=NaN,u){var d=-i[Mr[1-a]].getLocatorCount(a),h=i[Mr[a]].getLocatorCount(a)-1;r===qy.body?d=rn(0,d):r===qy.corner&&(h=Oi(-1,h)),h=e[0]&&t[0]<=e[1]}function kbt(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 VZr(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 Obt(t,e,r,n){var i=qye(e[n][0],r,n),a=qye(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 n7(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function GZr(t){return t&&(t.type===Yy.leaf||t.type===Yy.nonLeaf)?t:null}function aj(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var Ebt=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=QZr(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 zx;for(o.resetLayoutIterator(A,n);A.next();)S(A.item);for(a.resetLayoutIterator(A,n);A.next();)S(A.item);function S(T){uc(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 Nbt(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;uj(n.rect,t,n.id,n.span,e),uj(n.rect,1-t,n.id,n.span,e),n.type===Yy.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[_o[t]])}}function Bbt(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;uj(i,0,a,n,e),uj(i,1,a,n,e)}})}function uj(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 nJr(t,e,r){var n=lW(t,r[_o[e]]);return e1e(n,r[_o[e]])}function e1e(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function t1e(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var yc={inBody:1,inCorner:2,outside:3},c0={x:null,y:null,point:[]};function $bt(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)),d=o.shouldShow()?o.getUnitLayoutInfo(e,-1):null,h=t.point[e]=n[e];if(!l&&!d){t[Mr[e]]=yc.outside;return}if(i===qy.body){l?(t[Mr[e]]=yc.inBody,h=Oi(s.xy+s.wh,rn(l.xy,h)),t.point[e]=h):t[Mr[e]]=yc.outside;return}else if(i===qy.corner){d?(t[Mr[e]]=yc.inCorner,h=Oi(d.xy+d.wh,rn(u.xy,h)),t.point[e]=h):t[Mr[e]]=yc.outside;return}var f=l?l.xy:d?d.xy+d.wh:NaN,p=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){t[Mr[e]]=yc.outside;return}h=g}t.point[e]=h,t[Mr[e]]=f<=h&&h<=g?yc.inBody:p<=h&&h<=f?yc.inCorner:yc.outside}function Fbt(t,e,r,n){var i=1-r;if(t[Mr[r]]!==yc.outside)for(n[Mr[r]].resetCellIterator(Jye);Jye.next();){var a=Jye.item;if(Ubt(t.point[r],a.rect,r)&&Ubt(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function zbt(t,e,r,n){if(t[Mr[r]]!==yc.outside){var i=t[Mr[r]]===yc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(cj,r);cj.next();)if(iJr(t.point[r],cj.item)){e[r]=cj.item.id[Mr[r]];return}}}function iJr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function Ubt(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[_o[r]]}function aJr(t){t.registerComponentModel(qZr),t.registerComponentView(JZr),t.registerCoordinateSystem("matrix",rJr)}function oJr(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 Vbt(t,e){var r;return fe(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function sJr(t,e,r){var n=lt({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Gr(i,n,!0),Xm(i,n,{ignoreSize:!0}),zdt(r,i),dj(r,i),dj(r,i,"shape"),dj(r,i,"style"),dj(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var Gbt=["transition","enterFrom","leaveTo"],lJr=Gbt.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function dj(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?Gbt:lJr,i=0;i=0;d--){var h=i[d],f=Ls(h.id,null),p=f!=null?o.get(f):null;if(p){var g=p.parent,y=gp(g),b=g===a?{width:s,height:l}:{width:y.width,height:y.height},x={},w=tY(p,h,b,null,{hv:h.hv,boundingMode:h.bounding},x);if(!gp(p).isNew&&w){for(var A=h.transition,S={},T=0;T=0)?S[C]=O:p[C]=O}qn(p,S,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){hj(i,gp(i).option,n,r._lastGraphicModel)}),this._elMap=qt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Ki);function r1e(t){var e=Kt(Qbt,t)?Qbt[t]:M8(t),r=new e({});return gp(r).type=t,r}function Hbt(t,e,r,n){var i=r1e(r);return e.add(i),n.set(t,i),gp(i).id=t,gp(i).isNew=!0,i}function hj(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){hj(a,e,r,n)}),Xq(t,e,n),r.removeKey(gp(t).id))}function Wbt(t,e,r,n){t.isGroup||fe([["cursor",rp.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 hJr(t){return t=lt({},t),fe(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Ndt),function(e){delete t[e]}),t}function fJr(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 pJr(t){t.registerComponentModel(uJr),t.registerComponentView(dJr),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 Ybt=["x","y","radius","angle","single"],gJr=Qr(),mJr=["cartesian2d","polar","singleAxis"];function vJr(t){var e=t.get("coordinateSystem");return Nr(mJr,e)>=0}function pw(t){return t+"Axis"}function yJr(t,e){var r=qt(),n=[],i=qt();t.eachComponent({mainType:"dataZoom",query:e},function(d){i.get(d.uid)||s(d)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(d){!i.get(d.uid)&&l(d)&&(s(d),a=!0)}function s(d){i.set(d.uid,!0),n.push(d),u(d)}function l(d){var h=!1;return d.eachTargetAxis(function(f,p){var g=r.get(f);g&&g[p]&&(h=!0)}),h}function u(d){d.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function qbt(t){var e=t.ecModel,r={infoList:[],infoMap:qt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(pw(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 jbt(t){var e=gJr(mft(t));return e.axisProxyMap||(e.axisProxyMap=qt())}function fj(t){if(t)return jbt(t.ecModel).get(t.uid)}function bJr(t,e){jbt(t.ecModel).set(t.uid,e)}function Xbt(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?fj(r.model):null}var n1e=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}(),a7=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=Kbt(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=Kbt(r);Gr(this.option,r,!0),Gr(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(Ybt,function(i){var a=this.getReferringComponents(pw(i),o8r);if(a.specified){n=!0;var o=new n1e;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(d){return d.get("orient",!0)===n}});l(s,"single")}function l(u,d){var h=u[0];if(h){var f=new n1e;if(f.add(h.componentIndex),r.set(d,f),a=!1,d==="x"||d==="y"){var p=h.getReferringComponents("grid",xo).models[0];p&&fe(u,function(g){h.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",xo).models[0]&&f.add(g.componentIndex)})}}}a&&fe(Ybt,function(u){if(a){var d=i.findComponents({mainType:pw(u),filter:function(f){return f.get("type",!0)==="category"}});if(d[0]){var h=new n1e;h.add(d[0].componentIndex),r.set(u,h),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(pw(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 fj(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(pw(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 fj(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(d,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(d,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}(),SJr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(pw(o),s);i(o,s,l,a)})})}var r=[];e(function(i,a,o,s){if(!fj(o)){var l=new AJr(i,a,s,t);r.push(l),bJr(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=Xbt(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 TJr(t){t.registerAction("dataZoom",function(e,r){var n=yJr(r,e);fe(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var CJr=V_();function a1e(t){CJr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,SJr),TJr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function kJr(t){t.registerComponentModel(xJr),t.registerComponentView(wJr),a1e(t)}var u0=function(){function t(){}return t}(),Zbt={};function JR(t,e){Zbt[t]=e}function Jbt(t){return Zbt[t]}var OJr=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=Jbt(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Gr(r,i[n]),i[n]=null),Gr(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 ext(t,e){var r=lR(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 EJr=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")||{},d=this._features||(this._features=qt()),h=[];fe(u,function(b,x){h.push(x)}),new By(this._featureNames||[],h).add(f).update(f).remove(Kr(f,null)).execute(),this._featureNames=oi(h,function(b){return d.hasKey(b)});function f(b,x){var w=b!=null&&x==null,A=b!=null&&x!=null,S=b==null,T=w||A?h[b]:h[x],C=u[T],O=w||A?new bn(C,r,n):null,E=O&&O.get("show"),_;if(w){if(!E)return;if(_Jr(T))_={onclick:O.option.onclick,featureName:T};else{var P=Jbt(T);if(!P)return;_=new P}d.set(T,_)}else _=d.get(T);if(S||!E){txt(_)&&_.dispose&&_.dispose(n,i),d.removeKey(T);return}a&&a.newTitle!=null&&a.featureName===T&&(C.title=a.newTitle),w&&(_.uid=BS("toolbox-feature")),_.model=O,_.ecModel=n,_.api=i,p(O,_,T),O.setIconStatus=function(L,R){var D=this.option,M=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[L]=R,M[L]&&(R==="emphasis"?Dy:Ly)(M[L])},txt(_)&&_.render&&_.render(O,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),S=b.getModel(["emphasis","iconStyle"]),T=x instanceof u0&&x.getIcons?x.getIcons():b.get("icon"),C=b.get("title")||{},O,E;$t(T)?(O={},O[w]=T):O=T,$t(C)?(E={},E[w]=C):E=C;var _=b.iconPaths={};fe(O,function(P,L){var R=nR(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:hge({fontStyle:S.get("textFontStyle"),fontFamily:S.get("textFontFamily"),fontSize:S.get("textFontSize"),fontWeight:S.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),Iy({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"?Dy:Ly)(R),o.add(R),R.on("click",Wt(x.onclick,x,n,i,L)),_[L]=R})}var g=Ns(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=ba(m,g,v);zS(r.get("orient"),o,r.get("itemGap"),y.width,y.height),tY(o,m,g,v),o.add(ext(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={}),O=JH(x,$n.makeFont(C)),E=b.x+o.x,_=b.y+o.y+s,P=!1;_+O.height>i.getHeight()&&(A.position="top",P=!0);var L=P?-5-O.height:s+10;E+O.width/2>i.getWidth()?(A.position=["100%",L],C.align="right"):E-O.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 u0&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.dispose=function(r,n){fe(this._features,function(i){i&&i instanceof u0&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Ki);function _Jr(t){return t.indexOf("my")===0}function txt(t){return t instanceof u0}var RJr=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 d=document.createElement("a");d.download=a+"."+s,d.target="_blank",d.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(h)}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}(u0),rxt="__ec_magicType_stack__",DJr=[["line","bar"],["stack"]],LJr=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(nxt[i]){var s={series:[]},l=function(h){var f=h.subType,p=h.id,g=nxt[i](f,p,h,a);g&&(mr(g,h.option),s.series.push(g));var m=h.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=h.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(DJr,function(h){Nr(h,i)>=0&&fe(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,d=i;i==="stack"&&(u=Gr({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(d="tiled")),n.dispatchAction({type:"changeMagicType",currentType:d,newOption:s,newTitle:u,featureName:"magicType"})}},e}(u0),nxt={line:function(t,e,r,n){if(t==="bar")return Gr({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 Gr({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")===rxt;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Gr({id:e,stack:i?"":rxt},n.get(["option","stack"])||{},!0)}};vg({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var pj=new Array(60).join("-"),e5=" ";function MJr(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=gGr(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 IJr(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(e5)],d=0;d=0)return!0}var o1e=new RegExp("["+eR+"]+","g");function $Jr(t){for(var e=t.split(/\n+/g),r=gj(e.shift()).split(o1e),n=[],i=vt(r,function(l){return{name:l,data:[]}}),a=0;a=0)return!0}var o1e=new RegExp("["+e5+"]+","g");function $Jr(t){for(var e=t.split(/\n+/g),r=gj(e.shift()).split(o1e),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 QJr(t){var e=s1e(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return ixt(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 HJr(t){axt(t).snapshots=null}function WJr(t){return s1e(t).length}function s1e(t){var e=axt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var YJr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){HJr(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}(u0);vg({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var qJr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],l1e=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=oxt(r,e);fe(jJr,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=u1e[n.brushType](0,a,i);n.__rangeOffset={offset:uxt[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=u1e[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=u1e[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?uxt[n.brushType](a.values,o.offset,XJr(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:qyt(i),isTargetByCursor:Xyt(i,e,n.coordSysModel),getLinearBrushOtherExtent:jyt(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=oxt(r,e),a=0;at[1]&&t.reverse(),t}function oxt(t,e){return z_(t,e,{includeMainTypes:qJr})}var jJr={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,d=[];fe(u.getCartesians(),function(h,f){(Nr(r,h.getAxis("x").model)>=0||Nr(n,h.getAxis("y").model)>=0)&&d.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:d[0],coordSyses:d,getPanelRect:lxt.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:lxt.geo})})}},sxt=[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}],lxt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=j0t(null,t);return glt(e,e,Tq(null,t)),e}},u1e={lineX:Kr(cxt,0),lineY:Kr(cxt,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=[c1e([i[0],a[0]]),c1e([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(t,e,r,n){var i=[fc(),fc()],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 cxt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=c1e(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 uxt={lineX:Kr(dxt,0),lineY:Kr(dxt,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 dxt(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function XJr(t,e){var r=hxt(t),n=hxt(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 hxt(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var d1e=fe,KJr=t8r("toolbox-dataZoom_"),ZJr={x:"width",y:"height"},JJr=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 jve(i.getZr()),this._brushController.on("brush",Wt(this._onBrush,this)).mount()),ren(r,n,this,a,i),ten(r,n)},e.prototype.onclick=function(r,n,i){een[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 l1e(h1e(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,d,h){if(h.type==="cartesian2d"){var f=h.master.getRect().clone(),p=u.brushType;p==="rect"?(s("x",h,f,d[0]),s("y",h,f,d[1])):s({lineX:"x",lineY:"y"}[p],h,f,d)}}),GJr(a,i),this._dispatchZoomAction(i);function s(u,d,h,f){var p=d.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=lw(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=ipe(y,h[ZJr[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,d,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var g=p.getAxisModel(u,d.componentIndex);g&&(f=p)}),f}},e.prototype._dispatchZoomAction=function(r){var n=[];d1e(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}(u0),een={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(QJr(this.ecModel))}};function h1e(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 ten(t,e){t.setIconStatus("back",WJr(e)>1?"emphasis":"normal")}function ren(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 l1e(h1e(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)}G7r("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=h1e(n),o=z_(t,a);d1e(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),d1e(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,d){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:KJr+u+h};f[d]=h,i.push(f)}return i});function nen(t){t.registerComponentModel(OJr),t.registerComponentView(EJr),J5("saveAsImage",RJr),J5("magicType",LJr),J5("dataView",UJr),J5("dataZoom",JJr),J5("restore",YJr),Xr(kJr)}var 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.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 fxt(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function pxt(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 d=u*Math.PI/180,h=o+i,f=h*Math.abs(Math.cos(d))+h*Math.abs(Math.sin(d)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/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 den(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?""+f1e+i:",left"+i+",top"+i)),sen+":"+a}function vxt(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;"+f1e+":"+o+";":[["top",0],["left",0],[gxt,o]]}function hen(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 d=t.get(u);d&&e.push("text-"+u+":"+d)}),e.join(";")}function fen(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"),d=t.get("shadowOffsetY"),h=t.getModel("textStyle"),f=Ght(t,"html"),p=u+"px "+d+"px "+s+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(den(a,r,n)),o&&i.push("background-color:"+o),fe(["width","color","radius"],function(g){var m="border-"+g,v=_ge(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(hen(h)),f!=null&&i.push("padding:"+l5(f).join("px ")+"px"),i.join(";")+";"}function yxt(t,e,r,n,i){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&g6r(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 pen=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):XA(a)?a:ur(a)&&a(e.getDom()));yxt(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,d=i.painter.getViewportRoot();Xf(d,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=oen(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=len+fen(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+vxt(a[0],a[1],!0)+("border-color:"+$S(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"&&!fxt(n)&&(s=uen(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=wxt(a,i);this._ticket="";var s=a.dataByCoordSys,l=wen(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 d=men;d.x=a.x,d.y=a.y,d.update(),Cr(d).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:d},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 h=obt(a,n),f=h.point[0],p=h.point[1];f!=null&&p!=null&&this._tryShow({offsetX:f,offsetY:p,target:h.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(wxt(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 d=u.getData(),h=o7([d.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.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;qS(i,function(d){if(d.tooltipDisabled)return l=u=null,!0;l||u||(Cr(d).dataIndex!=null?l=d:Cr(d).tooltipConfig!=null&&(u=d))},!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=o7([n.tooltipOption],a),l=this._renderMode,u=[],d=fs("section",{blocks:[],noHeader:!0}),h=[],f=new Jge;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=J1t(A,S,i,x.seriesDataIndices,x.valueLabelOpt),O=fs("section",{header:C,noHeader:!Bh(C),sortBlocks:!0,blocks:[]});d.blocks.push(O),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=FY(w.axis,{value:T}),L.axisValueLabel=C,L.marker=f.makeTooltipMarker("item",$S(L.color),l);var R=wht(_.formatTooltip(P,!0,null)),D=R.frag;if(D){var M=o7([_],a).get("valueFormatter");O.blocks.push(M?lt({valueFormatter:M},D):D)}R.text&&h.push(R.text),u.push(L)}})}})}),d.blocks.reverse(),h.reverse();var p=n.position,g=s.get("order"),m=zht(d,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var v=l==="richText"?` - -`:"
",y=h.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,d=o.dataIndex,h=o.dataType,f=u.getData(h),p=this._renderMode,g=r.positionDefault,m=o7([f.getItemModel(d),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),v=m.get("trigger");if(!(v!=null&&v!=="item")){var y=u.getDataParams(d,h),b=new Jge;y.marker=b.makeTooltipMarker("item",$S(y.color),p);var x=wht(u.formatTooltip(d,!1,h)),w=m.get("order"),A=m.get("valueFormatter"),S=x.frag,T=S?zht(A?lt({valueFormatter:A},S):S,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,C="item_"+u.name+"_"+d;this._showOrMove(m,function(){this._showTooltipContent(m,T,y,C,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:d,dataIndex:f.getRawIndex(d),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 d=l;l={content:d,formatter:d},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Wc(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var p=r.positionDefault,g=o7(h,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new Jge;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,d){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.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=z8(y.axisValue,p,v)),p=Lge(p,i,!0)}else if(ur(f)){var x=Wt(function(w,A){w===this._ticket&&(h.setContent(A,d,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,p=f(i,a,x)}else p=f;h.setContent(p,d,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,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(),d=this._api.getHeight();n=n||r.get("position");var h=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,d],contentSize:h.slice()})),ft(n))i=Gt(n[0],u),a=Gt(n[1],d);else if(yr(n)){var m=n;m.width=h[0],m.height=h[1];var v=ba(m,{width:u,height:d});i=v.x,a=v.y,f=null,p=null}else if($t(n)&&l){var y=xen(n,g,h,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=yen(i,a,o,u,d,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=Axt(f)?h[0]/2:f==="right"?h[0]:0),p&&(a-=Axt(p)?h[1]/2:p==="bottom"?h[1]:0),fxt(r)){var y=ben(i,a,o,u,d);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||[],d=r[l]||{},h=d.dataByAxis||[];o=o&&u.length===h.length,o&&fe(u,function(f,p){var g=h[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()||(j8(this,"_updatePosition"),this._tooltipContent.dispose(),Uye("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Ki);function o7(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 wxt(t,e){return t.dispatchAction||Wt(e.dispatchAction,e)}function yen(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 ben(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 xen(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,d=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+d/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+d+o;break;case"left":s=e.x-i-o,l=e.y+d/2-a/2;break;case"right":s=e.x+u+o,l=e.y+d/2-a/2}return[s,l]}function Axt(t){return t==="center"||t==="middle"}function wen(t,e,r){var n=dpe(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=U_(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 d=Cr(u).tooltipConfig;if(d&&d.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function Aen(t){Xr(r7),t.registerComponentModel(ien),t.registerComponentView(ven),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},no),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},no)}var Sen=["rect","polygon","keep","clear"];function Ten(t,e){var r=ji(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),fW(s,function(l){return l+""},null),e&&!s.length&&s.push.apply(s,Sen)}}var Sxt=fe;function Txt(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function p1e(t,e,r){var n={};return Sxt(e,function(a){var o=n[a]=i();Sxt(t[a],function(s,l){if(sl.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new sl(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new sl(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Cxt(t,e,r){var n;fe(r,function(i){e.hasOwnProperty(i)&&Txt(e[i])&&(n=!0)}),n&&fe(r,function(i){e.hasOwnProperty(i)&&Txt(e[i])?t[i]=lr(e[i]):delete t[i]})}function Cen(t,e,r,n,i,a){var o={};fe(t,function(h){var f=sl.prepareVisualTypes(e[h]);o[h]=f});var s;function l(h){return rme(r,s,h)}function u(h,f){uft(r,s,h,f)}r.each(d);function d(h,f){s=h;var p=r.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var g=n.call(i,h),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&&Dxt(e)}};function Dxt(t){return new pr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var 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.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new jve(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){_xt(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}(Ki),Pen=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&&Cxt(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 Lxt(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=Lxt(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 Lxt(t,e){return Gr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new bn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var Nen=["rect","polygon","lineX","lineY","keep","clear"],Ben=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:Nen.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}(u0);function $en(t){t.registerComponentView(Ien),t.registerComponentModel(Pen),t.registerPreprocessor(Ten),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,Een),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),J5("brush",Ben)}var Fen=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),zen=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")),d=new $n({style:Xi(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=d.getBoundingRect(),f=r.get("subtext"),p=new $n({style:Xi(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),v=r.get("triggerEvent",!0);d.silent=!g&&!v,p.silent=!m&&!v,g&&d.on("click",function(){KW(g,"_"+r.get("target"))}),m&&p.on("click",function(){KW(m,"_"+r.get("subtarget"))}),Cr(d).eventData=Cr(p).eventData=v?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(d),f&&a.add(p);var y=a.getBoundingRect(),b=r.getBoxLayoutParams();b.width=y.width,b.height=y.height;var x=Ns(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};d.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}(Ki);function Uen(t){t.registerComponentModel(Fen),t.registerComponentView(zen)}var Mxt=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,d){var h=Ls(F_(u),""),f;yr(u)?(f=lr(u),f.value=d):f=d,o.push(f),a.push(h)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new Xc([{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),Ixt=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=jx(Mxt.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}(Mxt);Go(Ixt,aY.prototype);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.type="timeline",e}(Ki),Gen=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}(up),v1e=Math.PI,Pxt=Qr(),Qen=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 d=l.scale.getLabel({value:u});return fs("nameValue",{noName:!0,value:d})},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=Hen(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"},d={horizontal:0,vertical:v1e/2},h=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*v1e/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),O=0,E=h;A==="left"||A==="bottom"?(S&&(b=[0,0],O+=v),T&&(x=[O,0],O+=v),C&&(w=[E-g,0],E-=v)):(S&&(b=[E-g,0],E-=v),T&&(x=[0,0],O+=v),C&&(w=[E-g,0],E-=v));var _=[O,E];return r.get("inverse")&&_.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:d[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=Oa(),l=o.x,u=o.y+o.height;cg(s,s,[-l,-u]),Ay(s,s,-v1e/2),cg(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var d=b(o),h=b(i.getBoundingRect()),f=b(a.getBoundingRect()),p=[i.x,i.y],g=[a.x,a.y];g[0]=p[0]=d[0][0];var m=r.labelPosOpt;if(m==null||$t(m)){var v=m==="+"?0:1;x(p,h,d,1,v),x(g,f,d,1,1-v)}else{var v=m>=0?0:1;x(p,h,d,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=d[0][0]-w.x,w.originY=d[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=O5(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]),Wpt(o,{fixMinMax:[!0,!0]});var l=new Gen("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 Qo({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 Qo({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 d=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),p=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:d,y:0,onclick:Wt(o._changeTimeline,o,u.value)},v=Nxt(h,f,n,m);v.ensureState("emphasis").style=p.getItemStyle(),v.ensureState("progress").style=g.getItemStyle(),Wx(v);var y=Cr(v);h.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(d){if(!d.tick.offInterval){var h=d.tick.value,f=l.getItemModel(h),p=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),v=i.dataToCoord(h),y=new $n({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Wt(o._changeTimeline,o,h),silent:!1,style:Xi(p,{text:d.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Xi(g),y.ensureState("progress").style=Xi(m),n.add(y),Wx(y),Pxt(y).dataIndex=h,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(),d=a.getPlayState(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",Wt(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",Wt(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,d?"stop":"play",Wt(this._handlePlayClick,this,!d),!0);function f(p,g,m,v){if(p){var y=Pm(Jt(a.get(["controlStyle",g+"BtnSize"]),o),o),b=[0,-y/2,y,y],x=Wen(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),Wx(x)}}},e.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,d={onCreate:function(h){h.draggable=!0,h.drift=Wt(u._handlePointerDrag,u),h.ondragend=Wt(u._handlePointerDragend,u),Bxt(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){Bxt(h,u._progressLine,s,i,a)}};this._currentPointer=Nxt(l,l,this._mainGroup,{},this._currentPointer,d)},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=Dl(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,p]}var bj={min:Kr(yj,"min"),max:Kr(yj,"max"),average:Kr(yj,"average"),median:Kr(yj,"median")};function l7(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!Zen(e)&&!ft(e.coord)&&ft(i)){var a=Fxt(e,r,n,t);if(e=lr(e),e.type&&bj[e.type]&&a.baseAxis&&a.valueAxis){var o=Nr(i,a.baseAxis.dim),s=Nr(i,a.valueAxis.dim),l=bj[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&&bj[e.type]){var d=n.getOtherAxis(u);d&&(e.value=xj(r,r.mapDimension(d.dim),e.type))}}else for(var h=e.coord,f=0;f<2;f++)bj[h[f]]&&(h[f]=xj(r,r.mapDimension(i[f]),h[f]));return e}}function Fxt(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(Jen(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 Jen(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function c7(t,e){return t&&t.containData&&e.coord&&!b1e(e)?t.containData(e.coord):!0}function etn(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!b1e(e)&&!b1e(r)?t.containZone(e.coord,r.coord):!0}function zxt(t,e){return t?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Xx(o,e[a])}:function(r,n,i,a){return Xx(r.value,e[a])}}function xj(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 x1e=Qr(),w1e=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){x1e(s).keep=!1}),n.eachSeries(function(s){var l=d0.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!x1e(s).keep&&a.group.remove(s.group)}),ttn(n,o,this.type)},e.prototype.markKeep=function(r){x1e(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;fe(r,function(a){var o=d0.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?Sut(l):Vpe(l))})}})},e.type="marker",e}(Ki);function ttn(t,e,r){t.eachSeries(function(n){var i=d0.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var o=PS(i),s=o.z,l=o.zlevel;zW(a.group,s,l)}})}function Uxt(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",d=u?o?o.width:0:i,h=u?o?o.height:0:a,f=u&&o?o.x:0,p=u&&o?o.y:0,g,m=Gt(l.get("x"),d)+f,v=Gt(l.get("y"),h)+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 rtn=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=d0.getMarkerModelFromSeries(a,"markPoint");o&&(Uxt(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,d=u.get(s)||u.set(s,new AB),h=ntn(o,r,n);n.setData(h),Uxt(n.getData(),r,a),h.each(function(f){var p=h.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=J8(l,"color");A.fill||(A.fill=T),h.setItemVisual(f,{z2:Jt(S,0),symbol:g,symbolSize:m,symbolRotate:v,symbolOffset:y,symbolKeepAspect:b,style:A})}),d.updateData(h),this.group.add(d.group),h.eachItemGraphicEl(function(f){f.traverse(function(p){Cr(p).dataModel=n})}),this.markKeep(d),d.group.silent=n.get("silent")||r.get("silent")},e.type="markPoint",e}(w1e);function ntn(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 Xc(n,r),a=vt(r.get("data"),Kr(l7,e));t&&(a=oi(a,Kr(c7,t)));var o=zxt(!!t,n);return i.initData(a,null,o),i}function itn(t){t.registerComponentModel(Ken),t.registerComponentView(rtn),t.registerPreprocessor(function(e){y1e(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var atn=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}(d0),wj=Qr(),otn=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=Hc(n.yAxis,n.xAxis);else{var u=Fxt(n,i,e,t);s=u.valueAxis;var d=Mme(i,u.valueDataDim);l=xj(i,d,o)}var h=s.dim==="x"?0:1,f=1-h,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[h]=g.coord[h]=l,a=[p,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[l7(t,a[0]),l7(t,a[1]),lt({},a[2])];return v[2].type=v[2].type||null,Gr(v[2],v[0]),Gr(v[2],v[1]),v};function Aj(t){return!isNaN(t)&&!isFinite(t)}function Vxt(t,e,r,n){var i=1-t,a=n.dimensions[t];return Aj(e[i])&&Aj(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function stn(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Vxt(1,r,n,t)||Vxt(0,r,n,t)))return!0}return c7(t,e[0])&&c7(t,e[1])}function A1e(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Gt(o.get("x"),i.getWidth()),u=Gt(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 d=a.dimensions,h=t.get(d[0],e),f=t.get(d[1],e);s=a.dataToPoint([h,f])}if(dT(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),d=a.dimensions;Aj(t.get(d[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):Aj(t.get(d[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 ltn=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=d0.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=wj(o).from,u=wj(o).to;l.each(function(d){A1e(l,d,!0,a,i),A1e(u,d,!1,a,i)}),s.each(function(d){s.setItemLayout(d,[l.getItemLayout(d),u.getItemLayout(d)])}),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,d=u.get(s)||u.set(s,new Nve);this.group.add(d.group);var h=ctn(o,r,n),f=h.from,p=h.to,g=h.line;wj(n).from=f,wj(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]),h.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})}),d.updateData(g),h.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);A1e(w,A,S,r,a);var C=T.getModel("itemStyle").getItemStyle();C.fill==null&&(C.fill=J8(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(d),d.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(w1e);function ctn(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var d=e.getData(),h=d.getDimensionInfo(d.mapDimension(u))||{};return lt(lt({},h),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Xc(n,r),a=new Xc(n,r),o=new Xc([],r),s=vt(r.get("data"),Kr(otn,e,t,r));t&&(s=oi(s,Kr(stn,t)));var l=zxt(!!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 utn(t){t.registerComponentModel(atn),t.registerComponentView(ltn),t.registerPreprocessor(function(e){y1e(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var dtn=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}(d0),Sj=Qr(),htn=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=l7(t,i),s=l7(t,a),l=o.coord,u=s.coord;l[0]=Hc(l[0],-1/0),l[1]=Hc(l[1],-1/0),u[0]=Hc(u[0],1/0),u[1]=Hc(u[1],1/0);var d=TH([{},o,s]);return d.coord=[o.coord,s.coord],d.x0=o.x,d.y0=o.y,d.x1=s.x,d.y1=s.y,d}};function Tj(t){return!isNaN(t)&&!isFinite(t)}function Gxt(t,e,r,n){var i=1-t;return Tj(e[i])&&Tj(r[i])}function ftn(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 dT(t,"cartesian2d")?r&&n&&(Gxt(1,r,n)||Gxt(0,r,n))?!0:etn(t,i,a):c7(t,i)||c7(t,a)}function Qxt(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Gt(o.get(r[0]),i.getWidth()),u=Gt(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var d=t.getValues(["x0","y0"],e),h=t.getValues(["x1","y1"],e),f=a.clampData(d),p=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>p[0]?h[0]:d[0]:g[0]=f[0]>p[0]?d[0]:h[0],r[1]==="y0"?g[1]=f[1]>p[1]?h[1]:d[1]:g[1]=f[1]>p[1]?d[1]:h[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(dT(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);Tj(m)?s[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):Tj(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 Hxt=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],ptn=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=d0.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=vt(Hxt,function(h){return Qxt(s,l,h,a,i)});s.setItemLayout(l,u);var d=s.getItemGraphicEl(l);d.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,d=u.get(s)||u.set(s,{group:new gr});this.group.add(d.group),this.markKeep(d);var h=gtn(o,r,n);n.setData(h),h.each(function(f){var p=vt(Hxt,function(E){return Qxt(h,f,E,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,v=g.getExtent(),y=m.getExtent(),b=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],x=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Dl(b),Dl(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),tR=Kr,T1e=fe,Cj=gr,Wxt=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 Cj),this.group.add(this._selectorGroup=new Cj),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 d=Ns(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),p=ba(h,d,f),g=this.layoutInner(r,o,p,a,l,u),m=ba(mr({width:g.width,height:g.height},h),d,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=ext(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(),d=qt(),h=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),T1e(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` -`)){var b=new Cj;b.newline=!0,u.add(b);return}var x=i.getSeriesByName(y)[0];if(!d.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,h,a);C.on("click",tR(Yxt,y,null,a,p)).on("mouseover",tR(C1e,x.name,null,a,p)).on("mouseout",tR(k1e,x.name,null,a,p)),i.ssr&&C.eachChild(function(O){var E=Cr(O);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&C.eachChild(function(O){v.packEventData(O,n,x,m,y)}),d.set(y,!0)}else i.eachRawSeries(function(O){var E=this;if(!d.get(y)&&O.legendVisualProvider){var _=O.legendVisualProvider;if(!_.containName(y))return;var P=_.indexOfName(y),L=_.getItemVisual(P,"style"),R=_.getItemVisual(P,"legendIcon"),D=Yc(L.fill);D&&D[3]===0&&(D[3]=.2,L=lt(lt({},L),{fill:Jf(D,"rgba")}));var M=this._createItem(O,y,m,g,n,r,{},L,R,h,a);M.on("click",tR(Yxt,null,y,a,p)).on("mouseover",tR(C1e,null,y,a,p)).on("mouseout",tR(k1e,null,y,a,p)),i.ssr&&M.eachChild(function(I){var N=Cr(I);N.seriesIndex=O.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(I){E.packEventData(I,n,O,m,y)}),d.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();T1e(r,function(u){var d=u.type,h=new $n({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:d==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);al(h,{normal:f,emphasis:p},{defaultText:u.title}),Wx(h)})},e.prototype._createItem=function(r,n,i,a,o,s,l,u,d,h,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");d=x||d||"roundRect";var w=ytn(d,a,l,u,p,v,f),A=new Cj,S=a.getModel("textStyle");if(ur(r.getLegendIcon)&&(!x||x==="inherit"))A.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:d,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(btn({itemWidth:g,itemHeight:m,icon:d,iconRotate:T,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var C=s==="left"?g+5:-5,O=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:Xi(S,{text:_,x:C,y:m/2,fill:P,align:O,verticalAlign:"middle"},{inheritColor:P})}));var L=new nn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&Iy({el:L,componentModel:o,itemName:n,itemTooltipOption:R.option}),A.add(L),A.eachChild(function(D){D.silent=!0}),L.silent=!h,this.getContentGroup().add(A),Wx(A),A.__legendDataIndex=i,A},e.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();zS(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var d=l.getBoundingRect(),h=[-d.x,-d.y];if(u.markRedraw(),l.markRedraw(),o){zS("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]+=d[v]+g:h[m]+=f[v]+g,p[1-m]+=d[y]/2-f[y]/2,u.x=p[0],u.y=p[1],l.x=h[0],l.y=h[1];var x={x:0,y:0};return x[v]=d[v]+g+f[v],x[y]=Math.max(d[y],f[y]),x[b]=Math.min(0,f[b]+p[1-m]),x}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Ki);function ytn(t,e,r,n,i,a,o){function s(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),T1e(v,function(b,x){v[x]==="inherit"&&(v[x]=y[x])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),d=t.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:x5(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[d]),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[d];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 btn(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 Yxt(t,e,r,n){k1e(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),C1e(t,e,r,n)}function C1e(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function k1e(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function u7(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),qxt(s,i),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){fe(i,function(l,u){s[l?"select":"unSelect"](u)}),qxt(s,o)}),n?{selected:o,legendIndex:a}:{name:e.name,selected:o}}function qxt(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 xtn(t){t.registerAction("legendToggleSelect","legendselectchanged",Kr(u7,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",Kr(u7,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",Kr(u7,"inverseSelect")),t.registerAction("legendSelect","legendselected",Kr(u7,"select")),t.registerAction("legendUnSelect","legendunselected",Kr(u7,"unSelect"))}var wtn=w8(Atn);function Atn(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]=d[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,d.setPosition(v),h.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]),h.__rectSize=i[o],m){var S={x:0,y:0};S[o]=Math.max(i[o]-g[o]-x,0),S[s]=A[s],h.setClipPath(new nn({shape:S})),h.__rectSize=S[o]}else f.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&qn(d,{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(d){var h=d+"DataIndex",f=n[h]!=null,p=i.childOfName(d);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=O1e[o],l=E1e[o],u=this._findTargetItemIndex(n),d=i.children(),h=d[u],f=d.length,p=f?1:0,g={contentPosition:[i.x,i.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=w(h);g.contentPosition[o]=-m.s;for(var v=u+1,y=m,b=m,x=null;v<=f;++v)x=w(d[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(d[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}(Wxt);function Ctn(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 ktn(t){Xr(jxt),t.registerComponentModel(Stn),t.registerComponentView(Ttn),Ctn(t)}function Otn(t){Xr(jxt),Xr(ktn)}var Etn=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=jx(a7.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(a7),_1e=Qr();function _tn(t,e,r){_1e(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function Rtn(t,e){for(var r=_1e(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=h),o=o&&d.get("preventDefaultMouseMove",!0),s=Jt(d.get("cursorGrab",!0),s),l=Jt(d.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 Ptn(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=_1e(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=qt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=qbt(a);fe(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Dtn(r,s.model)),d=u.dataZoomInfoMap||(u.dataZoomInfoMap=qt());d.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){Zxt(i,a);return}var d=Itn(l,a,r);o.enable(d.controlType,d.opt),p5(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Ntn=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(),_tn(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(){Rtn(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(i1e),R1e={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),o=t.axisModels[0];if(o){var s=D1e[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 d=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(lw(0,a,[0,100],0,d.minSpan,d.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Jxt(function(t,e,r,n,i,a){var o=D1e[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Jxt(function(t,e,r,n,i,a){var o=D1e[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function Jxt(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(lw(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var D1e={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 ewt(t){a1e(t),t.registerComponentModel(Etn),t.registerComponentView(Ntn),Ptn(t)}var Btn=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=jx(a7.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}(a7),d7=nn,$tn=1,L1e=30,Ftn=7,h7="horizontal",twt="vertical",ztn=5,Utn=["line","bar","candlestick","scatter"],Vtn={easing:"cubicOut",duration:100,delay:0},Gtn=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),p5(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(){j8(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?Ftn:0,o=Ns(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===h7?{right:o.width-s.x-s.width,top:o.height-L1e-l-a,width:s.width,height:L1e}:{right:l,top:s.y,width:L1e,height:s.height},d=US(r.option);fe(["right","top","width","height"],function(f){d[f]==="ph"&&(d[f]=u[f])});var h=ba(d,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===twt&&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===h7&&!o?{scaleY:l?1:-1,scaleX:1}:i===h7&&o?{scaleY:l?1:-1,scaleX:-1}:i===twt&&!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]),d=isNaN(u.x)?0:u.x,h=isNaN(u.y)?0:u.y;r.x=n.x-d,r.y=n.y-h,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 d7({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new d7({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,d=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var h=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]/(h[1]-h[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-h[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,d=this._shadowPolylinePts=y}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var C=this.dataZoomModel;function O(P){var L=C.getModel(P?"selectedDataBackground":"dataBackground"),R=new gr,D=new gc({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Ml({shape:{points:d},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 _=O(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(Utn,u.get("type"))<0)){var d=a.getComponent(pw(o),s).axis,h=Qtn(o),f,p=u.coordinateSystem;h!=null&&p.getOtherAxis&&(f=p.getOtherAxis(d).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:d,series:u,thisDim:g,otherDim:h,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,d=l.get("borderRadius")||0,h=l.get("brushSelect"),f=n.filler=new d7({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new d7({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:d},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:$tn,fill:tt.color.transparent}})),fe([0,1],function(x){var w=l.get("handleIcon");!pY[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:Htn(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=Gt(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(),Wx(A);var C=l.get("handleColor");C!=null&&(A.style.fill=C),o.add(i[x]=A);var O=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new $n({silent:!0,invisible:!_,style:Xi(O,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:O.getTextColor(),font:O.getFont()}),z2:10}))},this);var p=f;if(h){var g=Gt(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];lw(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,d=this._range=Dl([Zn(a[0],o,l,!0),Zn(a[1],o,l,!0)]);return!u||u[0]!==d[0]||u[1]!==d[1]},e.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Dl(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]],d=0;dn[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();lw(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=Dl([Zn(l[0],o,s,!0),Zn(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(wy(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 d7({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),d=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:d[0],y:0,width:u[0]-d[0],height:h[1]})},e.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Vtn:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=qbt(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}(i1e);function rwt(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)?"":Kc(n)||lB(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 Qtn(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function Htn(t){return t==="vertical"?"ns-resize":"ew-resize"}function nwt(t){t.registerComponentModel(Btn),t.registerComponentView(Gtn),a1e(t)}function Wtn(t){Xr(ewt),Xr(nwt)}var iwt={get:function(t,e,r){var n=lr((Ytn[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},Ytn={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]}},awt=sl.mapVisual,qtn=sl.eachVisual,jtn=ft,M1e=fe,Xtn=Dl,Ktn=Zn,kj=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&&Cxt(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=p1e(this.option.controller,n,r),this.targetVisuals=p1e(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 M1e(n,function(l){if(l.seriesIndex!=null)i.push(l.seriesIndex);else if(l.seriesId!=null){var u;r.ecModel.eachSeries(function(d){d.id===l.seriesId&&(u=d)}),u&&i.push(u.componentIndex)}}),i}var a=this.option.seriesId,o=this.option.seriesIndex;o==null&&a==null&&(o="all");var s=U_(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 d=n?r:u?[h(r[0]),h(r[1])]:h(r);if($t(l))return l.replace("{value}",u?d[0]:d).replace("{value2}",u?d[1]:d);if(ur(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+d[1]:r[1]===s[1]?i[1]+" "+d[0]:d[0]+" - "+d[1];return d;function h(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=Xtn([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=my(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={});Gr(a,i),Gr(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),d.call(this,o);function l(h){jtn(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,p){var g=h[f],m=h[p];g&&!m&&(m=h[p]={},M1e(g,function(v,y){if(sl.isValidType(y)){var b=iwt.get(y,"inactive",s);b!=null&&(m[y]=b,y==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function d(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,p=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),v=m||"roundRect";M1e(this.stateList,function(y){var b=this.itemSize,x=h[y];x||(x=h[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=awt(x.symbol,function(S){return S==="none"?v:S});var w=x.symbolSize;if(w!=null){var A=-1/0;qtn(w,function(S){S>A&&(A=S)}),x.symbolSize=awt(w,function(S){return Ktn(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),owt=[20,140],Ztn=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]=owt[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=owt[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=Dl((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=swt(this,"outOfRange",this.getExtent()),i=swt(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,d=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(),d=this._applyTransform("left",i.mainGroup);Jtn([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var p=h0(r[h],[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=gg(i.handleLabelPoints[h],MS(f,this.group));if(this._orient==="horizontal"){var v=d==="left"||d==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),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]],d=this._shapes,h=d.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=h0(r,s,u,!0),v=l[0]-g/2,y={x:h.x,y:h.y};h.y=m,h.x=v;var b=gg(d.indicatorLabelPoint,MS(h,this.group)),x=d.indicatorLabel;x.attr("invisible",!1);var w=this._applyTransform("left",d.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 O={duration:100,easing:"cubicInOut",additive:!0};h.x=y.x,h.y=y.y,h.animateTo(T,O),x.animateTo(C,O)}else h.attr(T),x.attr(C);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_o[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(d,h[1],"< ",l):h[1]===1/0?this._showIndicator(d,h[0],"> ",l):this._showIndicator(d,d,"≈ ",l));var f=this._hoverLinkDataIndices,p=[];(n||fwt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=i8r(f,p);this._dispatchHighDown("downplay",Oj(g[0],i)),this._dispatchHighDown("highlight",Oj(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(qS(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 srn(t,e,r,n){for(var i=e.targetVisuals[n],a=sl.prepareVisualTypes(i),o={color:J8(t.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(irn,arn),fe(orn,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(lrn))}function ywt(t){t.registerComponentModel(Ztn),t.registerComponentView(rrn),vwt(t)}var crn=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=[],urn[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=sl.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(d){u=u||o(r,d,l)||o(r.target,d,l)},this),!u&&fe(this.stateList,function(d){(r[d]||(r[d]={}))[l]=iwt.get(l,d==="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 d=this.getSelectedMapKey(l);o.hasOwnProperty(d)||(o[d]=!0)},this),i.selectedMode==="single"){var s=!1;fe(a,function(l,u){var d=this.getSelectedMapKey(l);o[d]&&(s?o[d]=!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=sl.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 d=sl.findPieceIndex(l,i);d===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(d,h){var f=a.getRepresentValue({interval:d});h||(h=a.getValueState(f));var p=r(f,h);d[0]===-1/0?i[0]=p:d[1]===1/0?i[1]=p:n.push({value:d[0],color:p},{value:d[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(d){var h=d.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=jx(kj.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}(kj),urn={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 bwt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var drn=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,d=Hc(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,d,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]],h),d){var v=this.visualMapModel.getValueState(m),y=a.get("align")||o;g.add(new $n({style:Xi(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:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,d,o),zS(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:Oj(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return uwt(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:Xi(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}(lwt);function xwt(t){t.registerComponentModel(crn),t.registerComponentView(drn),vwt(t)}function hrn(t){Xr(ywt),Xr(xwt)}var frn=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:adt(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}(),prn=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 frn(this);if(this._target=null,this.ecModel.eachSeries(function(i){Tyt(i,null)}),this.shouldShow()){var n=this.getTarget();Tyt(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),grn=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 Aq),!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=Ns(r,i).refContainer,u=ba(Bdt(r,!0),l),d=s.lineWidth||0,h=this._contentRect=IS(u.clone(),d/2,!0,!0),f=new gr;a.add(f),f.setClipPath(new nn({shape:h.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(),Awt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),Awt(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,kq(i,s.x,s.y,s.width,s.height);var l=ba({left:"center",top:"center",aspect:s.width/s.height},a);Oq(i,l.x,l.y,l.width,l.height),zB(o,i,xT),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=Fh([],r.targetTrans),i=$h([],Tq(null,this._coordSys),n);this._transThisToTarget=Fh([],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 vT(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(wwt(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(wwt(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}(Ki);function wwt(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 Awt(t,e){var r=PS(t);zW(e.group,r.z,r.zlevel)}function mrn(t){t.registerComponentModel(prn),t.registerComponentView(grn)}var vrn={label:{enabled:!0},decal:{show:!1}},Swt=Qr(),Twt=Qr(),yrn=w8(brn);function brn(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Twt(t).scope||(Twt(t).scope={}),i=lr(vrn);Gr(i.label,t.getLocaleModel().get("aria"),!1),Gr(r.option,i,!1),a(),o();function a(){var d=r.getModel("decal"),h=d.get("show");if(h){var f=qt();t.eachSeries(function(p){p.isColorBySeries()||(Swt(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=Fge(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=Swt(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+"",O=Fge(p.ecModel,C,y,b),E=g.getItemVisual(T,"decal");g.setItemVisual(T,"decal",A(E,O))})}function A(S,T){var C=S?lt(lt({},T),S):T;return C.dirty=!0,C}})}}function o(){var d=e.getZr().dom;if(d){var h=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=mr(f.option,h),!!f.get("enabled")){if(d.setAttribute("role","img"),f.get("description")){d.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(O,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=s(_,{seriesId:O.seriesIndex,seriesName:O.get("name"),seriesType:u(O.subType)});var R=O.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"},Arn=function(){function t(e){var r=this._condVal=$t(e)?new RegExp(e):rlt(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}(),Srn=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),Trn=function(){function t(){}return t.prototype.evaluate=function(){for(var e=this.children,r=0;r2&&n.push(i),i=[L,R]}function d(L,R,D,M){nR(L,D)&&nR(R,M)||i.push(L,R,D,M,D,M)}function h(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 B1e(t,e,r,n,i,a,o,s,l,u){if(nR(t,r)&&nR(e,n)&&nR(i,o)&&nR(a,s)){l.push(o,s);return}var d=2/u,h=d*d,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 O=[],E=[];Nx(t,r,i,o,.5,O),Nx(e,n,a,s,.5,E),B1e(O[0],E[0],O[1],E[1],O[2],E[2],O[3],E[3],l,u),B1e(O[4],E[4],O[5],E[5],O[6],E[6],O[7],E[7],l,u)}function $rn(t,e){var r=N1e(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=Ewt([l,u],d?0:1,e),f=(d?s:u)/h.length,p=0;pi,o=Ewt([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",h=t[s]/o.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function Urn(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 iR(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Vrn(t,e,r){for(var n=t.length,i=[],a=0;ao?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),Vrn(e,u,d)}function Ej(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Ej(t,a[0],i,n),Ej(t,a[1],r-i,n)}return n}function Grn(t,e){for(var r=[],n=0;n0;u/=2){var d=0,h=0;(t&u)>0&&(d=1),(e&u)>0&&(h=1),s+=u*u*(3*d^h),h===0&&(d===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Dj(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(),d=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),r=Math.min(h,r),n=Math.max(d,n),i=Math.max(h,i),[d,h]}),o=vt(a,function(s,l){return{cp:s,z:Zrn(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 Bwt(t){return Wrn(t.path,t.count)}function F1e(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Jrn(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 tnn={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,d;$wt(t)&&(u=t,d=e),$wt(e)&&(u=e,d=t);function h(y,b,x,w,A){var S=y.many,T=y.one;if(S.length===1&&!A){var C=b?S[0]:T,O=b?T:S[0];if(_j(C))h({many:[C],one:O},!0,x,w,!0);else{var E=s?mr({delay:s(x,w)},l):l;$1e(C,O,E),a(C,O,C,O,E)}}else for(var _=mr({dividePath:tnn[r],individualDelay:s&&function(I,N,F,B){return s(I+x,w)}},l),P=b?Jrn(S,T,_):enn(T,S,_),L=P.fromIndividuals,R=P.toIndividuals,D=L.length,M=0;Me.length,p=u?Fwt(d,u):Fwt(f?e:t,[f?t:e]),g=0,m=0;mzwt))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 Wwt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Ywt(t){return ft(t)?t.sort().join(","):t}function mw(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function lnn(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=Wwt(a),d=Ywt(u);n.set(d,{dataGroupId:s,data:l}),ft(u)&&fe(u,function(h){i.set(h,{key:d,dataGroupId:s,data:l})})}),fe(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=Wwt(a),u=Ywt(l),d=n.get(u);if(d)r.set(u,{oldSeries:[{dataGroupId:d.dataGroupId,divide:mw(d.data),data:d.data}],newSeries:[{dataGroupId:o,divide:mw(s),data:s}]});else if(ft(l)){var h=[];fe(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:mw(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:mw(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:mw(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:o,data:s,divide:mw(s)})}}}}),r}function qwt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:mw(e.oldData[s]),groupIdDim:o.dimension})}),fe(ji(t.to),function(o){var s=qwt(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:mw(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Hwt(i,a,n)}function unn(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){fe(ji(n.seriesTransition),function(i){fe(ji(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===Fy)return e;for(var n=jwt,i=Xwt,a=!0,o=0,s=0;su?o=l.vmin+(e-u)/(d-u)*(l.vmax-l.vmin):o=i+e-n,i=l.vmax,a=!1;break}n=d,i=l.vmax}return a&&(o=i+e-n),o}},t}();function hnn(t,e){return new dnn(t,e)}var jwt=0,Xwt=0;function fnn(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 d=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(d&&h))if(d||h){var p=d?"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 pnn(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],d=n(u),h=i*3/4;d>s.vmin-h&&de[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=Bh(o.gap);if(u.match(/%$/)){var d=parseFloat(u)/100;i(d)||(d=0),s.gapParsed.type="tpPrct",s.gapParsed.val=d,l=!0}}if(!l){var h=e.parse(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}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 H1e(t,e){return W1e(e)===W1e(t)}function W1e(t){return t.start+"_\0_"+t.end}function mnn(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=my(n,function(u){return H1e(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 vnn(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=my(r,function(d){return H1e(d.breakOption,e.break.parsedBreak.breakOption)}),o={lookup:n,depth:Fy},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 ynn(t,e,r,n,i){i.original=Q1e(t,e,r);var a=i.transformed=Q1e(t,e,r),o=i.lookup;a.breaks=vt(a.breaks,function(s,l){var u={depth:Fy},d=e.transformIn(s.vmin,u),h=e.transformIn(s.vmax,u),f={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?e.transformIn(s.vmin+s.gapParsed.val,u)-d:s.gapParsed.val};return o.from[n+l]=d,o.to[n+l]=s.vmin,o.from[n+l+1]=h,o.to[n+l+1]=s.vmax,{vmin:d,vmax:h,gapParsed:f,gapReal:s.gapReal,breakOption:s.breakOption}})}var bnn={vmin:"start",vmax:"end"};function xnn(t,e){return e&&(t=t||{},t.break={type:bnn[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function wnn(){x7r({createBreakScaleMapper:hnn,pruneTicksByBreak:pnn,addBreaksToTicks:gnn,parseAxisBreakOption:Q1e,identifyAxisBreak:H1e,serializeAxisBreakIdentifier:W1e,retrieveAxisBreakPairs:mnn,getTicksBreakOutwardTransform:vnn,parseAxisBreakOptionInwardTransform:ynn,makeAxisLabelFormatterParamBreak:xnn})}var Kwt=Qr();function Ann(t,e){var r=my(t,function(n){return Ho().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function Snn(t){fe(t,function(e){return e.shouldRemove=!0})}function Tnn(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function Cnn(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(O){return O.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),d=s.get("zigzagMaxSpan");u=Math.max(2,u||0),d=Math.max(u,d||0);var h=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=Kwt(e).visualList||(Kwt(e).visualList=[]);Snn(A);for(var S=function(O){var E=o[O][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var P=Ann(A,E);P.shouldRemove=!1;var L=new gr;C(P.zigzagRandomList,L,_[0],_[1],w,E),h&&L.on("click",function(){var R={type:nq,breaks:[{start:E.breakOption.start,end:E.breakOption.end}]};R[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(R)}),L.silent=!h,x.add(L)},T=0;T=N;j&&(U=N);var q=[],ne=[];q[M]=_,ne[M]=P,!H&&!j&&(q[M]+=z?-l:l,ne[M]-=z?l:-l),q[I]=U,ne[I]=U,B.push(q),V.push(ne);var X=void 0;if(Gb[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],d=null,h=0;h=0?l[0].width:l[1].width),f=(h+d.x)/2-u.x,p=Math.min(f,f-d.x),g=Math.max(f,f-d.x),m=g<0?g:p>0?p:0;s=(f-m)/d.x}var v=new wr,y=new wr;wr.scale(v,n,-s),wr.scale(y,n,1-s),r0e(r[0],v),r0e(r[1],y)}function Enn(t,e){var r={breaks:[]};return fe(e.breaks,function(n){if(n){var i=my(t.get("breaks",!0),function(s){return Ho().identifyAxisBreak(s,n)});if(i){var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===nq?!0:a===Smt?!1:a===Tmt?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function _nn(){HVr({adjustBreakLabelPair:Onn,buildAxisBreakLine:knn,rectCoordBuildBreakAxis:Cnn,updateModelAxisBreak:Enn})}function Rnn(t){jVr(t),wnn(),_nn()}function Dnn(){dQr(Lnn)}function Lnn(t,e){fe(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Mnn(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 Mnn(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof cB?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=dB(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;dZwt(t,"name",{value:e,configurable:!0}),Lj=(t,e)=>{for(var r in e)Zwt(t,r,{get:e[r],enumerable:!0})},Jwt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ci,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",o="second",s="minute",l="hour",u="day",d="week",h="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=O,_.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=O(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:k((...t)=>{},"debug"),info:k((...t)=>{},"info"),warn:k((...t)=>{},"warn"),error:k((...t)=>{},"error"),fatal:k((...t)=>{},"fatal")},Y1e=k(function(t="fatal"){let e=jy.fatal;typeof t=="string"?t.toLowerCase()in jy&&(e=jy[t]):typeof t=="number"&&(e=t),ye.trace=()=>{},ye.debug=()=>{},ye.info=()=>{},ye.warn=()=>{},ye.error=()=>{},ye.fatal=()=>{},e<=jy.fatal&&(ye.fatal=console.error?console.error.bind(console,mp("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",mp("FATAL"))),e<=jy.error&&(ye.error=console.error?console.error.bind(console,mp("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",mp("ERROR"))),e<=jy.warn&&(ye.warn=console.warn?console.warn.bind(console,mp("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",mp("WARN"))),e<=jy.info&&(ye.info=console.info?console.info.bind(console,mp("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",mp("INFO"))),e<=jy.debug&&(ye.debug=console.debug?console.debug.bind(console,mp("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mp("DEBUG"))),e<=jy.trace&&(ye.trace=console.debug?console.debug.bind(console,mp("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mp("TRACE")))},"setLogLevel"),mp=k(t=>`%c${Nl().format("ss.SSS")} : ${t} : `,"format");const Mj={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 Mj.hue2rgb(a,i,t+1/3)*255;case"g":return Mj.hue2rgb(a,i,t)*255;case"b":return Mj.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}`}}},vw={};for(let t=0;t<=255;t++)vw[t]=Cn.unit.dec2hex(t);const Jc={ALL:0,RGB:1,HSL:2};let Nnn=class{constructor(){this.type=Jc.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=Jc.ALL}is(e){return this.type===e}};class Bnn{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Nnn}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Jc.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(Jc.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(Jc.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(Jc.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(Jc.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(Jc.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(Jc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Jc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Jc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Jc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Jc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Jc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Jc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Ij=new Bnn({r:0,g:0,b:0,a:0},"transparent"),oR={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(oR.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,d=o?255:15;return Ij.set({r:(n>>l*(u+3)&d)*s,g:(n>>l*(u+2)&d)*s,b:(n>>l*(u+1)&d)*s,a:a?(n&d)*s/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${vw[Math.round(e)]}${vw[Math.round(r)]}${vw[Math.round(n)]}${vw[Math.round(i*255)]}`:`#${vw[Math.round(e)]}${vw[Math.round(r)]}${vw[Math.round(n)]}`}},PT={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(PT.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(PT.re);if(!r)return;const[,n,i,a,o,s]=r;return Ij.set({h:PT._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)}%)`}},p7={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=p7.colors[t];if(e)return oR.parse(e)},stringify:t=>{const e=oR.stringify(t);for(const r in p7.colors)if(p7.colors[r]===e)return r}},g7={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(g7.re);if(!r)return;const[,n,i,a,o,s,l,u,d]=r;return Ij.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(d?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)})`}},Sg={format:{keyword:p7,hex:oR,rgb:g7,rgba:g7,hsl:PT,hsla:PT},parse:t=>{if(typeof t!="string")return t;const e=oR.parse(t)||g7.parse(t)||PT.parse(t)||p7.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Jc.HSL)||t.data.r===void 0?PT.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?g7.stringify(t):oR.stringify(t)},e2t=(t,e)=>{const r=Sg.parse(t);for(const n in e)r[n]=Cn.channel.clamp[n](e[n]);return Sg.stringify(r)},Tg=(t,e,r=0,n=1)=>{if(typeof t!="number")return e2t(t,{a:e});const i=Ij.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 Sg.stringify(i)},q1e=(t,e)=>Cn.lang.round(Sg.parse(t)[e]),$nn=t=>{const{r:e,g:r,b:n}=Sg.parse(t),i=.2126*Cn.channel.toLinear(e)+.7152*Cn.channel.toLinear(r)+.0722*Cn.channel.toLinear(n);return Cn.lang.round(i)},Fnn=t=>$nn(t)>=.5,zu=t=>!Fnn(t),j1e=(t,e,r)=>{const n=Sg.parse(t),i=n[e],a=Cn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Sg.stringify(n)},dt=(t,e)=>j1e(t,"l",e),ht=(t,e)=>j1e(t,"l",-e),t2t=(t,e)=>j1e(t,"a",-e),Ae=(t,e)=>{const r=Sg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return e2t(t,n)},znn=(t,e,r=50)=>{const{r:n,g:i,b:a,a:o}=Sg.parse(t),{r:s,g:l,b:u,a:d}=Sg.parse(e),h=r/100,f=h*2-1,p=o-d,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*h+d*(1-h);return Tg(y,b,x,w)},it=(t,e=100)=>{const r=Sg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,znn(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 r2t(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:$s(BigInt.prototype.toString),u2t=typeof Symbol>"u"?null:$s(Symbol.prototype.toString),Qd=$s(Object.prototype.hasOwnProperty),b7=$s(Object.prototype.toString),eu=$s(RegExp.prototype.test),BT=ein(TypeError);function $s(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]:v7;if(i2t&&i2t(t,null),!lR(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(Wnn(e)||(e[n]=a),i=a)}t[i]=!0}return t}function tin(t){for(let e=0;e/g),lin=Bl(/\${[\w\W]*/g),cin=Bl(/^data-[\-\w.\u00B7-\uFFFF]+$/),uin=Bl(/^aria-[\-\w]+$/),g2t=Bl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),din=Bl(/^(?:\w+script|data):/i),hin=Bl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fin=Bl(/^html$/i),pin=Bl(/^[a-z][.\w]*(-[.\w]+)+$/i),m2t=Bl(/<[/\w!]/g),v2t=Bl(/<[/\w]/g),gin=Bl(/<\/no(script|embed|frames)/i),min=Bl(/\/>/i),jh={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},y2t=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],vin=ll(Ni({},y2t)),yin=function(){const t={};return NT(y2t,e=>{t[e]=Bl(new RegExp("])","i"))}),ll(t)}(),bin=function(){return typeof window>"u"?null:window},xin=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}},b2t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yw=function(e,r,n,i){return Qd(e,r)&&lR(e[r])?Ni(i.base?qh(i.base):{},e[r],i.transform):n},nbe=function(e,r,n){const i=Qd(e,r)?e[r]:void 0;return i&&typeof i=="object"?qh(i):n()};function x2t(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bin();const e=Ht=>x2t(Ht);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==jh.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 d=t.DOMParser,h=t.trustedTypes,f=s.prototype,p=Cg(f,"cloneNode"),g=Cg(f,"remove"),m=Cg(f,"nextSibling"),v=Cg(f,"childNodes"),y=Cg(f,"parentNode"),b=Cg(f,"shadowRoot"),x=Cg(f,"attributes"),w=o&&o.prototype?Cg(o.prototype,"nodeType"):null,A=o&&o.prototype?Cg(o.prototype,"nodeName"):null,S=o&&o.prototype?Cg(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 O,E="",_,P=!1,L=0;const R=function(){if(L>0)throw BT('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 O.createHTML(Ve)}finally{L--}},M=function(Ve){R(),L++;try{return O.createScriptURL(Ve)}finally{L--}},I=function(){return P||(_=xin(h,i),P=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let G=b2t();e.isSupported=typeof n2t=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const H=oin,j=sin,q=lin,ne=cin,X=uin,J=din,ee=hin,te=pin;let pe=g2t,ie=null;const Ce=Ni({},[...d2t,...J1e,...ebe,...tbe,...h2t]);let Oe=null;const Ee=Ni({},[...f2t,...rbe,...p2t,...Pj]);let ue=Object.seal(sR(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}})),he=null,xe=null;const ge=Object.seal(sR(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ze=!0,we=!0,ke=!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=Ni({},["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=Ni({},["audio","video","img","source","image","track"]);let yt=null;const Ie=Ni({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Qt=ut,It=!1,gt=null;const Te=Ni({},[St,Ot,ut],Z1e),Bt=ll(["mi","mo","mn","ms","mtext"]);let Et=Ni({},Bt);const At=ll(["annotation-xml"]);let Mt=Ni({},At);const qr=Ni({},["title","style","font","a","script"]);let Me=null;const at=["application/xhtml+xml","text/html"],wt="text/html";let Tt=null,hr=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(hr&&hr===Ve)return;(!Ve||typeof Ve!="object")&&(Ve={}),Ve=qh(Ve),Me=at.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?wt:Ve.PARSER_MEDIA_TYPE,Tt=Me==="application/xhtml+xml"?Z1e:v7,ie=yw(Ve,"ALLOWED_TAGS",Ce,{transform:Tt}),Oe=yw(Ve,"ALLOWED_ATTR",Ee,{transform:Tt}),gt=yw(Ve,"ALLOWED_NAMESPACES",Te,{transform:Z1e}),yt=yw(Ve,"ADD_URI_SAFE_ATTR",Ie,{transform:Tt,base:Ie}),et=yw(Ve,"ADD_DATA_URI_TAGS",Pe,{transform:Tt,base:Pe}),Ze=yw(Ve,"FORBID_CONTENTS",He,{transform:Tt}),he=yw(Ve,"FORBID_TAGS",qh({}),{transform:Tt}),xe=yw(Ve,"FORBID_ATTR",qh({}),{transform:Tt}),$e=Qd(Ve,"USE_PROFILES")?Ve.USE_PROFILES&&typeof Ve.USE_PROFILES=="object"?qh(Ve.USE_PROFILES):Ve.USE_PROFILES:!1,ze=Ve.ALLOW_ARIA_ATTR!==!1,we=Ve.ALLOW_DATA_ATTR!==!1,ke=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=nin(Ve.ALLOWED_URI_REGEXP)?Ve.ALLOWED_URI_REGEXP:g2t,Qt=typeof Ve.NAMESPACE=="string"?Ve.NAMESPACE:ut,Et=nbe(Ve,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ni({},Bt)),Mt=nbe(Ve,"HTML_INTEGRATION_POINTS",()=>Ni({},At));const ot=nbe(Ve,"CUSTOM_ELEMENT_HANDLING",()=>sR(null));if(ue=sR(null),Qd(ot,"tagNameCheck")&&Ir(ot.tagNameCheck)&&(ue.tagNameCheck=ot.tagNameCheck),Qd(ot,"attributeNameCheck")&&Ir(ot.attributeNameCheck)&&(ue.attributeNameCheck=ot.attributeNameCheck),Qd(ot,"allowCustomizedBuiltInElements")&&typeof ot.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=ot.allowCustomizedBuiltInElements),Bl(ue),Z&&(we=!1),ve&&(oe=!0),$e&&(ie=Ni({},h2t),Oe=sR(null),$e.html===!0&&(Ni(ie,d2t),Ni(Oe,f2t)),$e.svg===!0&&(Ni(ie,J1e),Ni(Oe,rbe),Ni(Oe,Pj)),$e.svgFilters===!0&&(Ni(ie,ebe),Ni(Oe,rbe),Ni(Oe,Pj)),$e.mathMl===!0&&(Ni(ie,tbe),Ni(Oe,p2t),Ni(Oe,Pj))),ge.tagCheck=null,ge.attributeCheck=null,Qd(Ve,"ADD_TAGS")&&(typeof Ve.ADD_TAGS=="function"?ge.tagCheck=Ve.ADD_TAGS:lR(Ve.ADD_TAGS)&&(ie===Ce&&(ie=qh(ie)),Ni(ie,Ve.ADD_TAGS,Tt))),Qd(Ve,"ADD_ATTR")&&(typeof Ve.ADD_ATTR=="function"?ge.attributeCheck=Ve.ADD_ATTR:lR(Ve.ADD_ATTR)&&(Oe===Ee&&(Oe=qh(Oe)),Ni(Oe,Ve.ADD_ATTR,Tt))),Qd(Ve,"ADD_FORBID_CONTENTS")&&lR(Ve.ADD_FORBID_CONTENTS)&&(Ze===He&&(Ze=qh(Ze)),Ni(Ze,Ve.ADD_FORBID_CONTENTS,Tt)),Ne&&(ie["#text"]=!0),be&&Ni(ie,["html","head","body"]),ie.table&&(Ni(ie,["tbody"]),delete he.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw BT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw BT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Nt=O;O=Ve.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw O=Nt,ar}}else Ve.TRUSTED_TYPES_POLICY===null?(O=void 0,E=""):(O===void 0&&(O=I()),O&&typeof E=="string"&&(E=D("")));ll&&ll(Ve),hr=Ve},Ur=Ni({},[...J1e,...ebe,...iin]),On=Ni({},[...tbe,...ain]),$r=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="svg":ot.namespaceURI===St?Ve==="svg"&&(Nt==="annotation-xml"||Et[Nt]):!!Ur[Ve]},hn=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="math":ot.namespaceURI===Ot?Ve==="math"&&Mt[Nt]:!!On[Ve]},ii=function(Ve,ot,Nt){return ot.namespaceURI===Ot&&!Mt[Nt]||ot.namespaceURI===St&&!Et[Nt]?!1:!On[Ve]&&(qr[Ve]||!Ur[Ve])},pt=function(Ve){let ot=y(Ve);(!ot||!ot.tagName)&&(ot={namespaceURI:Qt,tagName:"template"});const Nt=v7(Ve.tagName),ar=v7(ot.tagName);return gt[Ve.namespaceURI]?Ve.namespaceURI===Ot?$r(Nt,ot,ar):Ve.namespaceURI===St?hn(Nt,ot,ar):Ve.namespaceURI===ut?ii(Nt,ot,ar):!!(Me==="application/xhtml+xml"&>[Ve.namespaceURI]):!1},Ct=function(Ve){m7(e.removed,{element:Ve});try{y(Ve).removeChild(Ve)}catch{if(g(Ve),!y(Ve))throw BT("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){kt(Ve);const ot=v(Ve);if(ot){const ar=[];NT(ot,Vr=>{m7(ar,Vr)}),NT(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}m7(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"||Oe[Tt(Vr)]||or(Ve,ar,Vr)}},kt=function(Ve){const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop();T(Nt)===jh.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===jh.processingInstruction||ar===jh.comment&&eu(v2t,Nt.data)){try{g(Nt)}catch{}continue}if(ar===jh.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=s2t(Ve,/^[\r\n\t ]+/);Nt=Rn&&Rn[0]}Me==="application/xhtml+xml"&&Qt===ut&&(Ve=''+Ve+"");const ar=O?D(Ve):Ve;if(Qt===ut)try{ot=new d().parseFromString(ar,Me)}catch{}if(!ot||!ot.documentElement){ot=F.createDocument(Qt,"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),Qt===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)},ra=function(Ve){return Ve=y7(Ve,H," "),Ve=y7(Ve,j," "),Ve=y7(Ve,q," "),Ve},Ge=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=ra(Vr.data),Vr=ar.nextNode();const Rn=(ot=Ve.querySelectorAll)===null||ot===void 0?void 0:ot.call(Ve,"template");Rn&&NT(Rn,Ya=>{di(Ya.content)&&Ge(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)},di=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return w(Ve)===jh.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 Qn(Ht,Ve,ot){Ht.length!==0&&NT(Ht,Nt=>{Nt.call(e,Ve,ot,hr)})}const fa=function(Ve,ot){return!!(le&&Ve.hasChildNodes()&&!Bo(Ve.firstElementChild)&&eu(m2t,Ve.textContent)&&eu(m2t,Ve.innerHTML)||le&&Ve.namespaceURI===ut&&vin[ot]&&(Bo(Ve.firstElementChild)||typeof Ve.textContent=="string"&&eu(yin[ot],Ve.textContent))||Ve.nodeType===jh.processingInstruction||le&&Ve.nodeType===jh.comment&&eu(v2t,Ve.data))},hi=function(Ve,ot){if(Ve instanceof RegExp)return eu(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},cm=function(Ve,ot,Nt,ar){return Ve.length===0?ot:ot===Nt||ot===ar?qh(ot):ot},Ev=function(Ve,ot){return Ve===ot||y(Ve)!==null?!1:(je&&kt(Ve),!0)},_O=function(Ve,ot){if(Qn(G.beforeSanitizeElements,Ve,null),Ev(Ve,ot))return!0;if(In(Ve))return Ct(Ve),!0;const Nt=Tt(C(Ve));if(ie=cm(G.uponSanitizeElement,ie,Ce,K),Qn(G.uponSanitizeElement,Ve,{tagName:Nt,allowedTags:ie}),Ev(Ve,ot))return!0;if(fa(Ve,Nt))return Ct(Ve),!0;if(he[Nt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Nt))&&!ie[Nt]){const Vr=yu(Ve,Nt,ot);return Vr===!1&&Qn(G.afterSanitizeElements,Ve,null),Vr}if(T(Ve)===jh.element&&!pt(Ve)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&eu(gin,Ve.innerHTML))return Ct(Ve),!0;if(Z&&Ve.nodeType===jh.text){const Vr=ra(Ve.textContent);Ve.textContent!==Vr&&(m7(e.removed,{element:Ve.cloneNode()}),Ve.textContent=Vr)}return Qn(G.afterSanitizeElements,Ve,null),!1},RO=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=Oe[ot]||ge.attributeCheck instanceof Function&&ge.attributeCheck(ot,Ve);return we&&eu(ne,ot)||ze&&eu(X,ot)?!0:ar?yt[ot]||eu(pe,y7(Nt,ee,""))||(ot==="src"||ot==="xlink:href"||ot==="href")&&Ve!=="script"&&l2t(Nt,"data:")===0&&et[Ve]||ke&&!eu(J,y7(Nt,ee,""))?!0:!Nt:wl(Ve)&&hi(ue.tagNameCheck,Ve)&&hi(ue.attributeNameCheck,ot,Ve)||ot==="is"&&ue.allowCustomizedBuiltInElements&&hi(ue.tagNameCheck,Nt)},DO=Ni({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wl=function(Ve){return!DO[v7(Ve)]&&eu(te,Ve)},mh=function(Ve,ot,Nt,ar){if(O&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Nt)switch(h.getAttributeType(Ve,ot)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},Fc=function(Ve,ot,Nt,ar){try{Nt?Ve.setAttributeNS(Nt,ot,ar):Ve.setAttribute(ot,ar),In(Ve)?Ct(Ve):o2t(e.removed)}catch{Mn(ot,Ve)}},Js=function(Ve){Qn(G.beforeSanitizeAttributes,Ve,null);const ot=Ve.attributes;if(!ot||In(Ve))return;Oe=cm(G.uponSanitizeAttribute,Oe,Ee,se);const Nt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let ar=ot.length;const Vr=Tt(Ve.nodeName);for(;ar--;){const Rn=ot[ar],Ya=Rn.name,$o=Rn.namespaceURI,vh=Rn.value,yh=Tt(Ya),bIe=vh;let wd=Ya==="value"?bIe:Knn(bIe);if(Nt.attrName=yh,Nt.attrValue=wd,Nt.keepAttr=!0,Nt.forceKeepAttr=void 0,Qn(G.uponSanitizeAttribute,Ve,Nt),wd=Nt.attrValue,Le&&(yh==="id"||yh==="name")&&l2t(wd,We)!==0&&(Mn(Ya,Ve,Rn),wd=We+wd),le&&eu(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,wd)){Mn(Ya,Ve,Rn);continue}if(yh==="attributename"&&s2t(wd,"href")){Mn(Ya,Ve,Rn);continue}if(!Nt.forceKeepAttr){if(!Nt.keepAttr){Mn(Ya,Ve,Rn);continue}if(!Be&&eu(min,wd)){Mn(Ya,Ve,Rn);continue}if(Z&&(wd=ra(wd)),!RO(Vr,yh,wd)){Mn(Ya,Ve,Rn);continue}wd=mh(Vr,yh,$o,wd),wd!==bIe&&Fc(Ve,Ya,$o,wd)}}Qn(G.afterSanitizeAttributes,Ve,null)},Of=function(Ve){let ot=null;const Nt=Fe(Ve);for(Qn(G.beforeSanitizeShadowDOM,Ve,null);ot=Nt.nextNode();)if(Qn(G.uponSanitizeShadowNode,ot,null),_O(ot,Ve),Js(ot),di(ot.content)&&Of(ot.content),T(ot)===jh.element){const ar=b(ot);di(ar)&&(K2(ar),Of(ar))}Qn(G.afterSanitizeShadowDOM,Ve,null)},K2=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)===jh.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 vh=ar.content;di(vh)&&ot.push({node:vh,shadow:null})}}if(Rn){const $o=b(ar);di($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=rin(Ht),typeof Ht!="string"))throw BT("dirty is not a string, aborting");if(!e.isSupported)return Ht;ae?(ie=K,Oe=se):Zr(Ve),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ie=qh(ie)),G.uponSanitizeAttribute.length>0&&(Oe=qh(Oe)),e.removed=[];const Rn=je&&typeof Ht!="string"&&Bo(Ht);if(Rn){mt(Ht);const vh=C(Ht);if(typeof vh=="string"){const yh=Tt(vh);if(!ie[yh]||he[yh])throw Jr(Ht),BT("root node is forbidden and cannot be sanitized in-place")}if(In(Ht))throw Jr(Ht),BT("root node is clobbered and cannot be sanitized in-place");try{K2(Ht)}catch(yh){throw Jr(Ht),yh}}else if(Bo(Ht))ot=Tr(""),Nt=ot.ownerDocument.importNode(Ht,!0),Nt.nodeType===jh.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?ot=Nt:ot.appendChild(Nt),K2(Nt);else{if(!oe&&!Z&&!be&&Ht.indexOf("<")===-1)return O&&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 vh=Fe(Ya);for(;ar=vh.nextNode();)_O(ar,Ya),Js(ar),di(ar.content)&&Of(ar.content)}catch(vh){throw Rn&&(Jr(Ht),NT(e.removed,yh=>{yh.element&&kt(yh.element)})),vh}if(Rn)return NT(e.removed,vh=>{vh.element&&kt(vh.element)}),Z&&Ge(Ht),Ht;if(oe){if(Z&&Ge(ot),ve)for(Vr=V.call(ot.ownerDocument);ot.firstChild;)Vr.appendChild(ot.firstChild);else Vr=ot;return(Oe.shadowroot||Oe.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&&eu(fin,ot.ownerDocument.doctype.name)&&($o=" -`+$o),Z&&($o=ra($o)),O&&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=Oe},e.clearConfig=function(){hr=null,ae=!1,K=null,se=null,O=_,E=""},e.isValidAttribute=function(Ht,Ve,ot){hr||Zr({});const Nt=Tt(Ht),ar=Tt(Ve);return RO(Nt,ar,ot)},e.addHook=function(Ht,Ve){typeof Ve=="function"&&Qd(G,Ht)&&m7(G[Ht],Ve)},e.removeHook=function(Ht,Ve){if(Qd(G,Ht)){if(Ve!==void 0){const ot=jnn(G[Ht],Ve);return ot===-1?void 0:Xnn(G[Ht],ot,1)[0]}return o2t(G[Ht])}},e.removeHooks=function(Ht){Qd(G,Ht)&&(G[Ht]=[])},e.removeAllHooks=function(){G=b2t()},e}var Xy=x2t(),ibe=k((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>ibe(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]=ibe(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"),Fs=ibe,p0="#ffffff",g0="#f2f2f2",xn=k((t,e)=>e?Ae(t,{s:-40,l:10}):Ae(t,{s:-40,l:-10}),"mkBorder"),win=(qD=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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,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?ht(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||ht(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||dt(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||ht(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ht(this.mainBkg,10)):(this.rowOdd=this.rowOdd||dt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||dt(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]})}},k(qD,"Theme"),qD),Ain=k(t=>{const e=new win;return e.calculate(t),e},"getThemeVariables"),Sin=(jD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Tg(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=ht("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ht(this.sectionBkgColor,10),this.taskBorderColor=Tg(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Tg(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||dt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ht(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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.secondBkg=dt(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=dt(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=dt(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]})}},k(jD,"Theme"),jD),Tin=k(t=>{const e=new Sin;return e.calculate(t),e},"getThemeVariables"),Cin=(XD=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=Tg(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,o,s,l,u,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,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||ht(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ht(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]})}},k(XD,"Theme"),XD),Ky=k(t=>{const e=new Cin;return e.calculate(t),e},"getThemeVariables"),kin=(KD=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=dt("#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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.actorBorder=ht(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||ht(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ht(this.tertiaryColor,40);for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},k(KD,"Theme"),KD),Oin=k(t=>{const e=new kin;return e.calculate(t),e},"getThemeVariables"),Ein=(ZD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=dt(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||dt(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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.secondBkg=dt(this.contrast,55),this.border2=this.contrast,this.actorBorder=dt(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]})}},k(ZD,"Theme"),ZD),_in=k(t=>{const e=new Ein;return e.calculate(t),e},"getThemeVariables"),Rin=(JD=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,d,h,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?ht(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||ht(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||dt(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]})}},k(JD,"Theme"),JD),Din=k(t=>{const e=new Rin;return e.calculate(t),e},"getThemeVariables"),Lin=(eL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(eL,"Theme"),eL),Min=k(t=>{const e=new Lin;return e.calculate(t),e},"getThemeVariables"),Iin=(tL=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,d,h,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?ht(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||ht(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||dt(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]})}},k(tL,"Theme"),tL),Pin=k(t=>{const e=new Iin;return e.calculate(t),e},"getThemeVariables"),Nin=(rL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(rL,"Theme"),rL),Bin=k(t=>{const e=new Nin;return e.calculate(t),e},"getThemeVariables"),$in=(nL=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,d,h,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?ht(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||ht(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||dt(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]})}},k(nL,"Theme"),nL),Fin=k(t=>{const e=new $in;return e.calculate(t),e},"getThemeVariables"),zin=(iL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(iL,"Theme"),iL),Uin=k(t=>{const e=new zin;return e.calculate(t),e},"getThemeVariables"),Zy={base:{getThemeVariables:Ain},dark:{getThemeVariables:Tin},default:{getThemeVariables:Ky},forest:{getThemeVariables:Oin},neutral:{getThemeVariables:_in},neo:{getThemeVariables:Din},"neo-dark":{getThemeVariables:Min},redux:{getThemeVariables:Pin},"redux-dark":{getThemeVariables:Bin},"redux-color":{getThemeVariables:Fin},"redux-dark-color":{getThemeVariables:Uin}},bc={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},w2t={...bc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Zy.default.getThemeVariables(),sequence:{...bc.sequence,messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:k(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:k(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...bc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...bc.c4,useWidth:void 0,personFont:k(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...bc.flowchart,inheritDir:!1},external_personFont:k(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:k(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:k(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:k(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:k(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:k(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:k(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:k(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:k(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:k(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:k(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:k(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:k(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:k(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:k(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:k(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:k(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:k(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:k(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:k(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...bc.pie,useWidth:984},xyChart:{...bc.xyChart,useWidth:void 0},requirement:{...bc.requirement,useWidth:void 0},packet:{...bc.packet},eventmodeling:{...bc.eventmodeling},treeView:{...bc.treeView,useWidth:void 0},radar:{...bc.radar},railroad:{...bc.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:{...bc.ishikawa},sankey:{...bc.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:{...bc.venn},cynefin:{...bc.cynefin}},A2t=k((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...A2t(t[n],"")]:[...r,e+n],[]),"keyify"),Vin=new Set(A2t(w2t,"")),Jn=w2t,Gin={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qin=k((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"),Nj=k(t=>{if(ye.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Nj(e));return}for(const e of Object.keys(t)){if(ye.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Vin.has(e)||t[e]==null){ye.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Gin[e];n?Qin(t[e],n):(ye.debug("sanitizing object",e),Nj(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ye.debug("sanitizing css option",e),t[e]=S2t(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"),S2t=k(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Hd=Fs({},cR),Bj,$T=[],x7=Fs({},cR),w7=k((t,e)=>{let r=Fs({},t),n={};for(const i of e)k2t(i),n=Fs(n,i);if(r=Fs(r,n),n.theme&&n.theme in Zy){const i=Fs({},Bj),a=Fs(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Zy&&(r.themeVariables=Zy[r.theme].getThemeVariables(a))}return x7=r,Xin(x7),x7},"updateCurrentConfig"),Hin=k(t=>(Hd=Fs({},cR),Hd=Fs(Hd,t),t.theme&&Zy[t.theme]&&(Hd.themeVariables=Zy[t.theme].getThemeVariables(t.themeVariables)),w7(Hd,$T),Hd),"setSiteConfig"),Win=k(t=>{Bj=Fs({},t)},"saveConfigFromInitialize"),Yin=k(t=>(Hd=Fs(Hd,t),w7(Hd,$T),Hd),"updateSiteConfig"),T2t=k(()=>Fs({},Hd),"getSiteConfig"),C2t=k(t=>(w7(x7,[t]),Dr()),"setConfig"),Dr=k(()=>Fs({},x7),"getConfig"),k2t=k(t=>{t&&(["secure",...Hd.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"&&k2t(t[e])}))},"sanitize"),qin=k(t=>{var e;Nj(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),$T.push(t),w7(Hd,$T)},"addDirective"),$j=k((t=Hd)=>{$T=[],w7(t,$T)},"reset"),jin={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={},E2t=k(t=>{O2t[t]||(ye.warn(jin[t]),O2t[t]=!0)},"issueWarning"),Xin=k(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&E2t("LAZY_LOAD_DEPRECATED")},"checkConfig"),_2t=k(()=>{let t={};Bj&&(t=Fs(t,Bj));for(const e of $T)t=Fs(t,e);return t},"getUserDefinedConfig"),ia=k(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&E2t("FLOWCHART_HTML_LABELS_DEPRECATED"),m0(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),R2t=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,A7=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Kin=/\s*%%.*\n/gm,D2t=(aL=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},k(aL,"UnknownDiagramError"),aL),FT={},abe=k(function(t,e){t=t.replace(R2t,"").replace(A7,"").replace(Kin,` -`);for(const[r,{detector:n}]of Object.entries(FT))if(n(t,e))return r;throw new D2t(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),obe=k((...t)=>{for(const{id:e,detector:r,loader:n}of t)L2t(e,r,n)},"registerLazyLoadedDiagrams"),L2t=k((t,e,r)=>{FT[t]&&ye.warn(`Detector with key ${t} already exists. Overwriting.`),FT[t]={detector:e,loader:r},ye.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Zin=k(t=>FT[t].loader,"getDiagramLoader"),uR=//gi,Jin=k(t=>t?N2t(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),ean=(()=>{let t=!1;return()=>{t||(M2t(),t=!0)}})();function M2t(){const t="data-temp-href-target";Xy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Xy.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"))})}k(M2t,"setupDompurifyHooks");var I2t=k(t=>(ean(),Xy.sanitize(t)),"removeScript"),P2t=k((t,e)=>{if(ia(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=I2t(t):r!=="loose"&&(t=N2t(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=ian(t))}return t},"sanitizeMore"),li=k((t,e)=>t&&(e.dompurifyConfig?t=Xy.sanitize(P2t(t,e),e.dompurifyConfig).toString():t=Xy.sanitize(P2t(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),tan=k((t,e)=>typeof t=="string"?li(t,e):t.flat().map(r=>li(r,e)),"sanitizeTextOrArray"),ran=k(t=>uR.test(t),"hasBreaks"),nan=k(t=>t.split(uR),"splitBreaks"),ian=k(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),N2t=k(t=>t.replace(uR,"#br#"),"breakToPlaceholder"),Fj=k(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),aan=k(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),oan=k(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),bw=k(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),san=k((t,e)=>{const r=sbe(t,"~"),n=sbe(e,"~");return r===1&&n===1},"shouldCombineSets"),lan=k(t=>{const e=sbe(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"),B2t=k(()=>window.MathMLElement!==void 0,"isMathMLSupported"),lbe=/\$\$(.*?)\$\$/g,ps=k(t=>{var e;return(((e=t.match(lbe))==null?void 0:e.length)??0)>0},"hasKatex"),S7=k(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await zj(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"),can=k(async(t,e)=>{if(!ps(t))return t;if(!(B2t()||e.legacyMathML||e.forceLegacyMathML))return t.replace(lbe,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>p4n),n=e.forceLegacyMathML||!B2t()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(uR).map(i=>ps(i)?`
${i}
`:`
${i}
`).join("").replace(lbe,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),zj=k(async(t,e)=>li(await can(t,e),e),"renderKatexSanitized"),Xt={getRows:Jin,sanitizeText:li,sanitizeTextOrArray:tan,hasBreaks:ran,splitBreaks:nan,lineBreakRegex:uR,removeScript:I2t,getUrl:Fj,evaluate:m0,getMax:aan,getMin:oan},uan=k(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),dan=k(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=k(function(t,e,r,n){const i=dan(e,r,n);uan(t,i)},"configureSvgSize"),dR=k(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"),Uj={};function cbe(t){return[...t.cssRules].map(e=>e.cssText).join(` +*`,"g")),n={series:[]};return fe(r,function(i,a){if(BJr(i)){var o=$Jr(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=FJr(i);n.series.push(o)}}),n}var UJr=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"),d=document.createElement("textarea");u.style.cssText="overflow:auto";var h=a.get("optionToContent"),f=a.get("contentToOption"),p=NJr(r);if(ur(h)){var g=h(n.getOption());$t(g)?u.innerHTML=g:XA(g)&&u.appendChild(g)}else{d.readOnly=a.get("readOnly");var m=d.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"),d.value=p.value,u.appendChild(d)}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}vfe(x,"click",S),vfe(w,"click",function(){if(f==null&&h!=null||f!=null&&h==null){S();return}var T;try{ur(f)?T=f(u,n.getOption()):T=zJr(d.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}(u0);function VJr(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})}vg({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:VJr(n.data,a)})}}),e.mergeOption(mr({series:r},t.newOption))});var ixt=fe,axt=Qr();function GJr(t,e){var r=s1e(t);ixt(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 QJr(t){var e=s1e(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return ixt(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 HJr(t){axt(t).snapshots=null}function WJr(t){return s1e(t).length}function s1e(t){var e=axt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var YJr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){HJr(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}(u0);vg({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var qJr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],l1e=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=oxt(r,e);fe(jJr,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=u1e[n.brushType](0,a,i);n.__rangeOffset={offset:uxt[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=u1e[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=u1e[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?uxt[n.brushType](a.values,o.offset,XJr(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:qyt(i),isTargetByCursor:Xyt(i,e,n.coordSysModel),getLinearBrushOtherExtent:jyt(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=oxt(r,e),a=0;at[1]&&t.reverse(),t}function oxt(t,e){return z_(t,e,{includeMainTypes:qJr})}var jJr={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,d=[];fe(u.getCartesians(),function(h,f){(Nr(r,h.getAxis("x").model)>=0||Nr(n,h.getAxis("y").model)>=0)&&d.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:d[0],coordSyses:d,getPanelRect:lxt.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:lxt.geo})})}},sxt=[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}],lxt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=j0t(null,t);return glt(e,e,Tq(null,t)),e}},u1e={lineX:Kr(cxt,0),lineY:Kr(cxt,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=[c1e([i[0],a[0]]),c1e([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(t,e,r,n){var i=[fc(),fc()],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 cxt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=c1e(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 uxt={lineX:Kr(dxt,0),lineY:Kr(dxt,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 dxt(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function XJr(t,e){var r=hxt(t),n=hxt(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 hxt(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var d1e=fe,KJr=t8r("toolbox-dataZoom_"),ZJr={x:"width",y:"height"},JJr=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 jve(i.getZr()),this._brushController.on("brush",Wt(this._onBrush,this)).mount()),ren(r,n,this,a,i),ten(r,n)},e.prototype.onclick=function(r,n,i){een[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 l1e(h1e(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,d,h){if(h.type==="cartesian2d"){var f=h.master.getRect().clone(),p=u.brushType;p==="rect"?(s("x",h,f,d[0]),s("y",h,f,d[1])):s({lineX:"x",lineY:"y"}[p],h,f,d)}}),GJr(a,i),this._dispatchZoomAction(i);function s(u,d,h,f){var p=d.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=lw(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=ipe(y,h[ZJr[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,d,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var g=p.getAxisModel(u,d.componentIndex);g&&(f=p)}),f}},e.prototype._dispatchZoomAction=function(r){var n=[];d1e(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}(u0),een={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(QJr(this.ecModel))}};function h1e(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 ten(t,e){t.setIconStatus("back",WJr(e)>1?"emphasis":"normal")}function ren(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 l1e(h1e(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)}G7r("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=h1e(n),o=z_(t,a);d1e(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),d1e(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,d){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:KJr+u+h};f[d]=h,i.push(f)}return i});function nen(t){t.registerComponentModel(OJr),t.registerComponentView(EJr),JR("saveAsImage",RJr),JR("magicType",LJr),JR("dataView",UJr),JR("dataZoom",JJr),JR("restore",YJr),Xr(kJr)}var 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.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 fxt(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function pxt(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 d=u*Math.PI/180,h=o+i,f=h*Math.abs(Math.cos(d))+h*Math.abs(Math.sin(d)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/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 den(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?""+f1e+i:",left"+i+",top"+i)),sen+":"+a}function vxt(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;"+f1e+":"+o+";":[["top",0],["left",0],[gxt,o]]}function hen(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 d=t.get(u);d&&e.push("text-"+u+":"+d)}),e.join(";")}function fen(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"),d=t.get("shadowOffsetY"),h=t.getModel("textStyle"),f=Ght(t,"html"),p=u+"px "+d+"px "+s+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(den(a,r,n)),o&&i.push("background-color:"+o),fe(["width","color","radius"],function(g){var m="border-"+g,v=_ge(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(hen(h)),f!=null&&i.push("padding:"+lR(f).join("px ")+"px"),i.join(";")+";"}function yxt(t,e,r,n,i){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&g6r(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 pen=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):XA(a)?a:ur(a)&&a(e.getDom()));yxt(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,d=i.painter.getViewportRoot();Xf(d,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=oen(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=len+fen(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+vxt(a[0],a[1],!0)+("border-color:"+$S(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"&&!fxt(n)&&(s=uen(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=wxt(a,i);this._ticket="";var s=a.dataByCoordSys,l=wen(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 d=men;d.x=a.x,d.y=a.y,d.update(),Cr(d).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:d},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 h=obt(a,n),f=h.point[0],p=h.point[1];f!=null&&p!=null&&this._tryShow({offsetX:f,offsetY:p,target:h.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(wxt(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 d=u.getData(),h=o7([d.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.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;qS(i,function(d){if(d.tooltipDisabled)return l=u=null,!0;l||u||(Cr(d).dataIndex!=null?l=d:Cr(d).tooltipConfig!=null&&(u=d))},!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=o7([n.tooltipOption],a),l=this._renderMode,u=[],d=fs("section",{blocks:[],noHeader:!0}),h=[],f=new Jge;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=J1t(A,S,i,x.seriesDataIndices,x.valueLabelOpt),O=fs("section",{header:C,noHeader:!Bh(C),sortBlocks:!0,blocks:[]});d.blocks.push(O),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=FY(w.axis,{value:T}),L.axisValueLabel=C,L.marker=f.makeTooltipMarker("item",$S(L.color),l);var R=wht(_.formatTooltip(P,!0,null)),D=R.frag;if(D){var M=o7([_],a).get("valueFormatter");O.blocks.push(M?lt({valueFormatter:M},D):D)}R.text&&h.push(R.text),u.push(L)}})}})}),d.blocks.reverse(),h.reverse();var p=n.position,g=s.get("order"),m=zht(d,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var v=l==="richText"?` + +`:"
",y=h.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,d=o.dataIndex,h=o.dataType,f=u.getData(h),p=this._renderMode,g=r.positionDefault,m=o7([f.getItemModel(d),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),v=m.get("trigger");if(!(v!=null&&v!=="item")){var y=u.getDataParams(d,h),b=new Jge;y.marker=b.makeTooltipMarker("item",$S(y.color),p);var x=wht(u.formatTooltip(d,!1,h)),w=m.get("order"),A=m.get("valueFormatter"),S=x.frag,T=S?zht(A?lt({valueFormatter:A},S):S,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,C="item_"+u.name+"_"+d;this._showOrMove(m,function(){this._showTooltipContent(m,T,y,C,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:d,dataIndex:f.getRawIndex(d),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 d=l;l={content:d,formatter:d},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Wc(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var p=r.positionDefault,g=o7(h,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new Jge;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,d){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.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=z8(y.axisValue,p,v)),p=Lge(p,i,!0)}else if(ur(f)){var x=Wt(function(w,A){w===this._ticket&&(h.setContent(A,d,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,p=f(i,a,x)}else p=f;h.setContent(p,d,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,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(),d=this._api.getHeight();n=n||r.get("position");var h=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,d],contentSize:h.slice()})),ft(n))i=Gt(n[0],u),a=Gt(n[1],d);else if(yr(n)){var m=n;m.width=h[0],m.height=h[1];var v=ba(m,{width:u,height:d});i=v.x,a=v.y,f=null,p=null}else if($t(n)&&l){var y=xen(n,g,h,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=yen(i,a,o,u,d,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=Axt(f)?h[0]/2:f==="right"?h[0]:0),p&&(a-=Axt(p)?h[1]/2:p==="bottom"?h[1]:0),fxt(r)){var y=ben(i,a,o,u,d);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||[],d=r[l]||{},h=d.dataByAxis||[];o=o&&u.length===h.length,o&&fe(u,function(f,p){var g=h[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()||(j8(this,"_updatePosition"),this._tooltipContent.dispose(),Uye("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Ki);function o7(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 wxt(t,e){return t.dispatchAction||Wt(e.dispatchAction,e)}function yen(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 ben(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 xen(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,d=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+d/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+d+o;break;case"left":s=e.x-i-o,l=e.y+d/2-a/2;break;case"right":s=e.x+u+o,l=e.y+d/2-a/2}return[s,l]}function Axt(t){return t==="center"||t==="middle"}function wen(t,e,r){var n=dpe(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=U_(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 d=Cr(u).tooltipConfig;if(d&&d.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function Aen(t){Xr(r7),t.registerComponentModel(ien),t.registerComponentView(ven),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},no),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},no)}var Sen=["rect","polygon","keep","clear"];function Ten(t,e){var r=ji(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),fW(s,function(l){return l+""},null),e&&!s.length&&s.push.apply(s,Sen)}}var Sxt=fe;function Txt(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function p1e(t,e,r){var n={};return Sxt(e,function(a){var o=n[a]=i();Sxt(t[a],function(s,l){if(sl.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new sl(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new sl(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Cxt(t,e,r){var n;fe(r,function(i){e.hasOwnProperty(i)&&Txt(e[i])&&(n=!0)}),n&&fe(r,function(i){e.hasOwnProperty(i)&&Txt(e[i])?t[i]=lr(e[i]):delete t[i]})}function Cen(t,e,r,n,i,a){var o={};fe(t,function(h){var f=sl.prepareVisualTypes(e[h]);o[h]=f});var s;function l(h){return rme(r,s,h)}function u(h,f){uft(r,s,h,f)}r.each(d);function d(h,f){s=h;var p=r.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var g=n.call(i,h),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&&Dxt(e)}};function Dxt(t){return new pr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var 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.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new jve(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){_xt(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}(Ki),Pen=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&&Cxt(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 Lxt(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=Lxt(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 Lxt(t,e){return Gr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new bn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var Nen=["rect","polygon","lineX","lineY","keep","clear"],Ben=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:Nen.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}(u0);function $en(t){t.registerComponentView(Ien),t.registerComponentModel(Pen),t.registerPreprocessor(Ten),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,Een),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),JR("brush",Ben)}var Fen=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),zen=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")),d=new $n({style:Xi(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=d.getBoundingRect(),f=r.get("subtext"),p=new $n({style:Xi(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),v=r.get("triggerEvent",!0);d.silent=!g&&!v,p.silent=!m&&!v,g&&d.on("click",function(){KW(g,"_"+r.get("target"))}),m&&p.on("click",function(){KW(m,"_"+r.get("subtarget"))}),Cr(d).eventData=Cr(p).eventData=v?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(d),f&&a.add(p);var y=a.getBoundingRect(),b=r.getBoxLayoutParams();b.width=y.width,b.height=y.height;var x=Ns(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};d.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}(Ki);function Uen(t){t.registerComponentModel(Fen),t.registerComponentView(zen)}var Mxt=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,d){var h=Ls(F_(u),""),f;yr(u)?(f=lr(u),f.value=d):f=d,o.push(f),a.push(h)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new Xc([{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),Ixt=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=jx(Mxt.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}(Mxt);Go(Ixt,aY.prototype);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.type="timeline",e}(Ki),Gen=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}(up),v1e=Math.PI,Pxt=Qr(),Qen=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 d=l.scale.getLabel({value:u});return fs("nameValue",{noName:!0,value:d})},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=Hen(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"},d={horizontal:0,vertical:v1e/2},h=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*v1e/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),O=0,E=h;A==="left"||A==="bottom"?(S&&(b=[0,0],O+=v),T&&(x=[O,0],O+=v),C&&(w=[E-g,0],E-=v)):(S&&(b=[E-g,0],E-=v),T&&(x=[0,0],O+=v),C&&(w=[E-g,0],E-=v));var _=[O,E];return r.get("inverse")&&_.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:d[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=Oa(),l=o.x,u=o.y+o.height;cg(s,s,[-l,-u]),Ay(s,s,-v1e/2),cg(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var d=b(o),h=b(i.getBoundingRect()),f=b(a.getBoundingRect()),p=[i.x,i.y],g=[a.x,a.y];g[0]=p[0]=d[0][0];var m=r.labelPosOpt;if(m==null||$t(m)){var v=m==="+"?0:1;x(p,h,d,1,v),x(g,f,d,1,1-v)}else{var v=m>=0?0:1;x(p,h,d,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=d[0][0]-w.x,w.originY=d[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=OR(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]),Wpt(o,{fixMinMax:[!0,!0]});var l=new Gen("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 Qo({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 Qo({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 d=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),p=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:d,y:0,onclick:Wt(o._changeTimeline,o,u.value)},v=Nxt(h,f,n,m);v.ensureState("emphasis").style=p.getItemStyle(),v.ensureState("progress").style=g.getItemStyle(),Wx(v);var y=Cr(v);h.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(d){if(!d.tick.offInterval){var h=d.tick.value,f=l.getItemModel(h),p=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),v=i.dataToCoord(h),y=new $n({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Wt(o._changeTimeline,o,h),silent:!1,style:Xi(p,{text:d.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Xi(g),y.ensureState("progress").style=Xi(m),n.add(y),Wx(y),Pxt(y).dataIndex=h,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(),d=a.getPlayState(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",Wt(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",Wt(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,d?"stop":"play",Wt(this._handlePlayClick,this,!d),!0);function f(p,g,m,v){if(p){var y=Pm(Jt(a.get(["controlStyle",g+"BtnSize"]),o),o),b=[0,-y/2,y,y],x=Wen(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),Wx(x)}}},e.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,d={onCreate:function(h){h.draggable=!0,h.drift=Wt(u._handlePointerDrag,u),h.ondragend=Wt(u._handlePointerDragend,u),Bxt(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){Bxt(h,u._progressLine,s,i,a)}};this._currentPointer=Nxt(l,l,this._mainGroup,{},this._currentPointer,d)},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=Dl(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,p]}var bj={min:Kr(yj,"min"),max:Kr(yj,"max"),average:Kr(yj,"average"),median:Kr(yj,"median")};function l7(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!Zen(e)&&!ft(e.coord)&&ft(i)){var a=Fxt(e,r,n,t);if(e=lr(e),e.type&&bj[e.type]&&a.baseAxis&&a.valueAxis){var o=Nr(i,a.baseAxis.dim),s=Nr(i,a.valueAxis.dim),l=bj[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&&bj[e.type]){var d=n.getOtherAxis(u);d&&(e.value=xj(r,r.mapDimension(d.dim),e.type))}}else for(var h=e.coord,f=0;f<2;f++)bj[h[f]]&&(h[f]=xj(r,r.mapDimension(i[f]),h[f]));return e}}function Fxt(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(Jen(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 Jen(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function c7(t,e){return t&&t.containData&&e.coord&&!b1e(e)?t.containData(e.coord):!0}function etn(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!b1e(e)&&!b1e(r)?t.containZone(e.coord,r.coord):!0}function zxt(t,e){return t?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Xx(o,e[a])}:function(r,n,i,a){return Xx(r.value,e[a])}}function xj(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 x1e=Qr(),w1e=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){x1e(s).keep=!1}),n.eachSeries(function(s){var l=d0.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!x1e(s).keep&&a.group.remove(s.group)}),ttn(n,o,this.type)},e.prototype.markKeep=function(r){x1e(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;fe(r,function(a){var o=d0.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?Sut(l):Vpe(l))})}})},e.type="marker",e}(Ki);function ttn(t,e,r){t.eachSeries(function(n){var i=d0.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var o=PS(i),s=o.z,l=o.zlevel;zW(a.group,s,l)}})}function Uxt(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",d=u?o?o.width:0:i,h=u?o?o.height:0:a,f=u&&o?o.x:0,p=u&&o?o.y:0,g,m=Gt(l.get("x"),d)+f,v=Gt(l.get("y"),h)+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 rtn=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=d0.getMarkerModelFromSeries(a,"markPoint");o&&(Uxt(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,d=u.get(s)||u.set(s,new AB),h=ntn(o,r,n);n.setData(h),Uxt(n.getData(),r,a),h.each(function(f){var p=h.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=J8(l,"color");A.fill||(A.fill=T),h.setItemVisual(f,{z2:Jt(S,0),symbol:g,symbolSize:m,symbolRotate:v,symbolOffset:y,symbolKeepAspect:b,style:A})}),d.updateData(h),this.group.add(d.group),h.eachItemGraphicEl(function(f){f.traverse(function(p){Cr(p).dataModel=n})}),this.markKeep(d),d.group.silent=n.get("silent")||r.get("silent")},e.type="markPoint",e}(w1e);function ntn(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 Xc(n,r),a=vt(r.get("data"),Kr(l7,e));t&&(a=oi(a,Kr(c7,t)));var o=zxt(!!t,n);return i.initData(a,null,o),i}function itn(t){t.registerComponentModel(Ken),t.registerComponentView(rtn),t.registerPreprocessor(function(e){y1e(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var atn=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}(d0),wj=Qr(),otn=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=Hc(n.yAxis,n.xAxis);else{var u=Fxt(n,i,e,t);s=u.valueAxis;var d=Mme(i,u.valueDataDim);l=xj(i,d,o)}var h=s.dim==="x"?0:1,f=1-h,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[h]=g.coord[h]=l,a=[p,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[l7(t,a[0]),l7(t,a[1]),lt({},a[2])];return v[2].type=v[2].type||null,Gr(v[2],v[0]),Gr(v[2],v[1]),v};function Aj(t){return!isNaN(t)&&!isFinite(t)}function Vxt(t,e,r,n){var i=1-t,a=n.dimensions[t];return Aj(e[i])&&Aj(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function stn(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Vxt(1,r,n,t)||Vxt(0,r,n,t)))return!0}return c7(t,e[0])&&c7(t,e[1])}function A1e(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Gt(o.get("x"),i.getWidth()),u=Gt(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 d=a.dimensions,h=t.get(d[0],e),f=t.get(d[1],e);s=a.dataToPoint([h,f])}if(dT(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),d=a.dimensions;Aj(t.get(d[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):Aj(t.get(d[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 ltn=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=d0.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=wj(o).from,u=wj(o).to;l.each(function(d){A1e(l,d,!0,a,i),A1e(u,d,!1,a,i)}),s.each(function(d){s.setItemLayout(d,[l.getItemLayout(d),u.getItemLayout(d)])}),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,d=u.get(s)||u.set(s,new Nve);this.group.add(d.group);var h=ctn(o,r,n),f=h.from,p=h.to,g=h.line;wj(n).from=f,wj(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]),h.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})}),d.updateData(g),h.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);A1e(w,A,S,r,a);var C=T.getModel("itemStyle").getItemStyle();C.fill==null&&(C.fill=J8(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(d),d.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(w1e);function ctn(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var d=e.getData(),h=d.getDimensionInfo(d.mapDimension(u))||{};return lt(lt({},h),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Xc(n,r),a=new Xc(n,r),o=new Xc([],r),s=vt(r.get("data"),Kr(otn,e,t,r));t&&(s=oi(s,Kr(stn,t)));var l=zxt(!!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 utn(t){t.registerComponentModel(atn),t.registerComponentView(ltn),t.registerPreprocessor(function(e){y1e(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var dtn=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}(d0),Sj=Qr(),htn=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=l7(t,i),s=l7(t,a),l=o.coord,u=s.coord;l[0]=Hc(l[0],-1/0),l[1]=Hc(l[1],-1/0),u[0]=Hc(u[0],1/0),u[1]=Hc(u[1],1/0);var d=TH([{},o,s]);return d.coord=[o.coord,s.coord],d.x0=o.x,d.y0=o.y,d.x1=s.x,d.y1=s.y,d}};function Tj(t){return!isNaN(t)&&!isFinite(t)}function Gxt(t,e,r,n){var i=1-t;return Tj(e[i])&&Tj(r[i])}function ftn(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 dT(t,"cartesian2d")?r&&n&&(Gxt(1,r,n)||Gxt(0,r,n))?!0:etn(t,i,a):c7(t,i)||c7(t,a)}function Qxt(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Gt(o.get(r[0]),i.getWidth()),u=Gt(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var d=t.getValues(["x0","y0"],e),h=t.getValues(["x1","y1"],e),f=a.clampData(d),p=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>p[0]?h[0]:d[0]:g[0]=f[0]>p[0]?d[0]:h[0],r[1]==="y0"?g[1]=f[1]>p[1]?h[1]:d[1]:g[1]=f[1]>p[1]?d[1]:h[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(dT(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);Tj(m)?s[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):Tj(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 Hxt=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],ptn=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=d0.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=vt(Hxt,function(h){return Qxt(s,l,h,a,i)});s.setItemLayout(l,u);var d=s.getItemGraphicEl(l);d.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,d=u.get(s)||u.set(s,{group:new gr});this.group.add(d.group),this.markKeep(d);var h=gtn(o,r,n);n.setData(h),h.each(function(f){var p=vt(Hxt,function(E){return Qxt(h,f,E,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,v=g.getExtent(),y=m.getExtent(),b=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],x=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Dl(b),Dl(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),t5=Kr,T1e=fe,Cj=gr,Wxt=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 Cj),this.group.add(this._selectorGroup=new Cj),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 d=Ns(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),p=ba(h,d,f),g=this.layoutInner(r,o,p,a,l,u),m=ba(mr({width:g.width,height:g.height},h),d,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=ext(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(),d=qt(),h=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),T1e(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` +`)){var b=new Cj;b.newline=!0,u.add(b);return}var x=i.getSeriesByName(y)[0];if(!d.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,h,a);C.on("click",t5(Yxt,y,null,a,p)).on("mouseover",t5(C1e,x.name,null,a,p)).on("mouseout",t5(k1e,x.name,null,a,p)),i.ssr&&C.eachChild(function(O){var E=Cr(O);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&C.eachChild(function(O){v.packEventData(O,n,x,m,y)}),d.set(y,!0)}else i.eachRawSeries(function(O){var E=this;if(!d.get(y)&&O.legendVisualProvider){var _=O.legendVisualProvider;if(!_.containName(y))return;var P=_.indexOfName(y),L=_.getItemVisual(P,"style"),R=_.getItemVisual(P,"legendIcon"),D=Yc(L.fill);D&&D[3]===0&&(D[3]=.2,L=lt(lt({},L),{fill:Jf(D,"rgba")}));var M=this._createItem(O,y,m,g,n,r,{},L,R,h,a);M.on("click",t5(Yxt,null,y,a,p)).on("mouseover",t5(C1e,null,y,a,p)).on("mouseout",t5(k1e,null,y,a,p)),i.ssr&&M.eachChild(function(I){var N=Cr(I);N.seriesIndex=O.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(I){E.packEventData(I,n,O,m,y)}),d.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();T1e(r,function(u){var d=u.type,h=new $n({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:d==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);al(h,{normal:f,emphasis:p},{defaultText:u.title}),Wx(h)})},e.prototype._createItem=function(r,n,i,a,o,s,l,u,d,h,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");d=x||d||"roundRect";var w=ytn(d,a,l,u,p,v,f),A=new Cj,S=a.getModel("textStyle");if(ur(r.getLegendIcon)&&(!x||x==="inherit"))A.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:d,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(btn({itemWidth:g,itemHeight:m,icon:d,iconRotate:T,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var C=s==="left"?g+5:-5,O=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:Xi(S,{text:_,x:C,y:m/2,fill:P,align:O,verticalAlign:"middle"},{inheritColor:P})}));var L=new nn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&Iy({el:L,componentModel:o,itemName:n,itemTooltipOption:R.option}),A.add(L),A.eachChild(function(D){D.silent=!0}),L.silent=!h,this.getContentGroup().add(A),Wx(A),A.__legendDataIndex=i,A},e.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();zS(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var d=l.getBoundingRect(),h=[-d.x,-d.y];if(u.markRedraw(),l.markRedraw(),o){zS("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]+=d[v]+g:h[m]+=f[v]+g,p[1-m]+=d[y]/2-f[y]/2,u.x=p[0],u.y=p[1],l.x=h[0],l.y=h[1];var x={x:0,y:0};return x[v]=d[v]+g+f[v],x[y]=Math.max(d[y],f[y]),x[b]=Math.min(0,f[b]+p[1-m]),x}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Ki);function ytn(t,e,r,n,i,a,o){function s(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),T1e(v,function(b,x){v[x]==="inherit"&&(v[x]=y[x])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),d=t.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:xR(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[d]),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[d];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 btn(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 Yxt(t,e,r,n){k1e(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),C1e(t,e,r,n)}function C1e(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function k1e(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function u7(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),qxt(s,i),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){fe(i,function(l,u){s[l?"select":"unSelect"](u)}),qxt(s,o)}),n?{selected:o,legendIndex:a}:{name:e.name,selected:o}}function qxt(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 xtn(t){t.registerAction("legendToggleSelect","legendselectchanged",Kr(u7,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",Kr(u7,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",Kr(u7,"inverseSelect")),t.registerAction("legendSelect","legendselected",Kr(u7,"select")),t.registerAction("legendUnSelect","legendunselected",Kr(u7,"unSelect"))}var wtn=w8(Atn);function Atn(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]=d[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,d.setPosition(v),h.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]),h.__rectSize=i[o],m){var S={x:0,y:0};S[o]=Math.max(i[o]-g[o]-x,0),S[s]=A[s],h.setClipPath(new nn({shape:S})),h.__rectSize=S[o]}else f.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&qn(d,{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(d){var h=d+"DataIndex",f=n[h]!=null,p=i.childOfName(d);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=O1e[o],l=E1e[o],u=this._findTargetItemIndex(n),d=i.children(),h=d[u],f=d.length,p=f?1:0,g={contentPosition:[i.x,i.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=w(h);g.contentPosition[o]=-m.s;for(var v=u+1,y=m,b=m,x=null;v<=f;++v)x=w(d[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(d[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}(Wxt);function Ctn(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 ktn(t){Xr(jxt),t.registerComponentModel(Stn),t.registerComponentView(Ttn),Ctn(t)}function Otn(t){Xr(jxt),Xr(ktn)}var Etn=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=jx(a7.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(a7),_1e=Qr();function _tn(t,e,r){_1e(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function Rtn(t,e){for(var r=_1e(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=h),o=o&&d.get("preventDefaultMouseMove",!0),s=Jt(d.get("cursorGrab",!0),s),l=Jt(d.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 Ptn(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=_1e(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=qt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=qbt(a);fe(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Dtn(r,s.model)),d=u.dataZoomInfoMap||(u.dataZoomInfoMap=qt());d.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){Zxt(i,a);return}var d=Itn(l,a,r);o.enable(d.controlType,d.opt),pR(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Ntn=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(),_tn(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(){Rtn(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(i1e),R1e={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),o=t.axisModels[0];if(o){var s=D1e[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 d=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(lw(0,a,[0,100],0,d.minSpan,d.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Jxt(function(t,e,r,n,i,a){var o=D1e[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Jxt(function(t,e,r,n,i,a){var o=D1e[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function Jxt(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(lw(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var D1e={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 ewt(t){a1e(t),t.registerComponentModel(Etn),t.registerComponentView(Ntn),Ptn(t)}var Btn=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=jx(a7.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}(a7),d7=nn,$tn=1,L1e=30,Ftn=7,h7="horizontal",twt="vertical",ztn=5,Utn=["line","bar","candlestick","scatter"],Vtn={easing:"cubicOut",duration:100,delay:0},Gtn=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),pR(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(){j8(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?Ftn:0,o=Ns(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===h7?{right:o.width-s.x-s.width,top:o.height-L1e-l-a,width:s.width,height:L1e}:{right:l,top:s.y,width:L1e,height:s.height},d=US(r.option);fe(["right","top","width","height"],function(f){d[f]==="ph"&&(d[f]=u[f])});var h=ba(d,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===twt&&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===h7&&!o?{scaleY:l?1:-1,scaleX:1}:i===h7&&o?{scaleY:l?1:-1,scaleX:-1}:i===twt&&!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]),d=isNaN(u.x)?0:u.x,h=isNaN(u.y)?0:u.y;r.x=n.x-d,r.y=n.y-h,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 d7({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new d7({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,d=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var h=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]/(h[1]-h[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-h[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,d=this._shadowPolylinePts=y}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var C=this.dataZoomModel;function O(P){var L=C.getModel(P?"selectedDataBackground":"dataBackground"),R=new gr,D=new gc({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Ml({shape:{points:d},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 _=O(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(Utn,u.get("type"))<0)){var d=a.getComponent(pw(o),s).axis,h=Qtn(o),f,p=u.coordinateSystem;h!=null&&p.getOtherAxis&&(f=p.getOtherAxis(d).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:d,series:u,thisDim:g,otherDim:h,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,d=l.get("borderRadius")||0,h=l.get("brushSelect"),f=n.filler=new d7({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new d7({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:d},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:$tn,fill:tt.color.transparent}})),fe([0,1],function(x){var w=l.get("handleIcon");!pY[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:Htn(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=Gt(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(),Wx(A);var C=l.get("handleColor");C!=null&&(A.style.fill=C),o.add(i[x]=A);var O=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new $n({silent:!0,invisible:!_,style:Xi(O,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:O.getTextColor(),font:O.getFont()}),z2:10}))},this);var p=f;if(h){var g=Gt(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];lw(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,d=this._range=Dl([Zn(a[0],o,l,!0),Zn(a[1],o,l,!0)]);return!u||u[0]!==d[0]||u[1]!==d[1]},e.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Dl(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]],d=0;dn[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();lw(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=Dl([Zn(l[0],o,s,!0),Zn(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(wy(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 d7({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),d=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:d[0],y:0,width:u[0]-d[0],height:h[1]})},e.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Vtn:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=qbt(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}(i1e);function rwt(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)?"":Kc(n)||lB(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 Qtn(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function Htn(t){return t==="vertical"?"ns-resize":"ew-resize"}function nwt(t){t.registerComponentModel(Btn),t.registerComponentView(Gtn),a1e(t)}function Wtn(t){Xr(ewt),Xr(nwt)}var iwt={get:function(t,e,r){var n=lr((Ytn[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},Ytn={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]}},awt=sl.mapVisual,qtn=sl.eachVisual,jtn=ft,M1e=fe,Xtn=Dl,Ktn=Zn,kj=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&&Cxt(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=p1e(this.option.controller,n,r),this.targetVisuals=p1e(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 M1e(n,function(l){if(l.seriesIndex!=null)i.push(l.seriesIndex);else if(l.seriesId!=null){var u;r.ecModel.eachSeries(function(d){d.id===l.seriesId&&(u=d)}),u&&i.push(u.componentIndex)}}),i}var a=this.option.seriesId,o=this.option.seriesIndex;o==null&&a==null&&(o="all");var s=U_(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 d=n?r:u?[h(r[0]),h(r[1])]:h(r);if($t(l))return l.replace("{value}",u?d[0]:d).replace("{value2}",u?d[1]:d);if(ur(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+d[1]:r[1]===s[1]?i[1]+" "+d[0]:d[0]+" - "+d[1];return d;function h(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=Xtn([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=my(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={});Gr(a,i),Gr(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),d.call(this,o);function l(h){jtn(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,p){var g=h[f],m=h[p];g&&!m&&(m=h[p]={},M1e(g,function(v,y){if(sl.isValidType(y)){var b=iwt.get(y,"inactive",s);b!=null&&(m[y]=b,y==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function d(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,p=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),v=m||"roundRect";M1e(this.stateList,function(y){var b=this.itemSize,x=h[y];x||(x=h[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=awt(x.symbol,function(S){return S==="none"?v:S});var w=x.symbolSize;if(w!=null){var A=-1/0;qtn(w,function(S){S>A&&(A=S)}),x.symbolSize=awt(w,function(S){return Ktn(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),owt=[20,140],Ztn=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]=owt[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=owt[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=Dl((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=swt(this,"outOfRange",this.getExtent()),i=swt(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,d=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(),d=this._applyTransform("left",i.mainGroup);Jtn([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var p=h0(r[h],[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=gg(i.handleLabelPoints[h],MS(f,this.group));if(this._orient==="horizontal"){var v=d==="left"||d==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),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]],d=this._shapes,h=d.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=h0(r,s,u,!0),v=l[0]-g/2,y={x:h.x,y:h.y};h.y=m,h.x=v;var b=gg(d.indicatorLabelPoint,MS(h,this.group)),x=d.indicatorLabel;x.attr("invisible",!1);var w=this._applyTransform("left",d.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 O={duration:100,easing:"cubicInOut",additive:!0};h.x=y.x,h.y=y.y,h.animateTo(T,O),x.animateTo(C,O)}else h.attr(T),x.attr(C);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_o[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(d,h[1],"< ",l):h[1]===1/0?this._showIndicator(d,h[0],"> ",l):this._showIndicator(d,d,"≈ ",l));var f=this._hoverLinkDataIndices,p=[];(n||fwt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=i8r(f,p);this._dispatchHighDown("downplay",Oj(g[0],i)),this._dispatchHighDown("highlight",Oj(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(qS(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 srn(t,e,r,n){for(var i=e.targetVisuals[n],a=sl.prepareVisualTypes(i),o={color:J8(t.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(irn,arn),fe(orn,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(lrn))}function ywt(t){t.registerComponentModel(Ztn),t.registerComponentView(rrn),vwt(t)}var crn=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=[],urn[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=sl.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(d){u=u||o(r,d,l)||o(r.target,d,l)},this),!u&&fe(this.stateList,function(d){(r[d]||(r[d]={}))[l]=iwt.get(l,d==="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 d=this.getSelectedMapKey(l);o.hasOwnProperty(d)||(o[d]=!0)},this),i.selectedMode==="single"){var s=!1;fe(a,function(l,u){var d=this.getSelectedMapKey(l);o[d]&&(s?o[d]=!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=sl.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 d=sl.findPieceIndex(l,i);d===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(d,h){var f=a.getRepresentValue({interval:d});h||(h=a.getValueState(f));var p=r(f,h);d[0]===-1/0?i[0]=p:d[1]===1/0?i[1]=p:n.push({value:d[0],color:p},{value:d[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(d){var h=d.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=jx(kj.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}(kj),urn={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 bwt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var drn=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,d=Hc(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,d,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]],h),d){var v=this.visualMapModel.getValueState(m),y=a.get("align")||o;g.add(new $n({style:Xi(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:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,d,o),zS(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:Oj(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return uwt(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:Xi(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}(lwt);function xwt(t){t.registerComponentModel(crn),t.registerComponentView(drn),vwt(t)}function hrn(t){Xr(ywt),Xr(xwt)}var frn=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:adt(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}(),prn=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 frn(this);if(this._target=null,this.ecModel.eachSeries(function(i){Tyt(i,null)}),this.shouldShow()){var n=this.getTarget();Tyt(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),grn=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 Aq),!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=Ns(r,i).refContainer,u=ba(Bdt(r,!0),l),d=s.lineWidth||0,h=this._contentRect=IS(u.clone(),d/2,!0,!0),f=new gr;a.add(f),f.setClipPath(new nn({shape:h.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(),Awt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),Awt(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,kq(i,s.x,s.y,s.width,s.height);var l=ba({left:"center",top:"center",aspect:s.width/s.height},a);Oq(i,l.x,l.y,l.width,l.height),zB(o,i,xT),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=Fh([],r.targetTrans),i=$h([],Tq(null,this._coordSys),n);this._transThisToTarget=Fh([],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 vT(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(wwt(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(wwt(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}(Ki);function wwt(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 Awt(t,e){var r=PS(t);zW(e.group,r.z,r.zlevel)}function mrn(t){t.registerComponentModel(prn),t.registerComponentView(grn)}var vrn={label:{enabled:!0},decal:{show:!1}},Swt=Qr(),Twt=Qr(),yrn=w8(brn);function brn(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Twt(t).scope||(Twt(t).scope={}),i=lr(vrn);Gr(i.label,t.getLocaleModel().get("aria"),!1),Gr(r.option,i,!1),a(),o();function a(){var d=r.getModel("decal"),h=d.get("show");if(h){var f=qt();t.eachSeries(function(p){p.isColorBySeries()||(Swt(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=Fge(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=Swt(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+"",O=Fge(p.ecModel,C,y,b),E=g.getItemVisual(T,"decal");g.setItemVisual(T,"decal",A(E,O))})}function A(S,T){var C=S?lt(lt({},T),S):T;return C.dirty=!0,C}})}}function o(){var d=e.getZr().dom;if(d){var h=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=mr(f.option,h),!!f.get("enabled")){if(d.setAttribute("role","img"),f.get("description")){d.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(O,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=s(_,{seriesId:O.seriesIndex,seriesName:O.get("name"),seriesType:u(O.subType)});var R=O.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"},Arn=function(){function t(e){var r=this._condVal=$t(e)?new RegExp(e):rlt(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}(),Srn=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),Trn=function(){function t(){}return t.prototype.evaluate=function(){for(var e=this.children,r=0;r2&&n.push(i),i=[L,R]}function d(L,R,D,M){n5(L,D)&&n5(R,M)||i.push(L,R,D,M,D,M)}function h(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 B1e(t,e,r,n,i,a,o,s,l,u){if(n5(t,r)&&n5(e,n)&&n5(i,o)&&n5(a,s)){l.push(o,s);return}var d=2/u,h=d*d,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 O=[],E=[];Nx(t,r,i,o,.5,O),Nx(e,n,a,s,.5,E),B1e(O[0],E[0],O[1],E[1],O[2],E[2],O[3],E[3],l,u),B1e(O[4],E[4],O[5],E[5],O[6],E[6],O[7],E[7],l,u)}function $rn(t,e){var r=N1e(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=Ewt([l,u],d?0:1,e),f=(d?s:u)/h.length,p=0;pi,o=Ewt([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",h=t[s]/o.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function Urn(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 i5(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Vrn(t,e,r){for(var n=t.length,i=[],a=0;ao?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),Vrn(e,u,d)}function Ej(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Ej(t,a[0],i,n),Ej(t,a[1],r-i,n)}return n}function Grn(t,e){for(var r=[],n=0;n0;u/=2){var d=0,h=0;(t&u)>0&&(d=1),(e&u)>0&&(h=1),s+=u*u*(3*d^h),h===0&&(d===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Dj(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(),d=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),r=Math.min(h,r),n=Math.max(d,n),i=Math.max(h,i),[d,h]}),o=vt(a,function(s,l){return{cp:s,z:Zrn(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 Bwt(t){return Wrn(t.path,t.count)}function F1e(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Jrn(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 tnn={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,d;$wt(t)&&(u=t,d=e),$wt(e)&&(u=e,d=t);function h(y,b,x,w,A){var S=y.many,T=y.one;if(S.length===1&&!A){var C=b?S[0]:T,O=b?T:S[0];if(_j(C))h({many:[C],one:O},!0,x,w,!0);else{var E=s?mr({delay:s(x,w)},l):l;$1e(C,O,E),a(C,O,C,O,E)}}else for(var _=mr({dividePath:tnn[r],individualDelay:s&&function(I,N,F,B){return s(I+x,w)}},l),P=b?Jrn(S,T,_):enn(T,S,_),L=P.fromIndividuals,R=P.toIndividuals,D=L.length,M=0;Me.length,p=u?Fwt(d,u):Fwt(f?e:t,[f?t:e]),g=0,m=0;mzwt))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 Wwt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Ywt(t){return ft(t)?t.sort().join(","):t}function mw(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function lnn(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=Wwt(a),d=Ywt(u);n.set(d,{dataGroupId:s,data:l}),ft(u)&&fe(u,function(h){i.set(h,{key:d,dataGroupId:s,data:l})})}),fe(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=Wwt(a),u=Ywt(l),d=n.get(u);if(d)r.set(u,{oldSeries:[{dataGroupId:d.dataGroupId,divide:mw(d.data),data:d.data}],newSeries:[{dataGroupId:o,divide:mw(s),data:s}]});else if(ft(l)){var h=[];fe(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:mw(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:mw(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:mw(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:o,data:s,divide:mw(s)})}}}}),r}function qwt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:mw(e.oldData[s]),groupIdDim:o.dimension})}),fe(ji(t.to),function(o){var s=qwt(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:mw(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Hwt(i,a,n)}function unn(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){fe(ji(n.seriesTransition),function(i){fe(ji(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===Fy)return e;for(var n=jwt,i=Xwt,a=!0,o=0,s=0;su?o=l.vmin+(e-u)/(d-u)*(l.vmax-l.vmin):o=i+e-n,i=l.vmax,a=!1;break}n=d,i=l.vmax}return a&&(o=i+e-n),o}},t}();function hnn(t,e){return new dnn(t,e)}var jwt=0,Xwt=0;function fnn(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 d=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(d&&h))if(d||h){var p=d?"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 pnn(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],d=n(u),h=i*3/4;d>s.vmin-h&&de[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=Bh(o.gap);if(u.match(/%$/)){var d=parseFloat(u)/100;i(d)||(d=0),s.gapParsed.type="tpPrct",s.gapParsed.val=d,l=!0}}if(!l){var h=e.parse(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}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 H1e(t,e){return W1e(e)===W1e(t)}function W1e(t){return t.start+"_\0_"+t.end}function mnn(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=my(n,function(u){return H1e(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 vnn(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=my(r,function(d){return H1e(d.breakOption,e.break.parsedBreak.breakOption)}),o={lookup:n,depth:Fy},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 ynn(t,e,r,n,i){i.original=Q1e(t,e,r);var a=i.transformed=Q1e(t,e,r),o=i.lookup;a.breaks=vt(a.breaks,function(s,l){var u={depth:Fy},d=e.transformIn(s.vmin,u),h=e.transformIn(s.vmax,u),f={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?e.transformIn(s.vmin+s.gapParsed.val,u)-d:s.gapParsed.val};return o.from[n+l]=d,o.to[n+l]=s.vmin,o.from[n+l+1]=h,o.to[n+l+1]=s.vmax,{vmin:d,vmax:h,gapParsed:f,gapReal:s.gapReal,breakOption:s.breakOption}})}var bnn={vmin:"start",vmax:"end"};function xnn(t,e){return e&&(t=t||{},t.break={type:bnn[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function wnn(){x7r({createBreakScaleMapper:hnn,pruneTicksByBreak:pnn,addBreaksToTicks:gnn,parseAxisBreakOption:Q1e,identifyAxisBreak:H1e,serializeAxisBreakIdentifier:W1e,retrieveAxisBreakPairs:mnn,getTicksBreakOutwardTransform:vnn,parseAxisBreakOptionInwardTransform:ynn,makeAxisLabelFormatterParamBreak:xnn})}var Kwt=Qr();function Ann(t,e){var r=my(t,function(n){return Ho().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function Snn(t){fe(t,function(e){return e.shouldRemove=!0})}function Tnn(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function Cnn(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(O){return O.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),d=s.get("zigzagMaxSpan");u=Math.max(2,u||0),d=Math.max(u,d||0);var h=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=Kwt(e).visualList||(Kwt(e).visualList=[]);Snn(A);for(var S=function(O){var E=o[O][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var P=Ann(A,E);P.shouldRemove=!1;var L=new gr;C(P.zigzagRandomList,L,_[0],_[1],w,E),h&&L.on("click",function(){var R={type:nq,breaks:[{start:E.breakOption.start,end:E.breakOption.end}]};R[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(R)}),L.silent=!h,x.add(L)},T=0;T=N;j&&(U=N);var q=[],ne=[];q[M]=_,ne[M]=P,!H&&!j&&(q[M]+=z?-l:l,ne[M]-=z?l:-l),q[I]=U,ne[I]=U,B.push(q),V.push(ne);var X=void 0;if(Gb[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],d=null,h=0;h=0?l[0].width:l[1].width),f=(h+d.x)/2-u.x,p=Math.min(f,f-d.x),g=Math.max(f,f-d.x),m=g<0?g:p>0?p:0;s=(f-m)/d.x}var v=new wr,y=new wr;wr.scale(v,n,-s),wr.scale(y,n,1-s),r0e(r[0],v),r0e(r[1],y)}function Enn(t,e){var r={breaks:[]};return fe(e.breaks,function(n){if(n){var i=my(t.get("breaks",!0),function(s){return Ho().identifyAxisBreak(s,n)});if(i){var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===nq?!0:a===Smt?!1:a===Tmt?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function _nn(){HVr({adjustBreakLabelPair:Onn,buildAxisBreakLine:knn,rectCoordBuildBreakAxis:Cnn,updateModelAxisBreak:Enn})}function Rnn(t){jVr(t),wnn(),_nn()}function Dnn(){dQr(Lnn)}function Lnn(t,e){fe(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Mnn(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 Mnn(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof cB?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=dB(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;dZwt(t,"name",{value:e,configurable:!0}),Lj=(t,e)=>{for(var r in e)Zwt(t,r,{get:e[r],enumerable:!0})},Jwt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ci,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",o="second",s="minute",l="hour",u="day",d="week",h="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=O,_.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=O(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:k((...t)=>{},"debug"),info:k((...t)=>{},"info"),warn:k((...t)=>{},"warn"),error:k((...t)=>{},"error"),fatal:k((...t)=>{},"fatal")},Y1e=k(function(t="fatal"){let e=jy.fatal;typeof t=="string"?t.toLowerCase()in jy&&(e=jy[t]):typeof t=="number"&&(e=t),ye.trace=()=>{},ye.debug=()=>{},ye.info=()=>{},ye.warn=()=>{},ye.error=()=>{},ye.fatal=()=>{},e<=jy.fatal&&(ye.fatal=console.error?console.error.bind(console,mp("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",mp("FATAL"))),e<=jy.error&&(ye.error=console.error?console.error.bind(console,mp("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",mp("ERROR"))),e<=jy.warn&&(ye.warn=console.warn?console.warn.bind(console,mp("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",mp("WARN"))),e<=jy.info&&(ye.info=console.info?console.info.bind(console,mp("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",mp("INFO"))),e<=jy.debug&&(ye.debug=console.debug?console.debug.bind(console,mp("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mp("DEBUG"))),e<=jy.trace&&(ye.trace=console.debug?console.debug.bind(console,mp("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mp("TRACE")))},"setLogLevel"),mp=k(t=>`%c${Nl().format("ss.SSS")} : ${t} : `,"format");const Mj={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 Mj.hue2rgb(a,i,t+1/3)*255;case"g":return Mj.hue2rgb(a,i,t)*255;case"b":return Mj.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}`}}},vw={};for(let t=0;t<=255;t++)vw[t]=Cn.unit.dec2hex(t);const Jc={ALL:0,RGB:1,HSL:2};let Nnn=class{constructor(){this.type=Jc.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=Jc.ALL}is(e){return this.type===e}};class Bnn{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Nnn}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Jc.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(Jc.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(Jc.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(Jc.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(Jc.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(Jc.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(Jc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Jc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Jc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Jc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Jc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Jc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Jc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Ij=new Bnn({r:0,g:0,b:0,a:0},"transparent"),o5={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(o5.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,d=o?255:15;return Ij.set({r:(n>>l*(u+3)&d)*s,g:(n>>l*(u+2)&d)*s,b:(n>>l*(u+1)&d)*s,a:a?(n&d)*s/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${vw[Math.round(e)]}${vw[Math.round(r)]}${vw[Math.round(n)]}${vw[Math.round(i*255)]}`:`#${vw[Math.round(e)]}${vw[Math.round(r)]}${vw[Math.round(n)]}`}},PT={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(PT.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(PT.re);if(!r)return;const[,n,i,a,o,s]=r;return Ij.set({h:PT._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)}%)`}},p7={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=p7.colors[t];if(e)return o5.parse(e)},stringify:t=>{const e=o5.stringify(t);for(const r in p7.colors)if(p7.colors[r]===e)return r}},g7={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(g7.re);if(!r)return;const[,n,i,a,o,s,l,u,d]=r;return Ij.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(d?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)})`}},Sg={format:{keyword:p7,hex:o5,rgb:g7,rgba:g7,hsl:PT,hsla:PT},parse:t=>{if(typeof t!="string")return t;const e=o5.parse(t)||g7.parse(t)||PT.parse(t)||p7.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Jc.HSL)||t.data.r===void 0?PT.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?g7.stringify(t):o5.stringify(t)},e2t=(t,e)=>{const r=Sg.parse(t);for(const n in e)r[n]=Cn.channel.clamp[n](e[n]);return Sg.stringify(r)},Tg=(t,e,r=0,n=1)=>{if(typeof t!="number")return e2t(t,{a:e});const i=Ij.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 Sg.stringify(i)},q1e=(t,e)=>Cn.lang.round(Sg.parse(t)[e]),$nn=t=>{const{r:e,g:r,b:n}=Sg.parse(t),i=.2126*Cn.channel.toLinear(e)+.7152*Cn.channel.toLinear(r)+.0722*Cn.channel.toLinear(n);return Cn.lang.round(i)},Fnn=t=>$nn(t)>=.5,zu=t=>!Fnn(t),j1e=(t,e,r)=>{const n=Sg.parse(t),i=n[e],a=Cn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Sg.stringify(n)},dt=(t,e)=>j1e(t,"l",e),ht=(t,e)=>j1e(t,"l",-e),t2t=(t,e)=>j1e(t,"a",-e),Ae=(t,e)=>{const r=Sg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return e2t(t,n)},znn=(t,e,r=50)=>{const{r:n,g:i,b:a,a:o}=Sg.parse(t),{r:s,g:l,b:u,a:d}=Sg.parse(e),h=r/100,f=h*2-1,p=o-d,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*h+d*(1-h);return Tg(y,b,x,w)},it=(t,e=100)=>{const r=Sg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,znn(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 r2t(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:$s(BigInt.prototype.toString),u2t=typeof Symbol>"u"?null:$s(Symbol.prototype.toString),Qd=$s(Object.prototype.hasOwnProperty),b7=$s(Object.prototype.toString),eu=$s(RegExp.prototype.test),BT=ein(TypeError);function $s(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]:v7;if(i2t&&i2t(t,null),!l5(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(Wnn(e)||(e[n]=a),i=a)}t[i]=!0}return t}function tin(t){for(let e=0;e/g),lin=Bl(/\${[\w\W]*/g),cin=Bl(/^data-[\-\w.\u00B7-\uFFFF]+$/),uin=Bl(/^aria-[\-\w]+$/),g2t=Bl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),din=Bl(/^(?:\w+script|data):/i),hin=Bl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fin=Bl(/^html$/i),pin=Bl(/^[a-z][.\w]*(-[.\w]+)+$/i),m2t=Bl(/<[/\w!]/g),v2t=Bl(/<[/\w]/g),gin=Bl(/<\/no(script|embed|frames)/i),min=Bl(/\/>/i),jh={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},y2t=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],vin=ll(Ni({},y2t)),yin=function(){const t={};return NT(y2t,e=>{t[e]=Bl(new RegExp("])","i"))}),ll(t)}(),bin=function(){return typeof window>"u"?null:window},xin=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}},b2t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yw=function(e,r,n,i){return Qd(e,r)&&l5(e[r])?Ni(i.base?qh(i.base):{},e[r],i.transform):n},nbe=function(e,r,n){const i=Qd(e,r)?e[r]:void 0;return i&&typeof i=="object"?qh(i):n()};function x2t(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bin();const e=Ht=>x2t(Ht);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==jh.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 d=t.DOMParser,h=t.trustedTypes,f=s.prototype,p=Cg(f,"cloneNode"),g=Cg(f,"remove"),m=Cg(f,"nextSibling"),v=Cg(f,"childNodes"),y=Cg(f,"parentNode"),b=Cg(f,"shadowRoot"),x=Cg(f,"attributes"),w=o&&o.prototype?Cg(o.prototype,"nodeType"):null,A=o&&o.prototype?Cg(o.prototype,"nodeName"):null,S=o&&o.prototype?Cg(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 O,E="",_,P=!1,L=0;const R=function(){if(L>0)throw BT('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 O.createHTML(Ve)}finally{L--}},M=function(Ve){R(),L++;try{return O.createScriptURL(Ve)}finally{L--}},I=function(){return P||(_=xin(h,i),P=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let G=b2t();e.isSupported=typeof n2t=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const H=oin,j=sin,q=lin,ne=cin,X=uin,J=din,ee=hin,te=pin;let pe=g2t,ie=null;const Ce=Ni({},[...d2t,...J1e,...ebe,...tbe,...h2t]);let Oe=null;const Ee=Ni({},[...f2t,...rbe,...p2t,...Pj]);let ue=Object.seal(s5(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,xe=null;const ge=Object.seal(s5(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ze=!0,we=!0,ke=!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=Ni({},["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=Ni({},["audio","video","img","source","image","track"]);let yt=null;const Ie=Ni({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Qt=ut,It=!1,gt=null;const Te=Ni({},[St,Ot,ut],Z1e),Bt=ll(["mi","mo","mn","ms","mtext"]);let Et=Ni({},Bt);const At=ll(["annotation-xml"]);let Mt=Ni({},At);const qr=Ni({},["title","style","font","a","script"]);let Me=null;const at=["application/xhtml+xml","text/html"],wt="text/html";let Tt=null,hr=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(hr&&hr===Ve)return;(!Ve||typeof Ve!="object")&&(Ve={}),Ve=qh(Ve),Me=at.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?wt:Ve.PARSER_MEDIA_TYPE,Tt=Me==="application/xhtml+xml"?Z1e:v7,ie=yw(Ve,"ALLOWED_TAGS",Ce,{transform:Tt}),Oe=yw(Ve,"ALLOWED_ATTR",Ee,{transform:Tt}),gt=yw(Ve,"ALLOWED_NAMESPACES",Te,{transform:Z1e}),yt=yw(Ve,"ADD_URI_SAFE_ATTR",Ie,{transform:Tt,base:Ie}),et=yw(Ve,"ADD_DATA_URI_TAGS",Pe,{transform:Tt,base:Pe}),Ze=yw(Ve,"FORBID_CONTENTS",He,{transform:Tt}),he=yw(Ve,"FORBID_TAGS",qh({}),{transform:Tt}),xe=yw(Ve,"FORBID_ATTR",qh({}),{transform:Tt}),$e=Qd(Ve,"USE_PROFILES")?Ve.USE_PROFILES&&typeof Ve.USE_PROFILES=="object"?qh(Ve.USE_PROFILES):Ve.USE_PROFILES:!1,ze=Ve.ALLOW_ARIA_ATTR!==!1,we=Ve.ALLOW_DATA_ATTR!==!1,ke=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=nin(Ve.ALLOWED_URI_REGEXP)?Ve.ALLOWED_URI_REGEXP:g2t,Qt=typeof Ve.NAMESPACE=="string"?Ve.NAMESPACE:ut,Et=nbe(Ve,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ni({},Bt)),Mt=nbe(Ve,"HTML_INTEGRATION_POINTS",()=>Ni({},At));const ot=nbe(Ve,"CUSTOM_ELEMENT_HANDLING",()=>s5(null));if(ue=s5(null),Qd(ot,"tagNameCheck")&&Ir(ot.tagNameCheck)&&(ue.tagNameCheck=ot.tagNameCheck),Qd(ot,"attributeNameCheck")&&Ir(ot.attributeNameCheck)&&(ue.attributeNameCheck=ot.attributeNameCheck),Qd(ot,"allowCustomizedBuiltInElements")&&typeof ot.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=ot.allowCustomizedBuiltInElements),Bl(ue),Z&&(we=!1),ve&&(oe=!0),$e&&(ie=Ni({},h2t),Oe=s5(null),$e.html===!0&&(Ni(ie,d2t),Ni(Oe,f2t)),$e.svg===!0&&(Ni(ie,J1e),Ni(Oe,rbe),Ni(Oe,Pj)),$e.svgFilters===!0&&(Ni(ie,ebe),Ni(Oe,rbe),Ni(Oe,Pj)),$e.mathMl===!0&&(Ni(ie,tbe),Ni(Oe,p2t),Ni(Oe,Pj))),ge.tagCheck=null,ge.attributeCheck=null,Qd(Ve,"ADD_TAGS")&&(typeof Ve.ADD_TAGS=="function"?ge.tagCheck=Ve.ADD_TAGS:l5(Ve.ADD_TAGS)&&(ie===Ce&&(ie=qh(ie)),Ni(ie,Ve.ADD_TAGS,Tt))),Qd(Ve,"ADD_ATTR")&&(typeof Ve.ADD_ATTR=="function"?ge.attributeCheck=Ve.ADD_ATTR:l5(Ve.ADD_ATTR)&&(Oe===Ee&&(Oe=qh(Oe)),Ni(Oe,Ve.ADD_ATTR,Tt))),Qd(Ve,"ADD_FORBID_CONTENTS")&&l5(Ve.ADD_FORBID_CONTENTS)&&(Ze===He&&(Ze=qh(Ze)),Ni(Ze,Ve.ADD_FORBID_CONTENTS,Tt)),Ne&&(ie["#text"]=!0),be&&Ni(ie,["html","head","body"]),ie.table&&(Ni(ie,["tbody"]),delete he.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw BT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw BT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Nt=O;O=Ve.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw O=Nt,ar}}else Ve.TRUSTED_TYPES_POLICY===null?(O=void 0,E=""):(O===void 0&&(O=I()),O&&typeof E=="string"&&(E=D("")));ll&&ll(Ve),hr=Ve},Ur=Ni({},[...J1e,...ebe,...iin]),On=Ni({},[...tbe,...ain]),$r=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="svg":ot.namespaceURI===St?Ve==="svg"&&(Nt==="annotation-xml"||Et[Nt]):!!Ur[Ve]},hn=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="math":ot.namespaceURI===Ot?Ve==="math"&&Mt[Nt]:!!On[Ve]},ii=function(Ve,ot,Nt){return ot.namespaceURI===Ot&&!Mt[Nt]||ot.namespaceURI===St&&!Et[Nt]?!1:!On[Ve]&&(qr[Ve]||!Ur[Ve])},pt=function(Ve){let ot=y(Ve);(!ot||!ot.tagName)&&(ot={namespaceURI:Qt,tagName:"template"});const Nt=v7(Ve.tagName),ar=v7(ot.tagName);return gt[Ve.namespaceURI]?Ve.namespaceURI===Ot?$r(Nt,ot,ar):Ve.namespaceURI===St?hn(Nt,ot,ar):Ve.namespaceURI===ut?ii(Nt,ot,ar):!!(Me==="application/xhtml+xml"&>[Ve.namespaceURI]):!1},Ct=function(Ve){m7(e.removed,{element:Ve});try{y(Ve).removeChild(Ve)}catch{if(g(Ve),!y(Ve))throw BT("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){kt(Ve);const ot=v(Ve);if(ot){const ar=[];NT(ot,Vr=>{m7(ar,Vr)}),NT(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}m7(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"||Oe[Tt(Vr)]||or(Ve,ar,Vr)}},kt=function(Ve){const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop();T(Nt)===jh.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===jh.processingInstruction||ar===jh.comment&&eu(v2t,Nt.data)){try{g(Nt)}catch{}continue}if(ar===jh.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=s2t(Ve,/^[\r\n\t ]+/);Nt=Rn&&Rn[0]}Me==="application/xhtml+xml"&&Qt===ut&&(Ve=''+Ve+"");const ar=O?D(Ve):Ve;if(Qt===ut)try{ot=new d().parseFromString(ar,Me)}catch{}if(!ot||!ot.documentElement){ot=F.createDocument(Qt,"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),Qt===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)},ra=function(Ve){return Ve=y7(Ve,H," "),Ve=y7(Ve,j," "),Ve=y7(Ve,q," "),Ve},Ge=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=ra(Vr.data),Vr=ar.nextNode();const Rn=(ot=Ve.querySelectorAll)===null||ot===void 0?void 0:ot.call(Ve,"template");Rn&&NT(Rn,Ya=>{di(Ya.content)&&Ge(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)},di=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return w(Ve)===jh.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 Qn(Ht,Ve,ot){Ht.length!==0&&NT(Ht,Nt=>{Nt.call(e,Ve,ot,hr)})}const fa=function(Ve,ot){return!!(le&&Ve.hasChildNodes()&&!Bo(Ve.firstElementChild)&&eu(m2t,Ve.textContent)&&eu(m2t,Ve.innerHTML)||le&&Ve.namespaceURI===ut&&vin[ot]&&(Bo(Ve.firstElementChild)||typeof Ve.textContent=="string"&&eu(yin[ot],Ve.textContent))||Ve.nodeType===jh.processingInstruction||le&&Ve.nodeType===jh.comment&&eu(v2t,Ve.data))},hi=function(Ve,ot){if(Ve instanceof RegExp)return eu(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},cm=function(Ve,ot,Nt,ar){return Ve.length===0?ot:ot===Nt||ot===ar?qh(ot):ot},Ev=function(Ve,ot){return Ve===ot||y(Ve)!==null?!1:(je&&kt(Ve),!0)},_O=function(Ve,ot){if(Qn(G.beforeSanitizeElements,Ve,null),Ev(Ve,ot))return!0;if(In(Ve))return Ct(Ve),!0;const Nt=Tt(C(Ve));if(ie=cm(G.uponSanitizeElement,ie,Ce,K),Qn(G.uponSanitizeElement,Ve,{tagName:Nt,allowedTags:ie}),Ev(Ve,ot))return!0;if(fa(Ve,Nt))return Ct(Ve),!0;if(he[Nt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Nt))&&!ie[Nt]){const Vr=yu(Ve,Nt,ot);return Vr===!1&&Qn(G.afterSanitizeElements,Ve,null),Vr}if(T(Ve)===jh.element&&!pt(Ve)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&eu(gin,Ve.innerHTML))return Ct(Ve),!0;if(Z&&Ve.nodeType===jh.text){const Vr=ra(Ve.textContent);Ve.textContent!==Vr&&(m7(e.removed,{element:Ve.cloneNode()}),Ve.textContent=Vr)}return Qn(G.afterSanitizeElements,Ve,null),!1},RO=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=Oe[ot]||ge.attributeCheck instanceof Function&&ge.attributeCheck(ot,Ve);return we&&eu(ne,ot)||ze&&eu(X,ot)?!0:ar?yt[ot]||eu(pe,y7(Nt,ee,""))||(ot==="src"||ot==="xlink:href"||ot==="href")&&Ve!=="script"&&l2t(Nt,"data:")===0&&et[Ve]||ke&&!eu(J,y7(Nt,ee,""))?!0:!Nt:wl(Ve)&&hi(ue.tagNameCheck,Ve)&&hi(ue.attributeNameCheck,ot,Ve)||ot==="is"&&ue.allowCustomizedBuiltInElements&&hi(ue.tagNameCheck,Nt)},DO=Ni({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wl=function(Ve){return!DO[v7(Ve)]&&eu(te,Ve)},mh=function(Ve,ot,Nt,ar){if(O&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Nt)switch(h.getAttributeType(Ve,ot)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},Fc=function(Ve,ot,Nt,ar){try{Nt?Ve.setAttributeNS(Nt,ot,ar):Ve.setAttribute(ot,ar),In(Ve)?Ct(Ve):o2t(e.removed)}catch{Mn(ot,Ve)}},Js=function(Ve){Qn(G.beforeSanitizeAttributes,Ve,null);const ot=Ve.attributes;if(!ot||In(Ve))return;Oe=cm(G.uponSanitizeAttribute,Oe,Ee,se);const Nt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let ar=ot.length;const Vr=Tt(Ve.nodeName);for(;ar--;){const Rn=ot[ar],Ya=Rn.name,$o=Rn.namespaceURI,vh=Rn.value,yh=Tt(Ya),bIe=vh;let wd=Ya==="value"?bIe:Knn(bIe);if(Nt.attrName=yh,Nt.attrValue=wd,Nt.keepAttr=!0,Nt.forceKeepAttr=void 0,Qn(G.uponSanitizeAttribute,Ve,Nt),wd=Nt.attrValue,Le&&(yh==="id"||yh==="name")&&l2t(wd,We)!==0&&(Mn(Ya,Ve,Rn),wd=We+wd),le&&eu(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,wd)){Mn(Ya,Ve,Rn);continue}if(yh==="attributename"&&s2t(wd,"href")){Mn(Ya,Ve,Rn);continue}if(!Nt.forceKeepAttr){if(!Nt.keepAttr){Mn(Ya,Ve,Rn);continue}if(!Be&&eu(min,wd)){Mn(Ya,Ve,Rn);continue}if(Z&&(wd=ra(wd)),!RO(Vr,yh,wd)){Mn(Ya,Ve,Rn);continue}wd=mh(Vr,yh,$o,wd),wd!==bIe&&Fc(Ve,Ya,$o,wd)}}Qn(G.afterSanitizeAttributes,Ve,null)},Of=function(Ve){let ot=null;const Nt=Fe(Ve);for(Qn(G.beforeSanitizeShadowDOM,Ve,null);ot=Nt.nextNode();)if(Qn(G.uponSanitizeShadowNode,ot,null),_O(ot,Ve),Js(ot),di(ot.content)&&Of(ot.content),T(ot)===jh.element){const ar=b(ot);di(ar)&&(K2(ar),Of(ar))}Qn(G.afterSanitizeShadowDOM,Ve,null)},K2=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)===jh.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 vh=ar.content;di(vh)&&ot.push({node:vh,shadow:null})}}if(Rn){const $o=b(ar);di($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=rin(Ht),typeof Ht!="string"))throw BT("dirty is not a string, aborting");if(!e.isSupported)return Ht;ae?(ie=K,Oe=se):Zr(Ve),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ie=qh(ie)),G.uponSanitizeAttribute.length>0&&(Oe=qh(Oe)),e.removed=[];const Rn=je&&typeof Ht!="string"&&Bo(Ht);if(Rn){mt(Ht);const vh=C(Ht);if(typeof vh=="string"){const yh=Tt(vh);if(!ie[yh]||he[yh])throw Jr(Ht),BT("root node is forbidden and cannot be sanitized in-place")}if(In(Ht))throw Jr(Ht),BT("root node is clobbered and cannot be sanitized in-place");try{K2(Ht)}catch(yh){throw Jr(Ht),yh}}else if(Bo(Ht))ot=Tr(""),Nt=ot.ownerDocument.importNode(Ht,!0),Nt.nodeType===jh.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?ot=Nt:ot.appendChild(Nt),K2(Nt);else{if(!oe&&!Z&&!be&&Ht.indexOf("<")===-1)return O&&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 vh=Fe(Ya);for(;ar=vh.nextNode();)_O(ar,Ya),Js(ar),di(ar.content)&&Of(ar.content)}catch(vh){throw Rn&&(Jr(Ht),NT(e.removed,yh=>{yh.element&&kt(yh.element)})),vh}if(Rn)return NT(e.removed,vh=>{vh.element&&kt(vh.element)}),Z&&Ge(Ht),Ht;if(oe){if(Z&&Ge(ot),ve)for(Vr=V.call(ot.ownerDocument);ot.firstChild;)Vr.appendChild(ot.firstChild);else Vr=ot;return(Oe.shadowroot||Oe.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&&eu(fin,ot.ownerDocument.doctype.name)&&($o=" +`+$o),Z&&($o=ra($o)),O&&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=Oe},e.clearConfig=function(){hr=null,ae=!1,K=null,se=null,O=_,E=""},e.isValidAttribute=function(Ht,Ve,ot){hr||Zr({});const Nt=Tt(Ht),ar=Tt(Ve);return RO(Nt,ar,ot)},e.addHook=function(Ht,Ve){typeof Ve=="function"&&Qd(G,Ht)&&m7(G[Ht],Ve)},e.removeHook=function(Ht,Ve){if(Qd(G,Ht)){if(Ve!==void 0){const ot=jnn(G[Ht],Ve);return ot===-1?void 0:Xnn(G[Ht],ot,1)[0]}return o2t(G[Ht])}},e.removeHooks=function(Ht){Qd(G,Ht)&&(G[Ht]=[])},e.removeAllHooks=function(){G=b2t()},e}var Xy=x2t(),ibe=k((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>ibe(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]=ibe(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"),Fs=ibe,p0="#ffffff",g0="#f2f2f2",xn=k((t,e)=>e?Ae(t,{s:-40,l:10}):Ae(t,{s:-40,l:-10}),"mkBorder"),win=(qD=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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,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?ht(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||ht(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||dt(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||ht(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ht(this.mainBkg,10)):(this.rowOdd=this.rowOdd||dt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||dt(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]})}},k(qD,"Theme"),qD),Ain=k(t=>{const e=new win;return e.calculate(t),e},"getThemeVariables"),Sin=(jD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Tg(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=ht("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ht(this.sectionBkgColor,10),this.taskBorderColor=Tg(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Tg(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||dt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ht(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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.secondBkg=dt(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=dt(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=dt(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]})}},k(jD,"Theme"),jD),Tin=k(t=>{const e=new Sin;return e.calculate(t),e},"getThemeVariables"),Cin=(XD=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=Tg(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,o,s,l,u,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,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||ht(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ht(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]})}},k(XD,"Theme"),XD),Ky=k(t=>{const e=new Cin;return e.calculate(t),e},"getThemeVariables"),kin=(KD=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=dt("#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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.actorBorder=ht(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||ht(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ht(this.tertiaryColor,40);for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},k(KD,"Theme"),KD),Oin=k(t=>{const e=new kin;return e.calculate(t),e},"getThemeVariables"),Ein=(ZD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=dt(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||dt(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,d,h,f,p,g,m,v,y,b,x,w,A,S,T,C,O,E,_,P,L,R,D,M,I,N,F,B,V,z,U,G,H,j,q,ne,X,J,ee,te,pe;this.secondBkg=dt(this.contrast,55),this.border2=this.contrast,this.actorBorder=dt(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]})}},k(ZD,"Theme"),ZD),_in=k(t=>{const e=new Ein;return e.calculate(t),e},"getThemeVariables"),Rin=(JD=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,d,h,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?ht(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||ht(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||dt(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]})}},k(JD,"Theme"),JD),Din=k(t=>{const e=new Rin;return e.calculate(t),e},"getThemeVariables"),Lin=(eL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(eL,"Theme"),eL),Min=k(t=>{const e=new Lin;return e.calculate(t),e},"getThemeVariables"),Iin=(tL=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,d,h,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?ht(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||ht(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||dt(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]})}},k(tL,"Theme"),tL),Pin=k(t=>{const e=new Iin;return e.calculate(t),e},"getThemeVariables"),Nin=(rL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(rL,"Theme"),rL),Bin=k(t=>{const e=new Nin;return e.calculate(t),e},"getThemeVariables"),$in=(nL=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,d,h,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?ht(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||ht(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||dt(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]})}},k(nL,"Theme"),nL),Fin=k(t=>{const e=new $in;return e.calculate(t),e},"getThemeVariables"),zin=(iL=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=dt(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=dt(it("#323D47"),10),this.border1="#ccc",this.border2=Tg(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,d,h,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?ht(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||ht(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||dt(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]})}},k(iL,"Theme"),iL),Uin=k(t=>{const e=new zin;return e.calculate(t),e},"getThemeVariables"),Zy={base:{getThemeVariables:Ain},dark:{getThemeVariables:Tin},default:{getThemeVariables:Ky},forest:{getThemeVariables:Oin},neutral:{getThemeVariables:_in},neo:{getThemeVariables:Din},"neo-dark":{getThemeVariables:Min},redux:{getThemeVariables:Pin},"redux-dark":{getThemeVariables:Bin},"redux-color":{getThemeVariables:Fin},"redux-dark-color":{getThemeVariables:Uin}},bc={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},w2t={...bc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Zy.default.getThemeVariables(),sequence:{...bc.sequence,messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:k(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:k(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...bc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...bc.c4,useWidth:void 0,personFont:k(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...bc.flowchart,inheritDir:!1},external_personFont:k(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:k(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:k(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:k(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:k(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:k(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:k(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:k(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:k(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:k(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:k(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:k(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:k(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:k(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:k(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:k(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:k(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:k(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:k(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:k(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...bc.pie,useWidth:984},xyChart:{...bc.xyChart,useWidth:void 0},requirement:{...bc.requirement,useWidth:void 0},packet:{...bc.packet},eventmodeling:{...bc.eventmodeling},treeView:{...bc.treeView,useWidth:void 0},radar:{...bc.radar},railroad:{...bc.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:{...bc.ishikawa},sankey:{...bc.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:{...bc.venn},cynefin:{...bc.cynefin}},A2t=k((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...A2t(t[n],"")]:[...r,e+n],[]),"keyify"),Vin=new Set(A2t(w2t,"")),Jn=w2t,Gin={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qin=k((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"),Nj=k(t=>{if(ye.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Nj(e));return}for(const e of Object.keys(t)){if(ye.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Vin.has(e)||t[e]==null){ye.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Gin[e];n?Qin(t[e],n):(ye.debug("sanitizing object",e),Nj(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ye.debug("sanitizing css option",e),t[e]=S2t(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"),S2t=k(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Hd=Fs({},c5),Bj,$T=[],x7=Fs({},c5),w7=k((t,e)=>{let r=Fs({},t),n={};for(const i of e)k2t(i),n=Fs(n,i);if(r=Fs(r,n),n.theme&&n.theme in Zy){const i=Fs({},Bj),a=Fs(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Zy&&(r.themeVariables=Zy[r.theme].getThemeVariables(a))}return x7=r,Xin(x7),x7},"updateCurrentConfig"),Hin=k(t=>(Hd=Fs({},c5),Hd=Fs(Hd,t),t.theme&&Zy[t.theme]&&(Hd.themeVariables=Zy[t.theme].getThemeVariables(t.themeVariables)),w7(Hd,$T),Hd),"setSiteConfig"),Win=k(t=>{Bj=Fs({},t)},"saveConfigFromInitialize"),Yin=k(t=>(Hd=Fs(Hd,t),w7(Hd,$T),Hd),"updateSiteConfig"),T2t=k(()=>Fs({},Hd),"getSiteConfig"),C2t=k(t=>(w7(x7,[t]),Dr()),"setConfig"),Dr=k(()=>Fs({},x7),"getConfig"),k2t=k(t=>{t&&(["secure",...Hd.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"&&k2t(t[e])}))},"sanitize"),qin=k(t=>{var e;Nj(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),$T.push(t),w7(Hd,$T)},"addDirective"),$j=k((t=Hd)=>{$T=[],w7(t,$T)},"reset"),jin={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={},E2t=k(t=>{O2t[t]||(ye.warn(jin[t]),O2t[t]=!0)},"issueWarning"),Xin=k(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&E2t("LAZY_LOAD_DEPRECATED")},"checkConfig"),_2t=k(()=>{let t={};Bj&&(t=Fs(t,Bj));for(const e of $T)t=Fs(t,e);return t},"getUserDefinedConfig"),ia=k(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&E2t("FLOWCHART_HTML_LABELS_DEPRECATED"),m0(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),R2t=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,A7=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Kin=/\s*%%.*\n/gm,D2t=(aL=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},k(aL,"UnknownDiagramError"),aL),FT={},abe=k(function(t,e){t=t.replace(R2t,"").replace(A7,"").replace(Kin,` +`);for(const[r,{detector:n}]of Object.entries(FT))if(n(t,e))return r;throw new D2t(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),obe=k((...t)=>{for(const{id:e,detector:r,loader:n}of t)L2t(e,r,n)},"registerLazyLoadedDiagrams"),L2t=k((t,e,r)=>{FT[t]&&ye.warn(`Detector with key ${t} already exists. Overwriting.`),FT[t]={detector:e,loader:r},ye.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Zin=k(t=>FT[t].loader,"getDiagramLoader"),u5=//gi,Jin=k(t=>t?N2t(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),ean=(()=>{let t=!1;return()=>{t||(M2t(),t=!0)}})();function M2t(){const t="data-temp-href-target";Xy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Xy.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"))})}k(M2t,"setupDompurifyHooks");var I2t=k(t=>(ean(),Xy.sanitize(t)),"removeScript"),P2t=k((t,e)=>{if(ia(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=I2t(t):r!=="loose"&&(t=N2t(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=ian(t))}return t},"sanitizeMore"),li=k((t,e)=>t&&(e.dompurifyConfig?t=Xy.sanitize(P2t(t,e),e.dompurifyConfig).toString():t=Xy.sanitize(P2t(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),tan=k((t,e)=>typeof t=="string"?li(t,e):t.flat().map(r=>li(r,e)),"sanitizeTextOrArray"),ran=k(t=>u5.test(t),"hasBreaks"),nan=k(t=>t.split(u5),"splitBreaks"),ian=k(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),N2t=k(t=>t.replace(u5,"#br#"),"breakToPlaceholder"),Fj=k(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),aan=k(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),oan=k(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),bw=k(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),san=k((t,e)=>{const r=sbe(t,"~"),n=sbe(e,"~");return r===1&&n===1},"shouldCombineSets"),lan=k(t=>{const e=sbe(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"),B2t=k(()=>window.MathMLElement!==void 0,"isMathMLSupported"),lbe=/\$\$(.*?)\$\$/g,ps=k(t=>{var e;return(((e=t.match(lbe))==null?void 0:e.length)??0)>0},"hasKatex"),S7=k(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await zj(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"),can=k(async(t,e)=>{if(!ps(t))return t;if(!(B2t()||e.legacyMathML||e.forceLegacyMathML))return t.replace(lbe,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>p4n),n=e.forceLegacyMathML||!B2t()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(u5).map(i=>ps(i)?`
${i}
`:`
${i}
`).join("").replace(lbe,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),zj=k(async(t,e)=>li(await can(t,e),e),"renderKatexSanitized"),Xt={getRows:Jin,sanitizeText:li,sanitizeTextOrArray:tan,hasBreaks:ran,splitBreaks:nan,lineBreakRegex:u5,removeScript:I2t,getUrl:Fj,evaluate:m0,getMax:aan,getMin:oan},uan=k(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),dan=k(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=k(function(t,e,r,n){const i=dan(e,r,n);uan(t,i)},"configureSvgSize"),d5=k(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"),Uj={};function cbe(t){return[...t.cssRules].map(e=>e.cssText).join(` `)}k(cbe,"cssStyleSheetToString");var han=k((t,e,r,n)=>{let i="";return t in Uj&&Uj[t]?i=Uj[t]({...r,svgId:n}):ye.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; @@ -525,9 +525,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e} `},"getStyles"),fan=k((t,e)=>{e!==void 0&&(Uj[t]=e)},"addStylesForDiagram"),pan=han,ube={};Lj(ube,{clear:()=>_a,getAccDescription:()=>lo,getAccTitle:()=>oo,getDiagramTitle:()=>$a,setAccDescription:()=>so,setAccTitle:()=>Ba,setDiagramTitle:()=>co});var dbe="",hbe="",fbe="",pbe=k(t=>li(t,Dr()),"sanitizeText"),_a=k(()=>{dbe="",fbe="",hbe=""},"clear"),Ba=k(t=>{dbe=pbe(t).replace(/^\s+/g,"")},"setAccTitle"),oo=k(()=>dbe,"getAccTitle"),so=k(t=>{fbe=pbe(t).replace(/\n\s+/g,` -`)},"setAccDescription"),lo=k(()=>fbe,"getAccDescription"),co=k(t=>{hbe=pbe(t)},"setDiagramTitle"),$a=k(()=>hbe,"getDiagramTitle"),$2t=ye,gan=Y1e,Ye=Dr,gbe=C2t,F2t=cR,mbe=k(t=>li(t,Ye()),"sanitizeText"),vbe=dR,man=k(()=>ube,"getCommonDb"),Vj={},Gj=k((t,e,r)=>{var n;Vj[t]&&$2t.warn(`Diagram with id ${t} already registered. Overwriting.`),Vj[t]=e,r&&L2t(t,r),fan(t,e.styles),(n=e.injectUtils)==null||n.call(e,$2t,gan,Ye,mbe,vbe,man(),()=>{})},"registerDiagram"),ybe=k(t=>{if(t in Vj)return Vj[t];throw new van(t)},"getDiagram"),van=(oL=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},k(oL,"DiagramNotFoundError"),oL);function Qj(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function yan(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function bbe(t){let e,r,n;t.length!==2?(e=Qj,r=(s,l)=>Qj(t(s),l),n=(s,l)=>t(s)-l):(e=t===Qj||t===yan?t:ban,r=t,n=t);function i(s,l,u=0,d=s.length){if(u>>1;r(s[h],l)<0?u=h+1:d=h}while(u>>1;r(s[h],l)<=0?u=h+1:d=h}while(uu&&n(s[h-1],l)>-n(s[h],l)?h-1:h}return{left:i,center:o,right:a}}function ban(){return 0}function xan(t){return t===null?NaN:+t}const wan=bbe(Qj).right;bbe(xan).center;class z2t extends Map{constructor(e,r=Tan){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(U2t(this,e))}has(e){return super.has(U2t(this,e))}set(e,r){return super.set(Aan(this,e),r)}delete(e){return super.delete(San(this,e))}}function U2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Aan({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function San({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Tan(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Can=Math.sqrt(50),kan=Math.sqrt(10),Oan=Math.sqrt(2);function Hj(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>=Can?10:a>=kan?5:a>=Oan?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 Ran(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 Dan(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 Nan(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Ban(){return!this.__axis}function G2t(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===Wj||t===Yj?-1:1,d=t===Yj||t===Abe?"x":"y",h=t===Wj||t===Sbe?Man:Ian;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Lan),v=Math.max(a,0)+s,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?Nan:Pan)(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(),O=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(O),E=E.merge(O.append("line").attr("stroke","currentColor").attr(d+"2",u*a)),_=_.merge(O.append("text").attr("fill","currentColor").attr(d,u*v).attr("dy",t===Wj?"0em":t===Sbe?"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",V2t).attr("transform",function(P){return isFinite(P=w(P))?h(P+l):this.getAttribute("transform")}),O.attr("opacity",V2t).attr("transform",function(P){var L=this.parentNode.__axis;return h((L&&isFinite(L=L(P))?L:w(P))+l)})),C.remove(),S.attr("d",t===Yj||t===Abe?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 h(w(P)+l)}),E.attr(d+"2",u*a),_.attr(d,u*v).text(m),A.filter(Ban).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Abe?"start":t===Yj?"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 $an(t){return G2t(Wj,t)}function Fan(t){return G2t(Sbe,t)}var zan={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}})}qj.prototype=Q2t.prototype={constructor:qj,on:function(t,e){var r=this._,n=Uan(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)),W2t.hasOwnProperty(e)?{space:W2t[e],local:t}:t}function Gan(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Tbe&&e.documentElement.namespaceURI===Tbe?e.createElement(t):e.createElementNS(r,t)}}function Qan(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Y2t(t){var e=jj(t);return(e.local?Qan:Gan)(e)}function Han(){}function Cbe(t){return t==null?Han:function(){return this.querySelector(t)}}function Wan(t){typeof t!="function"&&(t=Cbe(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 von(t){t||(t=yon);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function bon(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function xon(){return Array.from(this)}function won(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Lon:typeof e=="function"?Ion:Mon)(t,e,r??"")):hR(this.node(),t)}function hR(t,e){return t.style.getPropertyValue(e)||Z2t(t).getComputedStyle(t,null).getPropertyValue(e)}function Non(t){return function(){delete this[t]}}function Bon(t,e){return function(){this[t]=e}}function $on(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Fon(t,e){return arguments.length>1?this.each((e==null?Non:typeof e=="function"?$on:Bon)(t,e)):this.node()[t]}function J2t(t){return t.trim().split(/^|\s+/)}function kbe(t){return t.classList||new eAt(t)}function eAt(t){this._node=t,this._names=J2t(t.getAttribute("class")||"")}eAt.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 tAt(t,e){for(var r=kbe(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function fsn(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?Jj(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Jj(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=Asn.exec(t))?new tu(e[1],e[2],e[3],1):(e=Ssn.exec(t))?new tu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Tsn.exec(t))?Jj(e[1],e[2],e[3],e[4]):(e=Csn.exec(t))?Jj(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ksn.exec(t))?hAt(e[1],e[2]/100,e[3]/100,1):(e=Osn.exec(t))?hAt(e[1],e[2]/100,e[3]/100,e[4]):aAt.hasOwnProperty(t)?lAt(aAt[t]):t==="transparent"?new tu(NaN,NaN,NaN,0):null}function lAt(t){return new tu(t>>16&255,t>>8&255,t&255,1)}function Jj(t,e,r,n){return n<=0&&(t=e=r=NaN),new tu(t,e,r,n)}function cAt(t){return t instanceof zT||(t=UT(t)),t?(t=t.rgb(),new tu(t.r,t.g,t.b,t.opacity)):new tu}function Obe(t,e,r,n){return arguments.length===1?cAt(t):new tu(t,e,r,n??1)}function tu(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}C7(tu,Obe,Kj(zT,{brighter(t){return t=t==null?Zj:Math.pow(Zj,t),new tu(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?k7:Math.pow(k7,t),new tu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tu(VT(this.r),VT(this.g),VT(this.b),eX(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:uAt,formatHex:uAt,formatHex8:Rsn,formatRgb:dAt,toString:dAt}));function uAt(){return`#${GT(this.r)}${GT(this.g)}${GT(this.b)}`}function Rsn(){return`#${GT(this.r)}${GT(this.g)}${GT(this.b)}${GT((isNaN(this.opacity)?1:this.opacity)*255)}`}function dAt(){const t=eX(this.opacity);return`${t===1?"rgb(":"rgba("}${VT(this.r)}, ${VT(this.g)}, ${VT(this.b)}${t===1?")":`, ${t})`}`}function eX(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function VT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function GT(t){return t=VT(t),(t<16?"0":"")+t.toString(16)}function hAt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new kg(t,e,r,n)}function fAt(t){if(t instanceof kg)return new kg(t.h,t.s,t.l,t.opacity);if(t instanceof zT||(t=UT(t)),!t)return new kg;if(t instanceof kg)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 kg(o,s,l,t.opacity)}function Dsn(t,e,r,n){return arguments.length===1?fAt(t):new kg(t,e,r,n??1)}function kg(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}C7(kg,Dsn,Kj(zT,{brighter(t){return t=t==null?Zj:Math.pow(Zj,t),new kg(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?k7:Math.pow(k7,t),new kg(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 tu(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 kg(pAt(this.h),tX(this.s),tX(this.l),eX(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=eX(this.opacity);return`${t===1?"hsl(":"hsla("}${pAt(this.h)}, ${tX(this.s)*100}%, ${tX(this.l)*100}%${t===1?")":`, ${t})`}`}}));function pAt(t){return t=(t||0)%360,t<0?t+360:t}function tX(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 Lsn=Math.PI/180,Msn=180/Math.PI,rX=18,gAt=.96422,mAt=1,vAt=.82521,yAt=4/29,pR=6/29,bAt=3*pR*pR,Isn=pR*pR*pR;function xAt(t){if(t instanceof y0)return new y0(t.l,t.a,t.b,t.opacity);if(t instanceof Jy)return wAt(t);t instanceof tu||(t=cAt(t));var e=Lbe(t.r),r=Lbe(t.g),n=Lbe(t.b),i=_be((.2225045*e+.7168786*r+.0606169*n)/mAt),a,o;return e===r&&r===n?a=o=i:(a=_be((.4360747*e+.3850649*r+.1430804*n)/gAt),o=_be((.0139322*e+.0971045*r+.7141733*n)/vAt)),new y0(116*i-16,500*(a-i),200*(i-o),t.opacity)}function Psn(t,e,r,n){return arguments.length===1?xAt(t):new y0(t,e,r,n??1)}function y0(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}C7(y0,Psn,Kj(zT,{brighter(t){return new y0(this.l+rX*(t??1),this.a,this.b,this.opacity)},darker(t){return new y0(this.l-rX*(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=gAt*Rbe(e),t=mAt*Rbe(t),r=vAt*Rbe(r),new tu(Dbe(3.1338561*e-1.6168667*t-.4906146*r),Dbe(-.9787684*e+1.9161415*t+.033454*r),Dbe(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function _be(t){return t>Isn?Math.pow(t,1/3):t/bAt+yAt}function Rbe(t){return t>pR?t*t*t:bAt*(t-yAt)}function Dbe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lbe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nsn(t){if(t instanceof Jy)return new Jy(t.h,t.c,t.l,t.opacity);if(t instanceof y0||(t=xAt(t)),t.a===0&&t.b===0)return new Jy(NaN,0()=>t;function AAt(t,e){return function(r){return t+r*e}}function Bsn(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 $sn(t,e){var r=e-t;return r?AAt(t,r>180||r<-180?r-360*Math.round(r/360):r):nX(isNaN(t)?e:t)}function Fsn(t){return(t=+t)==1?E7:function(e,r){return r-e?Bsn(e,r,t):nX(isNaN(e)?r:e)}}function E7(t,e){var r=e-t;return r?AAt(t,r):nX(isNaN(t)?e:t)}const iX=function t(e){var r=Fsn(e);function n(i,a){var o=r((i=Obe(i)).r,(a=Obe(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=E7(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=s(d),i.b=l(d),i.opacity=u(d),i+""}}return n.gamma=t,n}(1);function zsn(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:Og(n,i)})),r=Pbe.lastIndex;return r180?d+=360:d-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Og(u,d)})):d&&h.push(i(h)+"rotate("+d+n)}function s(u,d,h,f){u!==d?f.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Og(u,d)}):d&&h.push(i(h)+"skewX("+d+n)}function l(u,d,h,f,p,g){if(u!==h||d!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Og(u,h)},{i:m-2,x:Og(d,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,d){var h=[],f=[];return u=t(u),d=t(d),a(u.translateX,u.translateY,d.translateX,d.translateY,h,f),o(u.rotate,d.rotate,h,f),s(u.skewX,d.skewX,h,f),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,h,f),u=d=null,function(p){for(var g=-1,m=f.length,v;++g=0&&t._call.call(void 0,e),t=t._next;--gR}function RAt(){QT=(sX=L7.now())+lX,gR=_7=0;try{tln()}finally{gR=0,nln(),QT=0}}function rln(){var t=L7.now(),e=t-sX;e>OAt&&(lX-=e,sX=t)}function nln(){for(var t,e=oX,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:oX=r);D7=t,Fbe(n)}function Fbe(t){if(!gR){_7&&(_7=clearTimeout(_7));var e=t-QT;e>24?(t<1/0&&(_7=setTimeout(RAt,t-L7.now()-lX)),R7&&(R7=clearInterval(R7))):(R7||(sX=L7.now(),R7=setInterval(rln,OAt)),gR=1,EAt(RAt))}}function DAt(t,e,r){var n=new cX;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var iln=Q2t("start","end","cancel","interrupt"),aln=[],LAt=0,MAt=1,zbe=2,uX=3,IAt=4,Ube=5,dX=6;function hX(t,e,r,n,i,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;oln(t,r,{name:e,index:n,group:i,on:iln,tween:aln,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:LAt})}function Vbe(t,e){var r=Eg(t,e);if(r.state>LAt)throw new Error("too late; already scheduled");return r}function b0(t,e){var r=Eg(t,e);if(r.state>uX)throw new Error("too late; already running");return r}function Eg(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function oln(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=_At(a,0,r.time);function a(u){r.state=MAt,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var d,h,f,p;if(r.state!==MAt)return l();for(d in n)if(p=n[d],p.name===r.name){if(p.state===uX)return DAt(o);p.state===IAt?(p.state=dX,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[d]):+dzbe&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Bln(t,e,r){var n,i,a=Nln(e)?Vbe:b0;return function(){var o=a(this,t),s=o.on;s!==n&&(i=(n=s).copy()).on(e,r),o.on=i}}function $ln(t,e){var r=this._id;return arguments.length<2?Eg(this.node(),r).on.on(t):this.each(Bln(r,t,e))}function Fln(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function zln(){return this.on("end.remove",Fln(this._id))}function Uln(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Cbe(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 $At;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iHT)if(!(Math.abs(h*l-u*d)>HT)||!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((Qbe-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>HT&&this._append`L${e+w*d},${r+w*h}`,this._append`A${a},${a},0,0,${+(h*p>d*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,d=r+l,h=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>HT||Math.abs(this._y1-d)>HT)&&this._append`L${u},${d}`,n&&(f<0&&(f=f%Hbe+Hbe),f>hcn?this._append`A${n},${n},0,1,${h},${e-s},${r-l}A${n},${n},0,1,${h},${this._x1=u},${this._y1=d}`:f>HT&&this._append`A${n},${n},0,${+(f>=Qbe)},${h},${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 gcn(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fX(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 mR(t){return t=fX(Math.abs(t)),t?t[1]:NaN}function mcn(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 vcn(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var ycn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pX(t){if(!(e=ycn.exec(t)))throw new Error("invalid format: "+t);var e;return new Wbe({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]})}pX.prototype=Wbe.prototype;function Wbe(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+""}Wbe.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 bcn(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 gX;function xcn(t,e){var r=fX(t,e);if(!r)return gX=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(gX=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")+fX(t,Math.max(0,e+a-1))[0]}function FAt(t,e){var r=fX(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 zAt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:gcn,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)=>FAt(t*100,e),r:FAt,s:xcn,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function UAt(t){return t}var VAt=Array.prototype.map,GAt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wcn(t){var e=t.grouping===void 0||t.thousands===void 0?UAt:mcn(VAt.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?UAt:vcn(VAt.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(h,f){h=pX(h);var p=h.fill,g=h.align,m=h.sign,v=h.symbol,y=h.zero,b=h.width,x=h.comma,w=h.precision,A=h.trim,S=h.type;S==="n"?(x=!0,S="g"):zAt[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:""),O=zAt[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=O(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:O(Math.abs(P),w),A&&(P=bcn(P)),N&&+P==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:s:m==="-"||m==="("?"":m)+L,R=(S==="s"&&!isNaN(P)&&gX!==void 0?GAt[8+gX/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 h+""},_}function d(h,f){var p=Math.max(-8,Math.min(8,Math.floor(mR(f)/3)))*3,g=Math.pow(10,-p),m=u((h=pX(h),h.type="f",h),{suffix:GAt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var mX,WT,QAt;Acn({thousands:",",grouping:[3],currency:["$",""]});function Acn(t){return mX=wcn(t),WT=mX.format,QAt=mX.formatPrefix,mX}function Scn(t){return Math.max(0,-mR(Math.abs(t)))}function Tcn(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(mR(e)/3)))*3-mR(Math.abs(t)))}function Ccn(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,mR(e)-mR(t))+1}function kcn(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 Ocn(){return this.eachAfter(kcn)}function Ecn(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function _cn(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 Rcn(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 Mcn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Icn(t){for(var e=this,r=Pcn(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 Pcn(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 Ncn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Bcn(){return Array.from(this)}function $cn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Fcn(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*zcn(){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 vX(o[s])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Hcn)}function Ucn(){return Ybe(this).eachBefore(Qcn)}function Vcn(t){return t.children}function Gcn(t){return Array.isArray(t)?t[1]:null}function Qcn(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Hcn(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function vX(t){this.data=t,this.depth=this.height=0,this.parent=null}vX.prototype=Ybe.prototype={constructor:vX,count:Ocn,each:Ecn,eachAfter:Rcn,eachBefore:_cn,find:Dcn,sum:Lcn,sort:Mcn,path:Icn,ancestors:Ncn,descendants:Bcn,leaves:$cn,links:Fcn,copy:Ucn,[Symbol.iterator]:zcn};function Wcn(t){if(typeof t!="function")throw new Error;return t}function M7(){return 0}function I7(t){return function(){return t}}function Ycn(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 qcn(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}(Xcn);function Jcn(){var t=Zcn,e=!1,r=1,n=1,i=[0],a=M7,o=M7,s=M7,l=M7,u=M7;function d(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(h),i=[0],e&&f.eachBefore(Ycn),f}function h(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 nun(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i2?iun:nun,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(l||(l=s(t.map(n),e,r)))(n(o(f)))}return h.invert=function(f){return o(i((u||(u=s(e,t.map(n),Og)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,tun),d()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),d()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),r=Ysn,d()},h.clamp=function(f){return arguments.length?(o=f?!0:vR,d()):o!==vR},h.interpolate=function(f){return arguments.length?(r=f,d()):r},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,p){return n=f,i=p,d()}}function qAt(){return aun()(vR,vR)}function oun(t,e,r,n){var i=wbe(t,e,r),a;switch(n=pX(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=Tcn(i,o))&&(n.precision=a),QAt(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Ccn(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Scn(i))&&(n.precision=a-(n.type==="%")*2);break}}return WT(n)}function sun(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ean(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return oun(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,d=10;for(s0;){if(u=xbe(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 yR(){var t=qAt();return t.copy=function(){return YAt(t,yR())},yX.apply(t,arguments),sun(t)}function lun(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(ucl(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)=>(Xbe.setTime(+a),Kbe.setTime(+o),t(Xbe),t(Kbe),Math.floor(r(Xbe,Kbe))),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 bR=cl(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);bR.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?cl(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):bR),bR.range;const r1=1e3,vp=r1*60,n1=vp*60,i1=n1*24,Zbe=i1*7,jAt=i1*30,Jbe=i1*365,xw=cl(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*r1)},(t,e)=>(e-t)/r1,t=>t.getUTCSeconds());xw.range;const P7=cl(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r1)},(t,e)=>{t.setTime(+t+e*vp)},(t,e)=>(e-t)/vp,t=>t.getMinutes());P7.range,cl(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*vp)},(t,e)=>(e-t)/vp,t=>t.getUTCMinutes()).range;const N7=cl(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r1-t.getMinutes()*vp)},(t,e)=>{t.setTime(+t+e*n1)},(t,e)=>(e-t)/n1,t=>t.getHours());N7.range,cl(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*n1)},(t,e)=>(e-t)/n1,t=>t.getUTCHours()).range;const qT=cl(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*vp)/i1,t=>t.getDate()-1);qT.range;const exe=cl(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/i1,t=>t.getUTCDate()-1);exe.range,cl(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/i1,t=>Math.floor(t/i1)).range;function jT(t){return cl(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())*vp)/Zbe)}const B7=jT(0),$7=jT(1),XAt=jT(2),KAt=jT(3),XT=jT(4),ZAt=jT(5),JAt=jT(6);B7.range,$7.range,XAt.range,KAt.range,XT.range,ZAt.range,JAt.range;function KT(t){return cl(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)/Zbe)}const eSt=KT(0),bX=KT(1),cun=KT(2),uun=KT(3),xR=KT(4),dun=KT(5),hun=KT(6);eSt.range,bX.range,cun.range,uun.range,xR.range,dun.range,hun.range;const F7=cl(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());F7.range,cl(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 a1=cl(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());a1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cl(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)}),a1.range;const ZT=cl(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());ZT.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cl(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)}),ZT.range;function fun(t,e,r,n,i,a){const o=[[xw,1,r1],[xw,5,5*r1],[xw,15,15*r1],[xw,30,30*r1],[a,1,vp],[a,5,5*vp],[a,15,15*vp],[a,30,30*vp],[i,1,n1],[i,3,3*n1],[i,6,6*n1],[i,12,12*n1],[n,1,i1],[n,2,2*i1],[r,1,Zbe],[e,1,jAt],[e,3,3*jAt],[t,1,Jbe]];function s(u,d,h){const f=dv).right(o,f);if(p===o.length)return t.every(wbe(u/Jbe,d/Jbe,h));if(p===0)return bR.every(Math.max(wbe(u,d,h),1));const[g,m]=o[f/o[p-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(ie=rxe(z7(te.y,0,1)),Ce=ie.getUTCDay(),ie=Ce>4||Ce===0?bX.ceil(ie):bX(ie),ie=exe.offset(ie,(te.V-1)*7),te.y=ie.getUTCFullYear(),te.m=ie.getUTCMonth(),te.d=ie.getUTCDate()+(te.w+6)%7):(ie=txe(z7(te.y,0,1)),Ce=ie.getDay(),ie=Ce>4||Ce===0?$7.ceil(ie):$7(ie),ie=qT.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?rxe(z7(te.y,0,1)).getUTCDay():txe(z7(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,rxe(te)):txe(te)}}function C(X,J,ee,te){for(var pe=0,ie=J.length,Ce=ee.length,Oe,Ee;pe=Ce)return-1;if(Oe=J.charCodeAt(pe++),Oe===37){if(Oe=J.charAt(pe++),Ee=A[Oe in tSt?J.charAt(pe++):Oe],!Ee||(te=Ee(X,ee,te))<0)return-1}else if(Oe!=ee.charCodeAt(te++))return-1}return te}function O(X,J,ee){var te=u.exec(J.slice(ee));return te?(X.p=d.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=h.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 G(X){return a[X.getUTCDay()]}function H(X){return l[X.getUTCMonth()]}function j(X){return s[X.getUTCMonth()]}function q(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 tSt={"-":"",_:" ",0:"0"},$l=/^\s*\d+/,vun=/^%/,yun=/[\\^$*+?|[\]().{}]/g;function Vi(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function xun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function wun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Aun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Sun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Tun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function rSt(t,e,r){var n=$l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function nSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Cun(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 kun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Oun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function iSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Eun(t,e,r){var n=$l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function aSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function _un(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Run(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Dun(t,e,r){var n=$l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Lun(t,e,r){var n=$l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Mun(t,e,r){var n=vun.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Iun(t,e,r){var n=$l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Pun(t,e,r){var n=$l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function oSt(t,e){return Vi(t.getDate(),e,2)}function Nun(t,e){return Vi(t.getHours(),e,2)}function Bun(t,e){return Vi(t.getHours()%12||12,e,2)}function $un(t,e){return Vi(1+qT.count(a1(t),t),e,3)}function sSt(t,e){return Vi(t.getMilliseconds(),e,3)}function Fun(t,e){return sSt(t,e)+"000"}function zun(t,e){return Vi(t.getMonth()+1,e,2)}function Uun(t,e){return Vi(t.getMinutes(),e,2)}function Vun(t,e){return Vi(t.getSeconds(),e,2)}function Gun(t){var e=t.getDay();return e===0?7:e}function Qun(t,e){return Vi(B7.count(a1(t)-1,t),e,2)}function lSt(t){var e=t.getDay();return e>=4||e===0?XT(t):XT.ceil(t)}function Hun(t,e){return t=lSt(t),Vi(XT.count(a1(t),t)+(a1(t).getDay()===4),e,2)}function Wun(t){return t.getDay()}function Yun(t,e){return Vi($7.count(a1(t)-1,t),e,2)}function qun(t,e){return Vi(t.getFullYear()%100,e,2)}function jun(t,e){return t=lSt(t),Vi(t.getFullYear()%100,e,2)}function Xun(t,e){return Vi(t.getFullYear()%1e4,e,4)}function Kun(t,e){var r=t.getDay();return t=r>=4||r===0?XT(t):XT.ceil(t),Vi(t.getFullYear()%1e4,e,4)}function Zun(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Vi(e/60|0,"0",2)+Vi(e%60,"0",2)}function cSt(t,e){return Vi(t.getUTCDate(),e,2)}function Jun(t,e){return Vi(t.getUTCHours(),e,2)}function edn(t,e){return Vi(t.getUTCHours()%12||12,e,2)}function tdn(t,e){return Vi(1+exe.count(ZT(t),t),e,3)}function uSt(t,e){return Vi(t.getUTCMilliseconds(),e,3)}function rdn(t,e){return uSt(t,e)+"000"}function ndn(t,e){return Vi(t.getUTCMonth()+1,e,2)}function idn(t,e){return Vi(t.getUTCMinutes(),e,2)}function adn(t,e){return Vi(t.getUTCSeconds(),e,2)}function odn(t){var e=t.getUTCDay();return e===0?7:e}function sdn(t,e){return Vi(eSt.count(ZT(t)-1,t),e,2)}function dSt(t){var e=t.getUTCDay();return e>=4||e===0?xR(t):xR.ceil(t)}function ldn(t,e){return t=dSt(t),Vi(xR.count(ZT(t),t)+(ZT(t).getUTCDay()===4),e,2)}function cdn(t){return t.getUTCDay()}function udn(t,e){return Vi(bX.count(ZT(t)-1,t),e,2)}function ddn(t,e){return Vi(t.getUTCFullYear()%100,e,2)}function hdn(t,e){return t=dSt(t),Vi(t.getUTCFullYear()%100,e,2)}function fdn(t,e){return Vi(t.getUTCFullYear()%1e4,e,4)}function pdn(t,e){var r=t.getUTCDay();return t=r>=4||r===0?xR(t):xR.ceil(t),Vi(t.getUTCFullYear()%1e4,e,4)}function gdn(){return"+0000"}function hSt(){return"%"}function fSt(t){return+t}function pSt(t){return Math.floor(+t/1e3)}var wR,xX;mdn({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 mdn(t){return wR=mun(t),xX=wR.format,wR.parse,wR.utcFormat,wR.utcParse,wR}function vdn(t){return new Date(t)}function ydn(t){return t instanceof Date?+t:+new Date(+t)}function gSt(t,e,r,n,i,a,o,s,l,u){var d=qAt(),h=d.invert,f=d.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?G7:Math.acos(t)}function vSt(t){return t>=1?wX:t<=-1?-wX:Math.asin(t)}function ySt(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 pcn(e)}function Tdn(t){return t.innerRadius}function Cdn(t){return t.outerRadius}function kdn(t){return t.startAngle}function Odn(t){return t.endAngle}function Edn(t){return t&&t.padAngle}function _dn(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,d=o-i,h=s-a,f=h*l-d*u;if(!(f*fR*R+D*D&&(C=E,O=_),{cx:C,cy:O,x01:-d,y01:-h,x11:C*(i/A-1),y11:O*(i/A-1)}}function SR(){var t=Tdn,e=Cdn,r=gs(0),n=null,i=kdn,a=Odn,o=Edn,s=null,l=ySt(u);function u(){var d,h,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-wX,m=a.apply(this,arguments)-wX,v=mSt(m-g),y=m>g;if(s||(s=d=l()),pnu))s.moveTo(0,0);else if(v>AX-nu)s.moveTo(p*JT(g),p*x0(g)),s.arc(0,0,p,g,m,!y),f>nu&&(s.moveTo(f*JT(m),f*x0(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,O=C>nu&&(n?+n.apply(this,arguments):AR(f*f+p*p)),E=nxe(mSt(p-f)/2,+r.apply(this,arguments)),_=E,P=E,L,R;if(O>nu){var D=vSt(O/f*x0(C)),M=vSt(O/p*x0(C));(S-=D*2)>nu?(D*=y?1:-1,w+=D,A-=D):(S=0,w=A=(g+m)/2),(T-=M*2)>nu?(M*=y?1:-1,b+=M,x-=M):(T=0,b=x=(g+m)/2)}var I=p*JT(b),N=p*x0(b),F=f*JT(A),B=f*x0(A);if(E>nu){var V=p*JT(x),z=p*x0(x),U=f*JT(w),G=f*x0(w),H;if(vnu?P>nu?(L=SX(U,G,I,N,p,P,y),R=SX(V,z,F,B,p,P,y),s.moveTo(L.cx+L.x01,L.cy+L.y01),Pnu)||!(S>nu)?s.lineTo(F,B):_>nu?(L=SX(F,B,V,z,f,-_,y),R=SX(I,N,U,G,f,-_,y),s.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function Mdn(t){return t}function Idn(){var t=Mdn,e=Ldn,r=null,n=gs(0),i=gs(AX),a=gs(0);function o(s){var l,u=(s=bSt(s)).length,d,h,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(AX,Math.max(-AX,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,h=f?(v-u*x)/f:0;l0?w*h:0)+x,g[d]={data:s[d],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 wSt{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 ASt(t){return new wSt(t,!0)}function SSt(t){return new wSt(t,!1)}function ww(){}function TX(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 CX(t){this._context=t}CX.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:TX(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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function W7(t){return new CX(t)}function TSt(t){this._context=t}TSt.prototype={areaStart:ww,areaEnd:ww,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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pdn(t){return new TSt(t)}function CSt(t){this._context=t}CSt.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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ndn(t){return new CSt(t)}function kSt(t,e){this._basis=new CX(t),this._beta=e}kSt.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 Bdn=function t(e){function r(n){return e===1?new CX(n):new kSt(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function kX(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 ixe(t,e){this._context=t,this._k=(1-e)/6}ixe.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:kX(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:kX(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 OSt=function t(e){function r(n){return new ixe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function axe(t,e){this._context=t,this._k=(1-e)/6}axe.prototype={areaStart:ww,areaEnd:ww,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:kX(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 $dn=function t(e){function r(n){return new axe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function oxe(t,e){this._context=t,this._k=(1-e)/6}oxe.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:kX(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 Fdn=function t(e){function r(n){return new oxe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function sxe(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>nu){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>nu){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,d=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/d,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/d}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function ESt(t,e){this._context=t,this._alpha=e}ESt.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:sxe(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 _St=function t(e){function r(n){return e?new ESt(n,e):new ixe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function RSt(t,e){this._context=t,this._alpha=e}RSt.prototype={areaStart:ww,areaEnd:ww,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:sxe(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 zdn=function t(e){function r(n){return e?new RSt(n,e):new axe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function DSt(t,e){this._context=t,this._alpha=e}DSt.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:sxe(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 Udn=function t(e){function r(n){return e?new DSt(n,e):new oxe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function LSt(t){this._context=t}LSt.prototype={areaStart:ww,areaEnd:ww,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 Vdn(t){return new LSt(t)}function MSt(t){return t<0?-1:1}function ISt(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(MSt(a)+MSt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function PSt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function lxe(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 OX(t){this._context=t}OX.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:lxe(this,this._t0,PSt(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,lxe(this,PSt(this,r=ISt(this,t,e)),r);break;default:lxe(this,this._t0,r=ISt(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function NSt(t){this._context=new BSt(t)}(NSt.prototype=Object.create(OX.prototype)).point=function(t,e){OX.prototype.point.call(this,e,t)};function BSt(t){this._context=t}BSt.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 $St(t){return new OX(t)}function FSt(t){return new NSt(t)}function zSt(t){this._context=t}zSt.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=USt(t),i=USt(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 GSt(t){return new EX(t,.5)}function QSt(t){return new EX(t,0)}function HSt(t){return new EX(t,1)}function Y7(t,e,r){this.k=t,this.x=e,this.y=r}Y7.prototype={constructor:Y7,scale:function(t){return t===1?this:new Y7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Y7(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+")"}},Y7.prototype;var iu=k(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 cxe(t){return typeof t>"u"||t===null}k(cxe,"isNothing");function WSt(t){return typeof t=="object"&&t!==null}k(WSt,"isObject");function YSt(t){return Array.isArray(t)?t:cxe(t)?[]:[t]}k(YSt,"toArray");function qSt(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;rfbe,"getAccDescription"),co=k(t=>{hbe=pbe(t)},"setDiagramTitle"),$a=k(()=>hbe,"getDiagramTitle"),$2t=ye,gan=Y1e,Ye=Dr,gbe=C2t,F2t=c5,mbe=k(t=>li(t,Ye()),"sanitizeText"),vbe=d5,man=k(()=>ube,"getCommonDb"),Vj={},Gj=k((t,e,r)=>{var n;Vj[t]&&$2t.warn(`Diagram with id ${t} already registered. Overwriting.`),Vj[t]=e,r&&L2t(t,r),fan(t,e.styles),(n=e.injectUtils)==null||n.call(e,$2t,gan,Ye,mbe,vbe,man(),()=>{})},"registerDiagram"),ybe=k(t=>{if(t in Vj)return Vj[t];throw new van(t)},"getDiagram"),van=(oL=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},k(oL,"DiagramNotFoundError"),oL);function Qj(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function yan(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function bbe(t){let e,r,n;t.length!==2?(e=Qj,r=(s,l)=>Qj(t(s),l),n=(s,l)=>t(s)-l):(e=t===Qj||t===yan?t:ban,r=t,n=t);function i(s,l,u=0,d=s.length){if(u>>1;r(s[h],l)<0?u=h+1:d=h}while(u>>1;r(s[h],l)<=0?u=h+1:d=h}while(uu&&n(s[h-1],l)>-n(s[h],l)?h-1:h}return{left:i,center:o,right:a}}function ban(){return 0}function xan(t){return t===null?NaN:+t}const wan=bbe(Qj).right;bbe(xan).center;class z2t extends Map{constructor(e,r=Tan){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(U2t(this,e))}has(e){return super.has(U2t(this,e))}set(e,r){return super.set(Aan(this,e),r)}delete(e){return super.delete(San(this,e))}}function U2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Aan({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function San({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Tan(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Can=Math.sqrt(50),kan=Math.sqrt(10),Oan=Math.sqrt(2);function Hj(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>=Can?10:a>=kan?5:a>=Oan?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 Ran(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 Dan(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 Nan(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Ban(){return!this.__axis}function G2t(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===Wj||t===Yj?-1:1,d=t===Yj||t===Abe?"x":"y",h=t===Wj||t===Sbe?Man:Ian;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Lan),v=Math.max(a,0)+s,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?Nan:Pan)(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(),O=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(O),E=E.merge(O.append("line").attr("stroke","currentColor").attr(d+"2",u*a)),_=_.merge(O.append("text").attr("fill","currentColor").attr(d,u*v).attr("dy",t===Wj?"0em":t===Sbe?"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",V2t).attr("transform",function(P){return isFinite(P=w(P))?h(P+l):this.getAttribute("transform")}),O.attr("opacity",V2t).attr("transform",function(P){var L=this.parentNode.__axis;return h((L&&isFinite(L=L(P))?L:w(P))+l)})),C.remove(),S.attr("d",t===Yj||t===Abe?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 h(w(P)+l)}),E.attr(d+"2",u*a),_.attr(d,u*v).text(m),A.filter(Ban).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Abe?"start":t===Yj?"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 $an(t){return G2t(Wj,t)}function Fan(t){return G2t(Sbe,t)}var zan={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}})}qj.prototype=Q2t.prototype={constructor:qj,on:function(t,e){var r=this._,n=Uan(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)),W2t.hasOwnProperty(e)?{space:W2t[e],local:t}:t}function Gan(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Tbe&&e.documentElement.namespaceURI===Tbe?e.createElement(t):e.createElementNS(r,t)}}function Qan(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Y2t(t){var e=jj(t);return(e.local?Qan:Gan)(e)}function Han(){}function Cbe(t){return t==null?Han:function(){return this.querySelector(t)}}function Wan(t){typeof t!="function"&&(t=Cbe(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 von(t){t||(t=yon);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function bon(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function xon(){return Array.from(this)}function won(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Lon:typeof e=="function"?Ion:Mon)(t,e,r??"")):h5(this.node(),t)}function h5(t,e){return t.style.getPropertyValue(e)||Z2t(t).getComputedStyle(t,null).getPropertyValue(e)}function Non(t){return function(){delete this[t]}}function Bon(t,e){return function(){this[t]=e}}function $on(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Fon(t,e){return arguments.length>1?this.each((e==null?Non:typeof e=="function"?$on:Bon)(t,e)):this.node()[t]}function J2t(t){return t.trim().split(/^|\s+/)}function kbe(t){return t.classList||new eAt(t)}function eAt(t){this._node=t,this._names=J2t(t.getAttribute("class")||"")}eAt.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 tAt(t,e){for(var r=kbe(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function fsn(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?Jj(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Jj(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=Asn.exec(t))?new tu(e[1],e[2],e[3],1):(e=Ssn.exec(t))?new tu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Tsn.exec(t))?Jj(e[1],e[2],e[3],e[4]):(e=Csn.exec(t))?Jj(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ksn.exec(t))?hAt(e[1],e[2]/100,e[3]/100,1):(e=Osn.exec(t))?hAt(e[1],e[2]/100,e[3]/100,e[4]):aAt.hasOwnProperty(t)?lAt(aAt[t]):t==="transparent"?new tu(NaN,NaN,NaN,0):null}function lAt(t){return new tu(t>>16&255,t>>8&255,t&255,1)}function Jj(t,e,r,n){return n<=0&&(t=e=r=NaN),new tu(t,e,r,n)}function cAt(t){return t instanceof zT||(t=UT(t)),t?(t=t.rgb(),new tu(t.r,t.g,t.b,t.opacity)):new tu}function Obe(t,e,r,n){return arguments.length===1?cAt(t):new tu(t,e,r,n??1)}function tu(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}C7(tu,Obe,Kj(zT,{brighter(t){return t=t==null?Zj:Math.pow(Zj,t),new tu(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?k7:Math.pow(k7,t),new tu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tu(VT(this.r),VT(this.g),VT(this.b),eX(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:uAt,formatHex:uAt,formatHex8:Rsn,formatRgb:dAt,toString:dAt}));function uAt(){return`#${GT(this.r)}${GT(this.g)}${GT(this.b)}`}function Rsn(){return`#${GT(this.r)}${GT(this.g)}${GT(this.b)}${GT((isNaN(this.opacity)?1:this.opacity)*255)}`}function dAt(){const t=eX(this.opacity);return`${t===1?"rgb(":"rgba("}${VT(this.r)}, ${VT(this.g)}, ${VT(this.b)}${t===1?")":`, ${t})`}`}function eX(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function VT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function GT(t){return t=VT(t),(t<16?"0":"")+t.toString(16)}function hAt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new kg(t,e,r,n)}function fAt(t){if(t instanceof kg)return new kg(t.h,t.s,t.l,t.opacity);if(t instanceof zT||(t=UT(t)),!t)return new kg;if(t instanceof kg)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 kg(o,s,l,t.opacity)}function Dsn(t,e,r,n){return arguments.length===1?fAt(t):new kg(t,e,r,n??1)}function kg(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}C7(kg,Dsn,Kj(zT,{brighter(t){return t=t==null?Zj:Math.pow(Zj,t),new kg(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?k7:Math.pow(k7,t),new kg(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 tu(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 kg(pAt(this.h),tX(this.s),tX(this.l),eX(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=eX(this.opacity);return`${t===1?"hsl(":"hsla("}${pAt(this.h)}, ${tX(this.s)*100}%, ${tX(this.l)*100}%${t===1?")":`, ${t})`}`}}));function pAt(t){return t=(t||0)%360,t<0?t+360:t}function tX(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 Lsn=Math.PI/180,Msn=180/Math.PI,rX=18,gAt=.96422,mAt=1,vAt=.82521,yAt=4/29,p5=6/29,bAt=3*p5*p5,Isn=p5*p5*p5;function xAt(t){if(t instanceof y0)return new y0(t.l,t.a,t.b,t.opacity);if(t instanceof Jy)return wAt(t);t instanceof tu||(t=cAt(t));var e=Lbe(t.r),r=Lbe(t.g),n=Lbe(t.b),i=_be((.2225045*e+.7168786*r+.0606169*n)/mAt),a,o;return e===r&&r===n?a=o=i:(a=_be((.4360747*e+.3850649*r+.1430804*n)/gAt),o=_be((.0139322*e+.0971045*r+.7141733*n)/vAt)),new y0(116*i-16,500*(a-i),200*(i-o),t.opacity)}function Psn(t,e,r,n){return arguments.length===1?xAt(t):new y0(t,e,r,n??1)}function y0(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}C7(y0,Psn,Kj(zT,{brighter(t){return new y0(this.l+rX*(t??1),this.a,this.b,this.opacity)},darker(t){return new y0(this.l-rX*(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=gAt*Rbe(e),t=mAt*Rbe(t),r=vAt*Rbe(r),new tu(Dbe(3.1338561*e-1.6168667*t-.4906146*r),Dbe(-.9787684*e+1.9161415*t+.033454*r),Dbe(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function _be(t){return t>Isn?Math.pow(t,1/3):t/bAt+yAt}function Rbe(t){return t>p5?t*t*t:bAt*(t-yAt)}function Dbe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lbe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nsn(t){if(t instanceof Jy)return new Jy(t.h,t.c,t.l,t.opacity);if(t instanceof y0||(t=xAt(t)),t.a===0&&t.b===0)return new Jy(NaN,0()=>t;function AAt(t,e){return function(r){return t+r*e}}function Bsn(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 $sn(t,e){var r=e-t;return r?AAt(t,r>180||r<-180?r-360*Math.round(r/360):r):nX(isNaN(t)?e:t)}function Fsn(t){return(t=+t)==1?E7:function(e,r){return r-e?Bsn(e,r,t):nX(isNaN(e)?r:e)}}function E7(t,e){var r=e-t;return r?AAt(t,r):nX(isNaN(t)?e:t)}const iX=function t(e){var r=Fsn(e);function n(i,a){var o=r((i=Obe(i)).r,(a=Obe(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=E7(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=s(d),i.b=l(d),i.opacity=u(d),i+""}}return n.gamma=t,n}(1);function zsn(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:Og(n,i)})),r=Pbe.lastIndex;return r180?d+=360:d-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Og(u,d)})):d&&h.push(i(h)+"rotate("+d+n)}function s(u,d,h,f){u!==d?f.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Og(u,d)}):d&&h.push(i(h)+"skewX("+d+n)}function l(u,d,h,f,p,g){if(u!==h||d!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Og(u,h)},{i:m-2,x:Og(d,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,d){var h=[],f=[];return u=t(u),d=t(d),a(u.translateX,u.translateY,d.translateX,d.translateY,h,f),o(u.rotate,d.rotate,h,f),s(u.skewX,d.skewX,h,f),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,h,f),u=d=null,function(p){for(var g=-1,m=f.length,v;++g=0&&t._call.call(void 0,e),t=t._next;--g5}function RAt(){QT=(sX=L7.now())+lX,g5=_7=0;try{tln()}finally{g5=0,nln(),QT=0}}function rln(){var t=L7.now(),e=t-sX;e>OAt&&(lX-=e,sX=t)}function nln(){for(var t,e=oX,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:oX=r);D7=t,Fbe(n)}function Fbe(t){if(!g5){_7&&(_7=clearTimeout(_7));var e=t-QT;e>24?(t<1/0&&(_7=setTimeout(RAt,t-L7.now()-lX)),R7&&(R7=clearInterval(R7))):(R7||(sX=L7.now(),R7=setInterval(rln,OAt)),g5=1,EAt(RAt))}}function DAt(t,e,r){var n=new cX;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var iln=Q2t("start","end","cancel","interrupt"),aln=[],LAt=0,MAt=1,zbe=2,uX=3,IAt=4,Ube=5,dX=6;function hX(t,e,r,n,i,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;oln(t,r,{name:e,index:n,group:i,on:iln,tween:aln,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:LAt})}function Vbe(t,e){var r=Eg(t,e);if(r.state>LAt)throw new Error("too late; already scheduled");return r}function b0(t,e){var r=Eg(t,e);if(r.state>uX)throw new Error("too late; already running");return r}function Eg(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function oln(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=_At(a,0,r.time);function a(u){r.state=MAt,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var d,h,f,p;if(r.state!==MAt)return l();for(d in n)if(p=n[d],p.name===r.name){if(p.state===uX)return DAt(o);p.state===IAt?(p.state=dX,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[d]):+dzbe&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Bln(t,e,r){var n,i,a=Nln(e)?Vbe:b0;return function(){var o=a(this,t),s=o.on;s!==n&&(i=(n=s).copy()).on(e,r),o.on=i}}function $ln(t,e){var r=this._id;return arguments.length<2?Eg(this.node(),r).on.on(t):this.each(Bln(r,t,e))}function Fln(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function zln(){return this.on("end.remove",Fln(this._id))}function Uln(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Cbe(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 $At;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iHT)if(!(Math.abs(h*l-u*d)>HT)||!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((Qbe-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>HT&&this._append`L${e+w*d},${r+w*h}`,this._append`A${a},${a},0,0,${+(h*p>d*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,d=r+l,h=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>HT||Math.abs(this._y1-d)>HT)&&this._append`L${u},${d}`,n&&(f<0&&(f=f%Hbe+Hbe),f>hcn?this._append`A${n},${n},0,1,${h},${e-s},${r-l}A${n},${n},0,1,${h},${this._x1=u},${this._y1=d}`:f>HT&&this._append`A${n},${n},0,${+(f>=Qbe)},${h},${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 gcn(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fX(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function m5(t){return t=fX(Math.abs(t)),t?t[1]:NaN}function mcn(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 vcn(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var ycn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pX(t){if(!(e=ycn.exec(t)))throw new Error("invalid format: "+t);var e;return new Wbe({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]})}pX.prototype=Wbe.prototype;function Wbe(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+""}Wbe.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 bcn(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 gX;function xcn(t,e){var r=fX(t,e);if(!r)return gX=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(gX=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")+fX(t,Math.max(0,e+a-1))[0]}function FAt(t,e){var r=fX(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 zAt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:gcn,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)=>FAt(t*100,e),r:FAt,s:xcn,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function UAt(t){return t}var VAt=Array.prototype.map,GAt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wcn(t){var e=t.grouping===void 0||t.thousands===void 0?UAt:mcn(VAt.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?UAt:vcn(VAt.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(h,f){h=pX(h);var p=h.fill,g=h.align,m=h.sign,v=h.symbol,y=h.zero,b=h.width,x=h.comma,w=h.precision,A=h.trim,S=h.type;S==="n"?(x=!0,S="g"):zAt[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:""),O=zAt[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=O(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:O(Math.abs(P),w),A&&(P=bcn(P)),N&&+P==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:s:m==="-"||m==="("?"":m)+L,R=(S==="s"&&!isNaN(P)&&gX!==void 0?GAt[8+gX/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 h+""},_}function d(h,f){var p=Math.max(-8,Math.min(8,Math.floor(m5(f)/3)))*3,g=Math.pow(10,-p),m=u((h=pX(h),h.type="f",h),{suffix:GAt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var mX,WT,QAt;Acn({thousands:",",grouping:[3],currency:["$",""]});function Acn(t){return mX=wcn(t),WT=mX.format,QAt=mX.formatPrefix,mX}function Scn(t){return Math.max(0,-m5(Math.abs(t)))}function Tcn(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(m5(e)/3)))*3-m5(Math.abs(t)))}function Ccn(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,m5(e)-m5(t))+1}function kcn(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 Ocn(){return this.eachAfter(kcn)}function Ecn(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function _cn(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 Rcn(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 Mcn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Icn(t){for(var e=this,r=Pcn(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 Pcn(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 Ncn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Bcn(){return Array.from(this)}function $cn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Fcn(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*zcn(){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 vX(o[s])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Hcn)}function Ucn(){return Ybe(this).eachBefore(Qcn)}function Vcn(t){return t.children}function Gcn(t){return Array.isArray(t)?t[1]:null}function Qcn(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Hcn(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function vX(t){this.data=t,this.depth=this.height=0,this.parent=null}vX.prototype=Ybe.prototype={constructor:vX,count:Ocn,each:Ecn,eachAfter:Rcn,eachBefore:_cn,find:Dcn,sum:Lcn,sort:Mcn,path:Icn,ancestors:Ncn,descendants:Bcn,leaves:$cn,links:Fcn,copy:Ucn,[Symbol.iterator]:zcn};function Wcn(t){if(typeof t!="function")throw new Error;return t}function M7(){return 0}function I7(t){return function(){return t}}function Ycn(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 qcn(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}(Xcn);function Jcn(){var t=Zcn,e=!1,r=1,n=1,i=[0],a=M7,o=M7,s=M7,l=M7,u=M7;function d(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(h),i=[0],e&&f.eachBefore(Ycn),f}function h(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 nun(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i2?iun:nun,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(l||(l=s(t.map(n),e,r)))(n(o(f)))}return h.invert=function(f){return o(i((u||(u=s(e,t.map(n),Og)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,tun),d()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),d()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),r=Ysn,d()},h.clamp=function(f){return arguments.length?(o=f?!0:v5,d()):o!==v5},h.interpolate=function(f){return arguments.length?(r=f,d()):r},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,p){return n=f,i=p,d()}}function qAt(){return aun()(v5,v5)}function oun(t,e,r,n){var i=wbe(t,e,r),a;switch(n=pX(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=Tcn(i,o))&&(n.precision=a),QAt(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Ccn(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Scn(i))&&(n.precision=a-(n.type==="%")*2);break}}return WT(n)}function sun(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ean(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return oun(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,d=10;for(s0;){if(u=xbe(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 y5(){var t=qAt();return t.copy=function(){return YAt(t,y5())},yX.apply(t,arguments),sun(t)}function lun(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(ucl(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)=>(Xbe.setTime(+a),Kbe.setTime(+o),t(Xbe),t(Kbe),Math.floor(r(Xbe,Kbe))),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 b5=cl(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);b5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?cl(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):b5),b5.range;const r1=1e3,vp=r1*60,n1=vp*60,i1=n1*24,Zbe=i1*7,jAt=i1*30,Jbe=i1*365,xw=cl(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*r1)},(t,e)=>(e-t)/r1,t=>t.getUTCSeconds());xw.range;const P7=cl(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r1)},(t,e)=>{t.setTime(+t+e*vp)},(t,e)=>(e-t)/vp,t=>t.getMinutes());P7.range,cl(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*vp)},(t,e)=>(e-t)/vp,t=>t.getUTCMinutes()).range;const N7=cl(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r1-t.getMinutes()*vp)},(t,e)=>{t.setTime(+t+e*n1)},(t,e)=>(e-t)/n1,t=>t.getHours());N7.range,cl(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*n1)},(t,e)=>(e-t)/n1,t=>t.getUTCHours()).range;const qT=cl(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*vp)/i1,t=>t.getDate()-1);qT.range;const exe=cl(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/i1,t=>t.getUTCDate()-1);exe.range,cl(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/i1,t=>Math.floor(t/i1)).range;function jT(t){return cl(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())*vp)/Zbe)}const B7=jT(0),$7=jT(1),XAt=jT(2),KAt=jT(3),XT=jT(4),ZAt=jT(5),JAt=jT(6);B7.range,$7.range,XAt.range,KAt.range,XT.range,ZAt.range,JAt.range;function KT(t){return cl(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)/Zbe)}const eSt=KT(0),bX=KT(1),cun=KT(2),uun=KT(3),x5=KT(4),dun=KT(5),hun=KT(6);eSt.range,bX.range,cun.range,uun.range,x5.range,dun.range,hun.range;const F7=cl(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());F7.range,cl(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 a1=cl(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());a1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cl(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)}),a1.range;const ZT=cl(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());ZT.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cl(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)}),ZT.range;function fun(t,e,r,n,i,a){const o=[[xw,1,r1],[xw,5,5*r1],[xw,15,15*r1],[xw,30,30*r1],[a,1,vp],[a,5,5*vp],[a,15,15*vp],[a,30,30*vp],[i,1,n1],[i,3,3*n1],[i,6,6*n1],[i,12,12*n1],[n,1,i1],[n,2,2*i1],[r,1,Zbe],[e,1,jAt],[e,3,3*jAt],[t,1,Jbe]];function s(u,d,h){const f=dv).right(o,f);if(p===o.length)return t.every(wbe(u/Jbe,d/Jbe,h));if(p===0)return b5.every(Math.max(wbe(u,d,h),1));const[g,m]=o[f/o[p-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(ie=rxe(z7(te.y,0,1)),Ce=ie.getUTCDay(),ie=Ce>4||Ce===0?bX.ceil(ie):bX(ie),ie=exe.offset(ie,(te.V-1)*7),te.y=ie.getUTCFullYear(),te.m=ie.getUTCMonth(),te.d=ie.getUTCDate()+(te.w+6)%7):(ie=txe(z7(te.y,0,1)),Ce=ie.getDay(),ie=Ce>4||Ce===0?$7.ceil(ie):$7(ie),ie=qT.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?rxe(z7(te.y,0,1)).getUTCDay():txe(z7(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,rxe(te)):txe(te)}}function C(X,J,ee,te){for(var pe=0,ie=J.length,Ce=ee.length,Oe,Ee;pe=Ce)return-1;if(Oe=J.charCodeAt(pe++),Oe===37){if(Oe=J.charAt(pe++),Ee=A[Oe in tSt?J.charAt(pe++):Oe],!Ee||(te=Ee(X,ee,te))<0)return-1}else if(Oe!=ee.charCodeAt(te++))return-1}return te}function O(X,J,ee){var te=u.exec(J.slice(ee));return te?(X.p=d.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=h.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 G(X){return a[X.getUTCDay()]}function H(X){return l[X.getUTCMonth()]}function j(X){return s[X.getUTCMonth()]}function q(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 tSt={"-":"",_:" ",0:"0"},$l=/^\s*\d+/,vun=/^%/,yun=/[\\^$*+?|[\]().{}]/g;function Vi(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function xun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function wun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Aun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Sun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Tun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function rSt(t,e,r){var n=$l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function nSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Cun(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 kun(t,e,r){var n=$l.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Oun(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function iSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Eun(t,e,r){var n=$l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function aSt(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function _un(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Run(t,e,r){var n=$l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Dun(t,e,r){var n=$l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Lun(t,e,r){var n=$l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Mun(t,e,r){var n=vun.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Iun(t,e,r){var n=$l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Pun(t,e,r){var n=$l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function oSt(t,e){return Vi(t.getDate(),e,2)}function Nun(t,e){return Vi(t.getHours(),e,2)}function Bun(t,e){return Vi(t.getHours()%12||12,e,2)}function $un(t,e){return Vi(1+qT.count(a1(t),t),e,3)}function sSt(t,e){return Vi(t.getMilliseconds(),e,3)}function Fun(t,e){return sSt(t,e)+"000"}function zun(t,e){return Vi(t.getMonth()+1,e,2)}function Uun(t,e){return Vi(t.getMinutes(),e,2)}function Vun(t,e){return Vi(t.getSeconds(),e,2)}function Gun(t){var e=t.getDay();return e===0?7:e}function Qun(t,e){return Vi(B7.count(a1(t)-1,t),e,2)}function lSt(t){var e=t.getDay();return e>=4||e===0?XT(t):XT.ceil(t)}function Hun(t,e){return t=lSt(t),Vi(XT.count(a1(t),t)+(a1(t).getDay()===4),e,2)}function Wun(t){return t.getDay()}function Yun(t,e){return Vi($7.count(a1(t)-1,t),e,2)}function qun(t,e){return Vi(t.getFullYear()%100,e,2)}function jun(t,e){return t=lSt(t),Vi(t.getFullYear()%100,e,2)}function Xun(t,e){return Vi(t.getFullYear()%1e4,e,4)}function Kun(t,e){var r=t.getDay();return t=r>=4||r===0?XT(t):XT.ceil(t),Vi(t.getFullYear()%1e4,e,4)}function Zun(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Vi(e/60|0,"0",2)+Vi(e%60,"0",2)}function cSt(t,e){return Vi(t.getUTCDate(),e,2)}function Jun(t,e){return Vi(t.getUTCHours(),e,2)}function edn(t,e){return Vi(t.getUTCHours()%12||12,e,2)}function tdn(t,e){return Vi(1+exe.count(ZT(t),t),e,3)}function uSt(t,e){return Vi(t.getUTCMilliseconds(),e,3)}function rdn(t,e){return uSt(t,e)+"000"}function ndn(t,e){return Vi(t.getUTCMonth()+1,e,2)}function idn(t,e){return Vi(t.getUTCMinutes(),e,2)}function adn(t,e){return Vi(t.getUTCSeconds(),e,2)}function odn(t){var e=t.getUTCDay();return e===0?7:e}function sdn(t,e){return Vi(eSt.count(ZT(t)-1,t),e,2)}function dSt(t){var e=t.getUTCDay();return e>=4||e===0?x5(t):x5.ceil(t)}function ldn(t,e){return t=dSt(t),Vi(x5.count(ZT(t),t)+(ZT(t).getUTCDay()===4),e,2)}function cdn(t){return t.getUTCDay()}function udn(t,e){return Vi(bX.count(ZT(t)-1,t),e,2)}function ddn(t,e){return Vi(t.getUTCFullYear()%100,e,2)}function hdn(t,e){return t=dSt(t),Vi(t.getUTCFullYear()%100,e,2)}function fdn(t,e){return Vi(t.getUTCFullYear()%1e4,e,4)}function pdn(t,e){var r=t.getUTCDay();return t=r>=4||r===0?x5(t):x5.ceil(t),Vi(t.getUTCFullYear()%1e4,e,4)}function gdn(){return"+0000"}function hSt(){return"%"}function fSt(t){return+t}function pSt(t){return Math.floor(+t/1e3)}var w5,xX;mdn({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 mdn(t){return w5=mun(t),xX=w5.format,w5.parse,w5.utcFormat,w5.utcParse,w5}function vdn(t){return new Date(t)}function ydn(t){return t instanceof Date?+t:+new Date(+t)}function gSt(t,e,r,n,i,a,o,s,l,u){var d=qAt(),h=d.invert,f=d.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?G7:Math.acos(t)}function vSt(t){return t>=1?wX:t<=-1?-wX:Math.asin(t)}function ySt(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 pcn(e)}function Tdn(t){return t.innerRadius}function Cdn(t){return t.outerRadius}function kdn(t){return t.startAngle}function Odn(t){return t.endAngle}function Edn(t){return t&&t.padAngle}function _dn(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,d=o-i,h=s-a,f=h*l-d*u;if(!(f*fR*R+D*D&&(C=E,O=_),{cx:C,cy:O,x01:-d,y01:-h,x11:C*(i/A-1),y11:O*(i/A-1)}}function S5(){var t=Tdn,e=Cdn,r=gs(0),n=null,i=kdn,a=Odn,o=Edn,s=null,l=ySt(u);function u(){var d,h,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-wX,m=a.apply(this,arguments)-wX,v=mSt(m-g),y=m>g;if(s||(s=d=l()),pnu))s.moveTo(0,0);else if(v>AX-nu)s.moveTo(p*JT(g),p*x0(g)),s.arc(0,0,p,g,m,!y),f>nu&&(s.moveTo(f*JT(m),f*x0(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,O=C>nu&&(n?+n.apply(this,arguments):A5(f*f+p*p)),E=nxe(mSt(p-f)/2,+r.apply(this,arguments)),_=E,P=E,L,R;if(O>nu){var D=vSt(O/f*x0(C)),M=vSt(O/p*x0(C));(S-=D*2)>nu?(D*=y?1:-1,w+=D,A-=D):(S=0,w=A=(g+m)/2),(T-=M*2)>nu?(M*=y?1:-1,b+=M,x-=M):(T=0,b=x=(g+m)/2)}var I=p*JT(b),N=p*x0(b),F=f*JT(A),B=f*x0(A);if(E>nu){var V=p*JT(x),z=p*x0(x),U=f*JT(w),G=f*x0(w),H;if(vnu?P>nu?(L=SX(U,G,I,N,p,P,y),R=SX(V,z,F,B,p,P,y),s.moveTo(L.cx+L.x01,L.cy+L.y01),Pnu)||!(S>nu)?s.lineTo(F,B):_>nu?(L=SX(F,B,V,z,f,-_,y),R=SX(I,N,U,G,f,-_,y),s.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function Mdn(t){return t}function Idn(){var t=Mdn,e=Ldn,r=null,n=gs(0),i=gs(AX),a=gs(0);function o(s){var l,u=(s=bSt(s)).length,d,h,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(AX,Math.max(-AX,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,h=f?(v-u*x)/f:0;l0?w*h:0)+x,g[d]={data:s[d],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 wSt{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 ASt(t){return new wSt(t,!0)}function SSt(t){return new wSt(t,!1)}function ww(){}function TX(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 CX(t){this._context=t}CX.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:TX(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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function W7(t){return new CX(t)}function TSt(t){this._context=t}TSt.prototype={areaStart:ww,areaEnd:ww,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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pdn(t){return new TSt(t)}function CSt(t){this._context=t}CSt.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:TX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ndn(t){return new CSt(t)}function kSt(t,e){this._basis=new CX(t),this._beta=e}kSt.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 Bdn=function t(e){function r(n){return e===1?new CX(n):new kSt(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function kX(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 ixe(t,e){this._context=t,this._k=(1-e)/6}ixe.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:kX(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:kX(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 OSt=function t(e){function r(n){return new ixe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function axe(t,e){this._context=t,this._k=(1-e)/6}axe.prototype={areaStart:ww,areaEnd:ww,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:kX(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 $dn=function t(e){function r(n){return new axe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function oxe(t,e){this._context=t,this._k=(1-e)/6}oxe.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:kX(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 Fdn=function t(e){function r(n){return new oxe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function sxe(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>nu){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>nu){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,d=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/d,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/d}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function ESt(t,e){this._context=t,this._alpha=e}ESt.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:sxe(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 _St=function t(e){function r(n){return e?new ESt(n,e):new ixe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function RSt(t,e){this._context=t,this._alpha=e}RSt.prototype={areaStart:ww,areaEnd:ww,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:sxe(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 zdn=function t(e){function r(n){return e?new RSt(n,e):new axe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function DSt(t,e){this._context=t,this._alpha=e}DSt.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:sxe(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 Udn=function t(e){function r(n){return e?new DSt(n,e):new oxe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function LSt(t){this._context=t}LSt.prototype={areaStart:ww,areaEnd:ww,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 Vdn(t){return new LSt(t)}function MSt(t){return t<0?-1:1}function ISt(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(MSt(a)+MSt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function PSt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function lxe(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 OX(t){this._context=t}OX.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:lxe(this,this._t0,PSt(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,lxe(this,PSt(this,r=ISt(this,t,e)),r);break;default:lxe(this,this._t0,r=ISt(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function NSt(t){this._context=new BSt(t)}(NSt.prototype=Object.create(OX.prototype)).point=function(t,e){OX.prototype.point.call(this,e,t)};function BSt(t){this._context=t}BSt.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 $St(t){return new OX(t)}function FSt(t){return new NSt(t)}function zSt(t){this._context=t}zSt.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=USt(t),i=USt(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 GSt(t){return new EX(t,.5)}function QSt(t){return new EX(t,0)}function HSt(t){return new EX(t,1)}function Y7(t,e,r){this.k=t,this.x=e,this.y=r}Y7.prototype={constructor:Y7,scale:function(t){return t===1?this:new Y7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Y7(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+")"}},Y7.prototype;var iu=k(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 cxe(t){return typeof t>"u"||t===null}k(cxe,"isNothing");function WSt(t){return typeof t=="object"&&t!==null}k(WSt,"isObject");function YSt(t){return Array.isArray(t)?t:cxe(t)?[]:[t]}k(YSt,"toArray");function qSt(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}}k(_X,"getLine");function RX(t,e){return ul.repeat(" ",e-t.length)+t}k(RX,"padStart");function KSt(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,d=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+d+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=_X(t.buffer,n[o-l],i[o-l],t.position-(n[o]-n[o-l]),h),s=ul.repeat(" ",e.indent)+RX((t.line-l+1).toString(),d)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}k(uxe,"formatError");function T5(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=uxe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}k(T5,"YAMLException$1"),T5.prototype=Object.create(Error.prototype),T5.prototype.constructor=T5,T5.prototype.toString=k(function(e){return this.name+": "+uxe(this,e)},"toString");var Wd=T5;function _X(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}}k(_X,"getLine");function RX(t,e){return ul.repeat(" ",e-t.length)+t}k(RX,"padStart");function KSt(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,d=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+d+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=_X(t.buffer,n[o-l],i[o-l],t.position-(n[o]-n[o-l]),h),s=ul.repeat(" ",e.indent)+RX((t.line-l+1).toString(),d)+" | "+u.str+` `+s;for(u=_X(t.buffer,n[o],i[o],t.position,h),s+=ul.repeat(" ",e.indent)+RX((t.line+1).toString(),d)+" | "+u.str+` `,s+=ul.repeat("-",e.indent+d+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=_X(t.buffer,n[o+l],i[o+l],t.position-(n[o]-n[o+l]),h),s+=ul.repeat(" ",e.indent)+RX((t.line+l+1).toString(),d)+" | "+u.str+` @@ -544,7 +544,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new WTt(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,Hr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position"u"&&(r=e,e=null);var n=xxe(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}k(kR,"codePointAt");function kxe(t){var e=/^\n* /;return e.test(t)}k(kxe,"needIndentIndicator");var yCt=1,Oxe=2,bCt=3,xCt=4,OR=5;function wCt(t,e,r,n,i,a,o,s){var l,u=0,d=null,h=!1,f=!1,p=n!==-1,g=-1,m=mCt(kR(t,0))&&vCt(kR(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=kR(t,l),!CR(u))return OR;m=m&&Cxe(u,d,s),d=u}else{for(l=0;l=65536?l+=2:l++){if(u=kR(t,l),u===X7)h=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!CR(u))return OR;m=m&&Cxe(u,d,s),d=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!h&&!f?m&&!o&&!i(t)?yCt:a===K7?OR:Oxe:r>9&&kxe(t)?OR:o?a===K7?OR:Oxe:f?xCt:bCt}k(wCt,"chooseScalarStyle");function ACt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===K7?'""':"''";if(!t.noCompatMode&&(Ghn.indexOf(e)!==-1||Qhn.test(e)))return t.quotingType===K7?'"'+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 gCt(t,u)}switch(k(l,"testAmbiguity"),wCt(e,s,t.indent,o,l,t.quotingType,t.forceQuotes&&!n,i)){case yCt:return e;case Oxe:return"'"+e.replace(/'/g,"''")+"'";case bCt:return"|"+Exe(e,t.indent)+_xe(Sxe(e,a));case xCt:return">"+Exe(e,t.indent)+_xe(Sxe(SCt(e,o),a));case OR:return'"'+TCt(e)+'"';default:throw new Wd("impossible error: invalid scalar style")}}()}k(ACt,"writeScalar");function Exe(t,e){var r=kxe(t)?String(e):"",n=t[t.length-1]===` +`+ul.repeat(" ",t.indent*e)}k(BX,"generateNextLine");function gCt(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}k(k5,"codePointAt");function kxe(t){var e=/^\n* /;return e.test(t)}k(kxe,"needIndentIndicator");var yCt=1,Oxe=2,bCt=3,xCt=4,O5=5;function wCt(t,e,r,n,i,a,o,s){var l,u=0,d=null,h=!1,f=!1,p=n!==-1,g=-1,m=mCt(k5(t,0))&&vCt(k5(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=k5(t,l),!C5(u))return O5;m=m&&Cxe(u,d,s),d=u}else{for(l=0;l=65536?l+=2:l++){if(u=k5(t,l),u===X7)h=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!C5(u))return O5;m=m&&Cxe(u,d,s),d=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!h&&!f?m&&!o&&!i(t)?yCt:a===K7?O5:Oxe:r>9&&kxe(t)?O5:o?a===K7?O5:Oxe:f?xCt:bCt}k(wCt,"chooseScalarStyle");function ACt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===K7?'""':"''";if(!t.noCompatMode&&(Ghn.indexOf(e)!==-1||Qhn.test(e)))return t.quotingType===K7?'"'+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 gCt(t,u)}switch(k(l,"testAmbiguity"),wCt(e,s,t.indent,o,l,t.quotingType,t.forceQuotes&&!n,i)){case yCt:return e;case Oxe:return"'"+e.replace(/'/g,"''")+"'";case bCt:return"|"+Exe(e,t.indent)+_xe(Sxe(e,a));case xCt:return">"+Exe(e,t.indent)+_xe(Sxe(SCt(e,o),a));case O5:return'"'+TCt(e)+'"';default:throw new Wd("impossible error: invalid scalar style")}}()}k(ACt,"writeScalar");function Exe(t,e){var r=kxe(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` @@ -555,13 +555,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `:"")+Rxe(l,e),i=a}return n}k(SCt,"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)}k(Rxe,"foldLine");function TCt(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=kR(t,i),n=ou[r],!n&&CR(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||fCt(r);return e}k(TCt,"escapeString");function CCt(t,e,r){var n="",i=t.tag,a,o,s;for(a=0,o=r.length;a"u"&&w0(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}k(CCt,"writeFlowSequence");function Dxe(t,e,r,n){var i="",a=t.tag,o,s,l;for(o=0,s=r.length;o"u"&&w0(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=BX(t,e)),t.dump&&X7===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}k(Dxe,"writeBlockSequence");function kCt(t,e,r){var n="",i=t.tag,a=Object.keys(r),o,s,l,u,d;for(o=0,s=a.length;o1024&&(d+="? "),d+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),w0(t,e,u,!1,!1)&&(d+=t.dump,n+=d));t.tag=i,t.dump="{"+n+"}"}k(kCt,"writeFlowMapping");function OCt(t,e,r,n){var i="",a=t.tag,o=Object.keys(r),s,l,u,d,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Wd("sortKeys must be a boolean or a function");for(s=0,l=o.length;s1024,h&&(t.dump&&X7===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=BX(t,e)),w0(t,e+1,d,!0,h)&&(t.dump&&X7===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}k(OCt,"writeBlockMapping");function Lxe(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}k(Lxe,"detectType");function w0(t,e,r,n,i,a,o){t.tag=null,t.dump=r,Lxe(t,r,!1)||Lxe(t,r,!0);var s=aCt.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var d=s==="[object Object]"||s==="[object Array]",h,f;if(d&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(d&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),s==="[object Object]")n&&Object.keys(t.dump).length!==0?(OCt(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(kCt(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(s==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Dxe(t,e-1,t.dump,i):Dxe(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(CCt(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&ACt(t,t.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Wd("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}k(w0,"writeNode");function ECt(t,e){var r=[],n=[],i,a;for($X(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=k5(t,i),n=ou[r],!n&&C5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||fCt(r);return e}k(TCt,"escapeString");function CCt(t,e,r){var n="",i=t.tag,a,o,s;for(a=0,o=r.length;a"u"&&w0(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}k(CCt,"writeFlowSequence");function Dxe(t,e,r,n){var i="",a=t.tag,o,s,l;for(o=0,s=r.length;o"u"&&w0(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=BX(t,e)),t.dump&&X7===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}k(Dxe,"writeBlockSequence");function kCt(t,e,r){var n="",i=t.tag,a=Object.keys(r),o,s,l,u,d;for(o=0,s=a.length;o1024&&(d+="? "),d+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),w0(t,e,u,!1,!1)&&(d+=t.dump,n+=d));t.tag=i,t.dump="{"+n+"}"}k(kCt,"writeFlowMapping");function OCt(t,e,r,n){var i="",a=t.tag,o=Object.keys(r),s,l,u,d,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Wd("sortKeys must be a boolean or a function");for(s=0,l=o.length;s1024,h&&(t.dump&&X7===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=BX(t,e)),w0(t,e+1,d,!0,h)&&(t.dump&&X7===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}k(OCt,"writeBlockMapping");function Lxe(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}k(Lxe,"detectType");function w0(t,e,r,n,i,a,o){t.tag=null,t.dump=r,Lxe(t,r,!1)||Lxe(t,r,!0);var s=aCt.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var d=s==="[object Object]"||s==="[object Array]",h,f;if(d&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(d&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),s==="[object Object]")n&&Object.keys(t.dump).length!==0?(OCt(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(kCt(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(s==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Dxe(t,e-1,t.dump,i):Dxe(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(CCt(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&ACt(t,t.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Wd("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}k(w0,"writeNode");function ECt(t,e){var r=[],n=[],i,a;for($X(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"),ER=k(t=>{const e=jhn([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),jhn=k(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"),Mxe=k(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"),kr=k(t=>{const{stylesArray:e}=ER(t),r=[],n=[],i=[],a=[];return e.forEach(o=>{const s=o[0];Mxe(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=k((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ye(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=ER(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:Xhn(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),Xhn=k(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"),_Ct={},Fl={};Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.BLANK_URL=Fl.relativeFirstCharacters=Fl.whitespaceEscapeCharsRegex=Fl.urlSchemeRegex=Fl.ctrlCharactersRegex=Fl.htmlCtrlEntityRegex=Fl.htmlEntitiesRegex=Fl.invalidProtocolRegex=void 0,Fl.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Fl.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Fl.htmlCtrlEntityRegex=/&(newline|tab);/gi,Fl.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Fl.urlSchemeRegex=/^.+(:|:)/gim,Fl.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Fl.relativeFirstCharacters=[".","/"],Fl.BLANK_URL="about:blank",Object.defineProperty(_Ct,"__esModule",{value:!0});var iC=_Ct.sanitizeUrl=efn,su=Fl;function Khn(t){return su.relativeFirstCharacters.indexOf(t[0])>-1}function Zhn(t){var e=t.replace(su.ctrlCharactersRegex,"");return e.replace(su.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function Jhn(t){return URL.canParse(t)}function RCt(t){try{return decodeURIComponent(t)}catch{return t}}function efn(t){if(!t)return su.BLANK_URL;var e,r=RCt(t.trim());do r=Zhn(r).replace(su.htmlCtrlEntityRegex,"").replace(su.ctrlCharactersRegex,"").replace(su.whitespaceEscapeCharsRegex,"").trim(),r=RCt(r),e=r.match(su.ctrlCharactersRegex)||r.match(su.htmlEntitiesRegex)||r.match(su.htmlCtrlEntityRegex)||r.match(su.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return su.BLANK_URL;if(Khn(n))return n;var i=n.trimStart(),a=i.match(su.urlSchemeRegex);if(!a)return n;var o=a[0].toLowerCase().trim();if(su.invalidProtocolRegex.test(o))return su.BLANK_URL;var s=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){if(!Jhn(s))return su.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}function tfn(t){return Array.isArray(t)}function Ixe(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 rfn(){}function DCt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function J7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const LCt="[object RegExp]",Pxe="[object String]",Nxe="[object Number]",Bxe="[object Boolean]",$xe="[object Arguments]",MCt="[object Symbol]",ICt="[object Date]",PCt="[object Map]",NCt="[object Set]",BCt="[object Array]",$Ct="[object ArrayBuffer]",FCt="[object Object]",zCt="[object DataView]",UCt="[object Uint8Array]",VCt="[object Uint8ClampedArray]",GCt="[object Uint16Array]",QCt="[object Uint32Array]",HCt="[object Int8Array]",WCt="[object Int16Array]",YCt="[object Int32Array]",qCt="[object Float32Array]",jCt="[object Float64Array]",XCt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function Fxe(t){return typeof XCt.Buffer<"u"&&XCt.Buffer.isBuffer(t)}function nfn(t){return Number.isSafeInteger(t)&&t>=0}function KCt(t){return t!=null&&typeof t!="function"&&nfn(t.length)}function ifn(t){return t==="__proto__"}function UX(t){return t==null||typeof t!="object"&&typeof t!="function"}function zxe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function afn(t,e){return _R(t,void 0,t,new Map,e)}function _R(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(UX(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(J7(t)==="[object Object]"&&typeof t.constructor!="function"){const o={};return a.set(t,o),Rg(o,t,i,a),o}switch(Object.prototype.toString.call(t)){case Nxe:case Pxe:case Bxe:{const o=new t.constructor(t==null?void 0:t.valueOf());return Rg(o,t),o}case $xe:{const o={};return Rg(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}}})}function ZCt(t){return sfn(t)}function Uxe(t){return t!==null&&typeof t=="object"&&J7(t)==="[object Arguments]"}function Vxe(t){return typeof t=="object"&&t!==null}function lfn(t){return Vxe(t)&&KCt(t)}function e$(t){return zxe(t)}function cfn(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function t$(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(t$.Cache||Map),r}t$.Cache=Map;function ufn(t){if(UX(t))return t;const e=J7(t);if(!dfn(t))return{};if(tfn(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(e$(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]"?ffn(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 pfn(r,t),Gxe(r,t),hfn(r,t),r}function dfn(t){switch(J7(t)){case $xe:case BCt:case $Ct:case zCt:case Bxe:case ICt:case qCt:case jCt:case HCt:case WCt:case YCt:case PCt:case Nxe:case FCt:case LCt:case NCt:case Pxe:case MCt:case UCt:case VCt:case GCt:case QCt:return!0;default:return!1}}function Gxe(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function hfn(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function pfn(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function gfn(t){if(UX(t))return t;if(Array.isArray(t)||zxe(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 mfn(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 ekt="​",yfn={curveBasis:W7,curveBasisClosed:Pdn,curveBasisOpen:Ndn,curveBumpX:ASt,curveBumpY:SSt,curveBundle:Bdn,curveCardinalClosed:$dn,curveCardinalOpen:Fdn,curveCardinal:OSt,curveCatmullRomClosed:zdn,curveCatmullRomOpen:Udn,curveCatmullRom:_St,curveLinear:Q7,curveLinearClosed:Vdn,curveMonotoneX:$St,curveMonotoneY:FSt,curveNatural:VSt,curveStep:GSt,curveStepAfter:HSt,curveStepBefore:QSt},bfn=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,xfn=k(function(t,e){const r=tkt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const o=r.map(s=>s.args);Nj(o),n=Fs(n,[...o])}else n=r.args;if(!n)return;let i=abe(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),tkt=k(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${bfn.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=A7.exec(t))!==null;)if(a.index===A7.lastIndex&&A7.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"),wfn=k(function(t){return t.replace(A7,"")},"removeDirectives"),Afn=k(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function Qxe(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return yfn[r]??e}k(Qxe,"interpolateToCurve");function rkt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?iC(r):r}k(rkt,"formatUrl");var Sfn=k((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let o=0;o{r+=Hxe(i,e),e=i});const n=r/2;return Wxe(t,n)}k(nkt,"traverseEdge");function ikt(t){return t.length===1?t[0]:nkt(t)}k(ikt,"calcLabelPosition");var akt=k((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Wxe=k((t,e)=>{let r,n=e;for(const i of t){if(r){const a=Hxe(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:akt((1-o)*r.x+o*i.x,5),y:akt((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Tfn=k((t,e,r)=>{ye.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=Wxe(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 okt(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=Wxe(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}k(okt,"calcTerminalLabelPosition");function Yxe(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}}k(Yxe,"getStylesFromArray");var skt=0,lkt=k(()=>(skt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+skt),"generateId");function ckt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ickt(t.length),"random"),Cfn=k(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"),kfn=k(function(t,e){const r=e.text.replace(Xt.lineBreakRegex," "),[,n]=s1(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"),r$=t$((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=Vu(`${o} `,r),u=Vu(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Ofn(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}`),Ofn=t$((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(Vu(u,n)>=e){const h=l+1,f=i.length===h,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 GX(t,e){return QX(t,e).height}k(GX,"calculateTextHeight");function Vu(t,e){return QX(t,e).width}k(Vu,"calculateTextWidth");var QX=t$((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=s1(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 d=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=Cfn();v.text=m||ekt;const y=kfn(d,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)}d.remove();const h=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[h]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Efn=(sL=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},k(sL,"InitIDGenerator"),sL),HX,_fn=k(function(t){return HX=HX||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),HX.innerHTML=t,unescape(HX.textContent)},"entityDecode");function qxe(t){return"str"in t}k(qxe,"isDetailedError");var Rfn=k((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"),s1=k(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 vfn({},t,e)}k(uo,"cleanAndMerge");var un={assignWithDepth:Fs,wrapLabel:r$,calculateTextHeight:GX,calculateTextWidth:Vu,calculateTextDimensions:QX,cleanAndMerge:uo,detectInit:xfn,detectDirective:tkt,isSubstringInArray:Afn,interpolateToCurve:Qxe,calcLabelPosition:ikt,calcCardinalityPosition:Tfn,calcTerminalLabelPosition:okt,formatUrl:rkt,getStylesFromArray:Yxe,generateId:lkt,random:ukt,runFunc:Sfn,entityDecode:_fn,insertTitle:Rfn,isLabelCoordinateInPath:dkt,parseFontSize:s1,InitIDGenerator:Efn},Dfn=k(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"),l1=k(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),RR=k((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function zl(t){return t??null}k(zl,"handleUndefinedAttr");function dkt(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())}k(dkt,"isLabelCoordinateInPath");var DR=k(({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 jxe(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]=s1(s),d=u*l+"px";i.style.minWidth=d,i.style.maxWidth=d}else i.style.width="100%";a(i)}k(o,"setupImage"),setTimeout(()=>{i.complete&&o()}),i.addEventListener("error",o),i.addEventListener("load",o)})))}k(jxe,"configureLabelImages");const Lfn=Object.freeze({left:0,top:0,width:16,height:16}),WX=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hkt=Object.freeze({...Lfn,...WX}),Mfn=Object.freeze({...hkt,body:"",hidden:!1}),Ifn=Object.freeze({width:null,height:null}),Pfn=Object.freeze({...Ifn,...WX}),Nfn=(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 Xxe(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 Xxe(s)?s:null}if(r&&n===""){const s={provider:n,prefix:"",name:a};return Xxe(s,r)?s:null}return null},Xxe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Bfn(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 fkt(t,e){const r=Bfn(t,e);for(const n in Mfn)n in WX?n in t&&!(n in r)&&(r[n]=WX[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function $fn(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 pkt(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function o(s){a=fkt(n[s]||i[s],a)}return o(e),r.forEach(o),fkt(t,a)}function Ffn(t,e){if(t.icons[e])return pkt(t,e,[]);const r=$fn(t,[e])[e];return r?pkt(t,e,r):null}const zfn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ufn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function gkt(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(zfn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),o=Ufn.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 Vfn(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 Gfn(t,e){return t?""+t+""+e:e}function Qfn(t,e,r){const n=Vfn(t);return Gfn(n.defs,e+n.content+r)}const Hfn=t=>t==="unset"||t==="undefined"||t==="none";function Wfn(t,e){const r={...hkt,...t},n={...Pfn,...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=Qfn(a,'',""))});const o=n.width,s=n.height,l=i.width,u=i.height;let d,h;o===null?(h=s===null?"1em":s==="auto"?u:s,d=gkt(h,l/u)):(d=o==="auto"?l:o,h=s===null?gkt(d,u/l):s==="auto"?u:s);const f={},p=(m,v)=>{Hfn(v)||(f[m]=v.toString())};p("width",d),p("height",h);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const Yfn=/\sid="(\S+)"/g,mkt=new Map;function qfn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=mkt.get(t)||0;return mkt.set(t,e+1),e?`${t}${e}`:t}function jfn(t){const e=[];let r;for(;r=Yfn.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=qfn(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 Xfn(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 vkt={body:'?',height:80,width:80},Kxe=new Map,ykt=new Map,Zxe=k(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)ykt.set(e.name,e.loader);else if("icons"in e)Kxe.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"),bkt=k(async(t,e)=>{const r=Nfn(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=Kxe.get(n);if(!i){const o=ykt.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},Kxe.set(n,i)}catch(s){throw ye.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Ffn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),Kfn=k(async t=>{try{return await bkt(t),!0}catch{return!1}},"isIconAvailable"),c1=k(async(t,e,r)=>{let n;try{n=await bkt(t,e==null?void 0:e.fallbackPrefix)}catch(o){ye.error(o),n=vkt}const i=Wfn(n,e),a=Xfn(jfn(i.body),{...i.attributes,...r});return li(a,Dr())},"getIconSVG");function Jxe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var aC=Jxe();function xkt(t){aC=t}var n$={exec:()=>null};function Gi(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(Gu.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var Zfn=(()=>{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")},Jfn=/^(?:[ \t]*(?:\n|$))+/,epn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tpn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,i$=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rpn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ewe=/(?:[*+-]|\d{1,9}[.)])/,wkt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Akt=Gi(wkt).replace(/bull/g,ewe).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(),npn=Gi(wkt).replace(/bull/g,ewe).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(),twe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ipn=/^[^\n]+/,rwe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,apn=Gi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rwe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),opn=Gi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ewe).getRegex(),YX="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",nwe=/|$))/,spn=Gi("^ {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",nwe).replace("tag",YX).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Skt=Gi(twe).replace("hr",i$).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",YX).getRegex(),lpn=Gi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Skt).getRegex(),iwe={blockquote:lpn,code:epn,def:apn,fences:tpn,heading:rpn,hr:i$,html:spn,lheading:Akt,list:opn,newline:Jfn,paragraph:Skt,table:n$,text:ipn},Tkt=Gi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",i$).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",YX).getRegex(),cpn={...iwe,lheading:npn,table:Tkt,paragraph:Gi(twe).replace("hr",i$).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tkt).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",YX).getRegex()},upn={...iwe,html:Gi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nwe).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:n$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gi(twe).replace("hr",i$).replace("heading",` *#{1,6} *[^ + */var qhn=k(t=>{const{handDrawnSeed:e}=Ye();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),E5=k(t=>{const e=jhn([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),jhn=k(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"),Mxe=k(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"),kr=k(t=>{const{stylesArray:e}=E5(t),r=[],n=[],i=[],a=[];return e.forEach(o=>{const s=o[0];Mxe(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=k((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ye(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=E5(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:Xhn(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),Xhn=k(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"),_Ct={},Fl={};Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.BLANK_URL=Fl.relativeFirstCharacters=Fl.whitespaceEscapeCharsRegex=Fl.urlSchemeRegex=Fl.ctrlCharactersRegex=Fl.htmlCtrlEntityRegex=Fl.htmlEntitiesRegex=Fl.invalidProtocolRegex=void 0,Fl.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Fl.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Fl.htmlCtrlEntityRegex=/&(newline|tab);/gi,Fl.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Fl.urlSchemeRegex=/^.+(:|:)/gim,Fl.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Fl.relativeFirstCharacters=[".","/"],Fl.BLANK_URL="about:blank",Object.defineProperty(_Ct,"__esModule",{value:!0});var iC=_Ct.sanitizeUrl=efn,su=Fl;function Khn(t){return su.relativeFirstCharacters.indexOf(t[0])>-1}function Zhn(t){var e=t.replace(su.ctrlCharactersRegex,"");return e.replace(su.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function Jhn(t){return URL.canParse(t)}function RCt(t){try{return decodeURIComponent(t)}catch{return t}}function efn(t){if(!t)return su.BLANK_URL;var e,r=RCt(t.trim());do r=Zhn(r).replace(su.htmlCtrlEntityRegex,"").replace(su.ctrlCharactersRegex,"").replace(su.whitespaceEscapeCharsRegex,"").trim(),r=RCt(r),e=r.match(su.ctrlCharactersRegex)||r.match(su.htmlEntitiesRegex)||r.match(su.htmlCtrlEntityRegex)||r.match(su.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return su.BLANK_URL;if(Khn(n))return n;var i=n.trimStart(),a=i.match(su.urlSchemeRegex);if(!a)return n;var o=a[0].toLowerCase().trim();if(su.invalidProtocolRegex.test(o))return su.BLANK_URL;var s=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){if(!Jhn(s))return su.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}function tfn(t){return Array.isArray(t)}function Ixe(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 rfn(){}function DCt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function J7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const LCt="[object RegExp]",Pxe="[object String]",Nxe="[object Number]",Bxe="[object Boolean]",$xe="[object Arguments]",MCt="[object Symbol]",ICt="[object Date]",PCt="[object Map]",NCt="[object Set]",BCt="[object Array]",$Ct="[object ArrayBuffer]",FCt="[object Object]",zCt="[object DataView]",UCt="[object Uint8Array]",VCt="[object Uint8ClampedArray]",GCt="[object Uint16Array]",QCt="[object Uint32Array]",HCt="[object Int8Array]",WCt="[object Int16Array]",YCt="[object Int32Array]",qCt="[object Float32Array]",jCt="[object Float64Array]",XCt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function Fxe(t){return typeof XCt.Buffer<"u"&&XCt.Buffer.isBuffer(t)}function nfn(t){return Number.isSafeInteger(t)&&t>=0}function KCt(t){return t!=null&&typeof t!="function"&&nfn(t.length)}function ifn(t){return t==="__proto__"}function UX(t){return t==null||typeof t!="object"&&typeof t!="function"}function zxe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function afn(t,e){return _5(t,void 0,t,new Map,e)}function _5(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(UX(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(J7(t)==="[object Object]"&&typeof t.constructor!="function"){const o={};return a.set(t,o),Rg(o,t,i,a),o}switch(Object.prototype.toString.call(t)){case Nxe:case Pxe:case Bxe:{const o=new t.constructor(t==null?void 0:t.valueOf());return Rg(o,t),o}case $xe:{const o={};return Rg(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}}})}function ZCt(t){return sfn(t)}function Uxe(t){return t!==null&&typeof t=="object"&&J7(t)==="[object Arguments]"}function Vxe(t){return typeof t=="object"&&t!==null}function lfn(t){return Vxe(t)&&KCt(t)}function e$(t){return zxe(t)}function cfn(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function t$(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(t$.Cache||Map),r}t$.Cache=Map;function ufn(t){if(UX(t))return t;const e=J7(t);if(!dfn(t))return{};if(tfn(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(e$(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]"?ffn(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 pfn(r,t),Gxe(r,t),hfn(r,t),r}function dfn(t){switch(J7(t)){case $xe:case BCt:case $Ct:case zCt:case Bxe:case ICt:case qCt:case jCt:case HCt:case WCt:case YCt:case PCt:case Nxe:case FCt:case LCt:case NCt:case Pxe:case MCt:case UCt:case VCt:case GCt:case QCt:return!0;default:return!1}}function Gxe(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function hfn(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function pfn(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function gfn(t){if(UX(t))return t;if(Array.isArray(t)||zxe(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 mfn(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 ekt="​",yfn={curveBasis:W7,curveBasisClosed:Pdn,curveBasisOpen:Ndn,curveBumpX:ASt,curveBumpY:SSt,curveBundle:Bdn,curveCardinalClosed:$dn,curveCardinalOpen:Fdn,curveCardinal:OSt,curveCatmullRomClosed:zdn,curveCatmullRomOpen:Udn,curveCatmullRom:_St,curveLinear:Q7,curveLinearClosed:Vdn,curveMonotoneX:$St,curveMonotoneY:FSt,curveNatural:VSt,curveStep:GSt,curveStepAfter:HSt,curveStepBefore:QSt},bfn=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,xfn=k(function(t,e){const r=tkt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const o=r.map(s=>s.args);Nj(o),n=Fs(n,[...o])}else n=r.args;if(!n)return;let i=abe(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),tkt=k(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${bfn.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=A7.exec(t))!==null;)if(a.index===A7.lastIndex&&A7.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"),wfn=k(function(t){return t.replace(A7,"")},"removeDirectives"),Afn=k(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function Qxe(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return yfn[r]??e}k(Qxe,"interpolateToCurve");function rkt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?iC(r):r}k(rkt,"formatUrl");var Sfn=k((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let o=0;o{r+=Hxe(i,e),e=i});const n=r/2;return Wxe(t,n)}k(nkt,"traverseEdge");function ikt(t){return t.length===1?t[0]:nkt(t)}k(ikt,"calcLabelPosition");var akt=k((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Wxe=k((t,e)=>{let r,n=e;for(const i of t){if(r){const a=Hxe(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:akt((1-o)*r.x+o*i.x,5),y:akt((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Tfn=k((t,e,r)=>{ye.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=Wxe(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 okt(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=Wxe(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}k(okt,"calcTerminalLabelPosition");function Yxe(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}}k(Yxe,"getStylesFromArray");var skt=0,lkt=k(()=>(skt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+skt),"generateId");function ckt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ickt(t.length),"random"),Cfn=k(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"),kfn=k(function(t,e){const r=e.text.replace(Xt.lineBreakRegex," "),[,n]=s1(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"),r$=t$((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=Vu(`${o} `,r),u=Vu(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Ofn(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}`),Ofn=t$((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(Vu(u,n)>=e){const h=l+1,f=i.length===h,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 GX(t,e){return QX(t,e).height}k(GX,"calculateTextHeight");function Vu(t,e){return QX(t,e).width}k(Vu,"calculateTextWidth");var QX=t$((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=s1(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 d=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=Cfn();v.text=m||ekt;const y=kfn(d,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)}d.remove();const h=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[h]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Efn=(sL=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},k(sL,"InitIDGenerator"),sL),HX,_fn=k(function(t){return HX=HX||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),HX.innerHTML=t,unescape(HX.textContent)},"entityDecode");function qxe(t){return"str"in t}k(qxe,"isDetailedError");var Rfn=k((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"),s1=k(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 vfn({},t,e)}k(uo,"cleanAndMerge");var un={assignWithDepth:Fs,wrapLabel:r$,calculateTextHeight:GX,calculateTextWidth:Vu,calculateTextDimensions:QX,cleanAndMerge:uo,detectInit:xfn,detectDirective:tkt,isSubstringInArray:Afn,interpolateToCurve:Qxe,calcLabelPosition:ikt,calcCardinalityPosition:Tfn,calcTerminalLabelPosition:okt,formatUrl:rkt,getStylesFromArray:Yxe,generateId:lkt,random:ukt,runFunc:Sfn,entityDecode:_fn,insertTitle:Rfn,isLabelCoordinateInPath:dkt,parseFontSize:s1,InitIDGenerator:Efn},Dfn=k(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"),l1=k(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),R5=k((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function zl(t){return t??null}k(zl,"handleUndefinedAttr");function dkt(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())}k(dkt,"isLabelCoordinateInPath");var D5=k(({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 jxe(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]=s1(s),d=u*l+"px";i.style.minWidth=d,i.style.maxWidth=d}else i.style.width="100%";a(i)}k(o,"setupImage"),setTimeout(()=>{i.complete&&o()}),i.addEventListener("error",o),i.addEventListener("load",o)})))}k(jxe,"configureLabelImages");const Lfn=Object.freeze({left:0,top:0,width:16,height:16}),WX=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hkt=Object.freeze({...Lfn,...WX}),Mfn=Object.freeze({...hkt,body:"",hidden:!1}),Ifn=Object.freeze({width:null,height:null}),Pfn=Object.freeze({...Ifn,...WX}),Nfn=(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 Xxe(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 Xxe(s)?s:null}if(r&&n===""){const s={provider:n,prefix:"",name:a};return Xxe(s,r)?s:null}return null},Xxe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Bfn(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 fkt(t,e){const r=Bfn(t,e);for(const n in Mfn)n in WX?n in t&&!(n in r)&&(r[n]=WX[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function $fn(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 pkt(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function o(s){a=fkt(n[s]||i[s],a)}return o(e),r.forEach(o),fkt(t,a)}function Ffn(t,e){if(t.icons[e])return pkt(t,e,[]);const r=$fn(t,[e])[e];return r?pkt(t,e,r):null}const zfn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ufn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function gkt(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(zfn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),o=Ufn.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 Vfn(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 Gfn(t,e){return t?""+t+""+e:e}function Qfn(t,e,r){const n=Vfn(t);return Gfn(n.defs,e+n.content+r)}const Hfn=t=>t==="unset"||t==="undefined"||t==="none";function Wfn(t,e){const r={...hkt,...t},n={...Pfn,...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=Qfn(a,'',""))});const o=n.width,s=n.height,l=i.width,u=i.height;let d,h;o===null?(h=s===null?"1em":s==="auto"?u:s,d=gkt(h,l/u)):(d=o==="auto"?l:o,h=s===null?gkt(d,u/l):s==="auto"?u:s);const f={},p=(m,v)=>{Hfn(v)||(f[m]=v.toString())};p("width",d),p("height",h);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const Yfn=/\sid="(\S+)"/g,mkt=new Map;function qfn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=mkt.get(t)||0;return mkt.set(t,e+1),e?`${t}${e}`:t}function jfn(t){const e=[];let r;for(;r=Yfn.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=qfn(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 Xfn(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 vkt={body:'?',height:80,width:80},Kxe=new Map,ykt=new Map,Zxe=k(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)ykt.set(e.name,e.loader);else if("icons"in e)Kxe.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"),bkt=k(async(t,e)=>{const r=Nfn(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=Kxe.get(n);if(!i){const o=ykt.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},Kxe.set(n,i)}catch(s){throw ye.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Ffn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),Kfn=k(async t=>{try{return await bkt(t),!0}catch{return!1}},"isIconAvailable"),c1=k(async(t,e,r)=>{let n;try{n=await bkt(t,e==null?void 0:e.fallbackPrefix)}catch(o){ye.error(o),n=vkt}const i=Wfn(n,e),a=Xfn(jfn(i.body),{...i.attributes,...r});return li(a,Dr())},"getIconSVG");function Jxe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var aC=Jxe();function xkt(t){aC=t}var n$={exec:()=>null};function Gi(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(Gu.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var Zfn=(()=>{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")},Jfn=/^(?:[ \t]*(?:\n|$))+/,epn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tpn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,i$=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rpn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ewe=/(?:[*+-]|\d{1,9}[.)])/,wkt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Akt=Gi(wkt).replace(/bull/g,ewe).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(),npn=Gi(wkt).replace(/bull/g,ewe).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(),twe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ipn=/^[^\n]+/,rwe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,apn=Gi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rwe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),opn=Gi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ewe).getRegex(),YX="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",nwe=/|$))/,spn=Gi("^ {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",nwe).replace("tag",YX).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Skt=Gi(twe).replace("hr",i$).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",YX).getRegex(),lpn=Gi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Skt).getRegex(),iwe={blockquote:lpn,code:epn,def:apn,fences:tpn,heading:rpn,hr:i$,html:spn,lheading:Akt,list:opn,newline:Jfn,paragraph:Skt,table:n$,text:ipn},Tkt=Gi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",i$).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",YX).getRegex(),cpn={...iwe,lheading:npn,table:Tkt,paragraph:Gi(twe).replace("hr",i$).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tkt).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",YX).getRegex()},upn={...iwe,html:Gi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nwe).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:n$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gi(twe).replace("hr",i$).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Akt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dpn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hpn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ckt=/^( {2,}|\\)\n(?!\s*$)/,fpn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Zfn?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ekt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ypn=Gi(Ekt,"u").replace(/punct/g,qX).getRegex(),bpn=Gi(Ekt,"u").replace(/punct/g,Okt).getRegex(),_kt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xpn=Gi(_kt,"gu").replace(/notPunctSpace/g,kkt).replace(/punctSpace/g,awe).replace(/punct/g,qX).getRegex(),wpn=Gi(_kt,"gu").replace(/notPunctSpace/g,mpn).replace(/punctSpace/g,gpn).replace(/punct/g,Okt).getRegex(),Apn=Gi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kkt).replace(/punctSpace/g,awe).replace(/punct/g,qX).getRegex(),Spn=Gi(/\\(punct)/,"gu").replace(/punct/g,qX).getRegex(),Tpn=Gi(/^<(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(),Cpn=Gi(nwe).replace("(?:-->|$)","-->").getRegex(),kpn=Gi("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Cpn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jX=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Opn=Gi(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jX).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rkt=Gi(/^!?\[(label)\]\[(ref)\]/).replace("label",jX).replace("ref",rwe).getRegex(),Dkt=Gi(/^!?\[(ref)\](?:\[\])?/).replace("ref",rwe).getRegex(),Epn=Gi("reflink|nolink(?!\\()","g").replace("reflink",Rkt).replace("nolink",Dkt).getRegex(),Lkt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,owe={_backpedal:n$,anyPunctuation:Spn,autolink:Tpn,blockSkip:vpn,br:Ckt,code:hpn,del:n$,emStrongLDelim:ypn,emStrongRDelimAst:xpn,emStrongRDelimUnd:Apn,escape:dpn,link:Opn,nolink:Dkt,punctuation:ppn,reflink:Rkt,reflinkSearch:Epn,tag:kpn,text:fpn,url:n$},_pn={...owe,link:Gi(/^!?\[(label)\]\((.*?)\)/).replace("label",jX).getRegex(),reflink:Gi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jX).getRegex()},swe={...owe,emStrongRDelimAst:wpn,emStrongLDelim:bpn,url:Gi(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Lkt).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:Gi(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Mkt=t=>Dpn[t];function A0(t,e){if(e){if(Gu.escapeTest.test(t))return t.replace(Gu.escapeReplace,Mkt)}else if(Gu.escapeTestNoEncode.test(t))return t.replace(Gu.escapeReplaceNoEncode,Mkt);return t}function Ikt(t){try{t=encodeURI(t).replace(Gu.percentDecode,"%")}catch{return null}return t}function Pkt(t,e){var a;let r=t.replace(Gu.findPipe,(o,s,l)=>{let u=!1,d=s;for(;--d>=0&&l[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Gu.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 Nkt(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 Mpn(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 KX=class{constructor(e){Pr(this,"options");Pr(this,"rules");Pr(this,"lexer");this.options=e||aC}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:o$(n,` @@ -630,8 +630,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error `);return Bkt(n)}k($kt,"preprocessMarkdown");function Fkt(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"})))??[]})}k(Fkt,"nonMarkdownToLines");function zkt(t,e={}){const r=$kt(t,e),n=aa.lexer(r),i=[[]];let a=0;function o(s,l="normal"){s.type==="text"?s.text.split(` `).forEach((d,h)=>{h!==0&&(a++,i.push([])),d.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 k(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}k(zkt,"markdownToLines");function Ukt(t){return t?`

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

`:""}k(Ukt,"nonMarkdownToHTML");function Vkt(t,{markdownAutoWrap:e}={}){const r=aa.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 k(n,"output"),r.map(n).join("")}k(Vkt,"markdownToHTML");function Gkt(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}k(Gkt,"splitTextToChars");function Qkt(t,e){const r=Gkt(e.content);return cwe(t,[],r,e.type)}k(Qkt,"splitWordToFitWidth");function cwe(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}])?cwe(t,o,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}k(cwe,"splitWordToFitWidthRecursion");function Hkt(t,e){if(t.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return JX(t,e)}k(Hkt,"splitLineToFitWidth");function JX(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 JX(t,e,r,o);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[s,l]=Qkt(e,a);r.push([s]),l.content&&t.unshift(l)}return JX(t,e,r)}k(JX,"splitLineToFitWidthRecursion");function uwe(t,e){e&&t.attr("style",e)}k(uwe,"applyStyle");var Wkt=16384;async function Ykt(t,e,r,n,i=!1,a=Dr()){const o=t.append("foreignObject");o.attr("width",`${Math.min(10*r,Wkt)}px`),o.attr("height",`${Math.min(10*r,Wkt)}px`);const s=o.append("xhtml:div"),l=ps(e.label)?await zj(e.label.replace(Xt.lineBreakRegex,` -`),a):li(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",d=s.append("span");d.html(l),uwe(d,e.labelStyle),d.attr("class",`${u} ${n}`),uwe(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 h=s.node().getBoundingClientRect();return h.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),h=s.node().getBoundingClientRect()),o.node()}k(Ykt,"addHtmlSpan");function eK(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}k(eK,"createTspan");function qkt(t,e,r){const n=t.append("text"),i=eK(n,1,e);tK(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}k(qkt,"computeWidthOfText");function jkt(t,e,r){var o;const n=t.append("text"),i=eK(n,1,e);tK(i,[{content:r,type:"normal"}]);const a=(o=i.node())==null?void 0:o.getBoundingClientRect();return a&&n.remove(),a}k(jkt,"computeDimensionOfText");function Xkt(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 d of r){const h=k(p=>qkt(o,1.1,p)<=t,"checkWidth"),f=h(d)?[d]:Hkt(d,h);for(const p of f){const g=eK(l,u,1.1,i);tK(g,p),u++}}if(n){const d=l.node().getBBox(),h=2;return s.attr("x",d.x-h).attr("y",d.y-h).attr("width",d.width+2*h).attr("height",d.height+2*h),o.node()}else return l.node()}k(Xkt,"createFormattedText");function dwe(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}})}k(dwe,"decodeHTMLEntities");function tK(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(dwe(r.content)):i.text(" "+dwe(r.content))})}k(tK,"updateTextContentAndStyles");async function Kkt(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await Kfn(s)?await c1(s,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}k(Kkt,"replaceIconSubstring");var lu=k(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}={},d)=>{if(ye.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){const h=o?Vkt(e,d):Ukt(e),f=await Kkt(l1(h),d),p=e.replace(/\\\\/g,"\\"),g={isNode:s,label:ps(e)?p:f,labelStyle:r.replace("fill:","color:")};return await Ykt(t,g,l,i,u,d)}else{const h=l1(e.replace(//g,"
")),f=o?zkt(h.replace("
","
"),d):Fkt(h),p=Xkt(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 hwe(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,d]=l;l[0]=(u-n)*o-(d-i)*s+n,l[1]=(u-n)*s+(d-i)*o+i}}}function Ppn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Npn(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)hwe(u,s,i);const l=function(u,d,h){const f=[];for(const b of u){const x=[...b];Ppn(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];d=Math.max(d,.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)),(h!==1||y%d==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+=h,m.forEach(b=>{b.edge.x=b.edge.x+h*b.edge.islope}),y++}return p}(o,a,n);if(i){for(const u of o)hwe(u,s,-i);(function(u,d,h){const f=[];u.forEach(p=>f.push(...p)),hwe(f,d,h)})(l,s,-i)}return l}function l$(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),Npn(t,i,n,a||1)}class fwe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=l$(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 rK(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 Bpn extends fwe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=l$(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,d]of i)rK([u,d])&&o.push([[u[0]-s,u[1]+l],[...d]],[[u[0]+s,u[1]-l],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class $pn extends fwe{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 Fpn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=l$(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=rK(s),u=l/i,d=Math.ceil(u)-1,h=l-d*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=rK(o),l=Math.floor(s/(n+i)),u=(s+i-l*(n+i))/2;let d=o[0],h=o[1];d[0]>h[0]&&(d=o[1],h=o[0]);const f=Math.atan((h[1]-d[1])/(h[0]-d[0]));for(let p=0;p{const o=rK(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 d=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let h=0;hd%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,d)=>d%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,d)=>d%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 eOt(t){const e=[];let r="",n=0,i=0,a=0,o=0,s=0,l=0;for(const{key:u,data:d}of t){switch(u){case"M":e.push({key:"M",data:[...d]}),[n,i]=d,[a,o]=d;break;case"C":e.push({key:"C",data:[...d]}),n=d[4],i=d[5],s=d[2],l=d[3];break;case"L":e.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],e.push({key:"L",data:[n,i]});break;case"V":i=d[0],e.push({key:"L",data:[n,i]});break;case"S":{let h=0,f=0;r==="C"||r==="S"?(h=n+(n-s),f=i+(i-l)):(h=n,f=i),e.push({key:"C",data:[h,f,...d]}),s=d[0],l=d[1],n=d[2],i=d[3];break}case"T":{const[h,f]=d;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=h+2*(p-h)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,v,y,b,h,f]}),s=p,l=g,n=h,i=f;break}case"Q":{const[h,f,p,g]=d,m=n+2*(h-n)/3,v=i+2*(f-i)/3,y=p+2*(h-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,v,y,b,p,g]}),s=h,l=f,n=p,i=g;break}case"A":{const h=Math.abs(d[0]),f=Math.abs(d[1]),p=d[2],g=d[3],m=d[4],v=d[5],y=d[6];h===0||f===0?(e.push({key:"C",data:[n,i,v,y,v,y]}),n=v,i=y):(n!==v||i!==y)&&(tOt(n,i,v,y,h,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 c$(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function tOt(t,e,r,n,i,a,o,s,l,u){const d=(h=o,Math.PI*h/180);var h;let f=[],p=0,g=0,m=0,v=0;if(u)[p,g,m,v]=u;else{[t,e]=c$(t,e,-d),[r,n]=c$(r,n,-d);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=tOt(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,O=[t,e],E=[t+T*x,e-C*b],_=[r+T*A,n-C*w],P=[r,n];if(E[0]=2*O[0]-E[0],E[1]=2*O[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=uOt(v,u,d,h,f,p,g,1,l);if(!l.disableMultiStroke){const b=uOt(v,u,d,h,f,p,g,1.5,l);y.push(...b)}return o&&(s?y.push(...Tw(u,d,u+h*Math.cos(p),d+f*Math.sin(p),l),...Tw(u,d,u+h*Math.cos(g),d+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,d]},{op:"lineTo",data:[u+h*Math.cos(p),d+f*Math.sin(p)]})),{type:"path",ops:y}}function oOt(t,e){const r=eOt(Jkt(mwe(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(...Tw(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[l,u,d,h,f,p]=s;n.push(...Wpn(l,u,d,h,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Tw(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function ywe(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 d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const h=d/2,f=.2+.2*lOt(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(h,i,u),y=()=>wn(d,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(d,i,u)),e+(b?0:wn(d,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 oK(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],d=t[e+2],h=t[e+3],f=sC(l,u,.5),p=sC(u,d,.5),g=sC(d,h,.5),m=sC(f,p,.5),v=sC(p,g,.5),y=sC(m,v,.5);xwe([l,f,m,y],0,r,i),xwe([y,v,g,h],0,r,i)}var a,o;return i}function qpn(t,e){return cK(t,0,t.length,e)}function cK(t,e,r,n,i){const a=i||[],o=t[e],s=t[r-1];let l=0,u=1;for(let d=e+1;dl&&(l=h,u=d)}return Math.sqrt(l)>n?(cK(t,e,u+1,n,a),cK(t,u,r,n,a)):(a.length||a.push(o),a.push(s)),a}function wwe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?cK(n,0,n.length,r):n}const Kh="none";class uK{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",[rOt(e,r,n,i,o)],o)}rectangle(e,r,n,i,a){const o=this._o(a),s=[],l=Hpn(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(ywe([u],o)):s.push(LR([u],o))}return o.stroke!==Kh&&s.push(l),this._d("rectangle",s,o)}ellipse(e,r,n,i,a){const o=this._o(a),s=[],l=iOt(n,i,o),u=vwe(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const d=vwe(e,r,o,l).opset;d.type="fillPath",s.push(d)}else s.push(LR([u.estimatedPoints],o));return o.stroke!==Kh&&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",[iK(e,!1,n)],n)}arc(e,r,n,i,a,o,s=!1,l){const u=this._o(l),d=[],h=aOt(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=aOt(e,r,n,i,a,o,!0,!1,f);p.type="fillPath",d.push(p)}else d.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 O=(C-T)/b.curveStepCount,E=[];for(let _=T;_<=C;_+=O)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]),LR([E],b)}(e,r,n,i,a,o,u));return u.stroke!==Kh&&d.push(h),this._d("arc",d,u)}curve(e,r){const n=this._o(r),i=[],a=nOt(e,n);if(n.fill&&n.fill!==Kh)if(n.fillStyle==="solid"){const o=nOt(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(...wwe(dOt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):o.push(...wwe(dOt(u),10,(1+n.roughness)/2))}o.length&&i.push(LR([o],n))}return n.stroke!==Kh&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=iK(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(ywe([e],n)):i.push(LR([e],n))),n.stroke!==Kh&&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!==Kh,o=n.stroke!==Kh,s=!!(n.simplification&&n.simplification<1),l=function(d,h,f){const p=eOt(Jkt(mwe(d))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...wwe(y,h)),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=qpn(A,f);S.length&&w.push(S)}return w}(e,1,s?4-4*(n.simplification||1):(1+n.roughness)/2),u=oOt(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const d=oOt(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(ywe(l,n));else i.push(LR(l,n));return o&&(s?l.forEach(d=>{i.push(iK(d,!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:Kh};break;case"fillPath":o={d:this.opsToPath(a),stroke:Kh,strokeWidth:0,fill:n.fill||Kh};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||Kh,strokeWidth:n,fill:Kh}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class jpn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new uK(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 dK="http://www.w3.org/2000/svg";class Xpn{constructor(e,r){this.svg=e,this.gen=new uK(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(dK,"g"),o=e.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=i.createElementNS(dK,"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(dK,"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(dK,"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 jpn(t,e),svg:(t,e)=>new Xpn(t,e),generator:t=>new uK(t),newSeed:()=>uK.newSeed()},gn=k(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||m0((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",zl(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",d=await lu(o,li(l1(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 h=d.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=d.children[0],v=_t(d);await jxe(m,s),h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}return i?o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):o.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:f,label:o}},"labelHelper"),Awe=k(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??ia(Ye()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await lu(i,li(l1(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(ia(Ye())){const d=a.children[0],h=_t(a);o=d.getBoundingClientRect(),h.attr("width",o.width),h.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=k((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),an=k((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function _i(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}k(_i,"createPathFromPoints");function Cw(t,e,r,n,i,a){const o=[],l=r-t,u=n-e,d=l/a,h=2*Math.PI/d,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,v=f+i*Math.sin(h*(m-t));o.push({x:m,y:v})}return o}k(Cw,"generateFullSineWavePoints");function d$(t,e,r,n,i,a){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hl.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=k((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,d])=>{d&&r.setAttribute(u,d)})}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,d])=>{d&&r.setAttribute(u,d)})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}k(Swe,"mergePaths");var Kpn=k((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"),lC=Kpn,Zpn=k(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=ia(o);return await lu(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),kw=Zpn,Ow=k((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"),Jpn=k(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,s=o,{labelStyles:l,nodeStyles:u,borderStyles:d,backgroundStyles:h}=kr(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=m0(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await lu(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,O=g?4:0,E=y.height+2*O;let _,P;if(g){const L=Math.max(E,y.height+2*O),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",d.join(";")),_.select("path").attr("style",h.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 G=B.rectangle(I,D,x,M,z);P=f.insert(()=>G,":first-child"),_.select("path:nth-child(2)").attr("style",d.join(";")),_.select("path").attr("style",h.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 lC(e,L)},{cluster:f,labelBBox:y}},"swimlane"),hOt=k(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:d}=kr(e),h=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ia(r),p=h.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await lu(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await kw(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(ia(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(h),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),O=T.path(Ow(b,x,v,y,0),C);w=h.insert(()=>(ye.debug("Rough node insert CXC",O),O),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=h.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}=DR(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 lC(e,T)},{cluster:h,labelBBox:m}},"rect"),egn=k((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 lC(e,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),tgn=k(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),d=u.insert("g",":first-child"),h=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await kw(h,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(ia(r)){const O=p.children[0],E=_t(p);g=O.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 O=e.cssClasses.includes("statediagram-cluster-alt"),E=Er.svg(u),_=e.rx||e.ry?E.path(Ow(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:O?a:o,fillStyle:O?"hachure":"solid",stroke:l,seed:i});T=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}else T=d.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);h.attr("transform",`translate(${e.x-g.width/2}, ${A+1-(ia(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(O){return lC(e,O)},{cluster:u,labelBBox:g}},"roundedWithTitle"),rgn=k(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:d}=kr(e),h=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ia(r),p=h.insert("g").attr("class","cluster-label "),g=await lu(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(ia(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(h),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),O=T.path(Ow(b,x,v,y,e.rx),C);w=h.insert(()=>(ye.debug("Rough node insert CXC",O),O),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=h.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}=DR(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 lC(e,T)},{cluster:h,labelBBox:m}},"kanbanSection"),ngn=k((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 d=e.height+l,h=e.x-u/2,f=e.y-d/2;e.width=u;let p;if(e.look==="handDrawn"){const v=Er.svg(o).rectangle(h,f,u,d,{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",h).attr("y",f).attr("width",u).attr("height",d).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 lC(e,m)},{cluster:o,labelBBox:{}}},"divider"),ign=hOt,agn={rect:hOt,squareRect:ign,roundedWithTitle:tgn,noteGroup:egn,divider:ngn,kanbanSection:rgn,swimlane:Jpn},fOt=new Map,hK=k(async(t,e)=>{const r=e.shape||"rect",n=await agn[r](t,e);return fOt.set(e.id,n),n},"insertCluster"),pOt=k(()=>{fOt=new Map},"clear");function gOt(t,e){return t.intersect(e)}k(gOt,"intersectNode");var ogn=gOt;function mOt(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}k(Twe,"sameSign");var lgn=bOt;function xOt(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(d){o=Math.min(o,d.x),s=Math.min(s,d.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 d=0;d1&&a.sort(function(d,h){let f=d.x-r.x,p=d.y-r.y,g=Math.sqrt(f*f+p*p),m=h.x-r.x,v=h.y-r.y,y=Math.sqrt(m*m+v*v);return gd,":first-child");return h.attr("class","anchor").attr("style",zl(s)),Br(e,h),e.intersect=function(f){return ye.info("Circle intersect",e,o,f),Sr.circle(e,o,f)},a}k(wOt,"anchor");function Cwe(t,e,r,n,i,a,o){const l=(t+r)/2,u=(e+n)/2,d=Math.atan2(n-e,r-t),h=(r-t)/2,f=(n-e)/2,p=h/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(d)*(o?-1:1),b=u-v*i*Math.cos(d)*(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,O=x+C*A,E=y+i*Math.cos(O),_=b+a*Math.sin(O);S.push({x:E,y:_})}return S}k(Cwe,"generateArcPoints");function AOt(t,e,r){const[n,i]=[e,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}k(AOt,"calculateArcSagitta");async function SOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=k(O=>O+o,"calcTotalHeight"),l=k(O=>{const E=O/2;return[E/(2.5+O/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:d}=await gn(t,e,an(e)),h=s(e!=null&&e.height?e==null?void 0:e.height:d.height),[f,p]=l(h),g=AOt(h,f,p),v=(e!=null&&e.width?e==null?void 0:e.width:d.width)+a*2+g-g,y=h,{cssStyles:b}=e,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...Cwe(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},...Cwe(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=_i(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(O){return Sr.polygon(e,x,O)},u}k(SOt,"bowTieRect");function u1(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+")")}k(u1,"insertPolygonShape");var fK=12;async function TOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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+fK),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),h=0,f=u,p=-d,g=0,m=[{x:h+fK,y:p},{x:f,y:p},{x:f,y:g},{x:h,y:g},{x:h,y:p+fK},{x:h+fK,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(s),x=_r(e,{}),w=_i(m),A=b.path(w,x);v=s.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`),y&&v.attr("style",y)}else v=u1(s,u,d,m);return n&&v.attr("style",n),Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},s}k(TOt,"card");function COt(t,e){const{nodeStyles:r}=kr(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=_i(o),d=s.path(u,l),h=n.insert(()=>d,":first-child");return i&&e.look!=="handDrawn"&&h.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&h.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Sr.polygon(e,o,f)},n}k(COt,"choice");async function kwe(t,e,r){const{labelStyles:n,nodeStyles:i}=kr(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,d=e.look==="neo"?o.width/2+l*2:o.width/2+u;let h;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(a),g=_r(e,{}),m=p.circle(0,0,d*2,g);h=a.insert(()=>m,":first-child"),h.attr("class","basic label-container").attr("style",zl(f))}else h=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return Br(e,h),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,d,p),Sr.circle(e,d,p)},a}k(kwe,"circle");function kOt(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}`}k(kOt,"createLine");function OOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=kOt(a),h=s.path(d,l),f=i.insert(()=>u,":first-child");return f.insert(()=>h),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}k(OOt,"crossedCircle");function d1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hA,":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(${h}, 0)`),o.attr("transform",`translate(${-u/2+h-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}k(EOt,"curlyBraceLeft");function h1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hA,":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(${-h}, 0)`),o.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}k(_Ot,"curlyBraceRight");function xc(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hO,":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(${h-h/4}, 0)`),o.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,m,_)},i}k(ROt,"curlyBraces");async function DOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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:d}=await gn(t,e,an(e)),h=Math.max(s,(d.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,d.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=h,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},...d$(-x,-b/2,p,50,270,90)],S=_i(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(${-h/2}, ${-f/2})`),Br(e,C),e.intersect=function(O){return Sr.polygon(e,A,O)},u}k(DOt,"curvedTrapezoid");var ugn=k((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"),dgn=k((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"),hgn=k((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),LOt=8,MOt=8;async function IOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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=ugn(0,0,d,p,h,f);g=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",zl(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/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(h!=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/(h*h));x>0&&(x=Math.sqrt(x)),x=f-x,v.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},s}k(IOt,"cylinder");async function MR(t,e,r){const{labelStyles:n,nodeStyles:i}=kr(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,d=-l/2;let h,{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(Ow(u,d,s,l,f||0),v):m.rectangle(u,d,s,l,v);h=a.insert(()=>y,":first-child"),h.attr("class","basic label-container").attr("style",zl(g))}else h=a.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",zl(f)).attr("ry",zl(p)).attr("x",u).attr("y",d).attr("width",s).attr("height",l);return Br(e,h),e.calcIntersect=function(m,v){return Sr.rect(m,v)},e.intersect=function(m){return Sr.rect(e,m)},a}k(MR,"drawRect");async function POt(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 MR(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 d=u.select(".basic.label-container"),h=(Number(d.attr("width"))||o)??0,f=(Number(d.attr("height"))||s)??0;return h>0&&f>0&&d.attr("stroke-dasharray",`${h} ${f}`),u}k(POt,"datastore");async function NOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=s.height+a,h=d*.2,f=-u/2,p=-d/2-h/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+h},{x:-f,y:p+h},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+h}],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+h+(e.padding??0)/2-(s.y-(s.top??0))})`),Br(e,x),e.intersect=function(w){return Sr.rect(e,w)},o}k(NOt,"dividedRectangle");async function BOt(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=kr(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),d=u-i;let h;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,d*2,y);h=s.insert("g",":first-child"),h.attr("class",zl(e.cssClasses)).attr("style",zl(f)),(p=h.node())==null||p.appendChild(b),(g=h.node())==null||g.appendChild(x)}else{h=s.insert("g",":first-child");const m=h.insert("circle",":first-child"),v=h.insert("circle");h.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",d).attr("cx",0).attr("cy",0)}return Br(e,h),e.intersect=function(m){return ye.info("DoubleCircle intersect",e,u,m),Sr.circle(e,u,m)},s}k(BOt,"doublecircle");function $Ot(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=kr(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,d=_r(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(d.roughness=0);const h=l.circle(0,0,o*2,d),f=a.insert(()=>h,":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}k($Ot,"filledCircle");var FOt=10,zOt=10;async function UOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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(${-d/2}, ${d/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=d,Br(e,b),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/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}k(UOt,"flippedTriangle");function VOt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=kr(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 d=-1*l/2,h=-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(d,h,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}k(VOt,"forkJoin");async function GOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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}k(GOt,"halfRoundedRectangle");var fgn=k((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}=kr(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:d,bbox:h}=await gn(t,e,an(e)),f=(e!=null&&e.height?e==null?void 0:e.height:h.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:h.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(d),x=_r(e,{}),w=fgn(0,0,g,f,p),A=b.path(w,x);v=d.insert(()=>A,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),y&&v.attr("style",y)}else v=u1(d,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)},d}k(QOt,"hexagon");async function HOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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 d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],h=_i(d),f=l.path(h,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:d}),Sr.polygon(e,d,g)},i}k(HOt,"hourglass");async function WOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,label:h}=await gn(t,e,"icon-shape default"),f=e.pos==="t",p=s,g=s,{nodeBorder:m}=r,{stylesMap:v}=ER(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,d.width),C=p+d.height+x,O=w.rectangle(-T/2,-C/2,T,C,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>S,":first-child"),_=u.insert(()=>O);if(e.icon){const P=u.append("g");P.html(`${await c1(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?d.height/2+x/2-D/2-I:-d.height/2-x/2-D/2-I})`),P.attr("style",`color: ${v.get("stroke")??m};`)}return h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${f?-C/2:C/2-d.height})`),E.attr("transform",`translate(0,${f?d.height/2+x/2:-d.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-d.width/2,y:R-D/2},{x:L+d.width/2,y:R-D/2},{x:L+d.width/2,y:R-D/2+d.height+x},{x:L+g/2,y:R-D/2+d.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+d.height+x},{x:L-d.width/2,y:R-D/2+d.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+d.width/2,y:R-D/2+p},{x:L+d.width/2/2,y:R+D/2},{x:L-d.width/2,y:R+D/2},{x:L-d.width/2,y:R-D/2+p},{x:L-g/2,y:R-D/2+p}],Sr.polygon(e,M,P)},u}k(WOt,"icon");async function YOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,label:h}=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}=ER(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 c1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const S=A.node().getBBox(),T=S.width,C=S.height,O=S.x,E=S.y,_=Math.max(T,C)*Math.SQRT2+f*2,P=b.circle(0,0,_,x),L=Math.max(_,d.width),R=_+d.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-O},${g?d.height/2+p/2-C/2-E:-d.height/2-p/2-C/2-E})`),A.attr("style",`color: ${y.get("stroke")??m};`),h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-R/2:R/2-d.height})`),M.attr("transform",`translate(0,${g?d.height/2+p/2:-d.height/2-p/2})`),Br(e,I),e.intersect=function(N){return ye.info("iconSquare intersect",e,N),Sr.rect(e,N)},u}k(YOt,"iconCircle");async function qOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,halfPadding:h,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+h*2,m=s+h*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=ER(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 O=S.path(Ow(x,w,m,g,5),T),E=Math.max(m,d.width),_=g+d.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>O,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await c1(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?d.height/2+A/2-N/2-B:-d.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-_/2:_/2-d.height})`),L.attr("transform",`translate(0,${p?d.height/2+A/2:-d.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-d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2+d.height+A},{x:M+m/2,y:I-N/2+d.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+d.height+A},{x:M-d.width/2,y:I-N/2+d.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+d.width/2,y:I-N/2+g},{x:M+d.width/2/2,y:I+N/2},{x:M-d.width/2,y:I+N/2},{x:M-d.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}k(qOt,"iconRounded");async function jOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,halfPadding:h,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+h*2,m=s+h*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=ER(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 O=S.path(Ow(x,w,m,g,.1),T),E=Math.max(m,d.width),_=g+d.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>O,":first-child"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await c1(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?d.height/2+A/2-N/2-B:-d.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-_/2:_/2-d.height})`),L.attr("transform",`translate(0,${p?d.height/2+A/2:-d.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-d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2+d.height+A},{x:M+m/2,y:I-N/2+d.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+d.height+A},{x:M-d.width/2,y:I-N/2+d.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+d.width/2,y:I-N/2+g},{x:M+d.width/2/2,y:I+N/2},{x:M-d.width/2,y:I+N/2},{x:M-d.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}k(jOt,"iconSquare");async function XOt(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}=kr(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,d=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,s??0);const{shapeSvg:h,bbox:f,label:p}=await gn(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,v=-d/2,y=e.label?8:0,b=Er.svg(h),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=b.rectangle(m,v,u,d,x),A=Math.max(u,f.width),S=d+f.height+y,T=b.rectangle(-A/2,-S/2,A,S,{...x,fill:"none",stroke:"none"}),C=h.insert(()=>w,":first-child"),O=h.insert(()=>T);if(e.img){const E=h.append("image");E.attr("href",e.img),E.attr("width",u),E.attr("height",d),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-u/2},${g?S/2-d:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-d/2-f.height/2-y/2:d/2-f.height/2+y/2})`),C.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Br(e,O),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+d},{x:_+f.width/2,y:P-L/2+d},{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+d},{x:_-u/2,y:P-L/2+d}],Sr.polygon(e,R,E)},h}k(XOt,"imageSquare");async function KOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),h=[{x:0,y:0},{x:u,y:0},{x:u+3*d/6,y:-d},{x:-3*d/6,y:-d}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(s),m=_r(e,{}),v=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`),p&&f.attr("style",p)}else f=u1(s,u,d,h);return n&&f.attr("style",n),e.width=u,e.height=d,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(KOt,"inv_trapezoid");async function ZOt(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}k(ZOt,"labelRect");async function JOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=((e==null?void 0:e.width)??l.width)+o,h=[{x:0,y:0},{x:d+3*u/6,y:0},{x:d,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=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=u1(s,d,u,h);return n&&f.attr("style",n),e.width=d,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(JOt,"lean_left");async function eEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=((e==null?void 0:e.width)??l.width)+o,h=[{x:-3*u/6,y:0},{x:d,y:0},{x:d+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=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=u1(s,d,u,h);return n&&f.attr("style",n),e.width=d,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(eEt,"lean_right");function tEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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}],d=Er.svg(i),h=_r(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const f=_i(u),p=d.path(f,h),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}k(tEt,"lightningBolt");var pgn=k((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"),ggn=k((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"),mgn=k((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),rEt=10,nEt=10;async function iEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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=pgn(0,0,d,p,h,f,g);m=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",zl(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-d/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(h!=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/(h*h));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},s}k(iEt,"linedCylinder");async function aEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(o??0)*2,f=e.look==="neo"?h/4:h/8,p=h+f,{cssStyles:g}=e,m=Er.svg(s),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:-d/2-d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:p/2},...Cw(-d/2-d/2*.1,p/2,d/2+d/2*.1,p/2,f,.8),{x:d/2+d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:-p/2},{x:-d/2,y:-p/2},{x:-d/2,y:p/2*1.1},{x:-d/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(${-d/2+(e.padding??0)+d/2*.1/2-(l.x-(l.left??0))},${-h/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}k(aEt,"linedWaveEdgedRect");async function oEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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:d}=await gn(t,e,an(e)),h=(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=h-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=_i(w);let T=b.path(S,x);const C=_i(A);let O=b.path(C,x);e.look!=="handDrawn"&&(T=Swe(T),O=Swe(O));const E=l.insert("g",":first-child");return E.insert(()=>T),E.insert(()=>O),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),d.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}k(oEt,"multiRect");async function sEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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 d=!0;(e.width||e.height)&&(d=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const h=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+(d?p/2:-p/2),m=-h/2,v=-g/2,y=10,{cssStyles:b}=e,x=Cw(m-y,v+g+y,m+h-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+h-y,y:w.y-y},{x:m+h,y:w.y-y},{x:m+h,y:w.y-2*y},{x:m+h+y,y:w.y-2*y},{x:m+h+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+h-y,y:v+y},{x:m+h-y,y:w.y-y},{x:m+h,y:w.y-y},{x:m+h,y:v},{x:m,y:v}],T=Er.svg(i),C=_r(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const O=_i(A),E=T.path(O,C),_=_i(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}k(sEt,"multiWaveEdgedRectangle");async function lEt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=kr(e);e.labelStyle=n,e.useHtmlLabels||ia(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),d=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),h=-u/2,f=-d/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(h,f,u,d,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}k(lEt,"note");var vgn=k((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 cEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let h;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(i),g=_r(e,{}),m=vgn(0,0,l),v=p.path(m,g);h=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&h.attr("style",f)}else h=u1(i,l,l,d),h.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&h.attr("style",n),Br(e,h),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}k(cEt,"question");async function uEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),f=-d/2,p=-h/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=_i(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}k(uEt,"rect_left_inv_arrow");async function dEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=await kw(s,u,e.labelStyle,!0,!0);let h={width:0,height:0};if(ia(Ye())){const C=d.children[0],O=_t(d);h=C.getBoundingClientRect(),O.attr("width",h.width),O.attr("height",h.height)}ye.info("Text 2",l);const f=l||[],p=d.getBBox(),g=await kw(s,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=_t(g);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height);const y=(e.padding||0)/2;_t(g).attr("transform","translate( "+(h.width>p.width?0:(p.width-h.width)/2)+", "+(p.height+y+5)+")"),_t(d).attr("transform","translate( "+(h.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",-h.width/2-y).attr("y",-h.height/2-y).attr("width",h.width+(e.padding||0)).attr("height",h.height+(e.padding||0)),T.attr("class","divider").attr("x1",-h.width/2-y).attr("x2",h.width/2+y).attr("y1",-h.height/2-y+p.height+y).attr("y2",-h.height/2-y+p.height+y);return Br(e,S),e.intersect=function(C){return Sr.rect(e,C)},a}k(dEt,"rectWithTitle");async function hEt(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 MR(t,e,i)}k(hEt,"roundedRect");var cC=8;async function fEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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"?cC:cC*2),d=((e==null?void 0:e.height)??s.height)+a*2,h=u-cC,f=d,p=cC-u/2,g=-d/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+h,y:g},{x:p+h,y:g+f},{x:p-cC,y:g+f},{x:p-cC,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",zl(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(${cC/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}k(fEt,"shadedProcess");async function pEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=(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*2)*1.5,f=d,p=h/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=_i(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}k(pEt,"slopedRect");async function gEt(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 MR(t,e,a)}k(gEt,"squareRect");async function mEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=l.width+u/4+(e.look==="neo"?a*2:a),h=u/2,{cssStyles:f}=e,p=Er.svg(s),g=_r(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-d/2+h,y:-u/2},{x:d/2-h,y:-u/2},...d$(-d/2+h,0,h,50,90,270),{x:d/2-h,y:u/2},...d$(d/2-h,0,h,50,270,450)],v=_i(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}k(mEt,"stadium");async function vEt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return MR(t,e,r)}k(vEt,"state");function yEt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=kr(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 d=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),h=Er.svg(d),f=_r(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=h.circle(0,0,e.width,{...f,stroke:o,strokeWidth:2}),g=s??l,m=(e.width??0)*5/14,v=h.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=d.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)},d}k(yEt,"stateEnd");function bEt(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 d=Er.svg(a).circle(0,0,e.width,qhn(n));o=a.insert(()=>d),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)??"",d=u?`${u}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${d})`)}return Br(e,o),e.intersect=function(u){return Sr.circle(e,(e.width??7)/2,u)},a}k(bEt,"stateStart");var IR=8;async function xEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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*IR+a,d=((e==null?void 0:e.height)??l.height)+o,h=u-2*IR,f=d,p=-u/2,g=-d/2,m=[{x:0,y:0},{x:h,y:0},{x:h,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:h+8,y:0},{x:h+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,h+16,f,y),x=v.line(p+IR,g,p+IR,g+f,y),w=v.line(p+IR+h,g,p+IR+h,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",zl(S)),Br(e,A)}else{const v=u1(s,h,f,m);n&&v.attr("style",n),Br(e,v)}return e.intersect=function(v){return Sr.polygon(e,m,v)},s}k(xEt,"subroutine");var Owe=.2;async function wEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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-Owe*(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,d=Owe*u,h=Owe*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+d-d,g=u,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(s),x=_r(e,{}),w=[{x:m-d/2,y:v},{x:m+p+d/2,y:v},{x:m+p+d/2,y:v+g},{x:m-d/2,y:v+g}],A=[{x:m+p-d/2,y:v+g},{x:m+p+d/2,y:v+g},{x:m+p+d/2,y:v+g-h}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=_i(w),T=b.path(S,x),C=_i(A),O=b.path(C,{...x,fillStyle:"solid"}),E=s.insert(()=>O,":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}k(wEt,"taggedRect");async function AEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=.2*s,h=.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},...Cw(-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-h*.4,x=[{x:y+s-d,y:(b+l)*1.3},{x:y+s,y:b+l-h},{x:y+s,y:(b+l)*.9},...Cw(y+s,(b+l)*1.25,y+s-d,(b+l)*1.3,-l*.02,.5)],w=_i(v),A=g.path(w,m),S=_i(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(O){return Sr.polygon(e,v,O)},i}k(AEt,"taggedWaveEdgedRectangle");async function SEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=i.insert("rect",":first-child");return d.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,d),e.intersect=function(h){return Sr.rect(e,h)},i}k(SEt,"text");var ygn=k((t,e,r,n,i,a)=>`M${t},${e} +`),a):li(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",d=s.append("span");d.html(l),uwe(d,e.labelStyle),d.attr("class",`${u} ${n}`),uwe(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 h=s.node().getBoundingClientRect();return h.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),h=s.node().getBoundingClientRect()),o.node()}k(Ykt,"addHtmlSpan");function eK(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}k(eK,"createTspan");function qkt(t,e,r){const n=t.append("text"),i=eK(n,1,e);tK(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}k(qkt,"computeWidthOfText");function jkt(t,e,r){var o;const n=t.append("text"),i=eK(n,1,e);tK(i,[{content:r,type:"normal"}]);const a=(o=i.node())==null?void 0:o.getBoundingClientRect();return a&&n.remove(),a}k(jkt,"computeDimensionOfText");function Xkt(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 d of r){const h=k(p=>qkt(o,1.1,p)<=t,"checkWidth"),f=h(d)?[d]:Hkt(d,h);for(const p of f){const g=eK(l,u,1.1,i);tK(g,p),u++}}if(n){const d=l.node().getBBox(),h=2;return s.attr("x",d.x-h).attr("y",d.y-h).attr("width",d.width+2*h).attr("height",d.height+2*h),o.node()}else return l.node()}k(Xkt,"createFormattedText");function dwe(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}})}k(dwe,"decodeHTMLEntities");function tK(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(dwe(r.content)):i.text(" "+dwe(r.content))})}k(tK,"updateTextContentAndStyles");async function Kkt(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await Kfn(s)?await c1(s,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}k(Kkt,"replaceIconSubstring");var lu=k(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}={},d)=>{if(ye.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){const h=o?Vkt(e,d):Ukt(e),f=await Kkt(l1(h),d),p=e.replace(/\\\\/g,"\\"),g={isNode:s,label:ps(e)?p:f,labelStyle:r.replace("fill:","color:")};return await Ykt(t,g,l,i,u,d)}else{const h=l1(e.replace(//g,"
")),f=o?zkt(h.replace("
","
"),d):Fkt(h),p=Xkt(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 hwe(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,d]=l;l[0]=(u-n)*o-(d-i)*s+n,l[1]=(u-n)*s+(d-i)*o+i}}}function Ppn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Npn(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)hwe(u,s,i);const l=function(u,d,h){const f=[];for(const b of u){const x=[...b];Ppn(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];d=Math.max(d,.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)),(h!==1||y%d==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+=h,m.forEach(b=>{b.edge.x=b.edge.x+h*b.edge.islope}),y++}return p}(o,a,n);if(i){for(const u of o)hwe(u,s,-i);(function(u,d,h){const f=[];u.forEach(p=>f.push(...p)),hwe(f,d,h)})(l,s,-i)}return l}function l$(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),Npn(t,i,n,a||1)}class fwe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=l$(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 rK(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 Bpn extends fwe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=l$(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,d]of i)rK([u,d])&&o.push([[u[0]-s,u[1]+l],[...d]],[[u[0]+s,u[1]-l],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class $pn extends fwe{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 Fpn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=l$(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=rK(s),u=l/i,d=Math.ceil(u)-1,h=l-d*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=rK(o),l=Math.floor(s/(n+i)),u=(s+i-l*(n+i))/2;let d=o[0],h=o[1];d[0]>h[0]&&(d=o[1],h=o[0]);const f=Math.atan((h[1]-d[1])/(h[0]-d[0]));for(let p=0;p{const o=rK(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 d=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let h=0;hd%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,d)=>d%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,d)=>d%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 eOt(t){const e=[];let r="",n=0,i=0,a=0,o=0,s=0,l=0;for(const{key:u,data:d}of t){switch(u){case"M":e.push({key:"M",data:[...d]}),[n,i]=d,[a,o]=d;break;case"C":e.push({key:"C",data:[...d]}),n=d[4],i=d[5],s=d[2],l=d[3];break;case"L":e.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],e.push({key:"L",data:[n,i]});break;case"V":i=d[0],e.push({key:"L",data:[n,i]});break;case"S":{let h=0,f=0;r==="C"||r==="S"?(h=n+(n-s),f=i+(i-l)):(h=n,f=i),e.push({key:"C",data:[h,f,...d]}),s=d[0],l=d[1],n=d[2],i=d[3];break}case"T":{const[h,f]=d;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=h+2*(p-h)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,v,y,b,h,f]}),s=p,l=g,n=h,i=f;break}case"Q":{const[h,f,p,g]=d,m=n+2*(h-n)/3,v=i+2*(f-i)/3,y=p+2*(h-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,v,y,b,p,g]}),s=h,l=f,n=p,i=g;break}case"A":{const h=Math.abs(d[0]),f=Math.abs(d[1]),p=d[2],g=d[3],m=d[4],v=d[5],y=d[6];h===0||f===0?(e.push({key:"C",data:[n,i,v,y,v,y]}),n=v,i=y):(n!==v||i!==y)&&(tOt(n,i,v,y,h,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 c$(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function tOt(t,e,r,n,i,a,o,s,l,u){const d=(h=o,Math.PI*h/180);var h;let f=[],p=0,g=0,m=0,v=0;if(u)[p,g,m,v]=u;else{[t,e]=c$(t,e,-d),[r,n]=c$(r,n,-d);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=tOt(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,O=[t,e],E=[t+T*x,e-C*b],_=[r+T*A,n-C*w],P=[r,n];if(E[0]=2*O[0]-E[0],E[1]=2*O[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=uOt(v,u,d,h,f,p,g,1,l);if(!l.disableMultiStroke){const b=uOt(v,u,d,h,f,p,g,1.5,l);y.push(...b)}return o&&(s?y.push(...Tw(u,d,u+h*Math.cos(p),d+f*Math.sin(p),l),...Tw(u,d,u+h*Math.cos(g),d+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,d]},{op:"lineTo",data:[u+h*Math.cos(p),d+f*Math.sin(p)]})),{type:"path",ops:y}}function oOt(t,e){const r=eOt(Jkt(mwe(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(...Tw(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[l,u,d,h,f,p]=s;n.push(...Wpn(l,u,d,h,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Tw(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function ywe(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 d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const h=d/2,f=.2+.2*lOt(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(h,i,u),y=()=>wn(d,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(d,i,u)),e+(b?0:wn(d,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 oK(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],d=t[e+2],h=t[e+3],f=sC(l,u,.5),p=sC(u,d,.5),g=sC(d,h,.5),m=sC(f,p,.5),v=sC(p,g,.5),y=sC(m,v,.5);xwe([l,f,m,y],0,r,i),xwe([y,v,g,h],0,r,i)}var a,o;return i}function qpn(t,e){return cK(t,0,t.length,e)}function cK(t,e,r,n,i){const a=i||[],o=t[e],s=t[r-1];let l=0,u=1;for(let d=e+1;dl&&(l=h,u=d)}return Math.sqrt(l)>n?(cK(t,e,u+1,n,a),cK(t,u,r,n,a)):(a.length||a.push(o),a.push(s)),a}function wwe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?cK(n,0,n.length,r):n}const Kh="none";class uK{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",[rOt(e,r,n,i,o)],o)}rectangle(e,r,n,i,a){const o=this._o(a),s=[],l=Hpn(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(ywe([u],o)):s.push(L5([u],o))}return o.stroke!==Kh&&s.push(l),this._d("rectangle",s,o)}ellipse(e,r,n,i,a){const o=this._o(a),s=[],l=iOt(n,i,o),u=vwe(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const d=vwe(e,r,o,l).opset;d.type="fillPath",s.push(d)}else s.push(L5([u.estimatedPoints],o));return o.stroke!==Kh&&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",[iK(e,!1,n)],n)}arc(e,r,n,i,a,o,s=!1,l){const u=this._o(l),d=[],h=aOt(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=aOt(e,r,n,i,a,o,!0,!1,f);p.type="fillPath",d.push(p)}else d.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 O=(C-T)/b.curveStepCount,E=[];for(let _=T;_<=C;_+=O)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]),L5([E],b)}(e,r,n,i,a,o,u));return u.stroke!==Kh&&d.push(h),this._d("arc",d,u)}curve(e,r){const n=this._o(r),i=[],a=nOt(e,n);if(n.fill&&n.fill!==Kh)if(n.fillStyle==="solid"){const o=nOt(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(...wwe(dOt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):o.push(...wwe(dOt(u),10,(1+n.roughness)/2))}o.length&&i.push(L5([o],n))}return n.stroke!==Kh&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=iK(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(ywe([e],n)):i.push(L5([e],n))),n.stroke!==Kh&&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!==Kh,o=n.stroke!==Kh,s=!!(n.simplification&&n.simplification<1),l=function(d,h,f){const p=eOt(Jkt(mwe(d))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...wwe(y,h)),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=qpn(A,f);S.length&&w.push(S)}return w}(e,1,s?4-4*(n.simplification||1):(1+n.roughness)/2),u=oOt(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const d=oOt(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(ywe(l,n));else i.push(L5(l,n));return o&&(s?l.forEach(d=>{i.push(iK(d,!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:Kh};break;case"fillPath":o={d:this.opsToPath(a),stroke:Kh,strokeWidth:0,fill:n.fill||Kh};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||Kh,strokeWidth:n,fill:Kh}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class jpn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new uK(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 dK="http://www.w3.org/2000/svg";class Xpn{constructor(e,r){this.svg=e,this.gen=new uK(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(dK,"g"),o=e.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=i.createElementNS(dK,"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(dK,"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(dK,"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 jpn(t,e),svg:(t,e)=>new Xpn(t,e),generator:t=>new uK(t),newSeed:()=>uK.newSeed()},gn=k(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||m0((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",zl(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",d=await lu(o,li(l1(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 h=d.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=d.children[0],v=_t(d);await jxe(m,s),h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}return i?o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):o.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:f,label:o}},"labelHelper"),Awe=k(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??ia(Ye()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await lu(i,li(l1(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(ia(Ye())){const d=a.children[0],h=_t(a);o=d.getBoundingClientRect(),h.attr("width",o.width),h.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=k((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),an=k((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function _i(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}k(_i,"createPathFromPoints");function Cw(t,e,r,n,i,a){const o=[],l=r-t,u=n-e,d=l/a,h=2*Math.PI/d,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,v=f+i*Math.sin(h*(m-t));o.push({x:m,y:v})}return o}k(Cw,"generateFullSineWavePoints");function d$(t,e,r,n,i,a){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hl.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=k((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,d])=>{d&&r.setAttribute(u,d)})}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,d])=>{d&&r.setAttribute(u,d)})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}k(Swe,"mergePaths");var Kpn=k((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"),lC=Kpn,Zpn=k(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=ia(o);return await lu(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),kw=Zpn,Ow=k((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"),Jpn=k(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,s=o,{labelStyles:l,nodeStyles:u,borderStyles:d,backgroundStyles:h}=kr(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=m0(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await lu(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,O=g?4:0,E=y.height+2*O;let _,P;if(g){const L=Math.max(E,y.height+2*O),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",d.join(";")),_.select("path").attr("style",h.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 G=B.rectangle(I,D,x,M,z);P=f.insert(()=>G,":first-child"),_.select("path:nth-child(2)").attr("style",d.join(";")),_.select("path").attr("style",h.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 lC(e,L)},{cluster:f,labelBBox:y}},"swimlane"),hOt=k(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:d}=kr(e),h=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ia(r),p=h.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await lu(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await kw(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(ia(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(h),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),O=T.path(Ow(b,x,v,y,0),C);w=h.insert(()=>(ye.debug("Rough node insert CXC",O),O),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=h.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}=D5(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 lC(e,T)},{cluster:h,labelBBox:m}},"rect"),egn=k((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 lC(e,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),tgn=k(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),d=u.insert("g",":first-child"),h=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await kw(h,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(ia(r)){const O=p.children[0],E=_t(p);g=O.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 O=e.cssClasses.includes("statediagram-cluster-alt"),E=Er.svg(u),_=e.rx||e.ry?E.path(Ow(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:O?a:o,fillStyle:O?"hachure":"solid",stroke:l,seed:i});T=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}else T=d.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);h.attr("transform",`translate(${e.x-g.width/2}, ${A+1-(ia(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(O){return lC(e,O)},{cluster:u,labelBBox:g}},"roundedWithTitle"),rgn=k(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:d}=kr(e),h=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ia(r),p=h.insert("g").attr("class","cluster-label "),g=await lu(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(ia(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(h),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),O=T.path(Ow(b,x,v,y,e.rx),C);w=h.insert(()=>(ye.debug("Rough node insert CXC",O),O),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=h.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}=D5(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 lC(e,T)},{cluster:h,labelBBox:m}},"kanbanSection"),ngn=k((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 d=e.height+l,h=e.x-u/2,f=e.y-d/2;e.width=u;let p;if(e.look==="handDrawn"){const v=Er.svg(o).rectangle(h,f,u,d,{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",h).attr("y",f).attr("width",u).attr("height",d).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 lC(e,m)},{cluster:o,labelBBox:{}}},"divider"),ign=hOt,agn={rect:hOt,squareRect:ign,roundedWithTitle:tgn,noteGroup:egn,divider:ngn,kanbanSection:rgn,swimlane:Jpn},fOt=new Map,hK=k(async(t,e)=>{const r=e.shape||"rect",n=await agn[r](t,e);return fOt.set(e.id,n),n},"insertCluster"),pOt=k(()=>{fOt=new Map},"clear");function gOt(t,e){return t.intersect(e)}k(gOt,"intersectNode");var ogn=gOt;function mOt(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}k(Twe,"sameSign");var lgn=bOt;function xOt(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(d){o=Math.min(o,d.x),s=Math.min(s,d.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 d=0;d1&&a.sort(function(d,h){let f=d.x-r.x,p=d.y-r.y,g=Math.sqrt(f*f+p*p),m=h.x-r.x,v=h.y-r.y,y=Math.sqrt(m*m+v*v);return gd,":first-child");return h.attr("class","anchor").attr("style",zl(s)),Br(e,h),e.intersect=function(f){return ye.info("Circle intersect",e,o,f),Sr.circle(e,o,f)},a}k(wOt,"anchor");function Cwe(t,e,r,n,i,a,o){const l=(t+r)/2,u=(e+n)/2,d=Math.atan2(n-e,r-t),h=(r-t)/2,f=(n-e)/2,p=h/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(d)*(o?-1:1),b=u-v*i*Math.cos(d)*(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,O=x+C*A,E=y+i*Math.cos(O),_=b+a*Math.sin(O);S.push({x:E,y:_})}return S}k(Cwe,"generateArcPoints");function AOt(t,e,r){const[n,i]=[e,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}k(AOt,"calculateArcSagitta");async function SOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=k(O=>O+o,"calcTotalHeight"),l=k(O=>{const E=O/2;return[E/(2.5+O/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:d}=await gn(t,e,an(e)),h=s(e!=null&&e.height?e==null?void 0:e.height:d.height),[f,p]=l(h),g=AOt(h,f,p),v=(e!=null&&e.width?e==null?void 0:e.width:d.width)+a*2+g-g,y=h,{cssStyles:b}=e,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...Cwe(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},...Cwe(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=_i(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(O){return Sr.polygon(e,x,O)},u}k(SOt,"bowTieRect");function u1(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+")")}k(u1,"insertPolygonShape");var fK=12;async function TOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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+fK),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),h=0,f=u,p=-d,g=0,m=[{x:h+fK,y:p},{x:f,y:p},{x:f,y:g},{x:h,y:g},{x:h,y:p+fK},{x:h+fK,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(s),x=_r(e,{}),w=_i(m),A=b.path(w,x);v=s.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`),y&&v.attr("style",y)}else v=u1(s,u,d,m);return n&&v.attr("style",n),Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},s}k(TOt,"card");function COt(t,e){const{nodeStyles:r}=kr(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=_i(o),d=s.path(u,l),h=n.insert(()=>d,":first-child");return i&&e.look!=="handDrawn"&&h.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&h.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Sr.polygon(e,o,f)},n}k(COt,"choice");async function kwe(t,e,r){const{labelStyles:n,nodeStyles:i}=kr(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,d=e.look==="neo"?o.width/2+l*2:o.width/2+u;let h;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(a),g=_r(e,{}),m=p.circle(0,0,d*2,g);h=a.insert(()=>m,":first-child"),h.attr("class","basic label-container").attr("style",zl(f))}else h=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return Br(e,h),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,d,p),Sr.circle(e,d,p)},a}k(kwe,"circle");function kOt(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}`}k(kOt,"createLine");function OOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=kOt(a),h=s.path(d,l),f=i.insert(()=>u,":first-child");return f.insert(()=>h),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}k(OOt,"crossedCircle");function d1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hA,":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(${h}, 0)`),o.attr("transform",`translate(${-u/2+h-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}k(EOt,"curlyBraceLeft");function h1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hA,":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(${-h}, 0)`),o.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}k(_Ot,"curlyBraceRight");function xc(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hO,":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(${h-h/4}, 0)`),o.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-d/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,m,_)},i}k(ROt,"curlyBraces");async function DOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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:d}=await gn(t,e,an(e)),h=Math.max(s,(d.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,d.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=h,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},...d$(-x,-b/2,p,50,270,90)],S=_i(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(${-h/2}, ${-f/2})`),Br(e,C),e.intersect=function(O){return Sr.polygon(e,A,O)},u}k(DOt,"curvedTrapezoid");var ugn=k((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"),dgn=k((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"),hgn=k((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),LOt=8,MOt=8;async function IOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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=ugn(0,0,d,p,h,f);g=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",zl(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/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(h!=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/(h*h));x>0&&(x=Math.sqrt(x)),x=f-x,v.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},s}k(IOt,"cylinder");async function M5(t,e,r){const{labelStyles:n,nodeStyles:i}=kr(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,d=-l/2;let h,{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(Ow(u,d,s,l,f||0),v):m.rectangle(u,d,s,l,v);h=a.insert(()=>y,":first-child"),h.attr("class","basic label-container").attr("style",zl(g))}else h=a.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",zl(f)).attr("ry",zl(p)).attr("x",u).attr("y",d).attr("width",s).attr("height",l);return Br(e,h),e.calcIntersect=function(m,v){return Sr.rect(m,v)},e.intersect=function(m){return Sr.rect(e,m)},a}k(M5,"drawRect");async function POt(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 M5(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 d=u.select(".basic.label-container"),h=(Number(d.attr("width"))||o)??0,f=(Number(d.attr("height"))||s)??0;return h>0&&f>0&&d.attr("stroke-dasharray",`${h} ${f}`),u}k(POt,"datastore");async function NOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=s.height+a,h=d*.2,f=-u/2,p=-d/2-h/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+h},{x:-f,y:p+h},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+h}],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+h+(e.padding??0)/2-(s.y-(s.top??0))})`),Br(e,x),e.intersect=function(w){return Sr.rect(e,w)},o}k(NOt,"dividedRectangle");async function BOt(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=kr(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),d=u-i;let h;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,d*2,y);h=s.insert("g",":first-child"),h.attr("class",zl(e.cssClasses)).attr("style",zl(f)),(p=h.node())==null||p.appendChild(b),(g=h.node())==null||g.appendChild(x)}else{h=s.insert("g",":first-child");const m=h.insert("circle",":first-child"),v=h.insert("circle");h.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",d).attr("cx",0).attr("cy",0)}return Br(e,h),e.intersect=function(m){return ye.info("DoubleCircle intersect",e,u,m),Sr.circle(e,u,m)},s}k(BOt,"doublecircle");function $Ot(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=kr(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,d=_r(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(d.roughness=0);const h=l.circle(0,0,o*2,d),f=a.insert(()=>h,":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}k($Ot,"filledCircle");var FOt=10,zOt=10;async function UOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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(${-d/2}, ${d/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=d,Br(e,b),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/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}k(UOt,"flippedTriangle");function VOt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=kr(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 d=-1*l/2,h=-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(d,h,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}k(VOt,"forkJoin");async function GOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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}k(GOt,"halfRoundedRectangle");var fgn=k((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}=kr(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:d,bbox:h}=await gn(t,e,an(e)),f=(e!=null&&e.height?e==null?void 0:e.height:h.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:h.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(d),x=_r(e,{}),w=fgn(0,0,g,f,p),A=b.path(w,x);v=d.insert(()=>A,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),y&&v.attr("style",y)}else v=u1(d,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)},d}k(QOt,"hexagon");async function HOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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 d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],h=_i(d),f=l.path(h,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:d}),Sr.polygon(e,d,g)},i}k(HOt,"hourglass");async function WOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,label:h}=await gn(t,e,"icon-shape default"),f=e.pos==="t",p=s,g=s,{nodeBorder:m}=r,{stylesMap:v}=E5(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,d.width),C=p+d.height+x,O=w.rectangle(-T/2,-C/2,T,C,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>S,":first-child"),_=u.insert(()=>O);if(e.icon){const P=u.append("g");P.html(`${await c1(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?d.height/2+x/2-D/2-I:-d.height/2-x/2-D/2-I})`),P.attr("style",`color: ${v.get("stroke")??m};`)}return h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${f?-C/2:C/2-d.height})`),E.attr("transform",`translate(0,${f?d.height/2+x/2:-d.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-d.width/2,y:R-D/2},{x:L+d.width/2,y:R-D/2},{x:L+d.width/2,y:R-D/2+d.height+x},{x:L+g/2,y:R-D/2+d.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+d.height+x},{x:L-d.width/2,y:R-D/2+d.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+d.width/2,y:R-D/2+p},{x:L+d.width/2/2,y:R+D/2},{x:L-d.width/2,y:R+D/2},{x:L-d.width/2,y:R-D/2+p},{x:L-g/2,y:R-D/2+p}],Sr.polygon(e,M,P)},u}k(WOt,"icon");async function YOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,label:h}=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}=E5(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 c1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const S=A.node().getBBox(),T=S.width,C=S.height,O=S.x,E=S.y,_=Math.max(T,C)*Math.SQRT2+f*2,P=b.circle(0,0,_,x),L=Math.max(_,d.width),R=_+d.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-O},${g?d.height/2+p/2-C/2-E:-d.height/2-p/2-C/2-E})`),A.attr("style",`color: ${y.get("stroke")??m};`),h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-R/2:R/2-d.height})`),M.attr("transform",`translate(0,${g?d.height/2+p/2:-d.height/2-p/2})`),Br(e,I),e.intersect=function(N){return ye.info("iconSquare intersect",e,N),Sr.rect(e,N)},u}k(YOt,"iconCircle");async function qOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,halfPadding:h,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+h*2,m=s+h*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=E5(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 O=S.path(Ow(x,w,m,g,5),T),E=Math.max(m,d.width),_=g+d.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>O,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await c1(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?d.height/2+A/2-N/2-B:-d.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-_/2:_/2-d.height})`),L.attr("transform",`translate(0,${p?d.height/2+A/2:-d.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-d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2+d.height+A},{x:M+m/2,y:I-N/2+d.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+d.height+A},{x:M-d.width/2,y:I-N/2+d.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+d.width/2,y:I-N/2+g},{x:M+d.width/2/2,y:I+N/2},{x:M-d.width/2,y:I+N/2},{x:M-d.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}k(qOt,"iconRounded");async function jOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=kr(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:d,halfPadding:h,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+h*2,m=s+h*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=E5(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 O=S.path(Ow(x,w,m,g,.1),T),E=Math.max(m,d.width),_=g+d.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>O,":first-child"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await c1(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?d.height/2+A/2-N/2-B:-d.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-_/2:_/2-d.height})`),L.attr("transform",`translate(0,${p?d.height/2+A/2:-d.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-d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2},{x:M+d.width/2,y:I-N/2+d.height+A},{x:M+m/2,y:I-N/2+d.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+d.height+A},{x:M-d.width/2,y:I-N/2+d.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+d.width/2,y:I-N/2+g},{x:M+d.width/2/2,y:I+N/2},{x:M-d.width/2,y:I+N/2},{x:M-d.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}k(jOt,"iconSquare");async function XOt(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}=kr(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,d=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,s??0);const{shapeSvg:h,bbox:f,label:p}=await gn(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,v=-d/2,y=e.label?8:0,b=Er.svg(h),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=b.rectangle(m,v,u,d,x),A=Math.max(u,f.width),S=d+f.height+y,T=b.rectangle(-A/2,-S/2,A,S,{...x,fill:"none",stroke:"none"}),C=h.insert(()=>w,":first-child"),O=h.insert(()=>T);if(e.img){const E=h.append("image");E.attr("href",e.img),E.attr("width",u),E.attr("height",d),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-u/2},${g?S/2-d:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-d/2-f.height/2-y/2:d/2-f.height/2+y/2})`),C.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Br(e,O),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+d},{x:_+f.width/2,y:P-L/2+d},{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+d},{x:_-u/2,y:P-L/2+d}],Sr.polygon(e,R,E)},h}k(XOt,"imageSquare");async function KOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),h=[{x:0,y:0},{x:u,y:0},{x:u+3*d/6,y:-d},{x:-3*d/6,y:-d}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(s),m=_r(e,{}),v=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`),p&&f.attr("style",p)}else f=u1(s,u,d,h);return n&&f.attr("style",n),e.width=u,e.height=d,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(KOt,"inv_trapezoid");async function ZOt(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}k(ZOt,"labelRect");async function JOt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=((e==null?void 0:e.width)??l.width)+o,h=[{x:0,y:0},{x:d+3*u/6,y:0},{x:d,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=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=u1(s,d,u,h);return n&&f.attr("style",n),e.width=d,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(JOt,"lean_left");async function eEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=((e==null?void 0:e.width)??l.width)+o,h=[{x:-3*u/6,y:0},{x:d,y:0},{x:d+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=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=u1(s,d,u,h);return n&&f.attr("style",n),e.width=d,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(eEt,"lean_right");function tEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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}],d=Er.svg(i),h=_r(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const f=_i(u),p=d.path(f,h),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}k(tEt,"lightningBolt");var pgn=k((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"),ggn=k((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"),mgn=k((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),rEt=10,nEt=10;async function iEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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=pgn(0,0,d,p,h,f,g);m=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",zl(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-d/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(h!=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/(h*h));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},s}k(iEt,"linedCylinder");async function aEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(o??0)*2,f=e.look==="neo"?h/4:h/8,p=h+f,{cssStyles:g}=e,m=Er.svg(s),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:-d/2-d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:p/2},...Cw(-d/2-d/2*.1,p/2,d/2+d/2*.1,p/2,f,.8),{x:d/2+d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:-p/2},{x:-d/2,y:-p/2},{x:-d/2,y:p/2*1.1},{x:-d/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(${-d/2+(e.padding??0)+d/2*.1/2-(l.x-(l.left??0))},${-h/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}k(aEt,"linedWaveEdgedRect");async function oEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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:d}=await gn(t,e,an(e)),h=(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=h-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=_i(w);let T=b.path(S,x);const C=_i(A);let O=b.path(C,x);e.look!=="handDrawn"&&(T=Swe(T),O=Swe(O));const E=l.insert("g",":first-child");return E.insert(()=>T),E.insert(()=>O),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),d.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}k(oEt,"multiRect");async function sEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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 d=!0;(e.width||e.height)&&(d=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const h=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+(d?p/2:-p/2),m=-h/2,v=-g/2,y=10,{cssStyles:b}=e,x=Cw(m-y,v+g+y,m+h-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+h-y,y:w.y-y},{x:m+h,y:w.y-y},{x:m+h,y:w.y-2*y},{x:m+h+y,y:w.y-2*y},{x:m+h+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+h-y,y:v+y},{x:m+h-y,y:w.y-y},{x:m+h,y:w.y-y},{x:m+h,y:v},{x:m,y:v}],T=Er.svg(i),C=_r(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const O=_i(A),E=T.path(O,C),_=_i(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}k(sEt,"multiWaveEdgedRectangle");async function lEt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=kr(e);e.labelStyle=n,e.useHtmlLabels||ia(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),d=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),h=-u/2,f=-d/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(h,f,u,d,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}k(lEt,"note");var vgn=k((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 cEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let h;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(i),g=_r(e,{}),m=vgn(0,0,l),v=p.path(m,g);h=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&h.attr("style",f)}else h=u1(i,l,l,d),h.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&h.attr("style",n),Br(e,h),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}k(cEt,"question");async function uEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),f=-d/2,p=-h/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=_i(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}k(uEt,"rect_left_inv_arrow");async function dEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=await kw(s,u,e.labelStyle,!0,!0);let h={width:0,height:0};if(ia(Ye())){const C=d.children[0],O=_t(d);h=C.getBoundingClientRect(),O.attr("width",h.width),O.attr("height",h.height)}ye.info("Text 2",l);const f=l||[],p=d.getBBox(),g=await kw(s,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=_t(g);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height);const y=(e.padding||0)/2;_t(g).attr("transform","translate( "+(h.width>p.width?0:(p.width-h.width)/2)+", "+(p.height+y+5)+")"),_t(d).attr("transform","translate( "+(h.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",-h.width/2-y).attr("y",-h.height/2-y).attr("width",h.width+(e.padding||0)).attr("height",h.height+(e.padding||0)),T.attr("class","divider").attr("x1",-h.width/2-y).attr("x2",h.width/2+y).attr("y1",-h.height/2-y+p.height+y).attr("y2",-h.height/2-y+p.height+y);return Br(e,S),e.intersect=function(C){return Sr.rect(e,C)},a}k(dEt,"rectWithTitle");async function hEt(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 M5(t,e,i)}k(hEt,"roundedRect");var cC=8;async function fEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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"?cC:cC*2),d=((e==null?void 0:e.height)??s.height)+a*2,h=u-cC,f=d,p=cC-u/2,g=-d/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+h,y:g},{x:p+h,y:g+f},{x:p-cC,y:g+f},{x:p-cC,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",zl(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(${cC/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}k(fEt,"shadedProcess");async function pEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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)),d=(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*2)*1.5,f=d,p=h/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=_i(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}k(pEt,"slopedRect");async function gEt(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 M5(t,e,a)}k(gEt,"squareRect");async function mEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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),d=l.width+u/4+(e.look==="neo"?a*2:a),h=u/2,{cssStyles:f}=e,p=Er.svg(s),g=_r(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-d/2+h,y:-u/2},{x:d/2-h,y:-u/2},...d$(-d/2+h,0,h,50,90,270),{x:d/2-h,y:u/2},...d$(d/2-h,0,h,50,270,450)],v=_i(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}k(mEt,"stadium");async function vEt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return M5(t,e,r)}k(vEt,"state");function yEt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=kr(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 d=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),h=Er.svg(d),f=_r(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=h.circle(0,0,e.width,{...f,stroke:o,strokeWidth:2}),g=s??l,m=(e.width??0)*5/14,v=h.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=d.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)},d}k(yEt,"stateEnd");function bEt(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 d=Er.svg(a).circle(0,0,e.width,qhn(n));o=a.insert(()=>d),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)??"",d=u?`${u}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${d})`)}return Br(e,o),e.intersect=function(u){return Sr.circle(e,(e.width??7)/2,u)},a}k(bEt,"stateStart");var I5=8;async function xEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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*I5+a,d=((e==null?void 0:e.height)??l.height)+o,h=u-2*I5,f=d,p=-u/2,g=-d/2,m=[{x:0,y:0},{x:h,y:0},{x:h,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:h+8,y:0},{x:h+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,h+16,f,y),x=v.line(p+I5,g,p+I5,g+f,y),w=v.line(p+I5+h,g,p+I5+h,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",zl(S)),Br(e,A)}else{const v=u1(s,h,f,m);n&&v.attr("style",n),Br(e,v)}return e.intersect=function(v){return Sr.polygon(e,m,v)},s}k(xEt,"subroutine");var Owe=.2;async function wEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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-Owe*(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,d=Owe*u,h=Owe*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+d-d,g=u,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(s),x=_r(e,{}),w=[{x:m-d/2,y:v},{x:m+p+d/2,y:v},{x:m+p+d/2,y:v+g},{x:m-d/2,y:v+g}],A=[{x:m+p-d/2,y:v+g},{x:m+p+d/2,y:v+g},{x:m+p+d/2,y:v+g-h}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=_i(w),T=b.path(S,x),C=_i(A),O=b.path(C,{...x,fillStyle:"solid"}),E=s.insert(()=>O,":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}k(wEt,"taggedRect");async function AEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=.2*s,h=.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},...Cw(-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-h*.4,x=[{x:y+s-d,y:(b+l)*1.3},{x:y+s,y:b+l-h},{x:y+s,y:(b+l)*.9},...Cw(y+s,(b+l)*1.25,y+s-d,(b+l)*1.3,-l*.02,.5)],w=_i(v),A=g.path(w,m),S=_i(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(O){return Sr.polygon(e,v,O)},i}k(AEt,"taggedWaveEdgedRectangle");async function SEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=i.insert("rect",":first-child");return d.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,d),e.intersect=function(h){return Sr.rect(e,h)},i}k(SEt,"text");var ygn=k((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} @@ -639,7 +639,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${i},${a} 0,0,0 0,${n} l${-r},0`,"createCylinderPathD"),bgn=k((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"),xgn=k((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),TEt=5,CEt=10;async function kEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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=ygn(0,0,f,u,h,d);g=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",zl(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",h),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(s.width/2)-h-(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(d!=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-h)){let b=h*h*(1-y*y/(d*d));b!=0&&(b=Math.sqrt(Math.abs(b))),b=h-b,m.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},o}k(kEt,"tiltedCylinder");async function OEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=((e==null?void 0:e.width)??l.width)+o,h=[{x:-3*u/6,y:0},{x:d+3*u/6,y:0},{x:d,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=_i(h),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=u1(s,d,u,h);return n&&f.attr("style",n),e.width=d,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,h,g)},s}k(OEt,"trapezoid");async function EEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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}k(EEt,"trapezoidalPentagon");var _Et=10,REt=10;async function DEt(t,e){var w;const{labelStyles:r,nodeStyles:n}=kr(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(${-h/2}, ${h/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=d,e.height=h,Br(e,x),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${h/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}k(DEt,"triangle");async function LEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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:d}=await gn(t,e,an(e)),h=(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-h,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:-h/2-b,y:g/2},...Cw(-h/2-b,g/2,h/2+b,g/2,p,.8),{x:h/2+b,y:-g/2},{x:-h/2-b,y:-g/2}],S=_i(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})`),d.attr("transform",`translate(${-h/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(O){return Sr.polygon(e,A,O)},l}k(LEt,"waveEdgedRectangle");async function MEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+o,h=d/8,f=d+h*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},...Cw(-u/2,f/2,u/2,f/2,h,1),{x:u/2,y:-f/2},...Cw(u/2,-f/2,-u/2,-f/2,h,-1)],y=_i(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}k(MEt,"waveRectangle");var Xo=10;async function IEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=(e!=null&&e.height?e==null?void 0:e.height:s.height)+a*2+Xo,h=u-Xo,f=d-Xo,p=-h/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+h,y:g+f},{x:p+h,y:g-Xo}],x=`M${p-Xo},${g-Xo} L${p+h},${g-Xo} L${p+h},${g+f} L${p-Xo},${g+f} L${p-Xo},${g-Xo} M${p-Xo},${g} L${p+h},${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}k(IEt,"windowPane");var PEt=new Set(["redux-color","redux-dark-color"]),wgn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Ewe(t,e){var j,q,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 Ewe(t,te)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let d=((j=u.er)==null?void 0:j.diagramPadding)??10,h=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=kr(e);if(r.attributes.length===0&&e.label){const J={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5};Vu(e.label,u)+J.labelPaddingX*20){const J=y.width+d*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+d*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,Oe=0;if(ie){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ie);ue&&(Ce=parseFloat(ue[1]),Oe=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+d/2+Ce}, ${Oe+B+y.height+h/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+h/2)+")"),n!=null&&PEt.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 G=NR(F,y.height+B,I+F,y.height+B,U),H=R.polygon(G.map(J=>[J.x,J.y]),D);if(v.insert(()=>H).attr("class","divider"),G=NR(A+F,y.height+B,A+F,N+B,U),H=R.polygon(G.map(J=>[J.x,J.y]),D),v.insert(()=>H).attr("class","divider"),O){const J=A+S+F;G=NR(J,y.height+B,J,N+B,U),H=R.polygon(G.map(ee=>[ee.x,ee.y]),D),v.insert(()=>H).attr("class","divider")}if(E){const J=A+S+T+F;G=NR(J,y.height+B,J,N+B,U),H=R.polygon(G.map(ee=>[ee.x,ee.y]),D),v.insert(()=>H).attr("class","divider")}for(const J of x){const ee=y.height+B+J;G=NR(F,ee,I+F,ee,U),H=R.polygon(G.map(te=>[te.x,te.y]),D),v.insert(()=>H).attr("class","divider")}if(Br(e,z),g&&e.look!=="handDrawn")if(n!=null&&wgn.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}k(Ewe,"erBox");async function PR(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!==bw(e)&&(e=bw(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await lu(s,e,{width:Vu(e,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let d=l.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(m0(r.htmlLabels)){const d=l.children[0];d.style.textAlign="start";const h=_t(l);u=d.getBoundingClientRect(),h.attr("width",u.width),h.attr("height",u.height)}return u}k(PR,"addText");function NR(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}]}k(NR,"lineToPolygon");async function NEt(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,d=null,h=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 h$(s,{text:`«${b}»`},0),h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await h$(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 h$(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),d=o.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await h$(d,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}, ${h})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${h+f+i*2})`),y=o.node().getBBox(),d.attr("transform",`translate(0, ${h+f+(p?p+i*4:i*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}k(NEt,"textHelper");async function h$(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:m0(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 lu(i,mbe(l1(s)),{width:Vu(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let u,d=1;if(o){const h=l.children[0],f=_t(l);d=h.innerHTML.split("
").length,h.innerHTML.includes("")&&(d+=h.innerHTML.split("").length-1);const p=h.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)}k(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&_t(l).selectAll("tspan").attr("font-weight",""),d=l.children.length;const h=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(h.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[1]===" "&&(h.textContent=h.textContent[0]+" "+h.textContent.substring(1))),h.textContent==="undefined"&&(h.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*d)+r)+")"),u.height}k(h$,"addText");async function BEt(t,e){var R,D;const r=Ye(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,s=e.useHtmlLabels??m0(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:d}=await NEt(t,e,r,s,o),{labelStyles:h,nodeStyles:f}=kr(e);e.labelStyle=h,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,d.width);let b=Math.max(e.height??0,d.height);const x=(e.height??0)>d.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 O=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 G,H;const F=_t(N[I]),B=F.attr("transform");let V=0;if(B){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);q&&(V=parseFloat(q[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 j=Math.max(P,o/2);x?z=Math.max(L,E+_+j+A+o*2+a)+o*2:z=E+_+j+A+o*4+a}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.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=-((H=F.node())==null?void 0:H.getBBox().width)/2||0,u.selectAll("text").each(function(j,q,ne){window.getComputedStyle(ne[q]).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(O.x,M,O.x+O.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(O.x,x?Math.max(L,M):M,O.x+O.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(h){const N=M.exec(h);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}k(BEt,"classBox");async function $Et(t,e){var O,E;const{labelStyles:r,nodeStyles:n}=kr(e);e.labelStyle=r;const i=e,a=e,o=20,s=20,l="verifyMethod"in e,u=an(e),{themeVariables:d}=Ye(),{borderColorArray:h,requirementEdgeLabelBackground:f}=d,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await S0(p,`<<${i.type}>>`,0,e.labelStyle):g=await S0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await S0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+s,l){const _=await S0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await S0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const L=await S0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await S0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await S0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await S0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((O=p.node())==null?void 0:O.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),h!=null&&h.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%h.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||h!=null&&h.length)&&p.selectAll("path").attr("style",n),p}k($Et,"requirementBox");async function S0(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 lu(i,mbe(l1(e)),{width:Vu(e,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},a);let l;if(o){const u=s.children[0],d=_t(s);l=u.getBoundingClientRect(),d.attr("width",l.width),d.attr("height",l.height)}else{const u=s.children[0];for(const d of u.children)n&&d.setAttribute("style",n);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}k(S0,"addText");var Agn=k(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 FEt(t,e,{config:r}){var P,L;const{labelStyles:n,nodeStyles:i}=kr(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)),d=e.padding||10;let h="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(h=(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",h).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 Awe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await Awe(s,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await Awe(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("+(d-x/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(d-x/2)+", "+(-w+l.height/2)+")"),v.attr("transform","translate("+(d+x/2-y.width-2*a)+", "+(-w+l.height/2)+")");let C;const{rx:O,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(s),D=_r(e,{}),M=O||E?R.path(Ow(S,T,x,A,O||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",O??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((O??0)/2),N=T+A-Math.floor((O??0)/2);D.attr("x1",M).attr("y1",I).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Agn(R))}}return Br(e,C),e.height=A,e.intersect=function(R){return Sr.rect(e,R)},s}k(FEt,"kanbanItem");async function zEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=.15*l,{cssStyles:h}=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}k(IEt,"windowPane");var PEt=new Set(["redux-color","redux-dark-color"]),wgn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Ewe(t,e){var j,q,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 Ewe(t,te)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let d=((j=u.er)==null?void 0:j.diagramPadding)??10,h=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=kr(e);if(r.attributes.length===0&&e.label){const J={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5};Vu(e.label,u)+J.labelPaddingX*20){const J=y.width+d*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+d*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,Oe=0;if(ie){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ie);ue&&(Ce=parseFloat(ue[1]),Oe=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+d/2+Ce}, ${Oe+B+y.height+h/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+h/2)+")"),n!=null&&PEt.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 G=N5(F,y.height+B,I+F,y.height+B,U),H=R.polygon(G.map(J=>[J.x,J.y]),D);if(v.insert(()=>H).attr("class","divider"),G=N5(A+F,y.height+B,A+F,N+B,U),H=R.polygon(G.map(J=>[J.x,J.y]),D),v.insert(()=>H).attr("class","divider"),O){const J=A+S+F;G=N5(J,y.height+B,J,N+B,U),H=R.polygon(G.map(ee=>[ee.x,ee.y]),D),v.insert(()=>H).attr("class","divider")}if(E){const J=A+S+T+F;G=N5(J,y.height+B,J,N+B,U),H=R.polygon(G.map(ee=>[ee.x,ee.y]),D),v.insert(()=>H).attr("class","divider")}for(const J of x){const ee=y.height+B+J;G=N5(F,ee,I+F,ee,U),H=R.polygon(G.map(te=>[te.x,te.y]),D),v.insert(()=>H).attr("class","divider")}if(Br(e,z),g&&e.look!=="handDrawn")if(n!=null&&wgn.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}k(Ewe,"erBox");async function P5(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!==bw(e)&&(e=bw(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await lu(s,e,{width:Vu(e,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let d=l.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(m0(r.htmlLabels)){const d=l.children[0];d.style.textAlign="start";const h=_t(l);u=d.getBoundingClientRect(),h.attr("width",u.width),h.attr("height",u.height)}return u}k(P5,"addText");function N5(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}]}k(N5,"lineToPolygon");async function NEt(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,d=null,h=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 h$(s,{text:`«${b}»`},0),h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await h$(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 h$(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),d=o.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await h$(d,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}, ${h})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${h+f+i*2})`),y=o.node().getBBox(),d.attr("transform",`translate(0, ${h+f+(p?p+i*4:i*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}k(NEt,"textHelper");async function h$(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:m0(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 lu(i,mbe(l1(s)),{width:Vu(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let u,d=1;if(o){const h=l.children[0],f=_t(l);d=h.innerHTML.split("
").length,h.innerHTML.includes("")&&(d+=h.innerHTML.split("").length-1);const p=h.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)}k(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&_t(l).selectAll("tspan").attr("font-weight",""),d=l.children.length;const h=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(h.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[1]===" "&&(h.textContent=h.textContent[0]+" "+h.textContent.substring(1))),h.textContent==="undefined"&&(h.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*d)+r)+")"),u.height}k(h$,"addText");async function BEt(t,e){var R,D;const r=Ye(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,s=e.useHtmlLabels??m0(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:d}=await NEt(t,e,r,s,o),{labelStyles:h,nodeStyles:f}=kr(e);e.labelStyle=h,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,d.width);let b=Math.max(e.height??0,d.height);const x=(e.height??0)>d.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 O=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 G,H;const F=_t(N[I]),B=F.attr("transform");let V=0;if(B){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);q&&(V=parseFloat(q[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 j=Math.max(P,o/2);x?z=Math.max(L,E+_+j+A+o*2+a)+o*2:z=E+_+j+A+o*4+a}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.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=-((H=F.node())==null?void 0:H.getBBox().width)/2||0,u.selectAll("text").each(function(j,q,ne){window.getComputedStyle(ne[q]).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(O.x,M,O.x+O.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(O.x,x?Math.max(L,M):M,O.x+O.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(h){const N=M.exec(h);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}k(BEt,"classBox");async function $Et(t,e){var O,E;const{labelStyles:r,nodeStyles:n}=kr(e);e.labelStyle=r;const i=e,a=e,o=20,s=20,l="verifyMethod"in e,u=an(e),{themeVariables:d}=Ye(),{borderColorArray:h,requirementEdgeLabelBackground:f}=d,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await S0(p,`<<${i.type}>>`,0,e.labelStyle):g=await S0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await S0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+s,l){const _=await S0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await S0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const L=await S0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await S0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await S0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await S0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((O=p.node())==null?void 0:O.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),h!=null&&h.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%h.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||h!=null&&h.length)&&p.selectAll("path").attr("style",n),p}k($Et,"requirementBox");async function S0(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 lu(i,mbe(l1(e)),{width:Vu(e,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},a);let l;if(o){const u=s.children[0],d=_t(s);l=u.getBoundingClientRect(),d.attr("width",l.width),d.attr("height",l.height)}else{const u=s.children[0];for(const d of u.children)n&&d.setAttribute("style",n);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}k(S0,"addText");var Agn=k(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 FEt(t,e,{config:r}){var P,L;const{labelStyles:n,nodeStyles:i}=kr(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)),d=e.padding||10;let h="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(h=(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",h).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 Awe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await Awe(s,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await Awe(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("+(d-x/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(d-x/2)+", "+(-w+l.height/2)+")"),v.attr("transform","translate("+(d+x/2-y.width-2*a)+", "+(-w+l.height/2)+")");let C;const{rx:O,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(s),D=_r(e,{}),M=O||E?R.path(Ow(S,T,x,A,O||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",O??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((O??0)/2),N=T+A-Math.floor((O??0)/2);D.attr("x1",M).attr("y1",I).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Agn(R))}}return Br(e,C),e.height=A,e.intersect=function(R){return Sr.rect(e,R)},s}k(FEt,"kanbanItem");async function zEt(t,e){const{labelStyles:r,nodeStyles:n}=kr(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,d=.15*l,{cssStyles:h}=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${d},${d} 1 0,0 ${g*.25},${-1*m*.1} a${d},${d} 1 0,0 ${g*.25},0 a${d},${d} 1 0,0 ${g*.25},0 @@ -691,7 +691,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error h${-(l-2*d)} q${-d},0 ${-d},${-d} 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",h);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}k(VEt,"defaultMindmapNode");async function GEt(t,e){const r={padding:e.padding??0};return kwe(t,e,r)}k(GEt,"mindmapCircle");var Sgn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:gEt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hEt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:mEt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:xEt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:IOt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:POt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:kwe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:zEt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:UEt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:cEt},{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:eEt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:JOt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:OEt},{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:KOt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:BOt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:SEt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:TOt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:fEt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:bEt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:yEt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:VOt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:HOt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:EOt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_Ot},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ROt},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tEt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:LEt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:GOt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:kEt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:iEt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:DOt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:NOt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:DEt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:IEt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:$Ot},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:EEt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:UOt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:pEt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:sEt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:oEt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:SOt},{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:AEt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:wEt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:MEt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:uEt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:aEt}],Tgn=k(()=>{const e=[...Object.entries({state:vEt,choice:COt,note:lEt,rectWithTitle:dEt,labelRect:ZOt,iconSquare:jOt,iconCircle:YOt,icon:WOt,iconRounded:qOt,imageSquare:XOt,anchor:wOt,kanbanItem:FEt,mindmapCircle:GEt,defaultMindmapNode:VEt,classBox:BEt,erBox:Ewe,requirementBox:$Et}),...Sgn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),QEt=Tgn();function HEt(t){return t in QEt}k(HEt,"isValidShape");var pK=new Map;async function f$(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?QEt[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",zl(e.look)),e.tooltip&&i.attr("title",e.tooltip),pK.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}k(f$,"insertNode");var Cgn=k((t,e)=>{pK.set(e.id,t)},"setNodeElem"),WEt=k(()=>{pK.clear()},"clear"),gK=k(t=>{const e=pK.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"),T0=k((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"),Ul={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},YEt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function p$(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}}k(p$,"calculateDeltaAndAngle");var wo=k(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),qEt=k(t=>({x:k(function(e,r,n){let i=0;const a=wo(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ul,t.arrowTypeEnd)){const{angle:p,deltaX:g}=p$(n[n.length-1],n[n.length-2]);i=Ul[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),d=Ul[t.arrowTypeStart],h=Ul[t.arrowTypeEnd],f=1;if(o0&&s0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ul,t.arrowTypeEnd)){const{angle:p,deltaY:g}=p$(n[n.length-1],n[n.length-2]);i=Ul[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),d=Ul[t.arrowTypeStart],h=Ul[t.arrowTypeEnd],f=1;if(o0&&s0&&u{e.arrowTypeStart&&jEt(t,"start",e.arrowTypeStart,r,n,i,a,o),e.arrowTypeEnd&&jEt(t,"end",e.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),Ogn={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}},Egn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],jEt=k((t,e,r,n,i,a,o=!1,s)=>{var g;const l=Ogn[r],u=l&&Egn.includes(l.type);if(!l){ye.warn(`Unknown arrow type: ${r}`);return}const d=l.type,p=`${i}_${a}-${d}${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"),_gn=k(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ye())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),g$=new Map,vs=new Map,XEt=k(()=>{g$.clear(),vs.clear()},"clear"),m$=k(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),mK=k(async(t,e)=>{const r=Ye();let n=ia(r);const{labelStyles:i}=kr(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 lu(t,e.label,{style:m$(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 d=u.getBBox(),h=d;if(n){const p=u.children[0],g=_t(u);d=p.getBoundingClientRect(),h=d,g.attr("width",d.width),g.attr("height",d.height)}else{const p=_t(u).select("text").node();p&&typeof p.getBBox=="function"&&(h=p.getBBox())}o.attr("transform",T0(h,n)),g$.set(e.id,a),e.width=d.width,e.height=d.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(g,e.startLabelLeft,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startLeft=p,v$(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(g,e.startLabelRight,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startRight=p,v$(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(p,e.endLabelLeft,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endLeft=p,v$(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(p,e.endLabelRight,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endRight=p,v$(f,e.endLabelRight)}return u},"insertEdgeLabel");function v$(t,e){ia(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}k(v$,"setTerminalWidth");var KEt=k((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,g$.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=DR(n);if(t.label){const a=g$.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"),Rgn=k((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"),Dgn=k((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"),Lgn=k((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",h);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}k(VEt,"defaultMindmapNode");async function GEt(t,e){const r={padding:e.padding??0};return kwe(t,e,r)}k(GEt,"mindmapCircle");var Sgn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:gEt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hEt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:mEt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:xEt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:IOt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:POt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:kwe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:zEt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:UEt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:cEt},{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:eEt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:JOt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:OEt},{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:KOt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:BOt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:SEt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:TOt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:fEt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:bEt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:yEt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:VOt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:HOt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:EOt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_Ot},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ROt},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tEt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:LEt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:GOt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:kEt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:iEt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:DOt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:NOt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:DEt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:IEt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:$Ot},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:EEt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:UOt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:pEt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:sEt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:oEt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:SOt},{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:AEt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:wEt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:MEt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:uEt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:aEt}],Tgn=k(()=>{const e=[...Object.entries({state:vEt,choice:COt,note:lEt,rectWithTitle:dEt,labelRect:ZOt,iconSquare:jOt,iconCircle:YOt,icon:WOt,iconRounded:qOt,imageSquare:XOt,anchor:wOt,kanbanItem:FEt,mindmapCircle:GEt,defaultMindmapNode:VEt,classBox:BEt,erBox:Ewe,requirementBox:$Et}),...Sgn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),QEt=Tgn();function HEt(t){return t in QEt}k(HEt,"isValidShape");var pK=new Map;async function f$(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?QEt[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",zl(e.look)),e.tooltip&&i.attr("title",e.tooltip),pK.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}k(f$,"insertNode");var Cgn=k((t,e)=>{pK.set(e.id,t)},"setNodeElem"),WEt=k(()=>{pK.clear()},"clear"),gK=k(t=>{const e=pK.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"),T0=k((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"),Ul={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},YEt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function p$(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}}k(p$,"calculateDeltaAndAngle");var wo=k(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),qEt=k(t=>({x:k(function(e,r,n){let i=0;const a=wo(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ul,t.arrowTypeEnd)){const{angle:p,deltaX:g}=p$(n[n.length-1],n[n.length-2]);i=Ul[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),d=Ul[t.arrowTypeStart],h=Ul[t.arrowTypeEnd],f=1;if(o0&&s0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ul,t.arrowTypeEnd)){const{angle:p,deltaY:g}=p$(n[n.length-1],n[n.length-2]);i=Ul[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),d=Ul[t.arrowTypeStart],h=Ul[t.arrowTypeEnd],f=1;if(o0&&s0&&u{e.arrowTypeStart&&jEt(t,"start",e.arrowTypeStart,r,n,i,a,o),e.arrowTypeEnd&&jEt(t,"end",e.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),Ogn={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}},Egn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],jEt=k((t,e,r,n,i,a,o=!1,s)=>{var g;const l=Ogn[r],u=l&&Egn.includes(l.type);if(!l){ye.warn(`Unknown arrow type: ${r}`);return}const d=l.type,p=`${i}_${a}-${d}${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"),_gn=k(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ye())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),g$=new Map,vs=new Map,XEt=k(()=>{g$.clear(),vs.clear()},"clear"),m$=k(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),mK=k(async(t,e)=>{const r=Ye();let n=ia(r);const{labelStyles:i}=kr(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 lu(t,e.label,{style:m$(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 d=u.getBBox(),h=d;if(n){const p=u.children[0],g=_t(u);d=p.getBoundingClientRect(),h=d,g.attr("width",d.width),g.attr("height",d.height)}else{const p=_t(u).select("text").node();p&&typeof p.getBBox=="function"&&(h=p.getBBox())}o.attr("transform",T0(h,n)),g$.set(e.id,a),e.width=d.width,e.height=d.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(g,e.startLabelLeft,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startLeft=p,v$(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(g,e.startLabelRight,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startRight=p,v$(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(p,e.endLabelLeft,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endLeft=p,v$(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await kw(p,e.endLabelRight,m$(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",T0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endRight=p,v$(f,e.endLabelRight)}return u},"insertEdgeLabel");function v$(t,e){ia(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}k(v$,"setTerminalWidth");var KEt=k((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,g$.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=D5(n);if(t.label){const a=g$.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"),Rgn=k((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"),Dgn=k((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"),Lgn=k((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 h=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),!Dgn(e,a)&&!i){const o=Lgn(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 JEt(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}}k(JEt,"extractCornerPoints");var e_t=k(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"),Mgn=k(function(t){const{cornerPointPositions:e}=JEt(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+h:s.x+p-h,y:d<0?s.y-h:s.y+h}:f={x:u<0?s.x-h:s.x+h,y:d<0?s.y-p+h:s.y+p-h}}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"),Ign=k((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"),_we=k(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 d=e.points,h=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)Mxe(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2)d=[f.intersect(d[0]),p.intersect(d[1])];else{const F=d.slice(1,-1),B=F[0],V=F[F.length-1],z=.5,U=Math.abs(d[d.length-1].x-V.x)!Number.isNaN(F.y));const y=_gn(e.curve);y!=="rounded"&&(v=Mgn(v));let b=Q7;switch(y){case"linear":b=Q7;break;case"basis":b=W7;break;case"cardinal":b=OSt;break;case"bumpX":b=ASt;break;case"bumpY":b=SSt;break;case"catmullRom":b=_St;break;case"monotoneX":b=$St;break;case"monotoneY":b=FSt;break;case"natural":b=VSt;break;case"step":b=GSt;break;case"stepAfter":b=HSt;break;case"stepBefore":b=QSt;break;case"rounded":b=Q7;break;default:b=W7}const{x,y:w}=qEt(e),A=H7().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"?t_t(r_t(v,e),5):A(v);const O=Array.isArray(e.style)?e.style:[e.style];let E=O.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",O?O.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=O?O.reduce((j,q)=>j+q+";",""):"",V=(F?F+";"+B+";":B)+";"+(O?O.reduce((j,q)=>j+";"+q,""):"");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,G=YEt[e.arrowTypeStart]||0,H=YEt[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Ign(U,G,H):`0 ${G} ${U-G-H} ${H}`}; stroke-dashoffset: 0;`;T.attr("style",q+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",zl(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";kgn(T,e,L,o,n,R,E);const D=Math.floor(d.length/2),M=d[D];un.isLabelCoordinateInPath(M,T.attr("d"))||(h=!0);let I={};return h&&(I.updatedPath=d),I.originalPath=e.points,I},"insertEdge");function t_t(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&&Ul[e.arrowTypeStart]){const i=Ul[e.arrowTypeStart],a=t[0],o=t[1],{angle:s}=Rwe(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&&Ul[e.arrowTypeEnd]){const i=Ul[e.arrowTypeEnd],a=t[n-1],o=t[n-2],{angle:s}=Rwe(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}k(r_t,"applyMarkerOffsetsToPoints");var Pgn=k((t,e,r,n)=>{e.forEach(i=>{imn[i](t,r,n)})},"insertMarkers"),Ngn=k((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"),Bgn=k((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"),$gn=k((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"),Fgn=k((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"),zgn=k((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"),Ugn=k((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"),Vgn=k((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"),Ggn=k((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"),Qgn=k((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"),Hgn=k((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"),Wgn=k((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"),Ygn=k((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"),qgn=k((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"),jgn=k((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"),Xgn=k((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"),Kgn=k((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"),Zgn=k((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"),Jgn=k((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"),emn=k((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 @@ -700,30 +700,30 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error L0,20`)},"requirement_arrow"),tmn=k((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"),rmn=k((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"),nmn=k((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"),imn={extension:Ngn,composition:Bgn,aggregation:$gn,dependency:Fgn,lollipop:zgn,point:Ugn,circle:Vgn,cross:Ggn,barb:Qgn,barbNeo:Hgn,only_one:Wgn,zero_or_one:Ygn,one_or_more:qgn,zero_or_more:jgn,only_one_neo:Xgn,zero_or_one_neo:Kgn,one_or_more_neo:Zgn,zero_or_more_neo:Jgn,requirement_arrow:emn,requirement_contains:rmn,requirement_arrow_neo:tmn,requirement_contains_neo:nmn},Dwe=Pgn,amn={common:Xt,getConfig:Dr,insertCluster:hK,insertEdge:_we,insertEdgeLabel:mK,insertMarkers:Dwe,insertNode:f$,interpolateToCurve:Qxe,labelHelper:gn,log:ye,positionEdgeLabel:KEt},y$={},n_t=k(t=>{for(const e of t)y$[e.name]=e},"registerLayoutLoaders"),omn=k(()=>{n_t([{name:"dagre",loader:k(async()=>await Promise.resolve().then(()=>Z6n),"loader")},{name:"swimlane",loader:k(async()=>await Promise.resolve().then(()=>uNn),"loader")},{name:"cose-bilkent",loader:k(async()=>await Promise.resolve().then(()=>X9n),"loader")}])},"registerDefaultLayoutLoaders");omn();var BR=k(async(t,e,r)=>{if(!(t.layoutAlgorithm in y$))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const f=h.domId||h.id;h.domId=`${t.diagramId}-${f}`}const n=y$[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:o}=t.config,{useGradient:s,gradientStart:l,gradientStop:u}=o,d=e.attr("id");if(e.append("defs").append("filter").attr("id",`${d}-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",`${d}-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 h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,amn,{algorithm:n.algorithm},r)},"render"),b$=k((t="",{fallback:e="dagre"}={})=>{if(t in y$)return t;if(e in y$)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"),Lwe="comm",i_t="rule",a_t="decl",smn="@media",lmn="@import",cmn="@supports",umn="@namespace",Mwe="@keyframes",o_t="@layer",dmn="@scope",hmn=Math.abs,x$=String.fromCharCode;function s_t(t){return t.trim()}function Iwe(t,e,r){return t.replace(e,r)}function $R(t,e){return t.charCodeAt(e)|0}function FR(t,e,r){return t.slice(e,r)}function C0(t){return t.length}function l_t(t){return t.length}function vK(t,e){return e.push(t),t}var yK=1,zR=1,c_t=0,yp=0,zs=0,UR="";function Pwe(t,e,r,n,i,a,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:yK,column:zR,length:o,return:"",siblings:s}}function fmn(){return zs}function pmn(){return zs=yp>0?$R(UR,--yp):0,zR--,zs===10&&(zR=1,yK--),zs}function Mg(){return zs=yp2||w$(zs)>3?"":" "}function ymn(t,e){for(;--e&&Mg()&&!(zs<48||zs>102||zs>57&&zs<65||zs>70&&zs<97););return xK(t,bK()+(e<6&&Ew()==32&&Mg()==32))}function Bwe(t){for(;Mg();)switch(zs){case t:return yp;case 34:case 39:t!==34&&t!==39&&Bwe(zs);break;case 40:t===41&&Bwe(t);break;case 92:Mg();break}return yp}function bmn(t,e){for(;Mg()&&t+zs!==57;)if(t+zs===84&&Ew()===47)break;return"/*"+xK(e,yp-1)+"*"+x$(t===47?t:Mg())}function xmn(t){for(;!w$(Ew());)Mg();return xK(t,yp)}function wmn(t){return mmn(wK("",null,null,null,[""],t=gmn(t),0,[0],t))}function wK(t,e,r,n,i,a,o,s,l){for(var u=0,d=0,h=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=Mg()){case 40:g!=108&&$R(C,h-1)==58?(b++,C+="("):C+=Nwe(x);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=Nwe(x);break;case 9:case 10:case 13:case 32:if(b>0){C+=x$(x);break}C+=vmn(g);break;case 92:C+=ymn(bK()-1,7);continue;case 47:switch(Ew()){case 42:case 47:vK(Amn(bmn(Mg(),bK()),e,r,l),l),(w$(g||1)==5||w$(Ew()||1)==5)&&C0(C)&&FR(C,-1,void 0)!==" "&&(C+=" ");break;default:C+="/"}break;case 123*m:s[u++]=C0(C)*y;case 125*m:case 59:case 0:if(b>0&&x){C+=x$(x);break}switch(x){case 0:case 125:v=0;case 59+d:y==-1&&(C=Iwe(C,/\f/g,"")),p>0&&(C0(C)-h||m===0)&&vK(p>32?d_t(C+";",n,r,h-1,l):d_t(Iwe(C," ","")+";",n,r,h-2,l),l);break;case 59:C+=";";default:if(vK(T=u_t(C,e,r,u,d,i,s,w,A=[],S=[],h,a),a),x===123)if(d===0)wK(C,e,T,T,A,a,h,s,S);else{switch(f){case 99:if($R(C,3)===110)break;case 108:if($R(C,2)===97)break;default:d=0;case 100:case 109:case 115:}d?wK(t,T,T,n&&vK(u_t(t,T,T,0,0,i,s,w,i,A=[],h,S),S),i,S,h,s,n?A:S):wK(C,T,T,T,[""],S,0,s,S)}}u=d=p=0,m=y=1,w=C="",h=o;break;case 58:h=1+C0(C),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&pmn()==125)continue}switch(C+=x$(x),x*m){case 38:y=d>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[u++]=(C0(C)-1)*y,y=1;break;case 64:Ew()===45&&(C+=Nwe(Mg())),f=Ew(),d=h=C0(w=C+=xmn(bK())),x++;break;case 45:g===45&&C0(C)==2&&(m=0)}}return a}function u_t(t,e,r,n,i,a,o,s,l,u,d,h){for(var f=i-1,p=i===0?a:[""],g=l_t(p),m=0,v=0,y=0;m0?p[b]+" "+x:Iwe(x,/&\f/g,p[b])))&&(l[y++]=w);return Pwe(t,e,r,i===0?i_t:s,l,u,d,h)}function Amn(t,e,r,n){return Pwe(t,e,r,Lwe,x$(fmn()),FR(t,2,-2),0,n)}function d_t(t,e,r,n,i){return Pwe(t,e,r,a_t,FR(t,0,n),FR(t,n+1,-1),n,i)}function $we(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),kmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hzn);return{id:h_t,diagram:t}},"loader"),Omn={id:h_t,detector:Cmn,loader:kmn},Emn=Omn,f_t="flowchart",_mn=k((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"),Rmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>P_e);return{id:f_t,diagram:t}},"loader"),Dmn={id:f_t,detector:_mn,loader:Rmn},Lmn=Dmn,p_t="flowchart-v2",Mmn=k((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"),Imn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>P_e);return{id:p_t,diagram:t}},"loader"),Pmn={id:p_t,detector:Mmn,loader:Imn},Nmn=Pmn,g_t="swimlane",Bmn=k(t=>/^\s*swimlane-beta\b/.test(t),"detector"),$mn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oUn);return{id:g_t,diagram:t}},"loader"),Fmn={id:g_t,detector:Bmn,loader:$mn},zmn=Fmn,m_t="er",Umn=k(t=>/^\s*erDiagram/.test(t),"detector"),Vmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pUn);return{id:m_t,diagram:t}},"loader"),Gmn={id:m_t,detector:Umn,loader:Vmn},Qmn=Gmn,v_t="gitGraph",Hmn=k(t=>/^\s*gitGraph/.test(t),"detector"),Wmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vri);return{id:v_t,diagram:t}},"loader"),Ymn={id:v_t,detector:Hmn,loader:Wmn},qmn=Ymn,y_t="gantt",jmn=k(t=>/^\s*gantt/.test(t),"detector"),Xmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vni);return{id:y_t,diagram:t}},"loader"),Kmn={id:y_t,detector:jmn,loader:Xmn},Zmn=Kmn,b_t="info",Jmn=k(t=>/^\s*info/.test(t),"detector"),e0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cni);return{id:b_t,diagram:t}},"loader"),t0n={id:b_t,detector:Jmn,loader:e0n},x_t="pie",r0n=k(t=>/^\s*pie/.test(t),"detector"),n0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vni);return{id:x_t,diagram:t}},"loader"),i0n={id:x_t,detector:r0n,loader:n0n},w_t="quadrantChart",a0n=k(t=>/^\s*quadrantChart/.test(t),"detector"),o0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xni);return{id:w_t,diagram:t}},"loader"),s0n={id:w_t,detector:a0n,loader:o0n},l0n=s0n,A_t="xychart",c0n=k(t=>/^\s*xychart(-beta)?/.test(t),"detector"),u0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>dii);return{id:A_t,diagram:t}},"loader"),d0n={id:A_t,detector:c0n,loader:u0n},h0n=d0n,S_t="requirement",f0n=k(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),p0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bii);return{id:S_t,diagram:t}},"loader"),g0n={id:S_t,detector:f0n,loader:p0n},m0n=g0n,T_t="sequence",v0n=k(t=>/^\s*sequenceDiagram/.test(t),"detector"),y0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pai);return{id:T_t,diagram:t}},"loader"),b0n={id:T_t,detector:v0n,loader:y0n},x0n=b0n,C_t="class",w0n=k((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"),A0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xai);return{id:C_t,diagram:t}},"loader"),S0n={id:C_t,detector:w0n,loader:A0n},T0n=S0n,k_t="classDiagram",C0n=k((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"),k0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Aai);return{id:k_t,diagram:t}},"loader"),O0n={id:k_t,detector:C0n,loader:k0n},E0n=O0n,O_t="state",_0n=k((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"),R0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>doi);return{id:O_t,diagram:t}},"loader"),D0n={id:O_t,detector:_0n,loader:R0n},L0n=D0n,E_t="stateDiagram",M0n=k((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"),I0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>foi);return{id:E_t,diagram:t}},"loader"),P0n={id:E_t,detector:M0n,loader:I0n},N0n=P0n,__t="journey",B0n=k(t=>/^\s*journey/.test(t),"detector"),$0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Poi);return{id:__t,diagram:t}},"loader"),F0n={id:__t,detector:B0n,loader:$0n},z0n=F0n,U0n=k((t,e,r)=>{ye.debug(`rendering svg for syntax error + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),rmn=k((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"),nmn=k((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"),imn={extension:Ngn,composition:Bgn,aggregation:$gn,dependency:Fgn,lollipop:zgn,point:Ugn,circle:Vgn,cross:Ggn,barb:Qgn,barbNeo:Hgn,only_one:Wgn,zero_or_one:Ygn,one_or_more:qgn,zero_or_more:jgn,only_one_neo:Xgn,zero_or_one_neo:Kgn,one_or_more_neo:Zgn,zero_or_more_neo:Jgn,requirement_arrow:emn,requirement_contains:rmn,requirement_arrow_neo:tmn,requirement_contains_neo:nmn},Dwe=Pgn,amn={common:Xt,getConfig:Dr,insertCluster:hK,insertEdge:_we,insertEdgeLabel:mK,insertMarkers:Dwe,insertNode:f$,interpolateToCurve:Qxe,labelHelper:gn,log:ye,positionEdgeLabel:KEt},y$={},n_t=k(t=>{for(const e of t)y$[e.name]=e},"registerLayoutLoaders"),omn=k(()=>{n_t([{name:"dagre",loader:k(async()=>await Promise.resolve().then(()=>Z6n),"loader")},{name:"swimlane",loader:k(async()=>await Promise.resolve().then(()=>uNn),"loader")},{name:"cose-bilkent",loader:k(async()=>await Promise.resolve().then(()=>X9n),"loader")}])},"registerDefaultLayoutLoaders");omn();var B5=k(async(t,e,r)=>{if(!(t.layoutAlgorithm in y$))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const f=h.domId||h.id;h.domId=`${t.diagramId}-${f}`}const n=y$[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:o}=t.config,{useGradient:s,gradientStart:l,gradientStop:u}=o,d=e.attr("id");if(e.append("defs").append("filter").attr("id",`${d}-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",`${d}-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 h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,amn,{algorithm:n.algorithm},r)},"render"),b$=k((t="",{fallback:e="dagre"}={})=>{if(t in y$)return t;if(e in y$)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"),Lwe="comm",i_t="rule",a_t="decl",smn="@media",lmn="@import",cmn="@supports",umn="@namespace",Mwe="@keyframes",o_t="@layer",dmn="@scope",hmn=Math.abs,x$=String.fromCharCode;function s_t(t){return t.trim()}function Iwe(t,e,r){return t.replace(e,r)}function $5(t,e){return t.charCodeAt(e)|0}function F5(t,e,r){return t.slice(e,r)}function C0(t){return t.length}function l_t(t){return t.length}function vK(t,e){return e.push(t),t}var yK=1,z5=1,c_t=0,yp=0,zs=0,U5="";function Pwe(t,e,r,n,i,a,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:yK,column:z5,length:o,return:"",siblings:s}}function fmn(){return zs}function pmn(){return zs=yp>0?$5(U5,--yp):0,z5--,zs===10&&(z5=1,yK--),zs}function Mg(){return zs=yp2||w$(zs)>3?"":" "}function ymn(t,e){for(;--e&&Mg()&&!(zs<48||zs>102||zs>57&&zs<65||zs>70&&zs<97););return xK(t,bK()+(e<6&&Ew()==32&&Mg()==32))}function Bwe(t){for(;Mg();)switch(zs){case t:return yp;case 34:case 39:t!==34&&t!==39&&Bwe(zs);break;case 40:t===41&&Bwe(t);break;case 92:Mg();break}return yp}function bmn(t,e){for(;Mg()&&t+zs!==57;)if(t+zs===84&&Ew()===47)break;return"/*"+xK(e,yp-1)+"*"+x$(t===47?t:Mg())}function xmn(t){for(;!w$(Ew());)Mg();return xK(t,yp)}function wmn(t){return mmn(wK("",null,null,null,[""],t=gmn(t),0,[0],t))}function wK(t,e,r,n,i,a,o,s,l){for(var u=0,d=0,h=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=Mg()){case 40:g!=108&&$5(C,h-1)==58?(b++,C+="("):C+=Nwe(x);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=Nwe(x);break;case 9:case 10:case 13:case 32:if(b>0){C+=x$(x);break}C+=vmn(g);break;case 92:C+=ymn(bK()-1,7);continue;case 47:switch(Ew()){case 42:case 47:vK(Amn(bmn(Mg(),bK()),e,r,l),l),(w$(g||1)==5||w$(Ew()||1)==5)&&C0(C)&&F5(C,-1,void 0)!==" "&&(C+=" ");break;default:C+="/"}break;case 123*m:s[u++]=C0(C)*y;case 125*m:case 59:case 0:if(b>0&&x){C+=x$(x);break}switch(x){case 0:case 125:v=0;case 59+d:y==-1&&(C=Iwe(C,/\f/g,"")),p>0&&(C0(C)-h||m===0)&&vK(p>32?d_t(C+";",n,r,h-1,l):d_t(Iwe(C," ","")+";",n,r,h-2,l),l);break;case 59:C+=";";default:if(vK(T=u_t(C,e,r,u,d,i,s,w,A=[],S=[],h,a),a),x===123)if(d===0)wK(C,e,T,T,A,a,h,s,S);else{switch(f){case 99:if($5(C,3)===110)break;case 108:if($5(C,2)===97)break;default:d=0;case 100:case 109:case 115:}d?wK(t,T,T,n&&vK(u_t(t,T,T,0,0,i,s,w,i,A=[],h,S),S),i,S,h,s,n?A:S):wK(C,T,T,T,[""],S,0,s,S)}}u=d=p=0,m=y=1,w=C="",h=o;break;case 58:h=1+C0(C),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&pmn()==125)continue}switch(C+=x$(x),x*m){case 38:y=d>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[u++]=(C0(C)-1)*y,y=1;break;case 64:Ew()===45&&(C+=Nwe(Mg())),f=Ew(),d=h=C0(w=C+=xmn(bK())),x++;break;case 45:g===45&&C0(C)==2&&(m=0)}}return a}function u_t(t,e,r,n,i,a,o,s,l,u,d,h){for(var f=i-1,p=i===0?a:[""],g=l_t(p),m=0,v=0,y=0;m0?p[b]+" "+x:Iwe(x,/&\f/g,p[b])))&&(l[y++]=w);return Pwe(t,e,r,i===0?i_t:s,l,u,d,h)}function Amn(t,e,r,n){return Pwe(t,e,r,Lwe,x$(fmn()),F5(t,2,-2),0,n)}function d_t(t,e,r,n,i){return Pwe(t,e,r,a_t,F5(t,0,n),F5(t,n+1,-1),n,i)}function $we(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),kmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hzn);return{id:h_t,diagram:t}},"loader"),Omn={id:h_t,detector:Cmn,loader:kmn},Emn=Omn,f_t="flowchart",_mn=k((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"),Rmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>P_e);return{id:f_t,diagram:t}},"loader"),Dmn={id:f_t,detector:_mn,loader:Rmn},Lmn=Dmn,p_t="flowchart-v2",Mmn=k((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"),Imn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>P_e);return{id:p_t,diagram:t}},"loader"),Pmn={id:p_t,detector:Mmn,loader:Imn},Nmn=Pmn,g_t="swimlane",Bmn=k(t=>/^\s*swimlane-beta\b/.test(t),"detector"),$mn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oUn);return{id:g_t,diagram:t}},"loader"),Fmn={id:g_t,detector:Bmn,loader:$mn},zmn=Fmn,m_t="er",Umn=k(t=>/^\s*erDiagram/.test(t),"detector"),Vmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pUn);return{id:m_t,diagram:t}},"loader"),Gmn={id:m_t,detector:Umn,loader:Vmn},Qmn=Gmn,v_t="gitGraph",Hmn=k(t=>/^\s*gitGraph/.test(t),"detector"),Wmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vri);return{id:v_t,diagram:t}},"loader"),Ymn={id:v_t,detector:Hmn,loader:Wmn},qmn=Ymn,y_t="gantt",jmn=k(t=>/^\s*gantt/.test(t),"detector"),Xmn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vni);return{id:y_t,diagram:t}},"loader"),Kmn={id:y_t,detector:jmn,loader:Xmn},Zmn=Kmn,b_t="info",Jmn=k(t=>/^\s*info/.test(t),"detector"),e0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cni);return{id:b_t,diagram:t}},"loader"),t0n={id:b_t,detector:Jmn,loader:e0n},x_t="pie",r0n=k(t=>/^\s*pie/.test(t),"detector"),n0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vni);return{id:x_t,diagram:t}},"loader"),i0n={id:x_t,detector:r0n,loader:n0n},w_t="quadrantChart",a0n=k(t=>/^\s*quadrantChart/.test(t),"detector"),o0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xni);return{id:w_t,diagram:t}},"loader"),s0n={id:w_t,detector:a0n,loader:o0n},l0n=s0n,A_t="xychart",c0n=k(t=>/^\s*xychart(-beta)?/.test(t),"detector"),u0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>dii);return{id:A_t,diagram:t}},"loader"),d0n={id:A_t,detector:c0n,loader:u0n},h0n=d0n,S_t="requirement",f0n=k(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),p0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bii);return{id:S_t,diagram:t}},"loader"),g0n={id:S_t,detector:f0n,loader:p0n},m0n=g0n,T_t="sequence",v0n=k(t=>/^\s*sequenceDiagram/.test(t),"detector"),y0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pai);return{id:T_t,diagram:t}},"loader"),b0n={id:T_t,detector:v0n,loader:y0n},x0n=b0n,C_t="class",w0n=k((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"),A0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xai);return{id:C_t,diagram:t}},"loader"),S0n={id:C_t,detector:w0n,loader:A0n},T0n=S0n,k_t="classDiagram",C0n=k((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"),k0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Aai);return{id:k_t,diagram:t}},"loader"),O0n={id:k_t,detector:C0n,loader:k0n},E0n=O0n,O_t="state",_0n=k((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"),R0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>doi);return{id:O_t,diagram:t}},"loader"),D0n={id:O_t,detector:_0n,loader:R0n},L0n=D0n,E_t="stateDiagram",M0n=k((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"),I0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>foi);return{id:E_t,diagram:t}},"loader"),P0n={id:E_t,detector:M0n,loader:I0n},N0n=P0n,__t="journey",B0n=k(t=>/^\s*journey/.test(t),"detector"),$0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Poi);return{id:__t,diagram:t}},"loader"),F0n={id:__t,detector:B0n,loader:$0n},z0n=F0n,U0n=k((t,e,r)=>{ye.debug(`rendering svg for syntax error `);const n=iu(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"),R_t={draw:U0n},V0n=R_t,G0n={db:{},renderer:R_t,parser:{parse:k(()=>{},"parse")}},Q0n=G0n,D_t="flowchart-elk",H0n=k((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"),W0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>P_e);return{id:D_t,diagram:t}},"loader"),Y0n={id:D_t,detector:H0n,loader:W0n},q0n=Y0n,L_t="timeline",j0n=k(t=>/^\s*timeline/.test(t),"detector"),X0n=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>usi);return{id:L_t,diagram:t}},"loader"),K0n={id:L_t,detector:j0n,loader:X0n},Z0n=K0n,M_t="mindmap",J0n=k(t=>/^\s*mindmap/.test(t),"detector"),evn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ksi);return{id:M_t,diagram:t}},"loader"),tvn={id:M_t,detector:J0n,loader:evn},rvn=tvn,I_t="kanban",nvn=k(t=>/^\s*kanban/.test(t),"detector"),ivn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wsi);return{id:I_t,diagram:t}},"loader"),avn={id:I_t,detector:nvn,loader:ivn},ovn=avn,P_t="sankey",svn=k(t=>/^\s*sankey(-beta)?/.test(t),"detector"),lvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Dli);return{id:P_t,diagram:t}},"loader"),cvn={id:P_t,detector:svn,loader:lvn},uvn=cvn,N_t="packet",dvn=k(t=>/^\s*packet(-beta)?/.test(t),"detector"),hvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vli);return{id:N_t,diagram:t}},"loader"),fvn={id:N_t,detector:dvn,loader:hvn},B_t="radar",pvn=k(t=>/^\s*radar-beta/.test(t),"detector"),gvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>cci);return{id:B_t,diagram:t}},"loader"),mvn={id:B_t,detector:pvn,loader:gvn},$_t="block",vvn=k(t=>/^\s*block(-beta)?/.test(t),"detector"),yvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Nui);return{id:$_t,diagram:t}},"loader"),bvn={id:$_t,detector:vvn,loader:yvn},xvn=bvn,F_t="treeView",wvn=k(t=>/^\s*treeView-beta/.test(t),"detector"),Avn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>odi);return{id:F_t,diagram:t}},"loader"),Svn={id:F_t,detector:wvn,loader:Avn},Tvn=Svn,z_t="architecture",Cvn=k(t=>/^\s*architecture/.test(t),"detector"),kvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rdi);return{id:z_t,diagram:t}},"loader"),Ovn={id:z_t,detector:Cvn,loader:kvn},Evn=Ovn,U_t="eventmodeling",_vn=k(t=>/^\s*eventmodeling/.test(t),"detector"),Rvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wdi);return{id:U_t,diagram:t}},"loader"),Dvn={id:U_t,detector:_vn,loader:Rvn},Lvn=Dvn,V_t="ishikawa",Mvn=k(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),Ivn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>chi);return{id:V_t,diagram:t}},"loader"),Pvn={id:V_t,detector:Mvn,loader:Ivn},G_t="venn",Nvn=k(t=>/^\s*venn-beta/.test(t),"detector"),Bvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qhi);return{id:G_t,diagram:t}},"loader"),$vn={id:G_t,detector:Nvn,loader:Bvn},Fvn=$vn,Q_t="treemap",zvn=k(t=>/^\s*treemap/.test(t),"detector"),Uvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>afi);return{id:Q_t,diagram:t}},"loader"),Vvn={id:Q_t,detector:zvn,loader:Uvn},H_t="wardley",Gvn=k(t=>/^\s*wardley-beta/i.test(t),"detector"),Qvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vfi);return{id:H_t,diagram:t}},"loader"),Hvn={id:H_t,detector:Gvn,loader:Qvn},Wvn=Hvn,W_t="cynefin",Yvn=k(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),qvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ifi);return{id:W_t,diagram:t}},"loader"),jvn={id:W_t,detector:Yvn,loader:qvn},Y_t="railroad",Xvn=k(t=>/^\s*railroad-beta/i.test(t),"detector"),Kvn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>api);return{id:Y_t,diagram:t}},"loader"),Zvn={id:Y_t,detector:Xvn,loader:Kvn},q_t="railroadEbnf",Jvn=k(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),eyn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ppi);return{id:q_t,diagram:t}},"loader"),tyn={id:q_t,detector:Jvn,loader:eyn},j_t="railroadAbnf",ryn=k(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),nyn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tpi);return{id:j_t,diagram:t}},"loader"),iyn={id:j_t,detector:ryn,loader:nyn},X_t="railroadPeg",ayn=k(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),oyn=k(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ipi);return{id:X_t,diagram:t}},"loader"),syn={id:X_t,detector:ayn,loader:oyn},K_t=!1,AK=k(()=>{K_t||(K_t=!0,Gj("error",Q0n,t=>t.toLowerCase().trim()==="error"),Gj("---",{db:{clear:k(()=>{},"clear")},styles:{},renderer:{draw:k(()=>{},"draw")},parser:{parse:k(()=>{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:k(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),obe(q0n,rvn,Evn),obe(Emn,ovn,E0n,T0n,Qmn,Zmn,t0n,i0n,m0n,x0n,zmn,Nmn,Lmn,Z0n,qmn,N0n,L0n,z0n,l0n,uvn,fvn,h0n,xvn,Lvn,Tvn,mvn,Pvn,Vvn,Zvn,tyn,iyn,syn,Fvn,Wvn,jvn))},"addDiagrams"),lyn=k(async()=>{ye.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(FT).map(async([r,{detector:n,loader:i}])=>{if(i)try{ybe(r)}catch{try{const{diagram:a,id:o}=await i();Gj(o,a,n)}catch(a){throw ye.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete FT[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"),cyn="graphics-document document";function Z_t(t,e){t.attr("role",cyn),e!==""&&t.attr("aria-roledescription",e)}k(Z_t,"setA11yDiagramInfo");function J_t(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)}}}k(J_t,"addSVGa11yTitleDescription");var Fwe=(CO=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,d;const n=Dr(),i=abe(e,n);e=Dfn(e)+` -`;try{ybe(i)}catch{const h=Zin(i);if(!h)throw new D2t(`Diagram ${i} not found.`);const{id:f,diagram:p}=await h();Gj(f,p)}const{db:a,parser:o,renderer:s,init:l}=ybe(i);return o.parser&&(o.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((d=a.setDiagramTitle)==null||d.call(a,r.title)),await o.parse(e),new CO(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}},k(CO,"Diagram"),CO),e5t=[],uyn=k(()=>{e5t.forEach(t=>{t()}),e5t=[]},"attachFunctions"),dyn=k(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function t5t(t){const e=t.match(R2t);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` +`;try{ybe(i)}catch{const h=Zin(i);if(!h)throw new D2t(`Diagram ${i} not found.`);const{id:f,diagram:p}=await h();Gj(f,p)}const{db:a,parser:o,renderer:s,init:l}=ybe(i);return o.parser&&(o.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((d=a.setDiagramTitle)==null||d.call(a,r.title)),await o.parse(e),new CO(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}},k(CO,"Diagram"),CO),eRt=[],uyn=k(()=>{eRt.forEach(t=>{t()}),eRt=[]},"attachFunctions"),dyn=k(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function tRt(t){const e=t.match(R2t);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=zX(n,{schema:FX})??{};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}}k(t5t,"extractFrontMatter");var hyn=k(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),fyn=k(t=>{const{text:e,metadata:r}=t5t(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"),pyn=k(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:wfn(t),directive:e}},"processDirectives");function zwe(t){const e=hyn(t),r=fyn(e),n=pyn(r.text),i=uo(r.config,n.directive);return t=dyn(n.text),{code:t,title:r.title,config:i}}k(zwe,"preprocessDiagram");function r5t(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}k(r5t,"toBase64");var gyn=5e4,myn="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",vyn="sandbox",yyn="loose",byn="http://www.w3.org/2000/svg",xyn="http://www.w3.org/1999/xlink",wyn="http://www.w3.org/1999/xhtml",Ayn="100%",Syn="100%",Tyn="border:0;margin:0;",Cyn="margin:0",kyn="allow-top-navigation-by-user-activation allow-popups",Oyn='The "iframe" tag is not supported by your browser.',Eyn=["foreignobject"],_yn=["dominant-baseline"];function Uwe(t){const e=zwe(t);return $j(),qin(e.config??{}),e}k(Uwe,"processAndSetConfigs");async function n5t(t,e){AK();try{const{code:r,config:n}=Uwe(t);return{diagramType:(await s5t(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}k(n5t,"parse");var i5t=k((t,e,r=[])=>{const n=S2t(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),Ryn=k((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=ia(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{JCt(l.styles)||s.forEach(u=>{r.insertRule(i5t(l.id,u,l.styles),r.cssRules.length)}),JCt(l.textStyles)||r.insertRule(i5t(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=cbe(i)+` +`):e[2];let i=zX(n,{schema:FX})??{};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}}k(tRt,"extractFrontMatter");var hyn=k(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),fyn=k(t=>{const{text:e,metadata:r}=tRt(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"),pyn=k(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:wfn(t),directive:e}},"processDirectives");function zwe(t){const e=hyn(t),r=fyn(e),n=pyn(r.text),i=uo(r.config,n.directive);return t=dyn(n.text),{code:t,title:r.title,config:i}}k(zwe,"preprocessDiagram");function rRt(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}k(rRt,"toBase64");var gyn=5e4,myn="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",vyn="sandbox",yyn="loose",byn="http://www.w3.org/2000/svg",xyn="http://www.w3.org/1999/xlink",wyn="http://www.w3.org/1999/xhtml",Ayn="100%",Syn="100%",Tyn="border:0;margin:0;",Cyn="margin:0",kyn="allow-top-navigation-by-user-activation allow-popups",Oyn='The "iframe" tag is not supported by your browser.',Eyn=["foreignobject"],_yn=["dominant-baseline"];function Uwe(t){const e=zwe(t);return $j(),qin(e.config??{}),e}k(Uwe,"processAndSetConfigs");async function nRt(t,e){AK();try{const{code:r,config:n}=Uwe(t);return{diagramType:(await sRt(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}k(nRt,"parse");var iRt=k((t,e,r=[])=>{const n=S2t(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),Ryn=k((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=ia(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{JCt(l.styles)||s.forEach(u=>{r.insertRule(iRt(l.id,u,l.styles),r.cssRules.length)}),JCt(l.textStyles)||r.insertRule(iRt(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=cbe(i)+` `}else n+=`${t.themeCSS} -`;return n+cbe(r)},"createCssStyles"),Dyn=k((t,e)=>$we(wmn(`${t}{${e}}`),Tmn([k(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===Mwe)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("@")&&([...[smn,cmn,o_t,dmn,"@container","@starting-style"],Mwe].includes(n.type)||(ye.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Lwe))},"addNamespace"),Smn])),"compileCSS"),Lyn=k((t,e,r,n)=>{const i=Ryn(t,r),a=pan(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return Dyn(n,a)},"createUserStyles"),Myn=k((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=l1(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),Iyn=k((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":Syn,n=r5t(`${t}`);return``},"putIntoIFrame"),a5t=k((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",byn);return i&&o.attr("xmlns:xlink",i),o.append("g"),t},"appendDivSvgG");function Vwe(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}k(Vwe,"sandboxedIframe");var Pyn=k((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"),Nyn=k(async function(t,e,r){var P,L,R,D,M,I;AK();const n=Uwe(e);e=n.code;const i=Dr();ye.debug(i),e.length>((i==null?void 0:i.maxTextSize)??gyn)&&(e=myn);const a=`#${t}`,o="i"+t,s="#"+o,l="d"+t,u="#"+l,d=k(()=>{const F=_t(f?s:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let h=_t(document.body);const f=i.securityLevel===vyn,p=i.securityLevel===yyn,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=Vwe(_t(r),o);h=_t(N.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=_t(r);a5t(h,t,l,`font-family: ${g}`,xyn)}else{if(Pyn(document,t,l,o),f){const N=Vwe(_t(document.body),o);h=_t(N.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=_t("body");a5t(h,t,l)}let m,v;try{m=await Fwe.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw d(),N;m=await Fwe.fromText("error"),v=N}const y=h.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=Lyn(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?d():V0n.draw(e,t,"11.16.1"),N}const C=h.select(`${u} svg`),O=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(I=(M=m.db).getAccDescription)==null?void 0:I.call(M);l5t(b,C,O,E),h.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",wyn);let _=h.select(u).node().innerHTML;if(ye.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=Myn(_,f,m0(i.arrowMarkerAbsolute)),f){const N=h.select(u+" svg").node();_=Iyn(_,N)}else p||(_=Xy.sanitize(_,{ADD_TAGS:Eyn,ADD_ATTR:_yn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(uyn(),v)throw v;return d(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function o5t(t={}){var n;const e=Fs({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Win(e),e!=null&&e.theme&&e.theme in Zy?e.themeVariables=Zy[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Zy.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Hin(e):T2t();Y1e(r.logLevel),AK()}k(o5t,"initialize");var s5t=k((t,e={})=>{const{code:r}=zwe(t);return Fwe.fromText(r,e)},"getDiagramFromText");function l5t(t,e,r,n){Z_t(e,t),J_t(e,r,n,e.attr("id"))}k(l5t,"addA11yInfo");var uC=Object.freeze({render:Nyn,parse:n5t,getDiagramFromText:s5t,initialize:o5t,getConfig:Dr,setConfig:C2t,getSiteConfig:T2t,updateSiteConfig:Yin,reset:k(()=>{$j()},"reset"),globalReset:k(()=>{$j(cR)},"globalReset"),defaultConfig:cR});Y1e(Dr().logLevel),$j(Dr());var Byn=k((t,e,r)=>{ye.warn(t),qxe(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"),c5t=k(async function(t={querySelector:".mermaid"}){try{await $yn(t)}catch(e){if(qxe(e)&&ye.error(e.str),Zh.parseError&&Zh.parseError(e),!t.suppressErrors)throw ye.error("Use the suppressErrors option to suppress these errors"),e}},"run"),$yn=k(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=uC.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)),uC.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=Bkt(un.entityDecode(o)).trim().replace(//gi,"
");const d=un.detectInit(o);d&&ye.debug("Detected early reinit: ",d);try{const{svg:h,bindFunctions:f}=await f5t(u,o,l);l.innerHTML=h,t&&await t(u),f&&f(l)}catch(h){Byn(h,s,Zh.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),u5t=k(function(t){uC.initialize(t)},"initialize"),Fyn=k(async function(t,e,r){ye.warn("mermaid.init is deprecated. Please use run instead."),t&&u5t(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await c5t(n)},"init"),zyn=k(async(t,{lazyLoad:e=!0}={})=>{AK(),obe(...t),e===!1&&await lyn()},"registerExternalDiagrams"),d5t=k(function(){if(Zh.startOnLoad){const{startOnLoad:t}=uC.getConfig();t&&Zh.run().catch(e=>ye.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",d5t,!1);var Uyn=k(function(t){Zh.parseError=t},"setParseErrorHandler"),SK=[],Gwe=!1,h5t=k(async()=>{if(!Gwe){for(Gwe=!0;SK.length>0;){const t=SK.shift();if(t)try{await t()}catch(e){ye.error("Error executing queue",e)}}Gwe=!1}},"executeQueue"),Vyn=k(async(t,e)=>new Promise((r,n)=>{const i=k(()=>new Promise((a,o)=>{uC.parse(t,e).then(s=>{a(s),r(s)},s=>{var l;ye.error("Error parsing",s),(l=Zh.parseError)==null||l.call(Zh,s),o(s),n(s)})}),"performCall");SK.push(i),h5t().catch(n)}),"parse"),f5t=k((t,e,r)=>new Promise((n,i)=>{const a=k(()=>new Promise((o,s)=>{uC.render(t,e,r).then(l=>{o(l),n(l)},l=>{var u;ye.error("Error parsing",l),(u=Zh.parseError)==null||u.call(Zh,l),s(l),i(l)})}),"performCall");SK.push(a),h5t().catch(i)}),"render"),Gyn=k(()=>Object.keys(FT).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Zh={startOnLoad:!0,mermaidAPI:uC,parse:Vyn,render:f5t,init:Fyn,run:c5t,registerExternalDiagrams:zyn,registerLayoutLoaders:n_t,initialize:u5t,parseError:void 0,contentLoaded:d5t,setParseErrorHandler:Uyn,detectType:abe,registerIconPacks:Zxe,getRegisteredDiagramsMetadata:Gyn},Qyn=Zh;/*! Check if previously processed *//*! +`},"putIntoIFrame"),aRt=k((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",byn);return i&&o.attr("xmlns:xlink",i),o.append("g"),t},"appendDivSvgG");function Vwe(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}k(Vwe,"sandboxedIframe");var Pyn=k((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"),Nyn=k(async function(t,e,r){var P,L,R,D,M,I;AK();const n=Uwe(e);e=n.code;const i=Dr();ye.debug(i),e.length>((i==null?void 0:i.maxTextSize)??gyn)&&(e=myn);const a=`#${t}`,o="i"+t,s="#"+o,l="d"+t,u="#"+l,d=k(()=>{const F=_t(f?s:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let h=_t(document.body);const f=i.securityLevel===vyn,p=i.securityLevel===yyn,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=Vwe(_t(r),o);h=_t(N.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=_t(r);aRt(h,t,l,`font-family: ${g}`,xyn)}else{if(Pyn(document,t,l,o),f){const N=Vwe(_t(document.body),o);h=_t(N.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=_t("body");aRt(h,t,l)}let m,v;try{m=await Fwe.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw d(),N;m=await Fwe.fromText("error"),v=N}const y=h.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=Lyn(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?d():V0n.draw(e,t,"11.16.1"),N}const C=h.select(`${u} svg`),O=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(I=(M=m.db).getAccDescription)==null?void 0:I.call(M);lRt(b,C,O,E),h.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",wyn);let _=h.select(u).node().innerHTML;if(ye.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=Myn(_,f,m0(i.arrowMarkerAbsolute)),f){const N=h.select(u+" svg").node();_=Iyn(_,N)}else p||(_=Xy.sanitize(_,{ADD_TAGS:Eyn,ADD_ATTR:_yn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(uyn(),v)throw v;return d(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function oRt(t={}){var n;const e=Fs({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Win(e),e!=null&&e.theme&&e.theme in Zy?e.themeVariables=Zy[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Zy.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Hin(e):T2t();Y1e(r.logLevel),AK()}k(oRt,"initialize");var sRt=k((t,e={})=>{const{code:r}=zwe(t);return Fwe.fromText(r,e)},"getDiagramFromText");function lRt(t,e,r,n){Z_t(e,t),J_t(e,r,n,e.attr("id"))}k(lRt,"addA11yInfo");var uC=Object.freeze({render:Nyn,parse:nRt,getDiagramFromText:sRt,initialize:oRt,getConfig:Dr,setConfig:C2t,getSiteConfig:T2t,updateSiteConfig:Yin,reset:k(()=>{$j()},"reset"),globalReset:k(()=>{$j(c5)},"globalReset"),defaultConfig:c5});Y1e(Dr().logLevel),$j(Dr());var Byn=k((t,e,r)=>{ye.warn(t),qxe(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"),cRt=k(async function(t={querySelector:".mermaid"}){try{await $yn(t)}catch(e){if(qxe(e)&&ye.error(e.str),Zh.parseError&&Zh.parseError(e),!t.suppressErrors)throw ye.error("Use the suppressErrors option to suppress these errors"),e}},"run"),$yn=k(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=uC.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)),uC.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=Bkt(un.entityDecode(o)).trim().replace(//gi,"
");const d=un.detectInit(o);d&&ye.debug("Detected early reinit: ",d);try{const{svg:h,bindFunctions:f}=await fRt(u,o,l);l.innerHTML=h,t&&await t(u),f&&f(l)}catch(h){Byn(h,s,Zh.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),uRt=k(function(t){uC.initialize(t)},"initialize"),Fyn=k(async function(t,e,r){ye.warn("mermaid.init is deprecated. Please use run instead."),t&&uRt(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await cRt(n)},"init"),zyn=k(async(t,{lazyLoad:e=!0}={})=>{AK(),obe(...t),e===!1&&await lyn()},"registerExternalDiagrams"),dRt=k(function(){if(Zh.startOnLoad){const{startOnLoad:t}=uC.getConfig();t&&Zh.run().catch(e=>ye.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",dRt,!1);var Uyn=k(function(t){Zh.parseError=t},"setParseErrorHandler"),SK=[],Gwe=!1,hRt=k(async()=>{if(!Gwe){for(Gwe=!0;SK.length>0;){const t=SK.shift();if(t)try{await t()}catch(e){ye.error("Error executing queue",e)}}Gwe=!1}},"executeQueue"),Vyn=k(async(t,e)=>new Promise((r,n)=>{const i=k(()=>new Promise((a,o)=>{uC.parse(t,e).then(s=>{a(s),r(s)},s=>{var l;ye.error("Error parsing",s),(l=Zh.parseError)==null||l.call(Zh,s),o(s),n(s)})}),"performCall");SK.push(i),hRt().catch(n)}),"parse"),fRt=k((t,e,r)=>new Promise((n,i)=>{const a=k(()=>new Promise((o,s)=>{uC.render(t,e,r).then(l=>{o(l),n(l)},l=>{var u;ye.error("Error parsing",l),(u=Zh.parseError)==null||u.call(Zh,l),s(l),i(l)})}),"performCall");SK.push(a),hRt().catch(i)}),"render"),Gyn=k(()=>Object.keys(FT).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Zh={startOnLoad:!0,mermaidAPI:uC,parse:Vyn,render:fRt,init:Fyn,run:cRt,registerExternalDiagrams:zyn,registerLayoutLoaders:n_t,initialize:uRt,parseError:void 0,contentLoaded:dRt,setParseErrorHandler:Uyn,detectType:abe,registerIconPacks:Zxe,getRegisteredDiagramsMetadata:Gyn},Qyn=Zh;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */const Hyn=Object.freeze(Object.defineProperty({__proto__:null,default:Qyn},Symbol.toStringTag,{value:"Module"})),p5t=1024;let Wyn=0,bp=class{constructor(e,r){this.from=e,this.to=r}};class _n{constructor(e={}){this.id=Wyn++,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=Us.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 VR{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 Yyn=Object.create(null);class Us{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):Yyn,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Us(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}}}}Us.none=new Us("",Object.create(null),0,8);class GR{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(o|Zi.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:Ywe(Us.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(Us.none,r,n,i)))}static build(e){return Kyn(e)}}ci.empty=new ci(Us.none,[],[],0);class Qwe{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 Qwe(this.buffer,this.index)}}class _w{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Us.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 A$(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 d=s[e],h=l[e]+o.from,f;if(!(!(a&Zi.EnterBracketed&&d instanceof ci&&(f=VR.get(d))&&!f.overlay&&f.bracketed&&n>=h&&n<=h+d.length)&&!m5t(i,n,h,h+d.length))){if(d instanceof _w){if(a&Zi.ExcludeBuffers)continue;let p=d.findChild(0,d.buffer.length,r,n-h,i);if(p>-1)return new k0(new qyn(o,d,e,h),null,p)}else if(a&Zi.IncludeAnonymous||!d.type.isAnonymous||Wwe(d)){let p;if(!(a&Zi.IgnoreMounts)&&(p=VR.get(d))&&!p.overlay)return new Aae(p.tree,h,e,o);let g=new Aae(d,h,e,o);return a&Zi.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?d.children.length-1:0,r,n,i,a)}}}if(a&Zi.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&Zi.IgnoreOverlays)&&(i=VR.get(this._tree))&&i.overlay){let a=e-this.from,o=n&Zi.EnterBracketed&&i.bracketed;for(let{from:s,to:l}of i.overlay)if((r>0||o?s<=a:s=a:l>a))return new Aae(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 y5t(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 Hwe(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 qyn{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class k0 extends v5t{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 k0(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&Zi.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 k0(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 k0(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 k0(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 b5t(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||o.to=e){let s=new xp(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(A$(s,e,r,!1))}}return i?b5t(i):n}class CK{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&~Zi.EnterBracketed,e instanceof xp)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 xp?(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&Zi.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zi.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&Zi.IncludeAnonymous||s instanceof _w||!s.type.isAnonymous||Wwe(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 Hwe(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 Wwe(t){return t.children.some(e=>e instanceof _w||!e.type.isAnonymous||Wwe(e))}function Kyn(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=p5t,reused:a=[],minRepeatType:o=n.types.length}=t,s=Array.isArray(r)?new Qwe(r,r.length):r,l=n.types,u=0,d=0;function h(A,S,T,C,O,E){let{id:_,start:P,end:L,size:R}=s,D=d,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){d=_;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,O))){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 _w(V,L-F.start,n),B=F.start-A}else{let V=s.pos-R;s.next();let z=[],U=[],G=_>=o?_:-1,H=0,j=L;for(;s.pos>V;)G>=0&&s.id==G&&s.size>=0?(s.end<=j-i&&(g(z,U,P,H,s.end,j,G,D,M),H=z.length,j=s.end),s.next()):E>2500?f(P,V,z,U):h(P,V,z,U,G,E+1);if(G>=0&&H>0&&H-1&&H>0){let q=p(I,M);N=Ywe(I,z,U,0,z.length,0,L-P,q,q)}else N=m(I,z,U,L-P,D-L,M)}T.push(N),C.push(B)}function f(A,S,T,C){let O=[],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),O.push(P,L,R),E++,s.next()}}if(E){let P=new Uint16Array(E*4),L=O[O.length-2];for(let R=O.length-3,D=0;R>=0;R-=3)P[D++]=O[R],P[D++]=O[R+1]-L,P[D++]=O[R+2]-L,P[D++]=D;T.push(new _w(P,O[2]-L,n)),C.push(L-A)}}function p(A,S){return(T,C,O)=>{let E=0,_=T.length-1,P,L;if(_>=0&&(P=T[_])instanceof ci){if(!_&&P.type==A&&P.length==O)return P;(L=P.prop(_n.lookAhead))&&(E=C[_]+P.length+L)}return m(A,T,C,O,E,S)}}function g(A,S,T,C,O,E,_,P,L){let R=[],D=[];for(;A.length>C;)R.push(A.pop()),D.push(S.pop()+T-O);A.push(m(n.types[_],R,D,E-O,P-E,L)),S.push(O-T)}function m(A,S,T,C,O,E,_){if(E){let P=[_n.contextHash,E];_=_?[P].concat(_):[P]}if(O>25){let P=[_n.lookAhead,O];_=_?[P].concat(_):[P]}return new ci(A,S,T,C,_)}function v(A,S){let T=s.fork(),C=0,O=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=O,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()}O=I,C+=R,E+=M}return(S<0||C==A)&&(P.size=C,P.start=O,P.skip=E),P.size>4?P:void 0}function y(A,S,T){let{id:C,start:O,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]=O-A,S[--T]=C}else _==-3?u=C:_==-4&&(d=C);return T}let b=[],x=[];for(;s.pos>0;)h(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 x5t=new WeakMap;function kK(t,e){if(!t.isAnonymous||e instanceof _w||e.type!=t)return 1;let r=x5t.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof ci)){r=1;break}r+=kK(t,n)}x5t.set(e,r)}return r}function Ywe(t,e,r,n,i,a,o,s,l){let u=0;for(let g=n;g=d)break;S+=T}if(x==w+1){if(S>d){let T=g[w];p(T.children,T.positions,0,T.children.length,m[w]+b);continue}h.push(g[w])}else{let T=m[x-1]+g[x-1].length-A;h.push(Ywe(t,g,m,w,x,A,T,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(s||l)(h,f,o)}class qwe{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 k0?this.setBuffer(e.context.buffer,e.index,r):e instanceof xp&&this.map.set(e.tree,r)}get(e){return e instanceof k0?this.getBuffer(e.context.buffer,e.index):e instanceof xp?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 f1{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 f1(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 d=s=n)for(;o&&o.from=f.from||h<=f.to||u){let p=Math.max(f.from,l)-u,g=Math.min(f.to,h)-u;f=p>=g?null:new f1(p,g,f.tree,f.offset+u,s>0,!!d)}if(f&&i.push(f),o.to>h)break;o=anew bp(i.from,i.to)):[new bp(0,0)]:[new bp(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 Zyn{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 w5t(t){return(e,r,n,i)=>new e1n(e,t,r,n,i)}class A5t{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 S5t(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Jyn{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 jwe=new _n({perNode:!0});class e1n{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([[jwe,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 VR(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(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let h=d.from+u.pos,f=d.to+u.pos;h>=i.from&&f<=i.to&&!r.ranges.some(p=>p.fromh)&&r.ranges.push({from:h,to:f})}}s=!1}else if(n&&(o=t1n(n.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew bp(h.from-i.from,h.to-i.from)):null,!!a.bracketed,i.tree,d.length?d[0].from:i.from)),a.overlay?d.length&&(n={ranges:d,depth:0,prev:n}):s=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new bp(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=k5t(this.ranges,r.ranges);u.length&&(S5t(u),this.inner.splice(r.index,0,new A5t(r.parser,r.parser.startParse(this.input,O5t(r.mounts,u),u),r.ranges.map(d=>new bp(d.from-r.start,d.to-r.start)),r.bracketed,r.target,u[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function t1n(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 T5t(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Zi.IgnoreOverlays|Zi.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 n1n=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(jwe))!==null&&r!==void 0?r:n.to,this.inner=new C5t(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(jwe))!==null&&e!==void 0?e:r.to,this.inner=new C5t(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 k5t(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 bp(s,l.to))):l.to>s?r[a--]=new bp(s,l.to):r.splice(a--,1))}}return n}function i1n(t,e,r,n){let i=0,a=0,o=!1,s=!1,l=-1e9,u=[];for(;;){let d=i==t.length?1e9:o?t[i].to:t[i].from,h=a==e.length?1e9:s?e[a].to:e[a].from;if(o!=s){let f=Math.max(l,r),p=Math.min(d,h,n);fnew bp(f.from+n,f.to+n)),h=i1n(e,d,l,u);for(let f=0,p=l;;f++){let g=f==h.length,m=g?u:h[f].from;if(m>p&&r.push(new f1(p,m,i.tree,-o,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=h[f].to}}else r.push(new f1(l,u,i.tree,-o,a.from>=o||a.openStart,a.to<=s||a.openEnd))}return r}let Xwe=[],E5t=[];(()=>{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=E5t[n])e=n+1;else return!0;if(e==r)return!1}}function _5t(t){return t>=127462&&t<=127487}const R5t=8205;function o1n(t,e,r=!0,n=!0){return(r?D5t:s1n)(t,e,n)}function D5t(t,e,r){if(e==t.length)return e;e&&L5t(t.charCodeAt(e))&&M5t(t.charCodeAt(e-1))&&e--;let n=Kwe(t,e);for(e+=I5t(n);e=0&&_5t(Kwe(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function s1n(t,e,r){for(;e>1;){let n=D5t(t,e-2,r);if(n=56320&&t<57344}function M5t(t){return t>=55296&&t<56320}function I5t(t){return t<65536?1:2}class Ai{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]=QR(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),EK.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]=QR(this,e,r);let n=[];return this.decompose(e,r,n,0),EK.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 S$(this),a=new S$(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 S$(this,e)}iterRange(e,r=this.length){return new N5t(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 B5t(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]?Ai.empty:e.length<=32?new ys(e):EK.from(ys.split(e,[]))}}class ys extends Ai{constructor(e,r=l1n(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 c1n(i,s,n,o);i=s+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new ys(P5t(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),s=_K(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]=QR(this,e,r);let i=_K(this.text,_K(n.text,P5t(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new ys(i,a):EK.from(ys.split(i,[]),a)}sliceString(e,r=this.length,n=` -`){[e,r]=QR(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 EK=class DP extends Ai{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]=QR(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 d=this.children.slice();return d[i]=l,new DP(d,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]=QR(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 DP))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,d=[];function h(p){let g;if(p.lines>a&&p instanceof DP)for(let m of p.children)h(m);else p.lines>o&&(l>o||!l)?(f(),s.push(p)):p instanceof ys&&l&&(g=d[d.length-1])instanceof ys&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,d[d.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,d.push(p))}function f(){l!=0&&(s.push(d.length==1?d[0]:DP.from(d,u)),u=-1,l=d.length=0)}for(let p of e)h(p);return f(),s.length==1?s[0]:new DP(s,r)}};Ai.empty=new ys([""],0);function l1n(t){let e=-1;for(let r of t)e+=r.length+1;return e}function _K(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 N5t{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new S$(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 B5t{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"&&(Ai.prototype[Symbol.iterator]=function(){return this.iter()},S$.prototype[Symbol.iterator]=N5t.prototype[Symbol.iterator]=B5t.prototype[Symbol.iterator]=function(){return this});let c1n=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 QR(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Vl(t,e,r=!0,n=!0){return o1n(t,e,r,n)}function u1n(t){return t>=56320&&t<57344}function d1n(t){return t>=55296&&t<56320}function qd(t,e){let r=t.charCodeAt(e);if(!d1n(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return u1n(n)?(r-55296<<10)+(n-56320)+65536:r}function Zwe(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function O0(t){return t<65536?1:2}const Jwe=/\r\n?|\n/;var wc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(wc||(wc={}));class E0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=s}else{if(n!=wc.Simple&&u>=e&&(n==wc.TrackDel&&ie||n==wc.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 E0(e)}static create(e){return new E0(e)}}class bs extends E0{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 e2e(this,(r,n,i,a,o)=>e=e.replace(i,i+(n-r),o),!1),e}mapDesc(e,r=!1){return t2e(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&&Rw(n,r,a.text),a.forward(d),s+=d}let u=e[o++];for(;s>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],o=0,s=null;function l(d=!1){if(!d&&!i.length)return;of||h<0||f>r)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?Ai.of(p.split(n||Jwe)):p:Ai.empty,m=g.length;if(h==f&&m==0)return;ho&&cu(i,h-o,-1),cu(i,f-h,m),Rw(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 Rw(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,d,h),i=u,a=d}}}function t2e(t,e,r,n=!1){let i=[],a=n?[]:null,o=new T$(t),s=new T$(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);cu(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,d=o.len;for(;d;)if(s.ins==-1){let h=Math.min(d,s.len);u+=h,d-=h,s.forward(h)}else if(s.ins==0&&s.lenl||o.ins>=0&&o.len>l)&&(s||n.length>u),a.forward2(l),o.forward(l)}}}}class T${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?Ai.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?Ai.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 C$=class SIe{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 SIe(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 SIe(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=>C$.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 F5t(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let r2e=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=r2e++,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:n2e),!!e.static,e.enables)}of(e){return new RK([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new RK(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new RK(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function n2e(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class RK{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=r2e++}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,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?u=!0:((r=e[h.id])!==null&&r!==void 0?r:1)&1||d.push(e[h.id]);return{create(h){return h.values[o]=n(h),1},update(h,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||i2e(h,d)){let p=n(h);if(s?!z5t(p,h.values[o],i):!i(p,h.values[o]))return h.values[o]=p,1}return 0},reconfigure:(h,f)=>{let p,g=f.config.address[a];if(g!=null){let m=MK(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===h.facet(v):v instanceof Ko?f.field(v,!1)==h.field(v,!1):!0)||(s?z5t(p=n(h),m,i):i(p=n(h),m)))return h.values[o]=m,0}else p=n(h);return h.values[o]=p,1}}}get extension(){return this}}function z5t(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 d=0;dn===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(DK).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(DK),o=i.facet(DK),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,DK.of({field:this,create:e})]}get extension(){return this}}const dC={lowest:4,low:3,default:2,high:1,highest:0};function k$(t){return e=>new U5t(e,t)}const Jh={highest:k$(dC.highest),high:k$(dC.high),default:k$(dC.default),low:k$(dC.low),lowest:k$(dC.lowest)};class U5t{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class HR{of(e){return new a2e(this,e)}reconfigure(e){return HR.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class a2e{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class LK{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 f1n(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 d=n==null?void 0:n.config.facets;for(let f in a){let p=a[f],g=p[0].facet,m=d&&d[f]||[];if(p.every(v=>v.type==0))if(s[g.id]=l.length<<1|1,n2e(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=>h1n(v,g,p))}}let h=u.map(f=>f(s));return new LK(e,o,h,s,l,a)}}function f1n(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 a2e&&r.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let u of o)a(u,s);else if(o instanceof a2e){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 U5t)a(o.inner,o.prec);else if(o instanceof Ko)n[s].push(o),o.provides&&a(o.provides,s);else if(o instanceof RK)n[s].push(o),o.facet.extensions&&a(o.facet.extensions,dC.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,dC.default),n.reduce((o,s)=>o.concat(s))}function O$(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 MK(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const V5t=vr.define(),o2e=vr.define({combine:t=>t.some(e=>e),static:!0}),G5t=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),Q5t=vr.define(),H5t=vr.define(),W5t=vr.define(),Y5t=vr.define({combine:t=>t.length?t[0]:!1});let _0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new p1n}};class p1n{of(e){return new _0(this,e)}}class g1n{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 g1n(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 Vs{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&&F5t(n,r.newLength),a.some(s=>s.type==Vs.time)||(this.annotations=a.concat(Vs.time.of(Date.now())))}static create(e,r,n,i,a,o){return new Vs(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(Vs.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Vs.time=_0.define(),Vs.userEvent=_0.define(),Vs.addToHistory=_0.define(),Vs.remote=_0.define();function m1n(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 Vs?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Vs?t=a[0]:t=j5t(e,WR(a),!1)}return t}function y1n(t){let e=t.startState,r=e.facet(W5t),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=q5t(n,s2e(e,a,t.changes.newLength),!0))}return n==t?t:Vs.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const b1n=[];function WR(t){return t==null?b1n: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 x1n=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let l2e;try{l2e=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function w1n(t){if(l2e)return l2e.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||x1n.test(r)))return!0}return!1}function A1n(t){return e=>{if(!/\S/.test(e))return Ao.Space;if(w1n(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=WR(n).concat(s.value));let a;r?a=e.startState.values.slice():(r=LK.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(o2e)?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=WR(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=LK.resolve(e.extensions||[],new Map),n=e.doc instanceof Ai?e.doc:Ai.of((e.doc||"").split(r.staticFacet(ei.lineSeparator)||Jwe)),i=e.selection?e.selection instanceof xt?e.selection:xt.single(e.selection.anchor,e.selection.head):xt.single(0);return F5t(i,n.length),r.staticFacet(o2e)||(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(Y5t)}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(V5t))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 A1n(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=Vl(r,o,!1);if(a(r.slice(l,o))!=Ao.Word)break;o=l}for(;st.length?t[0]:4}),ei.lineSeparator=G5t,ei.readOnly=Y5t,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=V5t,ei.changeFilter=Q5t,ei.transactionFilter=H5t,ei.transactionExtender=W5t,HR.reconfigure=on.define();function R0(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 Dw{eq(e){return this==e}range(e,r=e){return u2e.create(e,r,this)}}Dw.prototype.startSide=Dw.prototype.endSide=0,Dw.prototype.point=!1,Dw.prototype.mapMode=wc.TrackDel;function c2e(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let u2e=class Jsr{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new Jsr(e,r,n)}};function d2e(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let S1n=class elr{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 elr(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(d2e)),this.isEmpty)return r.length?ti.of(r):this;let s=new K5t(this,null,-1).goto(0),l=0,u=[],d=new Qu;for(;s.value||l=0){let h=r[l++];d.addInner(h.from,h.to,h.value)||u.push(h)}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 E$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return E$.from(e).goto(r)}static compare(e,r,n,i,a=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=a),s=r.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=a),l=X5t(o,s,n),u=new _$(o,l,a),d=new _$(s,l,a);n.iterGaps((h,f,p)=>Z5t(u,h,d,f,p,i)),n.empty&&n.length==0&&Z5t(u,0,d,0,0,i)}static eq(e,r,n=0,i){i==null&&(i=999999999);let a=e.filter(d=>!d.isEmpty&&r.indexOf(d)<0),o=r.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(a.length!=o.length)return!1;if(!a.length)return!0;let s=X5t(a,o),l=new _$(a,s,0).goto(n),u=new _$(o,s,0).goto(n);for(;;){if(l.to!=u.to||!f2e(l.active,u.active)||l.point&&(!u.point||!c2e(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 _$(e,null,a).goto(r),s=r,l=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let d=o.activeForPoint(o.to),h=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 u2e?[e]:r?T1n(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 T1n(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(d2e);e=n}return t}ti.empty.nextLayer=ti.empty;class Qu{finishChunk(e){this.chunks.push(new S1n(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 X5t(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 K5t(o,r,n,a));return i.length==1?i[0]:new E$(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--)h2e(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--)h2e(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(),h2e(this.heap,0)}}}function h2e(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 _${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=E$.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){IK(this.active,e),IK(this.activeTo,e),IK(this.activeRank,e),this.minActive=J5t(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;PK(this.active,r,n),PK(this.activeTo,r,i),PK(this.activeRank,r,a),e&&PK(e,r,this.cursor.from),this.minActive=J5t(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&&IK(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 Z5t(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 d=!1;;){let h=t.to+l-r.to,f=h||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&&c2e(t.point,r.point)&&f2e(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(s,g,t.point,r.point),d=!1):(d&&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 J5t(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=Vl(t,i)}return n===!0?-1:t.length}const g2e="ͼ",eRt=typeof Symbol>"u"?"__"+g2e:Symbol.for(g2e),m2e=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),tRt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class p1{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 d=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&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(!h)throw new RangeError("The value of a property ("+p+") should be a primitive value.");a(i(p),g,d,f)}else g!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+g+";")}(d.length||f)&&l.push((n&&!h&&!u?o.map(n):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)a(i(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=tRt[eRt]||1;return tRt[eRt]=e+1,g2e+e.toString(36)}static mount(e,r,n){let i=e[m2e],a=n&&n.nonce;i?a&&i.setNonce(a):i=new C1n(e,a),i.mount(Array.isArray(r)?r:[r],e)}}let rRt=new Map;class C1n{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=rRt.get(n);if(a)return e[m2e]=a;this.sheet=new i.CSSStyleSheet,rRt.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[m2e]=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:'"'},k1n=typeof navigator<"u"&&/Mac/.test(navigator.platform),O1n=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ac=0;Ac<10;Ac++)Lw[48+Ac]=Lw[96+Ac]=String(Ac);for(var Ac=1;Ac<=24;Ac++)Lw[Ac+111]="F"+Ac;for(var Ac=65;Ac<=90;Ac++)Lw[Ac]=String.fromCharCode(Ac+32),R$[Ac]=String.fromCharCode(Ac);for(var v2e in Lw)R$.hasOwnProperty(v2e)||(R$[v2e]=Lw[v2e]);function E1n(t){var e=k1n&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||O1n&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?R$:Lw)[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:sRt||/Mac/.test(Hu.platform),windows:/Win/.test(Hu.platform),linux:/Linux|X11/.test(Hu.platform),ie:NK,ie_version:iRt?y2e.documentMode||6:x2e?+x2e[1]:b2e?+b2e[1]:0,gecko:aRt,gecko_version:aRt?+(/Firefox\/(\d+)/.exec(Hu.userAgent)||[0,0])[1]:0,chrome:!!w2e,chrome_version:w2e?+w2e[1]:0,ios:sRt,android:/Android\b/.test(Hu.userAgent),webkit:oRt,webkit_version:oRt?+(/\bAppleWebKit\/(\d+)/.exec(Hu.userAgent)||[0,0])[1]:0,safari:A2e,safari_version:A2e?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hu.userAgent)||[0,0])[1]:0,tabSize:y2e.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function S2e(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 BK=Object.create(null);function T2e(t,e,r){if(t==e)return!0;t||(t=BK),e||(e=BK);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 _1n(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 lRt(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 R1n(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new hC(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}=cRt(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(o?r?2e8:1:-6e8)+1}return new hC(e,n,i,r,e.widget||null,!0)}static line(e){return new L$(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 D$ extends Ar{constructor(e){let{start:r,end:n}=cRt(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?S2e(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||BK}eq(e){return this==e||e instanceof D$&&this.tagName==e.tagName&&T2e(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)}}D$.prototype.point=!1;class L$ extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof L$&&this.spec.class==e.spec.class&&T2e(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)}}L$.prototype.mapMode=wc.TrackBefore,L$.prototype.point=!0;class hC 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?wc.TrackBefore:wc.TrackAfter:wc.TrackDel}get type(){return this.startSide!=this.endSide?Sc.WidgetRange:this.startSide<=0?Sc.WidgetBefore:Sc.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof hC&&D1n(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)}}hC.prototype.point=!0;function cRt(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 D1n(t,e){return t==e||!!(t&&e&&t.compare(e))}function YR(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 M$ extends Dw{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof M$&&this.tagName==e.tagName&&T2e(this.attributes,e.attributes)}static create(e){return new M$(e.tagName,e.attributes||BK,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return ti.of(e,r)}}M$.prototype.startSide=M$.prototype.endSide=-1;function I$(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function C2e(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function P$(t,e){if(!e.anchorNode)return!1;try{return C2e(t,e.anchorNode)}catch{return!1}}function N$(t){return t.nodeType==3?F$(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function B$(t,e,r,n){return r?uRt(t,e,r,n,-1)||uRt(t,e,r,n,1):!1}function Mw(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function $K(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function uRt(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:g1(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=Mw(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?g1(t):0}else return!1}}function g1(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 L1n(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 dRt(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 M1n(t,e,r,n,i,a,o,s){let l=t.ownerDocument,u=l.defaultView||window;for(let d=t,h=!1;d&&!h;)if(d.nodeType==1){let f,p=d==l.body,g=1,m=1;if(p)f=L1n(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let b=d.getBoundingClientRect();({scaleX:g,scaleY:m}=dRt(d,b)),f={left:b.left,right:b.left+d.clientWidth*g,top:b.top,bottom:b.top+d.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)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function hRt(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 I1n{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?g1(r):0),n,Math.min(e.focusOffset,n?g1(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let fC=null;br.safari&&br.safari_version>=26&&(fC=!1);function fRt(t){if(t.setActive)return t.setActive();if(fC)return t.focus(fC);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus(fC==null?{get preventScroll(){return fC={preventScroll:!0},!0}}:void 0),!fC){fC=!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 mRt(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=g1(r)}else if(r.parentNode&&!$K(r))n=Mw(r),r=r.parentNode;else return null}}function vRt(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 xRt(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(D0[m+1]==-p){let v=D0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Da[h]=Da[D0[m]]=y),s=m;break}}else{if(D0.length==189)break;D0[s++]=h,D0[s++]=f,D0[s++]=l}else if((g=Da[h])==2||g==1){let m=g==i;l=m?0:1;for(let v=s-3;v>=0;v-=3){let y=D0[v+2];if(y&2)break;if(m)D0[v+2]|=2;else{if(y&4)break;D0[v+2]|=4}}}}}function V1n(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=d}else a=u,l++}}}function E2e(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 L0(l,m.from,p));let v=m.direction==pC!=!(p%2);_2e(t,v?n+1:n,i,m.inner,m.from,m.to,o),l=m.to}g=m.to}else{if(g==r||(d?Da[g]!=s:Da[g]==s))break;g++}f?E2e(t,l,g,n+1,i,f,o):le;){let d=!0,h=!1;if(!u||l>a[u-1].to){let m=Da[l-1];m!=s&&(d=!1,h=m==16)}let f=!d&&s==1?[]:null,p=d?n:n+1,g=l;e:for(;;)if(u&&g==a[u-1].to){if(h)break e;let m=a[--u];if(!d)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==pC?0:1;return _2e(t,i,i,r,0,t.length,n),n}function wRt(t){return[new L0(0,t,0)]}let ARt="";function Q1n(t,e,r,n,i){var a;let o=n.head-t.from,s=L0.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 d=Vl(t.text,o,l.forward(i,r));(dl.to)&&(d=u),ARt=t.text.slice(Math.min(o,d),Math.max(o,d));let h=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return h&&d==u&&h.level+(i?0:1)t.some(e=>e)}),RRt=vr.define({combine:t=>t.some(e=>e)}),DRt=vr.define();class jR{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 jR(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 jR(xt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const FK=on.define({map:(t,e)=>t.map(e)}),LRt=on.define();function jd(t,e,r){let n=t.facet(kRt);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 m1=vr.define({combine:t=>t.length?t[0]:!0});let W1n=0;const XR=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return o&&l.push(zK.of(u=>{let d=u.plugin(s);return d?o(d):Ar.none})),a&&l.push(a(s)),l})}static fromClass(e,r){return Ro.define((n,i)=>new e(n,i),r)}}class M2e{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(jd(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){jd(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){jd(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const MRt=vr.define(),I2e=vr.define(),zK=vr.define(),IRt=vr.define(),P2e=vr.define(),z$=vr.define(),PRt=vr.define();function NRt(t,e){let r=t.state.facet(PRt);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,d=o-e.from,h=i;for(let f=s.length-1;f>=0;f--,l--){let p=s[f].spec.bidiIsolate,g;if(p==null&&(p=H1n(e.text,u,d)),l>0&&h.length&&(g=h[h.length-1]).to==u&&g.direction==p)g.to=d,h=g.inner;else{let m={from:u,to:d,direction:p,inner:[]};h.push(m),h=m.inner}}}}),i}const BRt=vr.define();function N2e(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(BRt)){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 U$=vr.define();class wp{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new wp(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 wp(a,o,s,l))),this.changedRanges=i}static create(e,r,n){return new UK(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 Y1n=[];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 Y1n}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&&_1n(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=Mw(this.dom),i=this.length?e>0:r>0;return new Pg(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 GK)return e;return null}static get(e){return e.cmTile}}class VK 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=$Rt(i);else r.insertBefore(s.dom,i);n=s.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=$Rt(i);this.length=o}}function $Rt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class GK extends VK{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 v1)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 v1 extends VK{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 v1(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class KR extends VK{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new KR(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(d,h){for(let f=0,p=0;f=h&&(g.isComposite()?l(g,h-p):(!o||o.isHidden&&(r>0&&!(o.flags&32)||n&&j1n(o,g)))&&(m>h||g.flags&32)?(o=g,s=h-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,d=>d.width)||u),n==null?u:$$(u,(s?s>0:r<0)==n)}static of(e,r){let n=new gC(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class mC 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 X1n{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 Xd&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(B2e(l.dom)),i=u;else{if(this.cache.reused.get(l)){let h=Zo.get(l.dom);h&&h.setDOM(B2e(l.dom))}let d=Xd.of(l.mark,l.dom);i.append(d),i=d}this.cache.reused.set(l,2)}let a=Zo.get(e.text);a&&this.cache.reused.set(a,2);let o=new gC(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=zRt);let i=KR.start(e,r||((n=this.cache.find(KR))===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 Xd&&s.mark.eq(o))i=s,r--;else{let l=Xd.of(o,(n=this.cache.find(Xd,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||!FRt(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&FRt(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget($2e,0,32)||new mC($2e.toDOM(),0,$2e,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 K1n(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(QK,void 0,1);return n&&(n.flags=r),n||new QK(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class J1n{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 HK=[mC,KR,gC,Xd,QK,v1,GK];for(let t=0;t[]),this.index=HK.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 Xd&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=a=0):o instanceof Xd&&(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,d,h,f)=>{if(u instanceof hC){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=d.length,h>d.length)i.continueWidget(l-s);else{let p=u.widget||(u.block?ZR.block:ZR.inline),g=rbn(u),m=this.cache.findWidget(p,l-s,g)||mC.of(p,this.view,l-s,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,d,h))}n=null}else n=nbn(n,u);l>s&&this.text.skip(l-s)},span:(s,l,u,d)=>{for(let h=s;h-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 Xd?r.push(a):a!=null&&a.isLine()?n=a:a instanceof v1||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new KR(i,zRt):n||r.push(Xd.of(new D$({tagName:i.nodeName.toLowerCase(),attributes:R1n(i)}),i)))}return{line:n,marks:r}}}function FRt(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 rbn(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 zRt={class:"cm-line"};function nbn(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&S2e(r,t),n&&(t.class+=" "+n)),t}function ibn(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 Xd&&e.push(n.mark)}return e}function B2e(t){let e=Zo.get(t);return e&&e.setDOM(t.cloneNode()),t}class ZR extends Wu{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}}ZR.inline=new ZR("span"),ZR.block=new ZR("div");const $2e=new class extends Wu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class URt{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 GK(e,e.contentDOM),this.updateInner([new wp(0,0,0,e.state.doc.length)],null)}update(e){var r;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:d,toA:h})=>hthis.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:!fbn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?obn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:h}=this.hasComposition;n=new wp(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,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=cbn(o,this.decorations,e.changes);l.length&&(n=wp.extendWithRanges(n,l));let u=dbn(s,this.blockWrappers,e.changes);return u.length&&(n=wp.extendWithRanges(n,u)),a&&!n.some(d=>d.fromA<=a.range.fromA&&d.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 tbn(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),F2e(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)&&P$(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,d;if(l.empty?d=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(d=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&&abn(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=d=new Pg(f,0),s=!0}let h=this.view.observer.selectionRange;(s||!h.focusNode||(!B$(u.node,u.offset,h.anchorNode,h.anchorOffset)||!B$(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(h.focusNode)&&hbn(h.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=I$(this.view.root);if(f)if(l.empty){if(br.gecko){let p=sbn(u.node,u.offset);if(p&&p!=3){let g=(p==1?mRt:vRt)(u.node,u.offset);g&&(u=new Pg(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(d.node,d.offset)}catch{}}else{let p=document.createRange();l.anchor>l.head&&([u,d]=[d,u]),p.setEnd(d.node,d.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,d)),this.impreciseAnchor=u.precise?null:new Pg(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Pg(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&B$(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=I$(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 d=this.domAtPos(r.head+r.assoc,r.assoc);n.collapse(d.node,d.offset),n.modify("move",r.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.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=g1(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,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(a=!0)}else{let h=d+u.length;if(d<=e&&(n=u,i=e-d,a=h=e&&!o&&(o=u,s=e-d,l=d>e),d>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 z2e?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,d=(h,f,p)=>{for(let g=0;gi);g++){let m=h.children[g],v=f+m.length,y=m.dom.getBoundingClientRect(),{height:b}=y;if(p&&!g&&(u+=y.top-p.top),m instanceof v1)v>n&&d(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?N$(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==h.children.length-1&&(u+=p.bottom-y.bottom),f=v+m.breakAfter}};return d(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 d=N$(u.dom);if(d.length!=1)return;s+=d[0].width,l=d[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=N$(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 z2e(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(zK).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(P2e).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(DRt))try{if(u(this.view,e.range,e))return!0}catch(d){jd(this.view.state,d,"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=N2e(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(M1n(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(){F2e(this.tile)}}function F2e(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)F2e(n,e)}}function abn(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 VRt(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=mRt(r.focusNode,r.focusOffset),i=vRt(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 obn(t,e,r){let n=VRt(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 wp(l.mapPos(a),l.mapPos(o),a,o),text:i}}function sbn(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class z2e extends Wu{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 pbn(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=Vl(i.text,a,!1):s=Vl(i.text,a);let l=n(i.text.slice(o,s));for(;o>0;){let u=Vl(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+p2e(o,a,t.state.tabSize)}function U2e(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==Sc.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function mbn(t,e,r,n){let i=U2e(t,e.head,e.assoc||-1),a=!n||i.type!=Sc.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 GRt(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=Q1n(i,a,o,s,r),d=ARt;if(!u){if(i.number==(r?t.state.doc.lines:1))return s;d=` -`,i=t.state.doc.line(i.number+(r?1:-1)),a=t.bidiSpans(i),u=t.visualLineSide(i,!r)}if(l){if(!l(d))return s}else{if(!n)return u;l=n(d)}s=u}}function vbn(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 ybn(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)),d=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)+d}let h=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=G2e(t,{x:h,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 M0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==Sc.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 h=t.viewState.heightOracle.textHeight/2;l=n>0?u.bottom+h:u.top-h}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(r)return null;if(u.type==Sc.Text){let h=gbn(t,i,u,o,s);return new M0(h,h==u.from?1:-1)}}if(u.type!=Sc.Text)return l<(u.top+u.bottom)/2?new M0(u.from,1):new M0(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),new bbn(t,o,s,t.textDirectionAt(u.from)).scanTile(d,u.from)}class bbn{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[d],1):this.baseDir)==Ra.LTR;return{i:d,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 F$(e.dom,o,s).getClientRects()});return i.after?new M0(n[i.i+1],-1):new M0(n[i.i],1)}scanTile(e,r){if(!e.length)return new M0(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:F$(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 M0(n[i.i+1],-1):new M0(o,1)}}const JR="￿";class xbn{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+=JR}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:$K(i))||$K(s)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>a)&&!Abn(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+(wbn(e,n.node,n.offset)?r:0))}}function wbn(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=WRt(e.docView.tile,r,n,0))){let l=a||o?[]:Cbn(e),u=new xbn(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=kbn(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!C2e(e.contentDOM,l.focusNode)?s.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!C2e(e.contentDOM,l.anchorNode)?s.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((br.ios||br.chrome)&&u!=d&&Math.min(u,d)<=s.main.from&&Math.max(u,d)>=s.main.to&&(h.from>0||h.to-1&&s.ranges.length>1)this.newSel=s.replaceRange(xt.range(d,u));else if(e.lineWrapping&&d==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(d,u)}}}function WRt(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let l=0,u=n,d=n;lr)return WRt(h,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&h.dom.parentNode==t.dom){o=l,s=d;break}d=f,u=f+h.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 YRt(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,d=null;(o===8||br.android&&e.text.length=s&&a.to<=l&&(e.typeOver||h!=e.text)&&h.slice(0,a.from-s)==e.text.slice(0,a.from-s)&&h.slice(a.to-s)==e.text.slice(f=e.text.length-(h.length-(a.to-s)))?r={from:a.from,to:a.to,insert:Ai.of(e.text.slice(a.from-s,f).split(JR))}:(p=qRt(h,e.text,u-s,d))&&(br.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==JR+JR&&p.toB--,r={from:s+p.from,to:s+p.toA,insert:Ai.of(e.text.slice(p.from,p.toB).split(JR))})}else n&&(!t.hasFocus&&i.facet(m1)||WK(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:Ai.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:Ai.of([" "])}),r)return Q2e(t,r,n,o);if(n&&!WK(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=QRt(i.facet(z$).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:s,userEvent:l}),!0}else return!1}function Q2e(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&&qR(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&qR(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&qR(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,s=()=>o||(o=Tbn(t,e,r));return t.state.facet(ORt).some(l=>l(t,e.from,e.to,a,s))||t.dispatch(s()),!0}function Tbn(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.fromh(t)),u,l);e.from==d&&(o=d)}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 d=t.state.sliceDoc(e.from,e.to),h,f=r&&VRt(t,r.main.head);if(f){let g=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-g}}else h=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-d.length;if(t.state.sliceDoc(v,m)!=d||m>=h.from&&v<=h.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 qRt(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 Cbn(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 HRt(r,n)),(i!=r||a!=n)&&e.push(new HRt(i,a))),e}function kbn(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 WK(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Obn{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&&Gbn(e.contentDOM.ownerDocument)}handleEvent(e){!Nbn(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=_bn(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&&KRt.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&&(XRt.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||Rbn.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)&&Ebn(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 Ebn(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function jRt(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){jd(r.state,i)}}}function _bn(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(jRt(n.value,l))}if(o)for(let s in o){let l=o[s];l&&r(s).observers.push(jRt(n.value,l))}}for(let n in Ng)r(n).handlers.push(Ng[n]);for(let n in Yu)r(n).observers.push(Yu[n]);return e}const XRt=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rbn="dthko",KRt=[16,17,18,20,91,92,224,225],YK=6;function qK(t){return Math.max(0,t)*.7+8}function Dbn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Lbn{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=hRt(e.contentDOM),this.atoms=e.state.facet(z$).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)&&Mbn(e,r),this.dragging=Pbn(e,r)&&i4t(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&&Dbn(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=N2e(this.view);e.clientX-l.left<=i+YK?r=-qK(i-e.clientX):e.clientX+l.right>=o-YK&&(r=qK(e.clientX-o)),e.clientY-l.top<=a+YK?n=-qK(a-e.clientY):e.clientY+l.bottom>=s-YK&&(n=qK(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=QRt(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 Mbn(t,e){let r=t.state.facet(SRt);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function Ibn(t,e){let r=t.state.facet(TRt);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function Pbn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=I$(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 Nbn(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 Ng=Object.create(null),Yu=Object.create(null),ZRt=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function Bbn(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(),JRt(t,r.value)},50)}function jK(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function JRt(t,e){e=jK(t.state,D2e,e);let{state:r}=t,n,i=1,a=r.toText(e),o=a.lines==r.selection.ranges.length;if(H2e!=null&&r.selection.ranges.every(l=>l.empty)&&H2e==a.toString()){let l=-1;n=r.changeByRange(u=>{let d=r.doc.lineAt(u.from);if(d.from==l)return{range:u};l=d.from;let h=r.toText((o?a.line(i++).text:e)+r.lineBreak);return{changes:{from:d.from,insert:h},range:xt.cursor(u.from+h.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})}Yu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Yu.wheel=Yu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ng.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Yu.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")},Yu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Yu.touchend=(t,e)=>{t.inputState.touchActive=!1},Ng.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(CRt))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=Fbn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new Lbn(t,e,r,n)),n&&t.observer.ignore(()=>{fRt(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 e4t(t,e,r,n){if(n==1)return xt.cursor(e,r);if(n==2)return pbn(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?(r4t+1)%3:1}function Fbn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=i4t(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,d=e4t(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!o){let h=e4t(t,r.pos,r.assoc,n),f=Math.min(h.from,d.from),p=Math.max(h.to,d.to);d=f1&&(u=zbn(i,l.pos))?u:s?i.addRange(d):xt.create([d])}}}function zbn(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}Ng.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",jK(t.state,L2e,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ng.dragend=t=>(t.inputState.draggedContent=null,!1);function a4t(t,e,r,n){if(r=jK(t.state,D2e,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,o=n&&a&&Ibn(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}Ng.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&&a4t(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 a4t(t,e,n,!0),!0}return!1},Ng.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=ZRt?null:e.clipboardData;return r?(JRt(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(Bbn(t),!1)};function Ubn(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 Vbn(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:jK(t,L2e,e.join(t.lineBreak)),ranges:r,linewise:n}}let H2e=null;Ng.copy=Ng.cut=(t,e)=>{if(!P$(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=Vbn(t.state);if(!r&&!i)return!1;H2e=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=ZRt?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(Ubn(t,r),!1)};const o4t=_0.define();function s4t(t,e){let r=[];for(let n of t.facet(ERt)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:o4t.of(!0)}):null}function l4t(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=s4t(t.state,e);r?t.dispatch(r):t.update([])}},10)}Yu.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),l4t(t)},Yu.blur=t=>{t.observer.clearSelectionRange(),l4t(t)},Yu.compositionstart=Yu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Yu.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))},Yu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ng.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 Q2e(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=XRt.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(()=>Yu.compositionend(t,e),20),!1};const c4t=new Set;function Gbn(t){c4t.has(t)||(c4t.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const u4t=["pre-wrap","normal","pre-line","break-spaces"];let e4=!1;function d4t(){e4=!1}class Qbn{constructor(e){this.lineWrapping=e,this.doc=Ai.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 u4t.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)>XK&&(e4=!0),this.height=e)}replace(e,r,n){return qu.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:d,toB:h}=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(h+=p.to-u,u=p.to;s>0&&f.from<=i[s-1].toA;)l=i[s-1].fromA,d=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 ef extends h4t{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 Bg(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 ef||i instanceof Tc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Tc?i=new ef(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):qu.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 Tc extends qu{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 Tc?n[n.length-1]=new Tc(a.length+i):n.push(null,new Tc(i-1))}if(e>0){let a=n[0];a instanceof Tc?n[0]=new Tc(e+a.length):n.unshift(new Tc(e-1),null)}return qu.of(n)}decomposeLeft(e,r){r.push(new Tc(e-1),null)}decomposeRight(e,r){r.push(null,new Tc(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 Tc(i.from-r-1).updateHeight(e,r));s<=a&&i.more;){let d=e.doc.lineAt(s).length;o.length&&o.push(null);let h=i.heights[i.index++],f=0;h<0&&(f=-h,h=i.heights[i.index++]),l==-1?l=h:Math.abs(h-l)>=XK&&(l=-2);let p=new ef(d,h,f);p.outdated=!1,o.push(p),s+=d+1}s<=a&&o.push(null,new Tc(a-s).updateHeight(e,s));let u=qu.of(o);return(l<0||Math.abs(u.height-this.height)>=XK||Math.abs(l-this.heightMetrics(e,r).perLine)>=XK)&&(e4=!0),KK(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 Ybn extends qu{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 d=r==Fa.ByPosNoHeight?Fa.ByPosNoHeight:Fa.ByPos;return l?u.join(this.right.lineAt(s,d,n,o,s)):this.left.lineAt(s,d,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&&f4t(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?qu.of(this.break?[e,null,r]:[e,r]):(this.left=KK(this.left,e),this.right=KK(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 f4t(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof Tc&&(n=t[e+1])instanceof Tc&&t.splice(e-1,3,new Tc(r.length+1+n.length))}const qbn=5;class W2e{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 ef?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new ef(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=qbn)&&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 ef(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new Tc(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 ef)return e;let r=new ef(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 ef)&&!this.isCovered?this.nodes.push(new ef(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&h.overflow!="visible"){let f=d.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=h.position=="absolute"||h.position=="fixed"?d.offsetParent:d.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 Zbn(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function Jbn(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class Y2e{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 Qbn(n),this.stateDeco=m4t(r),this.heightMap=qu.empty().applyChanges(this.stateDeco,Ai.empty,this.heightOracle.setDoc(r.doc),[new wp(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 ZK(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?g4t:new q2e(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(G$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=m4t(this.state);let i=e.changedRanges,a=wp.extendWithRanges(i,jbn(n,this.stateDeco,e?e.changes:bs.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);d4t(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=o||e4)&&(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(RRt)&&(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,d=0;if(s.width&&s.height){let{scaleX:A,scaleY:S}=dRt(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 h=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let p=hRt(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=gRt(this.scrollParent||e.win);let m=(this.printing?Jbn:Kbn)(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&&!Zbn(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?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),d4t();for(let S of this.viewports){let T=S.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?qu.empty().applyChanges(this.stateDeco,Ai.empty,this.heightOracle,[new wp(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Hbn(S.from,T))}e4&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(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 ZK(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 d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(u,Fa.ByPos,a,0,0),f;r.y=="center"?f=(h.top+h.bottom)/2-d/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=(d,h,f,p)=>{if(h-dd&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-d)y.fromb));if(!v){if(hx.from<=h&&x.to>=h)){let x=r.moveToLineBoundary(xt.cursor(h),!1,!0).head;x>d&&(h=x)}let y=this.gapSize(f,d,h,p),b=n||y<2e6?y:2e6;v=new Y2e(d,h,y,b)}s.push(v)},u=d=>{if(d.length2e6)for(let S of e)S.from>=d.from&&S.fromd.from&&l(d.from,p,d,h),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)||G$(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)||G$(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 G$(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 ZK{constructor(e,r){this.from=e,this.to=r}}function txn(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 eZ(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 rxn(t,e){for(let r of t)if(e(r))return r}const g4t={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function m4t(t){let e=t.facet(zK).filter(n=>typeof n!="function"),r=t.facet(P2e).filter(n=>typeof n!="function");return r.length&&e.push(ti.join(r)),e}class q2e{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,d=r.lineAt(l,Fa.ByPos,e,0,0).bottom;return i+=d-u,{from:s,to:l,top:u,bottom:d,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 G$(t,e){if(e.scale==1)return t;let r=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Bg(t.from,t.length,r,n-r,Array.isArray(t._content)?t._content.map(i=>G$(i,e)):t._content)}const tZ=vr.define({combine:t=>t.join(" ")}),j2e=vr.define({combine:t=>t.indexOf(!0)>-1}),X2e=p1.newName(),v4t=p1.newName(),y4t=p1.newName(),b4t={"&light":"."+v4t,"&dark":"."+y4t};function K2e(t,e,r){return new p1(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 nxn=K2e("."+X2e,{"&":{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"}},b4t),ixn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Z2e=br.ie&&br.ie_version<=11;class axn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new I1n,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 sxn(e),e.state.facet(m1)&&(e.contentDOM.editContext=this.editContext.editContext)),Z2e&&(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(m1)?n.root.activeElement!=this.dom:!P$(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&&B$(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=I$(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&oxn(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=P$(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&&qR(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&&P$(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 Sbn(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=YRt(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!WK(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=x4t(r,e.previousSibling||e.target.previousSibling,-1),i=x4t(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(m1)!=e.state.facet(m1)&&(e.view.contentDOM.editContext=e.state.facet(m1)?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 x4t(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 w4t(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 B$(o.node,o.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function oxn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return w4t(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?w4t(t,r):null}class sxn{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 d=qRt(e.state.sliceDoc(s,l),n.text,(u?i.from:i.to)-s,u?"end":null);if(!d){let f=xt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));WK(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:d.from+s,to:d.toA+s,insert:Ai.of(n.text.slice(d.from,d.toB).split(` -`))};if((br.mac||br.android)&&h.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:s,to:l,insert:Ai.of([n.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Q2e(e,h,xt.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.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=I$(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 d=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+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(a+=r,o+=r,o<=this.from)this.from+=d,this.to+=d;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+=d}r+=d}),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||P1n(e.parent)||document,this.viewState=new p4t(this,e.state||ei.create(e)),e.scrollTo&&e.scrollTo.is(FK)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(XR).map(i=>new M2e(i));for(let i of this.plugins)i.update(this);this.observer=new axn(this),this.inputState=new Obn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new URt(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 Vs?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(o4t))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=s4t(a,o),l||(s=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(d=null)):this.observer.clear(),a.facet(ei.phrases)!=this.state.facet(ei.phrases))return this.setState(a);i=UK.create(this,a,e),i.flags|=s;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection,{x:g,y:m}=this.state.facet(er.cursorScrollMargin);h=new jR(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(FK)&&(h=p.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=rZ.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(U$)!=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(tZ)!=i.state.facet(tZ)&&(this.viewState.mustMeasureContent=!0),(r||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),r&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(R2e))try{f(i)}catch(p){jd(this.state,p,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!YRt(this,d)&&u.force&&qR(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 p4t(this,e),this.plugins=e.facet(XR).map(n=>new M2e(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new URt(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(XR),n=e.state.facet(XR);if(r!=n){let i=[];for(let a of n){let o=r.indexOf(a);if(o<0)i.push(new M2e(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(gRt(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 d=u.map(p=>{try{return p.read(this)}catch(g){return jd(this.state,g),A4t}}),h=UK.create(this,this.state,[]),f=!1;h.flags|=l,r?r.flags|=l:r=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),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(R2e))s(r)}get themeClasses(){return X2e+" "+(this.state.facet(j2e)?y4t:v4t)+" "+this.state.facet(tZ)}updateAttrs(){let e=S4t(this,MRt,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(m1)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),S4t(this,I2e,r);let n=this.observer.ignore(()=>{let i=lRt(this.contentDOM,this.contentAttrs,r),a=lRt(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(U$);let e=this.state.facet(er.cspNonce);p1.mount(this.root,this.styleModules.concat(nxn).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 V2e(this,e,GRt(this,e,r,n))}moveByGroup(e,r){return V2e(this,e,GRt(this,e,r,n=>vbn(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 mbn(this,e,r,n)}moveVertically(e,r,n){return V2e(this,e,ybn(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=G2e(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),G2e(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[L0.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(_Rt)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>lxn)return wRt(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||xRt(a.isolates,n=NRt(this,e))))return a.order;n||(n=NRt(this,e));let i=G1n(e.text,r,n);return this.bidiCache.push(new rZ(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(()=>{fRt(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 FK.of(new jR(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 FK.of(new jR(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=p1.newName(),i=[tZ.of(n),U$.of(K2e(`.${n}`,e))];return r&&r.dark&&i.push(j2e.of(!0)),i}static baseTheme(e){return Jh.lowest(U$.of(K2e("."+X2e,e,b4t)))}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=U$,er.inputHandler=ORt,er.clipboardInputFilter=D2e,er.clipboardOutputFilter=L2e,er.scrollHandler=DRt,er.focusChangeEffect=ERt,er.perLineTextDirection=_Rt,er.exceptionSink=kRt,er.updateListener=R2e,er.editable=m1,er.mouseSelectionStyle=CRt,er.dragMovesSelection=TRt,er.clickAddsSelectionRange=SRt,er.decorations=zK,er.blockWrappers=IRt,er.outerDecorations=P2e,er.atomicRanges=z$,er.bidiIsolatedRanges=PRt,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=BRt,er.darkTheme=j2e,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=I2e,er.editorAttributes=MRt,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=on.define();const lxn=4096,A4t={};class rZ{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&&S2e(o,r)}return r}const cxn=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function uxn(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 hxn(t,e,r){return k4t(C4t(t.state),e,t,r)}let Iw=null;const fxn=4e3;function pxn(t,e=cxn){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,d)=>{var h,f;let p=r[o]||(r[o]=Object.create(null)),g=s.split(/ (?!$)/).map(y=>uxn(y,e));for(let y=1;y{let w=Iw={view:x,prefix:b,scope:o};return setTimeout(()=>{Iw==w&&(Iw=null)},fxn),!0}]})}let m=g.join(" ");i(m,!1);let v=p[m]||(p[m]={preventDefault:!1,stopPropagation:!1,run:((f=(h=p._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),u&&(v.preventDefault=!0),d&&(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 d=r[u]||(r[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in d)d[f].run.push(p=>h(p,J2e))}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 J2e=null;function k4t(t,e,r,n){J2e=e;let i=E1n(e),a=qd(i,0),o=O0(a)==i.length&&i!=" ",s="",l=!1,u=!1,d=!1;Iw&&Iw.view==r&&Iw.scope==n&&(s=Iw.prefix+" ",KRt.indexOf(e.keyCode)<0&&(u=!0,Iw=null));let h=new Set,f=v=>{if(v){for(let y of v.run)if(!h.has(y)&&(h.add(y),y(r)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},p=t[n],g,m;return p&&(f(p[s+nZ(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=Lw[e.keyCode])&&g!=i?(f(p[s+nZ(g,e,!0)])||e.shiftKey&&(m=R$[e.keyCode])!=i&&m!=g&&f(p[s+nZ(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[s+nZ(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&d&&e.stopPropagation(),J2e=null,l}class vC{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=O4t(e);return[new vC(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return gxn(e,r,n)}}function O4t(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 E4t(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 gxn(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=O4t(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),h=s.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=s.right-(d?parseInt(d.paddingRight):0),p=U2e(t,n,1),g=U2e(t,i,-1),m=p.type==Sc.Text?p:null,v=g.type==Sc.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=E4t(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=E4t(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:O,horizontal:E}}function w(A,S){let T=s.top+(S?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function mxn(t,e){return t.constructor==e.constructor&&t.eq(e)}class vxn{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(iZ)!=e.state.facet(iZ)&&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(iZ);for(;r!mxn(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 iZ=vr.define();function _4t(t){return[Ro.define(e=>new vxn(e,t)),iZ.of(t)]}const r4=vr.define({combine(t){return R0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function yxn(t={}){return[r4.of(t),bxn,xxn,wxn,RRt.of(!0)]}function R4t(t){return t.startState.facet(r4)!=t.state.facet(r4)}const bxn=_4t({above:!0,markers(t){let{state:e}=t,r=e.facet(r4),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 vC.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=R4t(t);return r&&D4t(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){D4t(e.state,t)},class:"cm-cursorLayer"});function D4t(t,e){e.style.animationDuration=t.facet(r4).cursorBlinkRate+"ms"}const xxn=_4t({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 vC.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(r4).iosSelectionHandles){for(let i of vC.forRange(t,"cm-selectionHandle cm-selectionHandle-start",xt.cursor(r.from,1)))e.push(i);for(let i of vC.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||R4t(t)},class:"cm-selectionLayer"}),wxn=Jh.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"}}}})),L4t=on.define({map(t,e){return t==null?null:e.mapPos(t)}}),Q$=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(L4t)?n.value:r,t)}}),Axn=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(Q$);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(Q$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Q$),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(Q$)!=t&&this.view.dispatch({effects:L4t.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 Sxn(){return[Q$,Axn]}function M4t(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 Txn(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 Cxn{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,d)=>i(d,u,u+s[0].length,s,l);else if(typeof n=="function")this.addMatch=(s,l,u,d)=>{let h=n(s,l,u);h&&d(u,u+s[0].length,h)};else if(n)this.addMatch=(s,l,u,d)=>d(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 Txn(e,this.maxLength))M4t(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])){d=o;break}for(;sf.push(y.range(m,v));if(l==u)for(this.regexp.lastIndex=d-l.from;(p=this.regexp.exec(l.text))&&p.indexthis.addMatch(v,e,m,g));r=r.update({filterFrom:d,filterTo:h,filter:(m,v)=>mh,add:f})}}return r}}const eAe=/x/.unicode!=null?"gu":"g",kxn=new RegExp(`[\0-\b + */const Hyn=Object.freeze(Object.defineProperty({__proto__:null,default:Qyn},Symbol.toStringTag,{value:"Module"})),pRt=1024;let Wyn=0,bp=class{constructor(e,r){this.from=e,this.to=r}};class _n{constructor(e={}){this.id=Wyn++,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=Us.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 V5{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 Yyn=Object.create(null);class Us{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):Yyn,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Us(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}}}}Us.none=new Us("",Object.create(null),0,8);class G5{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(o|Zi.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:Ywe(Us.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(Us.none,r,n,i)))}static build(e){return Kyn(e)}}ci.empty=new ci(Us.none,[],[],0);class Qwe{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 Qwe(this.buffer,this.index)}}class _w{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Us.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 A$(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 d=s[e],h=l[e]+o.from,f;if(!(!(a&Zi.EnterBracketed&&d instanceof ci&&(f=V5.get(d))&&!f.overlay&&f.bracketed&&n>=h&&n<=h+d.length)&&!mRt(i,n,h,h+d.length))){if(d instanceof _w){if(a&Zi.ExcludeBuffers)continue;let p=d.findChild(0,d.buffer.length,r,n-h,i);if(p>-1)return new k0(new qyn(o,d,e,h),null,p)}else if(a&Zi.IncludeAnonymous||!d.type.isAnonymous||Wwe(d)){let p;if(!(a&Zi.IgnoreMounts)&&(p=V5.get(d))&&!p.overlay)return new Aae(p.tree,h,e,o);let g=new Aae(d,h,e,o);return a&Zi.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?d.children.length-1:0,r,n,i,a)}}}if(a&Zi.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&Zi.IgnoreOverlays)&&(i=V5.get(this._tree))&&i.overlay){let a=e-this.from,o=n&Zi.EnterBracketed&&i.bracketed;for(let{from:s,to:l}of i.overlay)if((r>0||o?s<=a:s=a:l>a))return new Aae(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 yRt(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 Hwe(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 qyn{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class k0 extends vRt{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 k0(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&Zi.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 k0(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 k0(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 k0(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 bRt(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||o.to=e){let s=new xp(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(A$(s,e,r,!1))}}return i?bRt(i):n}class CK{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&~Zi.EnterBracketed,e instanceof xp)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 xp?(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&Zi.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zi.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&Zi.IncludeAnonymous||s instanceof _w||!s.type.isAnonymous||Wwe(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 Hwe(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 Wwe(t){return t.children.some(e=>e instanceof _w||!e.type.isAnonymous||Wwe(e))}function Kyn(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=pRt,reused:a=[],minRepeatType:o=n.types.length}=t,s=Array.isArray(r)?new Qwe(r,r.length):r,l=n.types,u=0,d=0;function h(A,S,T,C,O,E){let{id:_,start:P,end:L,size:R}=s,D=d,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){d=_;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,O))){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 _w(V,L-F.start,n),B=F.start-A}else{let V=s.pos-R;s.next();let z=[],U=[],G=_>=o?_:-1,H=0,j=L;for(;s.pos>V;)G>=0&&s.id==G&&s.size>=0?(s.end<=j-i&&(g(z,U,P,H,s.end,j,G,D,M),H=z.length,j=s.end),s.next()):E>2500?f(P,V,z,U):h(P,V,z,U,G,E+1);if(G>=0&&H>0&&H-1&&H>0){let q=p(I,M);N=Ywe(I,z,U,0,z.length,0,L-P,q,q)}else N=m(I,z,U,L-P,D-L,M)}T.push(N),C.push(B)}function f(A,S,T,C){let O=[],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),O.push(P,L,R),E++,s.next()}}if(E){let P=new Uint16Array(E*4),L=O[O.length-2];for(let R=O.length-3,D=0;R>=0;R-=3)P[D++]=O[R],P[D++]=O[R+1]-L,P[D++]=O[R+2]-L,P[D++]=D;T.push(new _w(P,O[2]-L,n)),C.push(L-A)}}function p(A,S){return(T,C,O)=>{let E=0,_=T.length-1,P,L;if(_>=0&&(P=T[_])instanceof ci){if(!_&&P.type==A&&P.length==O)return P;(L=P.prop(_n.lookAhead))&&(E=C[_]+P.length+L)}return m(A,T,C,O,E,S)}}function g(A,S,T,C,O,E,_,P,L){let R=[],D=[];for(;A.length>C;)R.push(A.pop()),D.push(S.pop()+T-O);A.push(m(n.types[_],R,D,E-O,P-E,L)),S.push(O-T)}function m(A,S,T,C,O,E,_){if(E){let P=[_n.contextHash,E];_=_?[P].concat(_):[P]}if(O>25){let P=[_n.lookAhead,O];_=_?[P].concat(_):[P]}return new ci(A,S,T,C,_)}function v(A,S){let T=s.fork(),C=0,O=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=O,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()}O=I,C+=R,E+=M}return(S<0||C==A)&&(P.size=C,P.start=O,P.skip=E),P.size>4?P:void 0}function y(A,S,T){let{id:C,start:O,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]=O-A,S[--T]=C}else _==-3?u=C:_==-4&&(d=C);return T}let b=[],x=[];for(;s.pos>0;)h(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 xRt=new WeakMap;function kK(t,e){if(!t.isAnonymous||e instanceof _w||e.type!=t)return 1;let r=xRt.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof ci)){r=1;break}r+=kK(t,n)}xRt.set(e,r)}return r}function Ywe(t,e,r,n,i,a,o,s,l){let u=0;for(let g=n;g=d)break;S+=T}if(x==w+1){if(S>d){let T=g[w];p(T.children,T.positions,0,T.children.length,m[w]+b);continue}h.push(g[w])}else{let T=m[x-1]+g[x-1].length-A;h.push(Ywe(t,g,m,w,x,A,T,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(s||l)(h,f,o)}class qwe{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 k0?this.setBuffer(e.context.buffer,e.index,r):e instanceof xp&&this.map.set(e.tree,r)}get(e){return e instanceof k0?this.getBuffer(e.context.buffer,e.index):e instanceof xp?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 f1{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 f1(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 d=s=n)for(;o&&o.from=f.from||h<=f.to||u){let p=Math.max(f.from,l)-u,g=Math.min(f.to,h)-u;f=p>=g?null:new f1(p,g,f.tree,f.offset+u,s>0,!!d)}if(f&&i.push(f),o.to>h)break;o=anew bp(i.from,i.to)):[new bp(0,0)]:[new bp(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 Zyn{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 wRt(t){return(e,r,n,i)=>new e1n(e,t,r,n,i)}class ARt{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 SRt(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Jyn{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 jwe=new _n({perNode:!0});class e1n{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([[jwe,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 V5(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(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let h=d.from+u.pos,f=d.to+u.pos;h>=i.from&&f<=i.to&&!r.ranges.some(p=>p.fromh)&&r.ranges.push({from:h,to:f})}}s=!1}else if(n&&(o=t1n(n.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew bp(h.from-i.from,h.to-i.from)):null,!!a.bracketed,i.tree,d.length?d[0].from:i.from)),a.overlay?d.length&&(n={ranges:d,depth:0,prev:n}):s=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new bp(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=kRt(this.ranges,r.ranges);u.length&&(SRt(u),this.inner.splice(r.index,0,new ARt(r.parser,r.parser.startParse(this.input,ORt(r.mounts,u),u),r.ranges.map(d=>new bp(d.from-r.start,d.to-r.start)),r.bracketed,r.target,u[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function t1n(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 TRt(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Zi.IgnoreOverlays|Zi.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 n1n=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(jwe))!==null&&r!==void 0?r:n.to,this.inner=new CRt(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(jwe))!==null&&e!==void 0?e:r.to,this.inner=new CRt(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 kRt(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 bp(s,l.to))):l.to>s?r[a--]=new bp(s,l.to):r.splice(a--,1))}}return n}function i1n(t,e,r,n){let i=0,a=0,o=!1,s=!1,l=-1e9,u=[];for(;;){let d=i==t.length?1e9:o?t[i].to:t[i].from,h=a==e.length?1e9:s?e[a].to:e[a].from;if(o!=s){let f=Math.max(l,r),p=Math.min(d,h,n);fnew bp(f.from+n,f.to+n)),h=i1n(e,d,l,u);for(let f=0,p=l;;f++){let g=f==h.length,m=g?u:h[f].from;if(m>p&&r.push(new f1(p,m,i.tree,-o,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=h[f].to}}else r.push(new f1(l,u,i.tree,-o,a.from>=o||a.openStart,a.to<=s||a.openEnd))}return r}let Xwe=[],ERt=[];(()=>{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=ERt[n])e=n+1;else return!0;if(e==r)return!1}}function _Rt(t){return t>=127462&&t<=127487}const RRt=8205;function o1n(t,e,r=!0,n=!0){return(r?DRt:s1n)(t,e,n)}function DRt(t,e,r){if(e==t.length)return e;e&&LRt(t.charCodeAt(e))&&MRt(t.charCodeAt(e-1))&&e--;let n=Kwe(t,e);for(e+=IRt(n);e=0&&_Rt(Kwe(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function s1n(t,e,r){for(;e>1;){let n=DRt(t,e-2,r);if(n=56320&&t<57344}function MRt(t){return t>=55296&&t<56320}function IRt(t){return t<65536?1:2}class Ai{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]=Q5(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),EK.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]=Q5(this,e,r);let n=[];return this.decompose(e,r,n,0),EK.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 S$(this),a=new S$(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 S$(this,e)}iterRange(e,r=this.length){return new NRt(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 BRt(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]?Ai.empty:e.length<=32?new ys(e):EK.from(ys.split(e,[]))}}class ys extends Ai{constructor(e,r=l1n(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 c1n(i,s,n,o);i=s+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new ys(PRt(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),s=_K(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]=Q5(this,e,r);let i=_K(this.text,_K(n.text,PRt(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new ys(i,a):EK.from(ys.split(i,[]),a)}sliceString(e,r=this.length,n=` +`){[e,r]=Q5(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 EK=class DP extends Ai{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]=Q5(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 d=this.children.slice();return d[i]=l,new DP(d,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]=Q5(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 DP))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,d=[];function h(p){let g;if(p.lines>a&&p instanceof DP)for(let m of p.children)h(m);else p.lines>o&&(l>o||!l)?(f(),s.push(p)):p instanceof ys&&l&&(g=d[d.length-1])instanceof ys&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,d[d.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,d.push(p))}function f(){l!=0&&(s.push(d.length==1?d[0]:DP.from(d,u)),u=-1,l=d.length=0)}for(let p of e)h(p);return f(),s.length==1?s[0]:new DP(s,r)}};Ai.empty=new ys([""],0);function l1n(t){let e=-1;for(let r of t)e+=r.length+1;return e}function _K(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 NRt{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new S$(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 BRt{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"&&(Ai.prototype[Symbol.iterator]=function(){return this.iter()},S$.prototype[Symbol.iterator]=NRt.prototype[Symbol.iterator]=BRt.prototype[Symbol.iterator]=function(){return this});let c1n=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 Q5(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Vl(t,e,r=!0,n=!0){return o1n(t,e,r,n)}function u1n(t){return t>=56320&&t<57344}function d1n(t){return t>=55296&&t<56320}function qd(t,e){let r=t.charCodeAt(e);if(!d1n(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return u1n(n)?(r-55296<<10)+(n-56320)+65536:r}function Zwe(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function O0(t){return t<65536?1:2}const Jwe=/\r\n?|\n/;var wc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(wc||(wc={}));class E0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=s}else{if(n!=wc.Simple&&u>=e&&(n==wc.TrackDel&&ie||n==wc.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 E0(e)}static create(e){return new E0(e)}}class bs extends E0{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 e2e(this,(r,n,i,a,o)=>e=e.replace(i,i+(n-r),o),!1),e}mapDesc(e,r=!1){return t2e(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&&Rw(n,r,a.text),a.forward(d),s+=d}let u=e[o++];for(;s>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],o=0,s=null;function l(d=!1){if(!d&&!i.length)return;of||h<0||f>r)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?Ai.of(p.split(n||Jwe)):p:Ai.empty,m=g.length;if(h==f&&m==0)return;ho&&cu(i,h-o,-1),cu(i,f-h,m),Rw(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 Rw(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,d,h),i=u,a=d}}}function t2e(t,e,r,n=!1){let i=[],a=n?[]:null,o=new T$(t),s=new T$(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);cu(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,d=o.len;for(;d;)if(s.ins==-1){let h=Math.min(d,s.len);u+=h,d-=h,s.forward(h)}else if(s.ins==0&&s.lenl||o.ins>=0&&o.len>l)&&(s||n.length>u),a.forward2(l),o.forward(l)}}}}class T${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?Ai.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?Ai.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 C$=class SIe{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 SIe(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 SIe(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=>C$.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 FRt(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let r2e=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=r2e++,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:n2e),!!e.static,e.enables)}of(e){return new RK([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new RK(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new RK(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function n2e(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class RK{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=r2e++}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,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?u=!0:((r=e[h.id])!==null&&r!==void 0?r:1)&1||d.push(e[h.id]);return{create(h){return h.values[o]=n(h),1},update(h,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||i2e(h,d)){let p=n(h);if(s?!zRt(p,h.values[o],i):!i(p,h.values[o]))return h.values[o]=p,1}return 0},reconfigure:(h,f)=>{let p,g=f.config.address[a];if(g!=null){let m=MK(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===h.facet(v):v instanceof Ko?f.field(v,!1)==h.field(v,!1):!0)||(s?zRt(p=n(h),m,i):i(p=n(h),m)))return h.values[o]=m,0}else p=n(h);return h.values[o]=p,1}}}get extension(){return this}}function zRt(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 d=0;dn===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(DK).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(DK),o=i.facet(DK),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,DK.of({field:this,create:e})]}get extension(){return this}}const dC={lowest:4,low:3,default:2,high:1,highest:0};function k$(t){return e=>new URt(e,t)}const Jh={highest:k$(dC.highest),high:k$(dC.high),default:k$(dC.default),low:k$(dC.low),lowest:k$(dC.lowest)};class URt{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class H5{of(e){return new a2e(this,e)}reconfigure(e){return H5.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class a2e{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class LK{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 f1n(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 d=n==null?void 0:n.config.facets;for(let f in a){let p=a[f],g=p[0].facet,m=d&&d[f]||[];if(p.every(v=>v.type==0))if(s[g.id]=l.length<<1|1,n2e(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=>h1n(v,g,p))}}let h=u.map(f=>f(s));return new LK(e,o,h,s,l,a)}}function f1n(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 a2e&&r.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let u of o)a(u,s);else if(o instanceof a2e){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 URt)a(o.inner,o.prec);else if(o instanceof Ko)n[s].push(o),o.provides&&a(o.provides,s);else if(o instanceof RK)n[s].push(o),o.facet.extensions&&a(o.facet.extensions,dC.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,dC.default),n.reduce((o,s)=>o.concat(s))}function O$(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 MK(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const VRt=vr.define(),o2e=vr.define({combine:t=>t.some(e=>e),static:!0}),GRt=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),QRt=vr.define(),HRt=vr.define(),WRt=vr.define(),YRt=vr.define({combine:t=>t.length?t[0]:!1});let _0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new p1n}};class p1n{of(e){return new _0(this,e)}}class g1n{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 g1n(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 Vs{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&&FRt(n,r.newLength),a.some(s=>s.type==Vs.time)||(this.annotations=a.concat(Vs.time.of(Date.now())))}static create(e,r,n,i,a,o){return new Vs(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(Vs.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Vs.time=_0.define(),Vs.userEvent=_0.define(),Vs.addToHistory=_0.define(),Vs.remote=_0.define();function m1n(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 Vs?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Vs?t=a[0]:t=jRt(e,W5(a),!1)}return t}function y1n(t){let e=t.startState,r=e.facet(WRt),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=qRt(n,s2e(e,a,t.changes.newLength),!0))}return n==t?t:Vs.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const b1n=[];function W5(t){return t==null?b1n: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 x1n=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let l2e;try{l2e=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function w1n(t){if(l2e)return l2e.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||x1n.test(r)))return!0}return!1}function A1n(t){return e=>{if(!/\S/.test(e))return Ao.Space;if(w1n(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=W5(n).concat(s.value));let a;r?a=e.startState.values.slice():(r=LK.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(o2e)?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=W5(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=LK.resolve(e.extensions||[],new Map),n=e.doc instanceof Ai?e.doc:Ai.of((e.doc||"").split(r.staticFacet(ei.lineSeparator)||Jwe)),i=e.selection?e.selection instanceof xt?e.selection:xt.single(e.selection.anchor,e.selection.head):xt.single(0);return FRt(i,n.length),r.staticFacet(o2e)||(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(YRt)}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(VRt))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 A1n(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=Vl(r,o,!1);if(a(r.slice(l,o))!=Ao.Word)break;o=l}for(;st.length?t[0]:4}),ei.lineSeparator=GRt,ei.readOnly=YRt,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=VRt,ei.changeFilter=QRt,ei.transactionFilter=HRt,ei.transactionExtender=WRt,H5.reconfigure=on.define();function R0(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 Dw{eq(e){return this==e}range(e,r=e){return u2e.create(e,r,this)}}Dw.prototype.startSide=Dw.prototype.endSide=0,Dw.prototype.point=!1,Dw.prototype.mapMode=wc.TrackDel;function c2e(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let u2e=class Jsr{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new Jsr(e,r,n)}};function d2e(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let S1n=class elr{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 elr(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(d2e)),this.isEmpty)return r.length?ti.of(r):this;let s=new KRt(this,null,-1).goto(0),l=0,u=[],d=new Qu;for(;s.value||l=0){let h=r[l++];d.addInner(h.from,h.to,h.value)||u.push(h)}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 E$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return E$.from(e).goto(r)}static compare(e,r,n,i,a=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=a),s=r.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=a),l=XRt(o,s,n),u=new _$(o,l,a),d=new _$(s,l,a);n.iterGaps((h,f,p)=>ZRt(u,h,d,f,p,i)),n.empty&&n.length==0&&ZRt(u,0,d,0,0,i)}static eq(e,r,n=0,i){i==null&&(i=999999999);let a=e.filter(d=>!d.isEmpty&&r.indexOf(d)<0),o=r.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(a.length!=o.length)return!1;if(!a.length)return!0;let s=XRt(a,o),l=new _$(a,s,0).goto(n),u=new _$(o,s,0).goto(n);for(;;){if(l.to!=u.to||!f2e(l.active,u.active)||l.point&&(!u.point||!c2e(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 _$(e,null,a).goto(r),s=r,l=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let d=o.activeForPoint(o.to),h=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 u2e?[e]:r?T1n(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 T1n(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(d2e);e=n}return t}ti.empty.nextLayer=ti.empty;class Qu{finishChunk(e){this.chunks.push(new S1n(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 XRt(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 KRt(o,r,n,a));return i.length==1?i[0]:new E$(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--)h2e(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--)h2e(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(),h2e(this.heap,0)}}}function h2e(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 _${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=E$.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){IK(this.active,e),IK(this.activeTo,e),IK(this.activeRank,e),this.minActive=JRt(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;PK(this.active,r,n),PK(this.activeTo,r,i),PK(this.activeRank,r,a),e&&PK(e,r,this.cursor.from),this.minActive=JRt(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&&IK(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 ZRt(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 d=!1;;){let h=t.to+l-r.to,f=h||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&&c2e(t.point,r.point)&&f2e(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(s,g,t.point,r.point),d=!1):(d&&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 JRt(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=Vl(t,i)}return n===!0?-1:t.length}const g2e="ͼ",e5t=typeof Symbol>"u"?"__"+g2e:Symbol.for(g2e),m2e=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),t5t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class p1{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 d=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&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(!h)throw new RangeError("The value of a property ("+p+") should be a primitive value.");a(i(p),g,d,f)}else g!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+g+";")}(d.length||f)&&l.push((n&&!h&&!u?o.map(n):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)a(i(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=t5t[e5t]||1;return t5t[e5t]=e+1,g2e+e.toString(36)}static mount(e,r,n){let i=e[m2e],a=n&&n.nonce;i?a&&i.setNonce(a):i=new C1n(e,a),i.mount(Array.isArray(r)?r:[r],e)}}let r5t=new Map;class C1n{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=r5t.get(n);if(a)return e[m2e]=a;this.sheet=new i.CSSStyleSheet,r5t.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[m2e]=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:'"'},k1n=typeof navigator<"u"&&/Mac/.test(navigator.platform),O1n=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ac=0;Ac<10;Ac++)Lw[48+Ac]=Lw[96+Ac]=String(Ac);for(var Ac=1;Ac<=24;Ac++)Lw[Ac+111]="F"+Ac;for(var Ac=65;Ac<=90;Ac++)Lw[Ac]=String.fromCharCode(Ac+32),R$[Ac]=String.fromCharCode(Ac);for(var v2e in Lw)R$.hasOwnProperty(v2e)||(R$[v2e]=Lw[v2e]);function E1n(t){var e=k1n&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||O1n&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?R$:Lw)[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:s5t||/Mac/.test(Hu.platform),windows:/Win/.test(Hu.platform),linux:/Linux|X11/.test(Hu.platform),ie:NK,ie_version:i5t?y2e.documentMode||6:x2e?+x2e[1]:b2e?+b2e[1]:0,gecko:a5t,gecko_version:a5t?+(/Firefox\/(\d+)/.exec(Hu.userAgent)||[0,0])[1]:0,chrome:!!w2e,chrome_version:w2e?+w2e[1]:0,ios:s5t,android:/Android\b/.test(Hu.userAgent),webkit:o5t,webkit_version:o5t?+(/\bAppleWebKit\/(\d+)/.exec(Hu.userAgent)||[0,0])[1]:0,safari:A2e,safari_version:A2e?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hu.userAgent)||[0,0])[1]:0,tabSize:y2e.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function S2e(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 BK=Object.create(null);function T2e(t,e,r){if(t==e)return!0;t||(t=BK),e||(e=BK);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 _1n(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 l5t(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 R1n(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new hC(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}=c5t(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(o?r?2e8:1:-6e8)+1}return new hC(e,n,i,r,e.widget||null,!0)}static line(e){return new L$(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 D$ extends Ar{constructor(e){let{start:r,end:n}=c5t(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?S2e(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||BK}eq(e){return this==e||e instanceof D$&&this.tagName==e.tagName&&T2e(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)}}D$.prototype.point=!1;class L$ extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof L$&&this.spec.class==e.spec.class&&T2e(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)}}L$.prototype.mapMode=wc.TrackBefore,L$.prototype.point=!0;class hC 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?wc.TrackBefore:wc.TrackAfter:wc.TrackDel}get type(){return this.startSide!=this.endSide?Sc.WidgetRange:this.startSide<=0?Sc.WidgetBefore:Sc.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof hC&&D1n(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)}}hC.prototype.point=!0;function c5t(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 D1n(t,e){return t==e||!!(t&&e&&t.compare(e))}function Y5(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 M$ extends Dw{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof M$&&this.tagName==e.tagName&&T2e(this.attributes,e.attributes)}static create(e){return new M$(e.tagName,e.attributes||BK,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return ti.of(e,r)}}M$.prototype.startSide=M$.prototype.endSide=-1;function I$(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function C2e(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function P$(t,e){if(!e.anchorNode)return!1;try{return C2e(t,e.anchorNode)}catch{return!1}}function N$(t){return t.nodeType==3?F$(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function B$(t,e,r,n){return r?u5t(t,e,r,n,-1)||u5t(t,e,r,n,1):!1}function Mw(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function $K(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function u5t(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:g1(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=Mw(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?g1(t):0}else return!1}}function g1(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 L1n(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 d5t(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 M1n(t,e,r,n,i,a,o,s){let l=t.ownerDocument,u=l.defaultView||window;for(let d=t,h=!1;d&&!h;)if(d.nodeType==1){let f,p=d==l.body,g=1,m=1;if(p)f=L1n(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let b=d.getBoundingClientRect();({scaleX:g,scaleY:m}=d5t(d,b)),f={left:b.left,right:b.left+d.clientWidth*g,top:b.top,bottom:b.top+d.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)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.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 I1n{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?g1(r):0),n,Math.min(e.focusOffset,n?g1(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let fC=null;br.safari&&br.safari_version>=26&&(fC=!1);function f5t(t){if(t.setActive)return t.setActive();if(fC)return t.focus(fC);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus(fC==null?{get preventScroll(){return fC={preventScroll:!0},!0}}:void 0),!fC){fC=!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 m5t(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=g1(r)}else if(r.parentNode&&!$K(r))n=Mw(r),r=r.parentNode;else return null}}function v5t(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 x5t(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(D0[m+1]==-p){let v=D0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Da[h]=Da[D0[m]]=y),s=m;break}}else{if(D0.length==189)break;D0[s++]=h,D0[s++]=f,D0[s++]=l}else if((g=Da[h])==2||g==1){let m=g==i;l=m?0:1;for(let v=s-3;v>=0;v-=3){let y=D0[v+2];if(y&2)break;if(m)D0[v+2]|=2;else{if(y&4)break;D0[v+2]|=4}}}}}function V1n(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=d}else a=u,l++}}}function E2e(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 L0(l,m.from,p));let v=m.direction==pC!=!(p%2);_2e(t,v?n+1:n,i,m.inner,m.from,m.to,o),l=m.to}g=m.to}else{if(g==r||(d?Da[g]!=s:Da[g]==s))break;g++}f?E2e(t,l,g,n+1,i,f,o):le;){let d=!0,h=!1;if(!u||l>a[u-1].to){let m=Da[l-1];m!=s&&(d=!1,h=m==16)}let f=!d&&s==1?[]:null,p=d?n:n+1,g=l;e:for(;;)if(u&&g==a[u-1].to){if(h)break e;let m=a[--u];if(!d)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==pC?0:1;return _2e(t,i,i,r,0,t.length,n),n}function w5t(t){return[new L0(0,t,0)]}let A5t="";function Q1n(t,e,r,n,i){var a;let o=n.head-t.from,s=L0.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 d=Vl(t.text,o,l.forward(i,r));(dl.to)&&(d=u),A5t=t.text.slice(Math.min(o,d),Math.max(o,d));let h=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return h&&d==u&&h.level+(i?0:1)t.some(e=>e)}),R5t=vr.define({combine:t=>t.some(e=>e)}),D5t=vr.define();class j5{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 j5(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 j5(xt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const FK=on.define({map:(t,e)=>t.map(e)}),L5t=on.define();function jd(t,e,r){let n=t.facet(k5t);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 m1=vr.define({combine:t=>t.length?t[0]:!0});let W1n=0;const X5=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return o&&l.push(zK.of(u=>{let d=u.plugin(s);return d?o(d):Ar.none})),a&&l.push(a(s)),l})}static fromClass(e,r){return Ro.define((n,i)=>new e(n,i),r)}}class M2e{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(jd(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){jd(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){jd(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const M5t=vr.define(),I2e=vr.define(),zK=vr.define(),I5t=vr.define(),P2e=vr.define(),z$=vr.define(),P5t=vr.define();function N5t(t,e){let r=t.state.facet(P5t);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,d=o-e.from,h=i;for(let f=s.length-1;f>=0;f--,l--){let p=s[f].spec.bidiIsolate,g;if(p==null&&(p=H1n(e.text,u,d)),l>0&&h.length&&(g=h[h.length-1]).to==u&&g.direction==p)g.to=d,h=g.inner;else{let m={from:u,to:d,direction:p,inner:[]};h.push(m),h=m.inner}}}}),i}const B5t=vr.define();function N2e(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(B5t)){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 U$=vr.define();class wp{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new wp(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 wp(a,o,s,l))),this.changedRanges=i}static create(e,r,n){return new UK(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 Y1n=[];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 Y1n}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&&_1n(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=Mw(this.dom),i=this.length?e>0:r>0;return new Pg(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 GK)return e;return null}static get(e){return e.cmTile}}class VK 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=$5t(i);else r.insertBefore(s.dom,i);n=s.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=$5t(i);this.length=o}}function $5t(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class GK extends VK{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 v1)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 v1 extends VK{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 v1(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class K5 extends VK{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new K5(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(d,h){for(let f=0,p=0;f=h&&(g.isComposite()?l(g,h-p):(!o||o.isHidden&&(r>0&&!(o.flags&32)||n&&j1n(o,g)))&&(m>h||g.flags&32)?(o=g,s=h-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,d=>d.width)||u),n==null?u:$$(u,(s?s>0:r<0)==n)}static of(e,r){let n=new gC(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class mC 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 X1n{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 Xd&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(B2e(l.dom)),i=u;else{if(this.cache.reused.get(l)){let h=Zo.get(l.dom);h&&h.setDOM(B2e(l.dom))}let d=Xd.of(l.mark,l.dom);i.append(d),i=d}this.cache.reused.set(l,2)}let a=Zo.get(e.text);a&&this.cache.reused.set(a,2);let o=new gC(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=z5t);let i=K5.start(e,r||((n=this.cache.find(K5))===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 Xd&&s.mark.eq(o))i=s,r--;else{let l=Xd.of(o,(n=this.cache.find(Xd,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||!F5t(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&F5t(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget($2e,0,32)||new mC($2e.toDOM(),0,$2e,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 K1n(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(QK,void 0,1);return n&&(n.flags=r),n||new QK(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class J1n{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 HK=[mC,K5,gC,Xd,QK,v1,GK];for(let t=0;t[]),this.index=HK.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 Xd&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=a=0):o instanceof Xd&&(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,d,h,f)=>{if(u instanceof hC){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=d.length,h>d.length)i.continueWidget(l-s);else{let p=u.widget||(u.block?Z5.block:Z5.inline),g=rbn(u),m=this.cache.findWidget(p,l-s,g)||mC.of(p,this.view,l-s,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,d,h))}n=null}else n=nbn(n,u);l>s&&this.text.skip(l-s)},span:(s,l,u,d)=>{for(let h=s;h-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 Xd?r.push(a):a!=null&&a.isLine()?n=a:a instanceof v1||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new K5(i,z5t):n||r.push(Xd.of(new D$({tagName:i.nodeName.toLowerCase(),attributes:R1n(i)}),i)))}return{line:n,marks:r}}}function F5t(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 rbn(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 z5t={class:"cm-line"};function nbn(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&S2e(r,t),n&&(t.class+=" "+n)),t}function ibn(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 Xd&&e.push(n.mark)}return e}function B2e(t){let e=Zo.get(t);return e&&e.setDOM(t.cloneNode()),t}class Z5 extends Wu{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}}Z5.inline=new Z5("span"),Z5.block=new Z5("div");const $2e=new class extends Wu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class U5t{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 GK(e,e.contentDOM),this.updateInner([new wp(0,0,0,e.state.doc.length)],null)}update(e){var r;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:d,toA:h})=>hthis.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:!fbn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?obn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:h}=this.hasComposition;n=new wp(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,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=cbn(o,this.decorations,e.changes);l.length&&(n=wp.extendWithRanges(n,l));let u=dbn(s,this.blockWrappers,e.changes);return u.length&&(n=wp.extendWithRanges(n,u)),a&&!n.some(d=>d.fromA<=a.range.fromA&&d.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 tbn(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),F2e(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)&&P$(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,d;if(l.empty?d=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(d=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&&abn(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=d=new Pg(f,0),s=!0}let h=this.view.observer.selectionRange;(s||!h.focusNode||(!B$(u.node,u.offset,h.anchorNode,h.anchorOffset)||!B$(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(h.focusNode)&&hbn(h.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=I$(this.view.root);if(f)if(l.empty){if(br.gecko){let p=sbn(u.node,u.offset);if(p&&p!=3){let g=(p==1?m5t:v5t)(u.node,u.offset);g&&(u=new Pg(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(d.node,d.offset)}catch{}}else{let p=document.createRange();l.anchor>l.head&&([u,d]=[d,u]),p.setEnd(d.node,d.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,d)),this.impreciseAnchor=u.precise?null:new Pg(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Pg(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&B$(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=I$(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 d=this.domAtPos(r.head+r.assoc,r.assoc);n.collapse(d.node,d.offset),n.modify("move",r.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.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=g1(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,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(a=!0)}else{let h=d+u.length;if(d<=e&&(n=u,i=e-d,a=h=e&&!o&&(o=u,s=e-d,l=d>e),d>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 z2e?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,d=(h,f,p)=>{for(let g=0;gi);g++){let m=h.children[g],v=f+m.length,y=m.dom.getBoundingClientRect(),{height:b}=y;if(p&&!g&&(u+=y.top-p.top),m instanceof v1)v>n&&d(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?N$(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==h.children.length-1&&(u+=p.bottom-y.bottom),f=v+m.breakAfter}};return d(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 d=N$(u.dom);if(d.length!=1)return;s+=d[0].width,l=d[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=N$(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 z2e(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(zK).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(P2e).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(D5t))try{if(u(this.view,e.range,e))return!0}catch(d){jd(this.view.state,d,"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=N2e(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(M1n(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(){F2e(this.tile)}}function F2e(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)F2e(n,e)}}function abn(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 V5t(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=m5t(r.focusNode,r.focusOffset),i=v5t(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 obn(t,e,r){let n=V5t(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 wp(l.mapPos(a),l.mapPos(o),a,o),text:i}}function sbn(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class z2e extends Wu{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 pbn(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=Vl(i.text,a,!1):s=Vl(i.text,a);let l=n(i.text.slice(o,s));for(;o>0;){let u=Vl(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+p2e(o,a,t.state.tabSize)}function U2e(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==Sc.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function mbn(t,e,r,n){let i=U2e(t,e.head,e.assoc||-1),a=!n||i.type!=Sc.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 G5t(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=Q1n(i,a,o,s,r),d=A5t;if(!u){if(i.number==(r?t.state.doc.lines:1))return s;d=` +`,i=t.state.doc.line(i.number+(r?1:-1)),a=t.bidiSpans(i),u=t.visualLineSide(i,!r)}if(l){if(!l(d))return s}else{if(!n)return u;l=n(d)}s=u}}function vbn(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 ybn(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)),d=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)+d}let h=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=G2e(t,{x:h,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 M0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==Sc.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 h=t.viewState.heightOracle.textHeight/2;l=n>0?u.bottom+h:u.top-h}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(r)return null;if(u.type==Sc.Text){let h=gbn(t,i,u,o,s);return new M0(h,h==u.from?1:-1)}}if(u.type!=Sc.Text)return l<(u.top+u.bottom)/2?new M0(u.from,1):new M0(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),new bbn(t,o,s,t.textDirectionAt(u.from)).scanTile(d,u.from)}class bbn{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[d],1):this.baseDir)==Ra.LTR;return{i:d,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 F$(e.dom,o,s).getClientRects()});return i.after?new M0(n[i.i+1],-1):new M0(n[i.i],1)}scanTile(e,r){if(!e.length)return new M0(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:F$(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 M0(n[i.i+1],-1):new M0(o,1)}}const J5="￿";class xbn{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+=J5}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:$K(i))||$K(s)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>a)&&!Abn(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+(wbn(e,n.node,n.offset)?r:0))}}function wbn(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=W5t(e.docView.tile,r,n,0))){let l=a||o?[]:Cbn(e),u=new xbn(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=kbn(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!C2e(e.contentDOM,l.focusNode)?s.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!C2e(e.contentDOM,l.anchorNode)?s.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((br.ios||br.chrome)&&u!=d&&Math.min(u,d)<=s.main.from&&Math.max(u,d)>=s.main.to&&(h.from>0||h.to-1&&s.ranges.length>1)this.newSel=s.replaceRange(xt.range(d,u));else if(e.lineWrapping&&d==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(d,u)}}}function W5t(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let l=0,u=n,d=n;lr)return W5t(h,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&h.dom.parentNode==t.dom){o=l,s=d;break}d=f,u=f+h.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 Y5t(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,d=null;(o===8||br.android&&e.text.length=s&&a.to<=l&&(e.typeOver||h!=e.text)&&h.slice(0,a.from-s)==e.text.slice(0,a.from-s)&&h.slice(a.to-s)==e.text.slice(f=e.text.length-(h.length-(a.to-s)))?r={from:a.from,to:a.to,insert:Ai.of(e.text.slice(a.from-s,f).split(J5))}:(p=q5t(h,e.text,u-s,d))&&(br.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==J5+J5&&p.toB--,r={from:s+p.from,to:s+p.toA,insert:Ai.of(e.text.slice(p.from,p.toB).split(J5))})}else n&&(!t.hasFocus&&i.facet(m1)||WK(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:Ai.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:Ai.of([" "])}),r)return Q2e(t,r,n,o);if(n&&!WK(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(z$).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:s,userEvent:l}),!0}else return!1}function Q2e(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&&q5(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&q5(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&q5(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,s=()=>o||(o=Tbn(t,e,r));return t.state.facet(O5t).some(l=>l(t,e.from,e.to,a,s))||t.dispatch(s()),!0}function Tbn(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.fromh(t)),u,l);e.from==d&&(o=d)}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 d=t.state.sliceDoc(e.from,e.to),h,f=r&&V5t(t,r.main.head);if(f){let g=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-g}}else h=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-d.length;if(t.state.sliceDoc(v,m)!=d||m>=h.from&&v<=h.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 q5t(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 Cbn(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 H5t(r,n)),(i!=r||a!=n)&&e.push(new H5t(i,a))),e}function kbn(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 WK(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Obn{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&&Gbn(e.contentDOM.ownerDocument)}handleEvent(e){!Nbn(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=_bn(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&&K5t.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&&(X5t.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||Rbn.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)&&Ebn(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 Ebn(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function j5t(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){jd(r.state,i)}}}function _bn(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(j5t(n.value,l))}if(o)for(let s in o){let l=o[s];l&&r(s).observers.push(j5t(n.value,l))}}for(let n in Ng)r(n).handlers.push(Ng[n]);for(let n in Yu)r(n).observers.push(Yu[n]);return e}const X5t=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rbn="dthko",K5t=[16,17,18,20,91,92,224,225],YK=6;function qK(t){return Math.max(0,t)*.7+8}function Dbn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Lbn{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(z$).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)&&Mbn(e,r),this.dragging=Pbn(e,r)&&i4t(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&&Dbn(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=N2e(this.view);e.clientX-l.left<=i+YK?r=-qK(i-e.clientX):e.clientX+l.right>=o-YK&&(r=qK(e.clientX-o)),e.clientY-l.top<=a+YK?n=-qK(a-e.clientY):e.clientY+l.bottom>=s-YK&&(n=qK(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 Mbn(t,e){let r=t.state.facet(S5t);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function Ibn(t,e){let r=t.state.facet(T5t);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function Pbn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=I$(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 Nbn(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 Ng=Object.create(null),Yu=Object.create(null),Z5t=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function Bbn(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(),J5t(t,r.value)},50)}function jK(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function J5t(t,e){e=jK(t.state,D2e,e);let{state:r}=t,n,i=1,a=r.toText(e),o=a.lines==r.selection.ranges.length;if(H2e!=null&&r.selection.ranges.every(l=>l.empty)&&H2e==a.toString()){let l=-1;n=r.changeByRange(u=>{let d=r.doc.lineAt(u.from);if(d.from==l)return{range:u};l=d.from;let h=r.toText((o?a.line(i++).text:e)+r.lineBreak);return{changes:{from:d.from,insert:h},range:xt.cursor(u.from+h.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})}Yu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Yu.wheel=Yu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ng.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Yu.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")},Yu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Yu.touchend=(t,e)=>{t.inputState.touchActive=!1},Ng.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(C5t))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=Fbn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new Lbn(t,e,r,n)),n&&t.observer.ignore(()=>{f5t(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 e4t(t,e,r,n){if(n==1)return xt.cursor(e,r);if(n==2)return pbn(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?(r4t+1)%3:1}function Fbn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=i4t(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,d=e4t(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!o){let h=e4t(t,r.pos,r.assoc,n),f=Math.min(h.from,d.from),p=Math.max(h.to,d.to);d=f1&&(u=zbn(i,l.pos))?u:s?i.addRange(d):xt.create([d])}}}function zbn(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}Ng.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",jK(t.state,L2e,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ng.dragend=t=>(t.inputState.draggedContent=null,!1);function a4t(t,e,r,n){if(r=jK(t.state,D2e,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,o=n&&a&&Ibn(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}Ng.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&&a4t(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 a4t(t,e,n,!0),!0}return!1},Ng.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=Z5t?null:e.clipboardData;return r?(J5t(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(Bbn(t),!1)};function Ubn(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 Vbn(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:jK(t,L2e,e.join(t.lineBreak)),ranges:r,linewise:n}}let H2e=null;Ng.copy=Ng.cut=(t,e)=>{if(!P$(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=Vbn(t.state);if(!r&&!i)return!1;H2e=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=Z5t?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(Ubn(t,r),!1)};const o4t=_0.define();function s4t(t,e){let r=[];for(let n of t.facet(E5t)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:o4t.of(!0)}):null}function l4t(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=s4t(t.state,e);r?t.dispatch(r):t.update([])}},10)}Yu.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),l4t(t)},Yu.blur=t=>{t.observer.clearSelectionRange(),l4t(t)},Yu.compositionstart=Yu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Yu.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))},Yu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ng.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 Q2e(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=X5t.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(()=>Yu.compositionend(t,e),20),!1};const c4t=new Set;function Gbn(t){c4t.has(t)||(c4t.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const u4t=["pre-wrap","normal","pre-line","break-spaces"];let e4=!1;function d4t(){e4=!1}class Qbn{constructor(e){this.lineWrapping=e,this.doc=Ai.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 u4t.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)>XK&&(e4=!0),this.height=e)}replace(e,r,n){return qu.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:d,toB:h}=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(h+=p.to-u,u=p.to;s>0&&f.from<=i[s-1].toA;)l=i[s-1].fromA,d=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 ef extends h4t{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 Bg(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 ef||i instanceof Tc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Tc?i=new ef(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):qu.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 Tc extends qu{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 Tc?n[n.length-1]=new Tc(a.length+i):n.push(null,new Tc(i-1))}if(e>0){let a=n[0];a instanceof Tc?n[0]=new Tc(e+a.length):n.unshift(new Tc(e-1),null)}return qu.of(n)}decomposeLeft(e,r){r.push(new Tc(e-1),null)}decomposeRight(e,r){r.push(null,new Tc(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 Tc(i.from-r-1).updateHeight(e,r));s<=a&&i.more;){let d=e.doc.lineAt(s).length;o.length&&o.push(null);let h=i.heights[i.index++],f=0;h<0&&(f=-h,h=i.heights[i.index++]),l==-1?l=h:Math.abs(h-l)>=XK&&(l=-2);let p=new ef(d,h,f);p.outdated=!1,o.push(p),s+=d+1}s<=a&&o.push(null,new Tc(a-s).updateHeight(e,s));let u=qu.of(o);return(l<0||Math.abs(u.height-this.height)>=XK||Math.abs(l-this.heightMetrics(e,r).perLine)>=XK)&&(e4=!0),KK(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 Ybn extends qu{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 d=r==Fa.ByPosNoHeight?Fa.ByPosNoHeight:Fa.ByPos;return l?u.join(this.right.lineAt(s,d,n,o,s)):this.left.lineAt(s,d,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&&f4t(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?qu.of(this.break?[e,null,r]:[e,r]):(this.left=KK(this.left,e),this.right=KK(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 f4t(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof Tc&&(n=t[e+1])instanceof Tc&&t.splice(e-1,3,new Tc(r.length+1+n.length))}const qbn=5;class W2e{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 ef?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new ef(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=qbn)&&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 ef(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new Tc(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 ef)return e;let r=new ef(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 ef)&&!this.isCovered?this.nodes.push(new ef(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&h.overflow!="visible"){let f=d.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=h.position=="absolute"||h.position=="fixed"?d.offsetParent:d.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 Zbn(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function Jbn(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class Y2e{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 Qbn(n),this.stateDeco=m4t(r),this.heightMap=qu.empty().applyChanges(this.stateDeco,Ai.empty,this.heightOracle.setDoc(r.doc),[new wp(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 ZK(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?g4t:new q2e(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(G$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=m4t(this.state);let i=e.changedRanges,a=wp.extendWithRanges(i,jbn(n,this.stateDeco,e?e.changes:bs.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);d4t(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=o||e4)&&(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(R5t)&&(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,d=0;if(s.width&&s.height){let{scaleX:A,scaleY:S}=d5t(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 h=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,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=g5t(this.scrollParent||e.win);let m=(this.printing?Jbn:Kbn)(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&&!Zbn(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?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),d4t();for(let S of this.viewports){let T=S.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?qu.empty().applyChanges(this.stateDeco,Ai.empty,this.heightOracle,[new wp(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Hbn(S.from,T))}e4&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(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 ZK(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 d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(u,Fa.ByPos,a,0,0),f;r.y=="center"?f=(h.top+h.bottom)/2-d/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=(d,h,f,p)=>{if(h-dd&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-d)y.fromb));if(!v){if(hx.from<=h&&x.to>=h)){let x=r.moveToLineBoundary(xt.cursor(h),!1,!0).head;x>d&&(h=x)}let y=this.gapSize(f,d,h,p),b=n||y<2e6?y:2e6;v=new Y2e(d,h,y,b)}s.push(v)},u=d=>{if(d.length2e6)for(let S of e)S.from>=d.from&&S.fromd.from&&l(d.from,p,d,h),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)||G$(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)||G$(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 G$(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 ZK{constructor(e,r){this.from=e,this.to=r}}function txn(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 eZ(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 rxn(t,e){for(let r of t)if(e(r))return r}const g4t={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function m4t(t){let e=t.facet(zK).filter(n=>typeof n!="function"),r=t.facet(P2e).filter(n=>typeof n!="function");return r.length&&e.push(ti.join(r)),e}class q2e{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,d=r.lineAt(l,Fa.ByPos,e,0,0).bottom;return i+=d-u,{from:s,to:l,top:u,bottom:d,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 G$(t,e){if(e.scale==1)return t;let r=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Bg(t.from,t.length,r,n-r,Array.isArray(t._content)?t._content.map(i=>G$(i,e)):t._content)}const tZ=vr.define({combine:t=>t.join(" ")}),j2e=vr.define({combine:t=>t.indexOf(!0)>-1}),X2e=p1.newName(),v4t=p1.newName(),y4t=p1.newName(),b4t={"&light":"."+v4t,"&dark":"."+y4t};function K2e(t,e,r){return new p1(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 nxn=K2e("."+X2e,{"&":{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"}},b4t),ixn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Z2e=br.ie&&br.ie_version<=11;class axn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new I1n,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 sxn(e),e.state.facet(m1)&&(e.contentDOM.editContext=this.editContext.editContext)),Z2e&&(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(m1)?n.root.activeElement!=this.dom:!P$(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&&B$(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=I$(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&oxn(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=P$(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&&q5(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&&P$(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 Sbn(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=Y5t(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!WK(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=x4t(r,e.previousSibling||e.target.previousSibling,-1),i=x4t(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(m1)!=e.state.facet(m1)&&(e.view.contentDOM.editContext=e.state.facet(m1)?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 x4t(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 w4t(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 B$(o.node,o.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function oxn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return w4t(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?w4t(t,r):null}class sxn{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 d=q5t(e.state.sliceDoc(s,l),n.text,(u?i.from:i.to)-s,u?"end":null);if(!d){let f=xt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));WK(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:d.from+s,to:d.toA+s,insert:Ai.of(n.text.slice(d.from,d.toB).split(` +`))};if((br.mac||br.android)&&h.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:s,to:l,insert:Ai.of([n.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Q2e(e,h,xt.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.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=I$(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 d=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+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(a+=r,o+=r,o<=this.from)this.from+=d,this.to+=d;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+=d}r+=d}),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||P1n(e.parent)||document,this.viewState=new p4t(this,e.state||ei.create(e)),e.scrollTo&&e.scrollTo.is(FK)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(X5).map(i=>new M2e(i));for(let i of this.plugins)i.update(this);this.observer=new axn(this),this.inputState=new Obn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new U5t(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 Vs?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(o4t))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=s4t(a,o),l||(s=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(d=null)):this.observer.clear(),a.facet(ei.phrases)!=this.state.facet(ei.phrases))return this.setState(a);i=UK.create(this,a,e),i.flags|=s;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection,{x:g,y:m}=this.state.facet(er.cursorScrollMargin);h=new j5(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(FK)&&(h=p.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=rZ.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(U$)!=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(tZ)!=i.state.facet(tZ)&&(this.viewState.mustMeasureContent=!0),(r||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),r&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(R2e))try{f(i)}catch(p){jd(this.state,p,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!Y5t(this,d)&&u.force&&q5(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 p4t(this,e),this.plugins=e.facet(X5).map(n=>new M2e(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new U5t(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(X5),n=e.state.facet(X5);if(r!=n){let i=[];for(let a of n){let o=r.indexOf(a);if(o<0)i.push(new M2e(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(g5t(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 d=u.map(p=>{try{return p.read(this)}catch(g){return jd(this.state,g),A4t}}),h=UK.create(this,this.state,[]),f=!1;h.flags|=l,r?r.flags|=l:r=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),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(R2e))s(r)}get themeClasses(){return X2e+" "+(this.state.facet(j2e)?y4t:v4t)+" "+this.state.facet(tZ)}updateAttrs(){let e=S4t(this,M5t,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(m1)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),S4t(this,I2e,r);let n=this.observer.ignore(()=>{let i=l5t(this.contentDOM,this.contentAttrs,r),a=l5t(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(U$);let e=this.state.facet(er.cspNonce);p1.mount(this.root,this.styleModules.concat(nxn).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 V2e(this,e,G5t(this,e,r,n))}moveByGroup(e,r){return V2e(this,e,G5t(this,e,r,n=>vbn(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 mbn(this,e,r,n)}moveVertically(e,r,n){return V2e(this,e,ybn(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=G2e(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),G2e(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[L0.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(_5t)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>lxn)return w5t(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||x5t(a.isolates,n=N5t(this,e))))return a.order;n||(n=N5t(this,e));let i=G1n(e.text,r,n);return this.bidiCache.push(new rZ(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(()=>{f5t(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 FK.of(new j5(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 FK.of(new j5(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=p1.newName(),i=[tZ.of(n),U$.of(K2e(`.${n}`,e))];return r&&r.dark&&i.push(j2e.of(!0)),i}static baseTheme(e){return Jh.lowest(U$.of(K2e("."+X2e,e,b4t)))}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=U$,er.inputHandler=O5t,er.clipboardInputFilter=D2e,er.clipboardOutputFilter=L2e,er.scrollHandler=D5t,er.focusChangeEffect=E5t,er.perLineTextDirection=_5t,er.exceptionSink=k5t,er.updateListener=R2e,er.editable=m1,er.mouseSelectionStyle=C5t,er.dragMovesSelection=T5t,er.clickAddsSelectionRange=S5t,er.decorations=zK,er.blockWrappers=I5t,er.outerDecorations=P2e,er.atomicRanges=z$,er.bidiIsolatedRanges=P5t,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=B5t,er.darkTheme=j2e,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=I2e,er.editorAttributes=M5t,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=on.define();const lxn=4096,A4t={};class rZ{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&&S2e(o,r)}return r}const cxn=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function uxn(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 hxn(t,e,r){return k4t(C4t(t.state),e,t,r)}let Iw=null;const fxn=4e3;function pxn(t,e=cxn){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,d)=>{var h,f;let p=r[o]||(r[o]=Object.create(null)),g=s.split(/ (?!$)/).map(y=>uxn(y,e));for(let y=1;y{let w=Iw={view:x,prefix:b,scope:o};return setTimeout(()=>{Iw==w&&(Iw=null)},fxn),!0}]})}let m=g.join(" ");i(m,!1);let v=p[m]||(p[m]={preventDefault:!1,stopPropagation:!1,run:((f=(h=p._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),u&&(v.preventDefault=!0),d&&(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 d=r[u]||(r[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in d)d[f].run.push(p=>h(p,J2e))}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 J2e=null;function k4t(t,e,r,n){J2e=e;let i=E1n(e),a=qd(i,0),o=O0(a)==i.length&&i!=" ",s="",l=!1,u=!1,d=!1;Iw&&Iw.view==r&&Iw.scope==n&&(s=Iw.prefix+" ",K5t.indexOf(e.keyCode)<0&&(u=!0,Iw=null));let h=new Set,f=v=>{if(v){for(let y of v.run)if(!h.has(y)&&(h.add(y),y(r)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},p=t[n],g,m;return p&&(f(p[s+nZ(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=Lw[e.keyCode])&&g!=i?(f(p[s+nZ(g,e,!0)])||e.shiftKey&&(m=R$[e.keyCode])!=i&&m!=g&&f(p[s+nZ(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[s+nZ(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&d&&e.stopPropagation(),J2e=null,l}class vC{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=O4t(e);return[new vC(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return gxn(e,r,n)}}function O4t(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 E4t(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 gxn(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=O4t(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),h=s.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=s.right-(d?parseInt(d.paddingRight):0),p=U2e(t,n,1),g=U2e(t,i,-1),m=p.type==Sc.Text?p:null,v=g.type==Sc.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=E4t(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=E4t(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:O,horizontal:E}}function w(A,S){let T=s.top+(S?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function mxn(t,e){return t.constructor==e.constructor&&t.eq(e)}class vxn{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(iZ)!=e.state.facet(iZ)&&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(iZ);for(;r!mxn(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 iZ=vr.define();function _4t(t){return[Ro.define(e=>new vxn(e,t)),iZ.of(t)]}const r4=vr.define({combine(t){return R0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function yxn(t={}){return[r4.of(t),bxn,xxn,wxn,R5t.of(!0)]}function R4t(t){return t.startState.facet(r4)!=t.state.facet(r4)}const bxn=_4t({above:!0,markers(t){let{state:e}=t,r=e.facet(r4),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 vC.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=R4t(t);return r&&D4t(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){D4t(e.state,t)},class:"cm-cursorLayer"});function D4t(t,e){e.style.animationDuration=t.facet(r4).cursorBlinkRate+"ms"}const xxn=_4t({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 vC.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(r4).iosSelectionHandles){for(let i of vC.forRange(t,"cm-selectionHandle cm-selectionHandle-start",xt.cursor(r.from,1)))e.push(i);for(let i of vC.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||R4t(t)},class:"cm-selectionLayer"}),wxn=Jh.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"}}}})),L4t=on.define({map(t,e){return t==null?null:e.mapPos(t)}}),Q$=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(L4t)?n.value:r,t)}}),Axn=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(Q$);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(Q$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Q$),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(Q$)!=t&&this.view.dispatch({effects:L4t.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 Sxn(){return[Q$,Axn]}function M4t(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 Txn(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 Cxn{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,d)=>i(d,u,u+s[0].length,s,l);else if(typeof n=="function")this.addMatch=(s,l,u,d)=>{let h=n(s,l,u);h&&d(u,u+s[0].length,h)};else if(n)this.addMatch=(s,l,u,d)=>d(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 Txn(e,this.maxLength))M4t(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])){d=o;break}for(;sf.push(y.range(m,v));if(l==u)for(this.regexp.lastIndex=d-l.from;(p=this.regexp.exec(l.text))&&p.indexthis.addMatch(v,e,m,g));r=r.update({filterFrom:d,filterTo:h,filter:(m,v)=>mh,add:f})}}return r}}const eAe=/x/.unicode!=null?"gu":"g",kxn=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,eAe),Oxn={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 tAe=null;function Exn(){var t;if(tAe==null&&typeof document<"u"&&document.body){let e=document.body.style;tAe=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return tAe||!1}const aZ=vr.define({combine(t){let e=R0(t,{render:null,specialChars:kxn,addSpecialChars:null});return(e.replaceTabs=!Exn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,eAe)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,eAe)),e}});function _xn(t={}){return[aZ.of(t),Rxn()]}let I4t=null;function Rxn(){return I4t||(I4t=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=Ar.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(aZ)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Cxn({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,a=qd(e[0],0);if(a==9){let o=i.lineAt(n),s=r.state.tabSize,l=Ig(o.text,s,n-o.from);return Ar.replace({widget:new Ixn((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ar.replace({widget:new Mxn(t,a)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(aZ);t.startState.facet(aZ)!=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 Dxn="•";function Lxn(t){return t>=32?Dxn:t==10?"␤":String.fromCharCode(9216+t)}class Mxn extends Wu{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=Lxn(this.code),n=e.state.phrase("Control character")+" "+(Oxn[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 Ixn extends Wu{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 Pxn(){return Bxn}const Nxn=Ar.line({class:"cm-activeLine"}),Bxn=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(Nxn.range(i.from)),e=i.from)}return Ar.set(r)}},{decorations:t=>t.decorations});class $xn extends Wu{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?N$(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 Fxn(t){let e=Ro.fromClass(class{constructor(r){this.view=r,this.placeholder=t?Ar.set([Ar.widget({widget:new $xn(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 rAe=2e3;function zxn(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),a=[];if(e.off>rAe||r.off>rAe||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),d=p2e(u.text,o,t.tabSize,!0);if(d<0)a.push(xt.cursor(u.to));else{let h=p2e(u.text,s,t.tabSize);a.push(xt.range(u.from+d,u.from+h))}}}return a}function Uxn(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function P4t(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>rAe?-1:i==n.length?Uxn(t,e.clientX):Ig(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:a,off:i}}function Vxn(t,e){let r=P4t(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=P4t(t,i);if(!s)return n;let l=zxn(t.state,r,s);return l.length?o?xt.create(l.concat(n.ranges)):xt.create(l):n}}:null}function Gxn(t){let e=r=>r.altKey&&r.button==0;return er.mouseSelectionStyle.of((r,n)=>e(n)?Vxn(r,n):null)}const Qxn={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Hxn={style:"cursor: crosshair"};function Wxn(t={}){let[e,r]=Qxn[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?Hxn:null})]}const oZ="-10000px";class N4t{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 Yxn(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const nAe=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)||Yxn}}}),B4t=new WeakMap,iAe=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(nAe);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 N4t(t,aAe,(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(nAe);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=oZ,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=N2e(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(nAe).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)||h.rightMath.min(r.right,n.right)+.1)){d.style.top=oZ;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,m=f.right-f.left,v=(e=B4t.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||jxn,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(h.left-(p?14:0)+y.x,n.right-m)):Math.min(Math.max(n.left,h.left-m+(p?14:0)-y.x),n.right-m),w=this.above[s];!l.strictSide&&(w?h.top-v-g-y.yn.bottom)&&w==n.bottom-h.bottom>h.top-n.top&&(w=this.above[s]=!w);let A=(w?h.top-n.top:n.bottom-h.bottom)-g;if(Ax&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-t.parent.top)/a+"px",$4t(d,(x-t.parent.left)/i)):(d.style.top=S/a+"px",$4t(d,x/i)),p){let C=h.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}),d.classList.toggle("cm-tooltip-above",w),d.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=oZ}},{eventObservers:{scroll(){this.maybeMeasure()}}});function $4t(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const qxn=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"}}}),jxn={x:0,y:0},aAe=vr.define({enables:[iAe,qxn]}),sZ=vr.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class lZ{static create(e){return new lZ(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new N4t(e,sZ,(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 Xxn=aAe.compute([sZ],t=>{let e=t.facet(sZ);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:lZ.create,above:e[0].above,arrow:e.some(r=>r.arrow)}}),F4t=vr.define();class Kxn{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=>jd(e.state,l,"hover tooltip"))}else o(a)}get tooltip(){let e=this.view.plugin(iAe),r=e?e.manager.tooltips.findIndex(n=>n.create==lZ.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&&!Zxn(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:!Jxn(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 cZ=4;function Zxn(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-cZ&&e.clientX<=n+cZ&&e.clientY>=i-cZ&&e.clientY<=a+cZ}function Jxn(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 ewn(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 d of o){let h=s.changes.mapPos(d.pos,-1,wc.TrackDel);if(h!=null){let f=Object.assign(Object.create(null),d);f.pos=h,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(rwn)&&!u.value||u.value==i)&&(o=[]);return o.length&&l&&n.set(o,l),o},provide:o=>sZ.from(o)});const a=Ro.define(o=>new Kxn(o,t,i,n,r,e.hoverTime||300));return{active:i,extension:[i,a,F4t.of(a),Xxn]}}function twn(t,e,r,n={}){var i;let a=t.state.facet(F4t).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 z4t(t,e){let r=t.plugin(iAe);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const rwn=on.define(),U4t=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 oAe(t,e){let r=t.plugin(V4t),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const V4t=Ro.fromClass(class{constructor(t){this.input=t.state.facet(H$),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet(U4t);this.top=new uZ(t,!0,e.topContainer),this.bottom=new uZ(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(U4t);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new uZ(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new uZ(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(H$);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),d;u<0?(d=l(t.view),s.push(d)):(d=this.panels[u],d.update&&d.update(t)),i.push(d),(d.top?a:o).push(d)}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 uZ{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=G4t(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=G4t(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 G4t(t){let e=t.nextSibling;return t.remove(),e}const H$=vr.define({enables:V4t});function nwn(t,e){let r,n=new Promise(o=>r=o),i=o=>iwn(o,e,r);t.state.field(sAe,!1)?t.dispatch({effects:Q4t.of(i)}):t.dispatch({effects:on.appendConfig.of(sAe.init(()=>[i]))});let a=H4t.of(i);return{close:a,result:n.then(o=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(sAe).indexOf(i)>-1&&t.dispatch({effects:a})}),o))}}const sAe=Ko.define({create(){return[]},update(t,e){for(let r of e.effects)r.is(Q4t)?t=[r.value].concat(t):r.is(H4t)&&(t=t.filter(n=>n!=r.value));return t},provide:t=>H$.computeN([t],e=>e.field(t))}),Q4t=on.define(),H4t=on.define();function iwn(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 Ap extends Dw{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ap.prototype.elementClass="",Ap.prototype.toDOM=void 0,Ap.prototype.mapMode=wc.TrackBefore,Ap.prototype.startSide=Ap.prototype.endSide=-1,Ap.prototype.point=!0;const dZ=vr.define(),awn=vr.define(),own={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ti.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},W$=vr.define();function lAe(t){return[Y4t(),W$.of({...own,...t})]}const W4t=vr.define({combine:t=>t.some(e=>e)});function Y4t(t){return[swn]}const swn=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(W$).map(e=>new j4t(t,e)),this.fixed=!t.state.facet(W4t);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(W4t)!=!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(dZ),this.view.viewport.from),n=[],i=this.gutters.map(a=>new lwn(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==Sc.Text&&o){cAe(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==Sc.Text){cAe(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(W$),r=t.state.facet(W$),n=t.docChanged||t.heightChanged||t.viewportChanged||!ti.eq(t.startState.facet(dZ),t.state.facet(dZ),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 j4t(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 q4t(t){return Array.isArray(t)?t:[t]}function cAe(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class lwn{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 X4t(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=[];cAe(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(awn)){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 j4t{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=q4t(r.markers(e)),r.initialSpacer&&(this.spacer=new X4t(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=q4t(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 X4t{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":""),cwn(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 uAe extends Ap{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function dAe(t,e){return t.state.facet(n4).formatNumber(e,t.state)}const hwn=W$.compute([n4],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(uwn)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new uAe(dAe(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(dwn)){let a=i(e,r,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(n4)!=e.state.facet(n4),initialSpacer(e){return new uAe(dAe(e,Z4t(e.state.doc.lines)))},updateSpacer(e,r){let n=dAe(r.view,Z4t(r.view.state.doc.lines));return n==e.number?e:new uAe(n)},domEventHandlers:t.facet(n4).domEventHandlers,side:"before"}));function K4t(t={}){return[n4.of(t),Y4t(),hwn]}function Z4t(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(fwn.range(i)))}return ti.of(e)});function gwn(){return pwn}let mwn=0,I0=class TIe{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=mwn++}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 TIe&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new TIe(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 hZ(e);return n=>n.modified.indexOf(r)>-1?n:hZ.get(n.base||n,n.modified.concat(r).sort((i,a)=>i.id-a.id))}},vwn=0;class hZ{constructor(e){this.name=e,this.instances=[],this.id=vwn++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(s=>s.base==e&&ywn(r,s.modified));if(n)return n;let i=[],a=new I0(e.name,i,e,r);for(let s of r)s.instances.push(a);let o=bwn(r);for(let s of e.set)if(!s.modified.length)for(let l of o)i.push(hZ.get(s,l));return a}}function ywn(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function bwn(t){let e=[[]];for(let r=0;rn.length-r.length)}function y1(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 h=0;;){if(s=="..."&&h>0&&h+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]),h+=f[0].length,h==i.length)break;let p=i[h++];if(h==i.length&&p=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);s=i.slice(h)}let l=a.length-1,u=a[l];if(!u)throw new RangeError("Invalid path: "+i);let d=new Y$(n,o,l>0?a.slice(0,l):null);e[u]=d.sort(e[u])}}return J4t.add(e)}const J4t=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 Y$(i.tags,i.mode,i.context);r?r.next=a:n=a,r=a}return n}});let Y$=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 xwn(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function t3t(t,e,r,n=0,i=t.length){let a=new wwn(n,Array.isArray(e)?e:[e],r);a.highlightRange(t.cursor(),n,i,"",a.highlighters),a.flush(i)}class wwn{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,d=Awn(e)||Y$.empty,h=xwn(a,d.tags);if(h&&(u&&(u+=" "),u+=h,d.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(r,s),u),d.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 Awn(t){let e=t.type.prop(J4t);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dr=I0.define,fZ=dr(),Pw=dr(),r3t=dr(Pw),n3t=dr(Pw),Nw=dr(),pZ=dr(Nw),hAe=dr(Nw),P0=dr(),yC=dr(P0),N0=dr(),B0=dr(),fAe=dr(),q$=dr(fAe),gZ=dr(),Re={comment:fZ,lineComment:dr(fZ),blockComment:dr(fZ),docComment:dr(fZ),name:Pw,variableName:dr(Pw),typeName:r3t,tagName:dr(r3t),propertyName:n3t,attributeName:dr(n3t),className:dr(Pw),labelName:dr(Pw),namespace:dr(Pw),macroName:dr(Pw),literal:Nw,string:pZ,docString:dr(pZ),character:dr(pZ),attributeValue:dr(pZ),number:hAe,integer:dr(hAe),float:dr(hAe),bool:dr(Nw),regexp:dr(Nw),escape:dr(Nw),color:dr(Nw),url:dr(Nw),keyword:N0,self:dr(N0),null:dr(N0),atom:dr(N0),unit:dr(N0),modifier:dr(N0),operatorKeyword:dr(N0),controlKeyword:dr(N0),definitionKeyword:dr(N0),moduleKeyword:dr(N0),operator:B0,derefOperator:dr(B0),arithmeticOperator:dr(B0),logicOperator:dr(B0),bitwiseOperator:dr(B0),compareOperator:dr(B0),updateOperator:dr(B0),definitionOperator:dr(B0),typeOperator:dr(B0),controlOperator:dr(B0),punctuation:fAe,separator:dr(fAe),bracket:q$,angleBracket:dr(q$),squareBracket:dr(q$),paren:dr(q$),brace:dr(q$),content:P0,heading:yC,heading1:dr(yC),heading2:dr(yC),heading3:dr(yC),heading4:dr(yC),heading5:dr(yC),heading6:dr(yC),contentSeparator:dr(P0),list:dr(P0),quote:dr(P0),emphasis:dr(P0),strong:dr(P0),link:dr(P0),monospace:dr(P0),strikethrough:dr(P0),inserted:dr(),deleted:dr(),changed:dr(),invalid:dr(),meta:gZ,documentMeta:dr(gZ),annotation:dr(gZ),processingInstruction:dr(gZ),definition:I0.defineModifier("definition"),constant:I0.defineModifier("constant"),function:I0.defineModifier("function"),standard:I0.defineModifier("standard"),local:I0.defineModifier("local"),special:I0.defineModifier("special")};for(let t in Re){let e=Re[t];e instanceof I0&&(e.name=t)}e3t([{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 pAe;const Bw=new _n;function mZ(t){return vr.define({combine:t?e=>e.concat(t):void 0})}const gAe=new _n;class tf{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=[x1.of(this),ei.languageData.of((a,o,s)=>{let l=i3t(a,o,s),u=l.type.prop(Bw);if(!u)return[];let d=a.facet(u),h=l.type.prop(gAe);if(h){let f=l.resolve(o-l.from,s);for(let p of h)if(p.test(f,a)){let g=a.facet(p.facet);return p.type=="replace"?g:g.concat(d)}}return d})].concat(n)}isActiveAt(e,r,n=-1){return i3t(e,r,n).type.prop(Bw)==this.data}findRegions(e){let r=e.facet(x1);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(Bw)==this.data){n.push({from:o,to:o+a.length});return}let s=a.prop(_n.mounted);if(s){if(s.tree.prop(Bw)==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 b1(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function wa(t){let e=t.field(tf.state,!1);return e?e.tree:ci.empty}class Swn{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 j$=null;class bC{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 bC(e,r,[],ci.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Swn(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(f1.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=j$;j$=this;try{return e()}finally{j$=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=a3t(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,d,h,f)=>l.push({fromA:u,toA:d,fromB:h,toB:f})),n=f1.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 d=e.mapPos(u.from,1),h=e.mapPos(u.to,-1);de.from&&(this.fragments=a3t(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 OK{createParse(r,n,i){let a=i[0].from,o=i[i.length-1].to;return{parsedPos:a,advance(){let l=j$;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(Us.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 j$}}function a3t(t,e,r){return f1.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class i4{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 i4(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=bC.create(e.facet(x1).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new i4(n)}}tf.state=Ko.define({create:i4.init,update(t,e){for(let r of e.effects)if(r.is(tf.setState))return r.value;return e.startState.facet(x1)!=e.state.facet(x1)?i4.init(e.state):t.apply(e)}});let o3t=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(o3t=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const mAe=typeof navigator<"u"&&(!((pAe=navigator.scheduling)===null||pAe===void 0)&&pAe.isInputPending)?()=>navigator.scheduling.isInputPending():null,Twn=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(tf.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(tf.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=o3t(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEndi+1e3,l=a.context.work(()=>mAe&&mAe()||Date.now()>o,i+(s?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:tf.setState.of(new i4(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=>jd(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()}}}),x1=vr.define({combine(t){return t.length?t[0]:null},enables:t=>[tf.state,Twn,er.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class $w{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class vZ{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 vZ(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 Cwn=vr.define(),a4=vr.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(r=>r!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function xC(t){let e=t.facet(a4);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function X$(t,e){let r="",n=t.tabSize,i=t.facet(a4)[0];if(i==" "){for(;e>=n;)r+=" ",e-=n;i=" "}for(let a=0;a=e?kwn(t,r,e):null}class yZ{constructor(e,r={}){this.state=e,this.options=r,this.unit=xC(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 Ig(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 w1=new _n;function kwn(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 s3t(n,t,r)}function s3t(t,e,r){for(let n=t;n;n=n.next){let i=Ewn(n.node);if(i)return i(yAe.create(e,r,n))}return 0}function Own(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Ewn(t){let e=t.type.prop(w1);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=>l3t(o,!0,1,void 0,a&&!Own(o)?i.from:void 0)}return t.parent==null?_wn:null}function _wn(){return 0}class yAe extends yZ{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 yAe(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(Rwn(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return s3t(this.context.next,this.base,this.pos)}}function Rwn(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Dwn(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 o4({closing:t,align:e=!0,units:r=1}){return n=>l3t(n,e,r,t)}function l3t(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?Dwn(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*r)}const Lwn=t=>t.baseIndent;function s4({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const Mwn=200;function Iwn(){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+Mwn)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 d=o.doc.lineAt(u);if(d.from==s)continue;s=d.from;let h=vAe(o,d.from);if(h==null)continue;let f=/^\s*/.exec(d.text)[0],p=X$(o,h);f!=p&&l.push({from:d.from,to:d.from+f.length,insert:p})}return l.length?[t,{changes:l,sequential:!0}]:t})}const c3t=vr.define(),A1=new _n;function K$(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 Nwn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function bZ(t,e,r){for(let n of t.facet(c3t)){let i=n(t,e,r);if(i)return i}return Pwn(t,e,r)}function u3t(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 xZ=on.define({map:u3t}),Z$=on.define({map:u3t});function d3t(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 wC=Ko.define({create(){return Ar.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=h3t(t,n,i)),t=t.map(e.changes);let r=[];for(let n of e.effects)n.is(xZ)&&!Bwn(t,n.value.from,n.value.to)?r.push(n.value):n.is(Z$)&&(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(g3t),i=r.map(a=>(n?Ar.replace({widget:new Vwn(n(e.state,a))}):y3t).range(a.from,a.to));t=t.update({add:i})}return e.selection&&(t=h3t(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 wZ(t,e,r){var n;let i=null;return(n=t.field(wC,!1))===null||n===void 0||n.between(e,r,(a,o)=>{(!i||i.from>a)&&(i={from:a,to:o})}),i}function Bwn(t,e,r){let n=!1;return t.between(e,e,(i,a)=>{i==e&&a==r&&(n=!0)}),n}function f3t(t,e){return t.field(wC,!1)?e:e.concat(on.appendConfig.of(m3t()))}const $wn=t=>{for(let e of d3t(t)){let r=bZ(t.state,e.from,e.to);if(r)return t.dispatch({effects:f3t(t.state,[xZ.of(r),p3t(t,r)])}),!0}return!1},Fwn=t=>{if(!t.state.field(wC,!1))return!1;let e=[];for(let r of d3t(t)){let n=wZ(t.state,r.from,r.to);n&&e.push(Z$.of(n),p3t(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function p3t(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 zwn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:$wn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Fwn},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n{let e=t.state.field(wC,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(Z$.of({from:n,to:i}))}),t.dispatch({effects:r}),!0}}],Uwn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},g3t=vr.define({combine(t){return R0(t,Uwn)}});function m3t(t){return[wC,Hwn]}function v3t(t,e){let{state:r}=t,n=r.facet(g3t),i=o=>{let s=t.lineBlockAt(t.posAtDOM(o.target)),l=wZ(t.state,s.from,s.to);l&&t.dispatch({effects:Z$.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 y3t=Ar.replace({widget:new class extends Wu{toDOM(t){return v3t(t,null)}}});class Vwn extends Wu{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return v3t(e,this.value)}}const Gwn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class bAe extends Ap{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 Qwn(t={}){let e={...Gwn,...t},r=new bAe(e,!0),n=new bAe(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(x1)!=o.state.facet(x1)||o.startState.field(wC,!1)!=o.state.field(wC,!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=wZ(o.state,l.from,l.to)?n:bZ(o.state,l.from,l.to)?r:null;u&&s.add(l.from,l.from,u)}return s.finish()}}),{domEventHandlers:a}=e;return[i,lAe({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 bAe(e,!1)},domEventHandlers:{...a,click:(o,s,l)=>{if(a.click&&a.click(o,s,l))return!0;let u=wZ(o.state,s.from,s.to);if(u)return o.dispatch({effects:Z$.of(u)}),!0;let d=bZ(o.state,s.from,s.to);return d?(o.dispatch({effects:xZ.of(d)}),!0):!1}}}),m3t()]}const Hwn=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 J${constructor(e,r){this.specs=e;let n;function i(s){let l=p1.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 tf?s=>s.prop(Bw)==o.data:o?s=>s==o:void 0,this.style=e3t(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=n?new p1(n):null,this.themeType=r.themeType}static define(e,r){return new J$(e,r||{})}}const xAe=vr.define(),b3t=vr.define({combine(t){return t.length?[t[0]]:null}});function AZ(t){let e=t.facet(xAe);return e.length?e:t.facet(b3t)}function x3t(t,e){let r=[qwn],n;return t instanceof J$&&(t.module&&r.push(er.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(b3t.of(t)):n?r.push(xAe.computeN([er.darkTheme],i=>i.facet(er.darkTheme)==(n=="dark")?[t]:[])):r.push(xAe.of(t)),r}function Wwn(t,e,r){let n=AZ(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 Ywn{constructor(e){this.markCache=Object.create(null),this.tree=wa(e.state),this.decorations=this.buildDeco(e,AZ(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=wa(e.state),n=AZ(e.state),i=n!=AZ(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)t3t(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 qwn=Jh.high(Ro.fromClass(Ywn,{decorations:t=>t.decorations})),jwn=J$.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"}]),Xwn=er.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),w3t=1e4,A3t="()[]{}",S3t=vr.define({combine(t){return R0(t,{afterCursor:!0,brackets:A3t,maxScanDistance:w3t,renderMatch:Jwn})}}),Kwn=Ar.mark({class:"cm-matchingBracket"}),Zwn=Ar.mark({class:"cm-nonmatchingBracket"});function Jwn(t){let e=[],r=t.matched?Kwn:Zwn;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 T3t(t){let e=[],r=t.facet(S3t);for(let n of t.selection.ranges){if(!n.empty)continue;let i=$0(t,n.head,-1,r)||n.head>0&&$0(t,n.head-1,1,r)||r.afterCursor&&($0(t,n.head,1,r)||n.headt.decorations}),Xwn];function t2n(t={}){return[S3t.of(t),e2n]}const C3t=new _n;function wAe(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 AAe(t){let e=t.type.prop(C3t);return e?e(t.node):t}function $0(t,e,r,n={}){let i=n.maxScanDistance||w3t,a=n.brackets||A3t,o=wa(t),s=o.resolveInner(e,r);for(let l=s;l;l=l.parent){let u=wAe(l.type,r,a);if(u&&l.from0?e>=d.from&&ed.from&&e<=d.to))return r2n(t,e,r,l,d,u,a)}}return n2n(t,e,r,o,s.type,i,a)}function r2n(t,e,r,n,i,a,o){let s=n.parent,l={from:i.from,to:i.to},u=0,d=s==null?void 0:s.cursor();if(d&&(r<0?d.childBefore(n.from):d.childAfter(n.to)))do if(r<0?d.to<=n.from:d.from>=n.to){if(u==0&&a.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:r<0?e-1:e,to:r>0?e+1:e},d=t.doc.iterRange(e,r>0?t.doc.length:0),h=0;for(let f=0;!d.next().done&&f<=a;){let p=d.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)h++;else{if(h==1)return{start:u,end:{from:g+m,to:g+m+1},matched:y>>1==l>>1};h--}}r>0&&(f+=p.length)}return d.done?{start:u,matched:!1}:null}function k3t(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 i2n(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||a2n,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||CAe,mergeTokens:t.mergeTokens!==!1}}function a2n(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 E3t=new WeakMap;class SAe extends tf{constructor(e){let r=mZ(e.languageData),n=i2n(e),i,a=new class extends OK{createParse(o,s,l){return new s2n(i,o,s,l)}};super(r,a,[],e.name),this.topNode=u2n(r,this),i=this,this.streamParser=n,this.stateAfter=new _n({perNode:!0}),this.tokenTable=e.tokenTable?new I3t(n.tokenTable):c2n}static define(e){return new SAe(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=E3t.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&&TAe(t,a.tree,0-a.offset,r,s),u;if(l&&l.pos<=n&&(u=_3t(t,a.tree,r+a.offset,l.pos+a.offset,!1)))return{state:l.state,tree:u}}return{state:t.streamParser.startState(i?xC(i):4),tree:ci.empty}}let s2n=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=bC.get(),o=i[0].from,{state:s,tree:l}=o2n(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(xC(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=bC.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 O3t(r,e?e.state.tabSize:4,e?xC(e.state):2);if(o.eol())a.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let s=R3t(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 CAe=Object.create(null),eF=[Us.none],l2n=new GR(eF),D3t=[],L3t=Object.create(null),M3t=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"]])M3t[t]=P3t(CAe,e);class I3t{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),M3t)}resolve(e){return e?this.table[e]||(this.table[e]=P3t(this.extra,e)):0}}const c2n=new I3t(CAe);function kAe(t,e){D3t.indexOf(t)>-1||(D3t.push(t),console.warn(e))}function P3t(t,e){let r=[];for(let s of e.split(" ")){let l=[];for(let u of s.split(".")){let d=t[u]||Re[u];d?typeof d=="function"?l.length?l=l.map(d):kAe(u,`Modifier ${u} used at start of tag`):l.length?kAe(u,`Tag ${u} used as modifier`):l=Array.isArray(d)?d:[d]:kAe(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=L3t[i];if(a)return a.id;let o=L3t[i]=Us.define({id:eF.length,name:n,props:[y1({[n]:r})]});return eF.push(o),o.id}function u2n(t,e){let r=Us.define({id:eF.length,name:"Document",props:[Bw.add(()=>t),w1.add(()=>n=>e.getIndent(n))],top:!0});return eF.push(r),r}Ra.RTL,Ra.LTR;let d2n=class CIe{constructor(e,r,n,i,a,o,s,l,u,d=0,h){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=d,this.parent=h}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 CIe(e,[],r,n,n,0,[],0,i?new N3t(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=d):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 CIe(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 h2n(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 N3t{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class h2n{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 SZ{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 SZ(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 SZ(this.stack,this.pos,this.index)}}function tF(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 TZ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const B3t=new TZ;class f2n{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=B3t,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=B3t,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 l4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;$3t(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}l4.prototype.contextual=l4.prototype.fallback=l4.prototype.extend=!1;class CZ{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?tF(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,o=e.resolveOffset(1,1);if($3t(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))}}CZ.prototype.contextual=l4.prototype.fallback=l4.prototype.extend=!1;class xs{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function $3t(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||p2n(g,e.token.value,i,a))){e.acceptToken(g);break}}let d=e.next,h=0,f=t[o+2];if(e.next<0&&f>h&&t[u+f*3-3]==65535){o=t[u+f*3-1];continue e}for(;h>1,g=u+p+(p<<1),m=t[g],v=t[g+1]||65536;if(d=v)h=p+1;else{o=t[g+2],e.advance();continue e}}break}}function F3t(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function p2n(t,e,r,n){let i=F3t(r,n,e);return i<0||F3t(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 g2n=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?z3t(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?z3t(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 m2n{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new TZ)}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;uh.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=r;if(h.extended>-1&&(r=this.addActions(e,h.extended,h.end,r)),r=this.addActions(e,h.value,h.end,r),!d.extend&&(n=h,r>f))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new TZ,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 TZ,{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 g2n(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&&b2n(i);if(o)return rf&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw rf&&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 rf&&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,d=u?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?a.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!u||(h.prop(_n.contextHash)||0)==d))return e.useNode(h,f),rf&&console.log(o+this.stackID(e)+` (via reuse of ${a.getName(h.type.id)})`),!0;if(!(h instanceof ci)||h.children.length==0||h.positions[0]>0)break;let p=h.children[0];if(p instanceof ci&&h.positions[0]==0)h=p;else break}}let s=a.stateSlot(e.state,4);if(s>0)return e.reduce(s),rf&&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 U3t(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(),rf&&console.log(d+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let h=s.split(),f=d;for(let p=0;p<10&&h.forceReduce()&&(rf&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));p++)rf&&(f=this.stackID(h)+" -> ");for(let p of s.recoverByInsert(l))rf&&console.log(d+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),rf&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),U3t(s,n)):(!i||i.scoret;class kZ{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 S1 extends OK{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(d,l,s[u++]);else{let h=s[u+-d];for(let f=-d;f>0;f--)a(s[u++],l,h);u++}}}this.nodeSet=new GR(r.map((s,l)=>Us.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=p5t;let o=tF(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 l4(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 v2n(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=T1(this.data,a+2);else break;i=r(T1(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=T1(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(S1.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]=V3t(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 x2n=316,w2n=317,G3t=1,A2n=2,S2n=3,T2n=4,C2n=318,k2n=320,O2n=321,E2n=5,_2n=6,R2n=0,_Ae=[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],Q3t=125,D2n=59,RAe=47,L2n=42,M2n=43,I2n=45,P2n=60,N2n=44,B2n=63,$2n=46,F2n=91,z2n=new kZ({start:!1,shift(t,e){return e==E2n||e==_2n||e==k2n?t:e==O2n},strict:!1}),U2n=new xs((t,e)=>{let{next:r}=t;(r==Q3t||r==-1||e.context)&&t.acceptToken(C2n)},{contextual:!0,fallback:!0}),V2n=new xs((t,e)=>{let{next:r}=t,n;_Ae.indexOf(r)>-1||r==RAe&&((n=t.peek(1))==RAe||n==L2n)||r!=Q3t&&r!=D2n&&r!=-1&&!e.context&&t.acceptToken(x2n)},{contextual:!0}),G2n=new xs((t,e)=>{t.next==F2n&&!e.context&&t.acceptToken(w2n)},{contextual:!0}),Q2n=new xs((t,e)=>{let{next:r}=t;if(r==M2n||r==I2n){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(G3t);t.acceptToken(n?G3t:A2n)}}else r==B2n&&t.peek(1)==$2n&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(S2n))},{contextual:!0});function DAe(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const H2n=new xs((t,e)=>{if(t.next!=P2n||!e.dialectEnabled(R2n)||(t.advance(),t.next==RAe))return;let r=0;for(;_Ae.indexOf(t.next)>-1;)t.advance(),r++;if(DAe(t.next,!0)){for(t.advance(),r++;DAe(t.next,!1);)t.advance(),r++;for(;_Ae.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==N2n)return;for(let n=0;;n++){if(n==7){if(!DAe(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(T2n,-r)}),W2n=y1({"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)}),Y2n={__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},q2n={__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},j2n={__proto__:null,"<":193},X2n=S1.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:z2n,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:[W2n],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:[V2n,G2n,Q2n,H2n,2,3,4,5,6,7,8,9,10,11,12,13,14,U2n,new CZ("$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 CZ("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=>Y2n[t]||-1},{term:343,get:t=>q2n[t]||-1},{term:95,get:t=>j2n[t]||-1}],tokenPrec:15201});class LAe{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(q3t(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 H3t(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 K2n(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+$/]:K2n(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function W3t(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 Y3t=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function AC(t){return t.selection.main.from}function q3t(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 IAe=_0.define();function Z2n(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 j3t=new WeakMap;function J2n(t){if(!Array.isArray(t))return t;let e=j3t.get(t);return e||j3t.set(t,e=MAe(t)),e}const OZ=on.define(),rF=on.define();class eAn{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=Zwe(A))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!b||T==1&&v||w==0&&T!=0)&&(r[h]==A||n[h]==A&&(f=!0)?o[h++]=b:o.length&&(y=!1)),w=T,b+=O0(A)}return h==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]):h==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?O0(qd(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 tAn{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:rAn,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=>X3t(e(n),r(n)),optionClass:(e,r)=>n=>X3t(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function X3t(t,e){return t?e?t+" "+e:t:e}function rAn(t,e,r,n,i,a){let o=t.textDirection==Ra.RTL,s=o,l=!1,u="top",d,h,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?d=r.bottom-e.top:(u="bottom",d=e.bottom-r.top)}let v=(e.bottom-e.top)/a.offsetHeight,y=(e.right-e.left)/a.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":s?"left":"right")}}const PAe=on.define();function nAn(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,d)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(s.slice(d,h))),f.className="cm-completionMatchedText",l=h}return lr.position-n.position).map(r=>r.render)}function NAe(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 iAn{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(Gl);this.optionContent=nAn(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=NAe(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 d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(e.dispatch({effects:PAe.of(d)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Gl).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:rF.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=NAe(a.length,o,e.state.facet(Gl).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=NAe(r.options.length,r.selected,this.view.state.facet(Gl).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=>jd(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&&oAn(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 d=i.appendChild(document.createElement("li"));d.id=r+"-"+o,d.setAttribute("role","option");let h=this.optionClass(s);h&&(d.className=h);for(let f of this.optionContent){let p=f(s,this.view.state,this.view,l);p&&d.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew iAn(r,t,e)}function oAn(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 K3t(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function sAn(t,e){let r=[],n=null,i=null,a=d=>{r.push(d);let{section:h}=d.completion;if(h){n||(n=[]);let f=typeof h=="string"?h:h.name;n.some(p=>p.name==f)||n.push(typeof h=="string"?{name:f}:h)}},o=e.facet(Gl);for(let d of t)if(d.hasResult()){let h=d.result.getMatch;if(d.result.filter===!1)for(let f of d.result.options)a(new Y3t(f,d.source,h?h(f):[],1e9-r.length));else{let f=e.sliceDoc(d.from,d.to),p,g=o.filterStrict?new tAn(f):new eAn(f);for(let m of d.result.options)if(p=g.match(m.label)){let v=m.displayLabel?h?h(m,p.matched):[]:p.matched,y=p.score+(m.boost||0);if(a(new Y3t(m,d.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 d=Object.create(null),h=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-h.score||u(h.completion,f.completion))){let h=d.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?s.push(d):K3t(d.completion)>K3t(l)&&(s[s.length-1]=d),l=d.completion}return s}class c4{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 c4(this.options,Z3t(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=sAn(e,r);if(!s.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Gl).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:fAn,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new c4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new c4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class EZ{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new EZ(dAn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Gl),a=(n.override||r.languageDataAt("autocomplete",AC(r)).map(J2n)).map(l=>(this.active.find(d=>d.source==l)||new Sp(l,this.active.some(d=>d.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(BAe));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!lAn(a,this.active)||s?o=c4.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 Sp(l.source,0):l));for(let l of e.effects)l.is(PAe)&&(o=o&&o.setSelected(l.value,this.id));return a==this.active&&o==this.open?this:new EZ(a,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?cAn:uAn}}function lAn(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const dAn=[];function J3t(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(IAe);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 Sp{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=J3t(e,r),i=this;(n&8||n&16&&this.touches(e))&&(i=new Sp(i.source,0)),n&4&&i.state==0&&(i=new Sp(this.source,1)),i=i.updateFor(e,n);for(let a of e.effects)if(a.is(OZ))i=new Sp(i.source,1,a.value);else if(a.is(rF))i=new Sp(i.source,0);else if(a.is(BAe))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(AC(e.state))}}class u4 extends Sp{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=AC(e.state);if(s>o||!i||r&2&&(AC(e.startState)==this.from||sr.map(e))}}),Kd=Ko.define({create(){return EZ.start()},update(t,e){return t.update(e)},provide:t=>[aAe.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function $Ae(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field(Kd).active.find(i=>i.source==e.source);return n instanceof u4?(typeof r=="string"?t.dispatch({...Z2n(t.state,r,n.from,n.to),annotations:IAe.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const fAn=aAn(Kd,$Ae);function _Z(t,e="option"){return r=>{let n=r.state.field(Kd,!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:PAe.of(s)}),!0}}const pAn=t=>{let e=t.state.field(Kd,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Kd,!1)?(t.dispatch({effects:OZ.of(!0)}),!0):!1,gAn=t=>{let e=t.state.field(Kd,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:rF.of(null)}),!0)};class mAn{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const vAn=50,yAn=1e3,bAn=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(Kd).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Kd),r=t.state.facet(Gl);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Kd)==e)return;let n=t.transactions.some(a=>{let o=J3t(a,r);return o&8||(a.selection||a.docChanged)&&!(o&3)});for(let a=0;avAn&&Date.now()-o.time>yAn){for(let s of o.context.abortListeners)try{s()}catch(l){jd(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(OZ)))&&(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(Kd);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(Gl).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=AC(e),n=new LAe(e,r,t.explicit,this.view),i=new mAn(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:rF.of(null)}),jd(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(Gl).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Gl),n=this.view.state.field(Kd);for(let i=0;is.source==a.active.source);if(o&&o.isPending)if(a.done==null){let s=new Sp(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:BAe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Kd,!1);if(e&&e.tooltip&&this.view.state.facet(Gl).closeOnBlur){let r=e.open&&z4t(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:rF.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:OZ.of(!1)}),20),this.composing=0}}}),xAn=typeof navigator=="object"&&/Win/.test(navigator.platform),wAn=Jh.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field(Kd,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(xAn&&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&&$Ae(e,n),!1}})),eDt=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 AAn{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class zAe{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,wc.TrackDel),n=e.mapPos(this.to,1,wc.TrackDel);return r==null||n==null?null:new zAe(this.field,r,n)}}class UAe{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,d=/^\t*/.exec(l)[0].length;for(let h=0;hnew zAe(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 d=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=u&&f.field++}for(let h of i)if(h.line==n.length&&h.from>a.index){let f=a[2]?3+(a[1]||"").length:2;h.from-=f,h.to-=f}i.push(new AAn(u,n.length,a.index,a.index+d.length)),o=o.slice(0,a.index)+l+o.slice(a.index+a[0].length)}o=o.replace(/\\([{}])/g,(s,l,u)=>{for(let d of i)d.line==n.length&&d.from>u&&(d.from--,d.to--);return l}),n.push(o)}return new UAe(n,i)}}let SAn=Ar.widget({widget:new class extends Wu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),TAn=Ar.mark({class:"cm-snippetField"});class d4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?SAn:TAn).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 d4(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 nF=on.define({map(t,e){return t&&t.map(e)}}),CAn=on.define(),iF=Ko.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(nF))return r.value;if(r.is(CAn)&&t)return new d4(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 VAe(t,e){return xt.create(t.filter(r=>r.field==e).map(r=>xt.range(r.from,r.to)))}function kAn(t){let e=UAe.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:Ai.of(o)},scrollIntoView:!0,annotations:n?[IAe.of(n),Vs.userEvent.of("input.complete")]:void 0};if(s.length&&(u.selection=VAe(s,0)),s.some(d=>d.field>0)){let d=new d4(s,0),h=u.effects=[nF.of(d)];r.state.field(iF,!1)===void 0&&h.push(on.appendConfig.of([iF,EAn,_An,eDt]))}r.dispatch(r.state.update(u))}}function tDt(t){return({state:e,dispatch:r})=>{let n=e.field(iF,!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:VAe(n.ranges,i),effects:nF.of(a?null:new d4(n.ranges,i)),scrollIntoView:!0})),!0}}const OAn=[{key:"Tab",run:tDt(1),shift:tDt(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(iF,!1)?(e(t.update({effects:nF.of(null)})),!0):!1}],rDt=vr.define({combine(t){return t.length?t[0]:OAn}}),EAn=Jh.highest(t4.compute([rDt],t=>t.facet(rDt)));function Do(t,e){return{...e,apply:kAn(t)}}const _An=er.domEventHandlers({mousedown(t,e){let r=e.state.field(iF,!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:VAe(r.ranges,i.field),effects:nF.of(r.ranges.some(a=>a.field>i.field)?new d4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),aF={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},SC=on.define({map(t,e){let r=e.mapPos(t,-1,wc.TrackAfter);return r??void 0}}),GAe=new class extends Dw{};GAe.startSide=1,GAe.endSide=-1;const nDt=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(SC)&&(t=t.update({add:[GAe.range(r.value,r.value+1)]}));return t}});function RAn(){return[LAn,nDt]}const QAe="()[]{}<>«»»«[]{}";function iDt(t){for(let e=0;e{if((DAn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&O0(qd(n,0))==1||e!=i.from||r!=i.to)return!1;let a=IAn(t.state,n);return a?(t.dispatch(a),!0):!1}),MAn=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=aDt(t,t.selection.main.head).brackets||aF.brackets,i=null,a=t.changeByRange(o=>{if(o.empty){let s=PAn(t.doc,o.head);for(let l of n)if(l==s&&RZ(t.doc,o.head)==iDt(qd(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 IAn(t,e){let r=aDt(t,t.selection.main.head),n=r.brackets||aF.brackets;for(let i of n){let a=iDt(qd(i,0));if(e==i)return a==i?$An(t,i,n.indexOf(i+i+i)>-1,r):NAn(t,i,a,r.before||aF.before);if(e==a&&oDt(t,t.selection.main.from))return BAn(t,i,a)}return null}function oDt(t,e){let r=!1;return t.field(nDt).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function RZ(t,e){let r=t.sliceString(e,e+2);return r.slice(0,O0(qd(r,0)))}function PAn(t,e){let r=t.sliceString(e-2,e);return O0(qd(r,0))==r.length?r:r.slice(1)}function NAn(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:SC.of(o.to+e.length),range:xt.range(o.anchor+e.length,o.head+e.length)};let s=RZ(t.doc,o.head);return!s||/\s/.test(s)||n.indexOf(s)>-1?{changes:{insert:e+r,from:o.head},effects:SC.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 BAn(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&RZ(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 $An(t,e,r,n){let i=n.stringPrefixes||aF.stringPrefixes,a=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:SC.of(s.to+e.length),range:xt.range(s.anchor+e.length,s.head+e.length)};let l=s.head,u=RZ(t.doc,l),d;if(u==e){if(sDt(t,l))return{changes:{insert:e+e,from:l},effects:SC.of(l+e.length),range:xt.cursor(l+e.length)};if(oDt(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&&(d=lDt(t,l-2*e.length,i))>-1&&sDt(t,d))return{changes:{insert:e+e+e+e,from:l},effects:SC.of(l+e.length),range:xt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=Ao.Word&&lDt(t,l,i)>-1&&!FAn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:SC.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 sDt(t,e){let r=wa(t).resolveInner(e+1);return r.parent&&r.from==e}function FAn(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 d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>r.length+l;){if(t.sliceDoc(d.to-r.length,d.to)==r)return!1;d=d.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function lDt(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 zAn(t={}){return[wAn,Kd,Gl.of(t),bAn,UAn,eDt]}const cDt=[{key:"Ctrl-Space",run:FAe},{mac:"Alt-`",run:FAe},{mac:"Alt-i",run:FAe},{key:"Escape",run:gAn},{key:"ArrowDown",run:_Z(!0)},{key:"ArrowUp",run:_Z(!1)},{key:"PageDown",run:_Z(!0,"page")},{key:"PageUp",run:_Z(!1,"page")},{key:"Enter",run:pAn}],UAn=Jh.highest(t4.computeN([Gl],t=>t.facet(Gl).defaultKeymap?[cDt]:[])),uDt=[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 O3t(r,e?e.state.tabSize:4,e?xC(e.state):2);if(o.eol())a.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let s=R3t(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 CAe=Object.create(null),eF=[Us.none],l2n=new G5(eF),D3t=[],L3t=Object.create(null),M3t=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"]])M3t[t]=P3t(CAe,e);class I3t{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),M3t)}resolve(e){return e?this.table[e]||(this.table[e]=P3t(this.extra,e)):0}}const c2n=new I3t(CAe);function kAe(t,e){D3t.indexOf(t)>-1||(D3t.push(t),console.warn(e))}function P3t(t,e){let r=[];for(let s of e.split(" ")){let l=[];for(let u of s.split(".")){let d=t[u]||Re[u];d?typeof d=="function"?l.length?l=l.map(d):kAe(u,`Modifier ${u} used at start of tag`):l.length?kAe(u,`Tag ${u} used as modifier`):l=Array.isArray(d)?d:[d]:kAe(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=L3t[i];if(a)return a.id;let o=L3t[i]=Us.define({id:eF.length,name:n,props:[y1({[n]:r})]});return eF.push(o),o.id}function u2n(t,e){let r=Us.define({id:eF.length,name:"Document",props:[Bw.add(()=>t),w1.add(()=>n=>e.getIndent(n))],top:!0});return eF.push(r),r}Ra.RTL,Ra.LTR;let d2n=class CIe{constructor(e,r,n,i,a,o,s,l,u,d=0,h){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=d,this.parent=h}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 CIe(e,[],r,n,n,0,[],0,i?new N3t(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=d):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 CIe(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 h2n(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 N3t{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class h2n{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 SZ{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 SZ(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 SZ(this.stack,this.pos,this.index)}}function tF(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 TZ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const B3t=new TZ;class f2n{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=B3t,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=B3t,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 l4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;$3t(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}l4.prototype.contextual=l4.prototype.fallback=l4.prototype.extend=!1;class CZ{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?tF(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,o=e.resolveOffset(1,1);if($3t(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))}}CZ.prototype.contextual=l4.prototype.fallback=l4.prototype.extend=!1;class xs{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function $3t(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||p2n(g,e.token.value,i,a))){e.acceptToken(g);break}}let d=e.next,h=0,f=t[o+2];if(e.next<0&&f>h&&t[u+f*3-3]==65535){o=t[u+f*3-1];continue e}for(;h>1,g=u+p+(p<<1),m=t[g],v=t[g+1]||65536;if(d=v)h=p+1;else{o=t[g+2],e.advance();continue e}}break}}function F3t(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function p2n(t,e,r,n){let i=F3t(r,n,e);return i<0||F3t(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 g2n=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?z3t(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?z3t(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 m2n{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new TZ)}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;uh.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=r;if(h.extended>-1&&(r=this.addActions(e,h.extended,h.end,r)),r=this.addActions(e,h.value,h.end,r),!d.extend&&(n=h,r>f))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new TZ,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 TZ,{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 g2n(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&&b2n(i);if(o)return rf&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw rf&&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 rf&&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,d=u?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?a.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!u||(h.prop(_n.contextHash)||0)==d))return e.useNode(h,f),rf&&console.log(o+this.stackID(e)+` (via reuse of ${a.getName(h.type.id)})`),!0;if(!(h instanceof ci)||h.children.length==0||h.positions[0]>0)break;let p=h.children[0];if(p instanceof ci&&h.positions[0]==0)h=p;else break}}let s=a.stateSlot(e.state,4);if(s>0)return e.reduce(s),rf&&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 U3t(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(),rf&&console.log(d+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let h=s.split(),f=d;for(let p=0;p<10&&h.forceReduce()&&(rf&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));p++)rf&&(f=this.stackID(h)+" -> ");for(let p of s.recoverByInsert(l))rf&&console.log(d+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),rf&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),U3t(s,n)):(!i||i.scoret;class kZ{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 S1 extends OK{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(d,l,s[u++]);else{let h=s[u+-d];for(let f=-d;f>0;f--)a(s[u++],l,h);u++}}}this.nodeSet=new G5(r.map((s,l)=>Us.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=pRt;let o=tF(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 l4(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 v2n(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=T1(this.data,a+2);else break;i=r(T1(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=T1(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(S1.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]=V3t(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 x2n=316,w2n=317,G3t=1,A2n=2,S2n=3,T2n=4,C2n=318,k2n=320,O2n=321,E2n=5,_2n=6,R2n=0,_Ae=[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],Q3t=125,D2n=59,RAe=47,L2n=42,M2n=43,I2n=45,P2n=60,N2n=44,B2n=63,$2n=46,F2n=91,z2n=new kZ({start:!1,shift(t,e){return e==E2n||e==_2n||e==k2n?t:e==O2n},strict:!1}),U2n=new xs((t,e)=>{let{next:r}=t;(r==Q3t||r==-1||e.context)&&t.acceptToken(C2n)},{contextual:!0,fallback:!0}),V2n=new xs((t,e)=>{let{next:r}=t,n;_Ae.indexOf(r)>-1||r==RAe&&((n=t.peek(1))==RAe||n==L2n)||r!=Q3t&&r!=D2n&&r!=-1&&!e.context&&t.acceptToken(x2n)},{contextual:!0}),G2n=new xs((t,e)=>{t.next==F2n&&!e.context&&t.acceptToken(w2n)},{contextual:!0}),Q2n=new xs((t,e)=>{let{next:r}=t;if(r==M2n||r==I2n){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(G3t);t.acceptToken(n?G3t:A2n)}}else r==B2n&&t.peek(1)==$2n&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(S2n))},{contextual:!0});function DAe(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const H2n=new xs((t,e)=>{if(t.next!=P2n||!e.dialectEnabled(R2n)||(t.advance(),t.next==RAe))return;let r=0;for(;_Ae.indexOf(t.next)>-1;)t.advance(),r++;if(DAe(t.next,!0)){for(t.advance(),r++;DAe(t.next,!1);)t.advance(),r++;for(;_Ae.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==N2n)return;for(let n=0;;n++){if(n==7){if(!DAe(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(T2n,-r)}),W2n=y1({"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)}),Y2n={__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},q2n={__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},j2n={__proto__:null,"<":193},X2n=S1.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:z2n,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:[W2n],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:[V2n,G2n,Q2n,H2n,2,3,4,5,6,7,8,9,10,11,12,13,14,U2n,new CZ("$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 CZ("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=>Y2n[t]||-1},{term:343,get:t=>q2n[t]||-1},{term:95,get:t=>j2n[t]||-1}],tokenPrec:15201});class LAe{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(q3t(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 H3t(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 K2n(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+$/]:K2n(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function W3t(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 Y3t=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function AC(t){return t.selection.main.from}function q3t(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 IAe=_0.define();function Z2n(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 j3t=new WeakMap;function J2n(t){if(!Array.isArray(t))return t;let e=j3t.get(t);return e||j3t.set(t,e=MAe(t)),e}const OZ=on.define(),rF=on.define();class eAn{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=Zwe(A))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!b||T==1&&v||w==0&&T!=0)&&(r[h]==A||n[h]==A&&(f=!0)?o[h++]=b:o.length&&(y=!1)),w=T,b+=O0(A)}return h==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]):h==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?O0(qd(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 tAn{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:rAn,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=>X3t(e(n),r(n)),optionClass:(e,r)=>n=>X3t(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function X3t(t,e){return t?e?t+" "+e:t:e}function rAn(t,e,r,n,i,a){let o=t.textDirection==Ra.RTL,s=o,l=!1,u="top",d,h,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?d=r.bottom-e.top:(u="bottom",d=e.bottom-r.top)}let v=(e.bottom-e.top)/a.offsetHeight,y=(e.right-e.left)/a.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":s?"left":"right")}}const PAe=on.define();function nAn(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,d)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(s.slice(d,h))),f.className="cm-completionMatchedText",l=h}return lr.position-n.position).map(r=>r.render)}function NAe(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 iAn{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(Gl);this.optionContent=nAn(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=NAe(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 d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(e.dispatch({effects:PAe.of(d)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Gl).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:rF.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=NAe(a.length,o,e.state.facet(Gl).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=NAe(r.options.length,r.selected,this.view.state.facet(Gl).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=>jd(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&&oAn(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 d=i.appendChild(document.createElement("li"));d.id=r+"-"+o,d.setAttribute("role","option");let h=this.optionClass(s);h&&(d.className=h);for(let f of this.optionContent){let p=f(s,this.view.state,this.view,l);p&&d.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew iAn(r,t,e)}function oAn(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 K3t(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function sAn(t,e){let r=[],n=null,i=null,a=d=>{r.push(d);let{section:h}=d.completion;if(h){n||(n=[]);let f=typeof h=="string"?h:h.name;n.some(p=>p.name==f)||n.push(typeof h=="string"?{name:f}:h)}},o=e.facet(Gl);for(let d of t)if(d.hasResult()){let h=d.result.getMatch;if(d.result.filter===!1)for(let f of d.result.options)a(new Y3t(f,d.source,h?h(f):[],1e9-r.length));else{let f=e.sliceDoc(d.from,d.to),p,g=o.filterStrict?new tAn(f):new eAn(f);for(let m of d.result.options)if(p=g.match(m.label)){let v=m.displayLabel?h?h(m,p.matched):[]:p.matched,y=p.score+(m.boost||0);if(a(new Y3t(m,d.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 d=Object.create(null),h=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-h.score||u(h.completion,f.completion))){let h=d.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?s.push(d):K3t(d.completion)>K3t(l)&&(s[s.length-1]=d),l=d.completion}return s}class c4{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 c4(this.options,Z3t(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=sAn(e,r);if(!s.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Gl).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:fAn,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new c4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new c4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class EZ{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new EZ(dAn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Gl),a=(n.override||r.languageDataAt("autocomplete",AC(r)).map(J2n)).map(l=>(this.active.find(d=>d.source==l)||new Sp(l,this.active.some(d=>d.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(BAe));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!lAn(a,this.active)||s?o=c4.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 Sp(l.source,0):l));for(let l of e.effects)l.is(PAe)&&(o=o&&o.setSelected(l.value,this.id));return a==this.active&&o==this.open?this:new EZ(a,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?cAn:uAn}}function lAn(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const dAn=[];function J3t(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(IAe);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 Sp{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=J3t(e,r),i=this;(n&8||n&16&&this.touches(e))&&(i=new Sp(i.source,0)),n&4&&i.state==0&&(i=new Sp(this.source,1)),i=i.updateFor(e,n);for(let a of e.effects)if(a.is(OZ))i=new Sp(i.source,1,a.value);else if(a.is(rF))i=new Sp(i.source,0);else if(a.is(BAe))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(AC(e.state))}}class u4 extends Sp{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=AC(e.state);if(s>o||!i||r&2&&(AC(e.startState)==this.from||sr.map(e))}}),Kd=Ko.define({create(){return EZ.start()},update(t,e){return t.update(e)},provide:t=>[aAe.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function $Ae(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field(Kd).active.find(i=>i.source==e.source);return n instanceof u4?(typeof r=="string"?t.dispatch({...Z2n(t.state,r,n.from,n.to),annotations:IAe.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const fAn=aAn(Kd,$Ae);function _Z(t,e="option"){return r=>{let n=r.state.field(Kd,!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:PAe.of(s)}),!0}}const pAn=t=>{let e=t.state.field(Kd,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Kd,!1)?(t.dispatch({effects:OZ.of(!0)}),!0):!1,gAn=t=>{let e=t.state.field(Kd,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:rF.of(null)}),!0)};class mAn{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const vAn=50,yAn=1e3,bAn=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(Kd).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Kd),r=t.state.facet(Gl);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Kd)==e)return;let n=t.transactions.some(a=>{let o=J3t(a,r);return o&8||(a.selection||a.docChanged)&&!(o&3)});for(let a=0;avAn&&Date.now()-o.time>yAn){for(let s of o.context.abortListeners)try{s()}catch(l){jd(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(OZ)))&&(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(Kd);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(Gl).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=AC(e),n=new LAe(e,r,t.explicit,this.view),i=new mAn(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:rF.of(null)}),jd(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(Gl).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Gl),n=this.view.state.field(Kd);for(let i=0;is.source==a.active.source);if(o&&o.isPending)if(a.done==null){let s=new Sp(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:BAe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Kd,!1);if(e&&e.tooltip&&this.view.state.facet(Gl).closeOnBlur){let r=e.open&&z4t(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:rF.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:OZ.of(!1)}),20),this.composing=0}}}),xAn=typeof navigator=="object"&&/Win/.test(navigator.platform),wAn=Jh.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field(Kd,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(xAn&&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&&$Ae(e,n),!1}})),eDt=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 AAn{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class zAe{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,wc.TrackDel),n=e.mapPos(this.to,1,wc.TrackDel);return r==null||n==null?null:new zAe(this.field,r,n)}}class UAe{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,d=/^\t*/.exec(l)[0].length;for(let h=0;hnew zAe(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 d=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=u&&f.field++}for(let h of i)if(h.line==n.length&&h.from>a.index){let f=a[2]?3+(a[1]||"").length:2;h.from-=f,h.to-=f}i.push(new AAn(u,n.length,a.index,a.index+d.length)),o=o.slice(0,a.index)+l+o.slice(a.index+a[0].length)}o=o.replace(/\\([{}])/g,(s,l,u)=>{for(let d of i)d.line==n.length&&d.from>u&&(d.from--,d.to--);return l}),n.push(o)}return new UAe(n,i)}}let SAn=Ar.widget({widget:new class extends Wu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),TAn=Ar.mark({class:"cm-snippetField"});class d4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?SAn:TAn).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 d4(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 nF=on.define({map(t,e){return t&&t.map(e)}}),CAn=on.define(),iF=Ko.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(nF))return r.value;if(r.is(CAn)&&t)return new d4(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 VAe(t,e){return xt.create(t.filter(r=>r.field==e).map(r=>xt.range(r.from,r.to)))}function kAn(t){let e=UAe.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:Ai.of(o)},scrollIntoView:!0,annotations:n?[IAe.of(n),Vs.userEvent.of("input.complete")]:void 0};if(s.length&&(u.selection=VAe(s,0)),s.some(d=>d.field>0)){let d=new d4(s,0),h=u.effects=[nF.of(d)];r.state.field(iF,!1)===void 0&&h.push(on.appendConfig.of([iF,EAn,_An,eDt]))}r.dispatch(r.state.update(u))}}function tDt(t){return({state:e,dispatch:r})=>{let n=e.field(iF,!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:VAe(n.ranges,i),effects:nF.of(a?null:new d4(n.ranges,i)),scrollIntoView:!0})),!0}}const OAn=[{key:"Tab",run:tDt(1),shift:tDt(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(iF,!1)?(e(t.update({effects:nF.of(null)})),!0):!1}],rDt=vr.define({combine(t){return t.length?t[0]:OAn}}),EAn=Jh.highest(t4.compute([rDt],t=>t.facet(rDt)));function Do(t,e){return{...e,apply:kAn(t)}}const _An=er.domEventHandlers({mousedown(t,e){let r=e.state.field(iF,!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:VAe(r.ranges,i.field),effects:nF.of(r.ranges.some(a=>a.field>i.field)?new d4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),aF={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},SC=on.define({map(t,e){let r=e.mapPos(t,-1,wc.TrackAfter);return r??void 0}}),GAe=new class extends Dw{};GAe.startSide=1,GAe.endSide=-1;const nDt=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(SC)&&(t=t.update({add:[GAe.range(r.value,r.value+1)]}));return t}});function RAn(){return[LAn,nDt]}const QAe="()[]{}<>«»»«[]{}";function iDt(t){for(let e=0;e{if((DAn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&O0(qd(n,0))==1||e!=i.from||r!=i.to)return!1;let a=IAn(t.state,n);return a?(t.dispatch(a),!0):!1}),MAn=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=aDt(t,t.selection.main.head).brackets||aF.brackets,i=null,a=t.changeByRange(o=>{if(o.empty){let s=PAn(t.doc,o.head);for(let l of n)if(l==s&&RZ(t.doc,o.head)==iDt(qd(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 IAn(t,e){let r=aDt(t,t.selection.main.head),n=r.brackets||aF.brackets;for(let i of n){let a=iDt(qd(i,0));if(e==i)return a==i?$An(t,i,n.indexOf(i+i+i)>-1,r):NAn(t,i,a,r.before||aF.before);if(e==a&&oDt(t,t.selection.main.from))return BAn(t,i,a)}return null}function oDt(t,e){let r=!1;return t.field(nDt).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function RZ(t,e){let r=t.sliceString(e,e+2);return r.slice(0,O0(qd(r,0)))}function PAn(t,e){let r=t.sliceString(e-2,e);return O0(qd(r,0))==r.length?r:r.slice(1)}function NAn(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:SC.of(o.to+e.length),range:xt.range(o.anchor+e.length,o.head+e.length)};let s=RZ(t.doc,o.head);return!s||/\s/.test(s)||n.indexOf(s)>-1?{changes:{insert:e+r,from:o.head},effects:SC.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 BAn(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&RZ(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 $An(t,e,r,n){let i=n.stringPrefixes||aF.stringPrefixes,a=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:SC.of(s.to+e.length),range:xt.range(s.anchor+e.length,s.head+e.length)};let l=s.head,u=RZ(t.doc,l),d;if(u==e){if(sDt(t,l))return{changes:{insert:e+e,from:l},effects:SC.of(l+e.length),range:xt.cursor(l+e.length)};if(oDt(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&&(d=lDt(t,l-2*e.length,i))>-1&&sDt(t,d))return{changes:{insert:e+e+e+e,from:l},effects:SC.of(l+e.length),range:xt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=Ao.Word&&lDt(t,l,i)>-1&&!FAn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:SC.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 sDt(t,e){let r=wa(t).resolveInner(e+1);return r.parent&&r.from==e}function FAn(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 d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>r.length+l;){if(t.sliceDoc(d.to-r.length,d.to)==r)return!1;d=d.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function lDt(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 zAn(t={}){return[wAn,Kd,Gl.of(t),bAn,UAn,eDt]}const cDt=[{key:"Ctrl-Space",run:FAe},{mac:"Alt-`",run:FAe},{mac:"Alt-i",run:FAe},{key:"Escape",run:gAn},{key:"ArrowDown",run:_Z(!0)},{key:"ArrowUp",run:_Z(!1)},{key:"PageDown",run:_Z(!0,"page")},{key:"PageUp",run:_Z(!1,"page")},{key:"Enter",run:pAn}],UAn=Jh.highest(t4.computeN([Gl],t=>t.facet(Gl).defaultKeymap?[cDt]:[])),uDt=[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}) { \${} @@ -739,13 +739,13 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error `+r.scrub(),a=this.advance(i);return a>-1&&athis.pos){let i=QDt(e,r,this.start);if(i){let a=KAe(e,i.to-this.start);a>0&&(this.nextStage(i),n=a)}}return n||(n=KAe(e,this.pos)),n>0&&n_Dt(e)>=0,(t,e)=>kDt(e)>=0,(t,e)=>ODt(e)>=0,(t,e)=>YAe(e,t,!0)>=0,(t,e)=>qAe(e,t,!0)>=0,(t,e)=>WAe(e,t,!0)>=0,(t,e)=>MDt(e,t,!0)>=0],aSn={text:"",end:0};class oSn{constructor(e,r,n,i){this.parser=e,this.input=r,this.ranges=i,this.line=new tSn,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=DZ.create(nr.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new cSn(n,r):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let i=e.depth=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let r=aSn;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].too&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==` `?"":r;else{let i=r.indexOf(` -`);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=DZ.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],h4,h4,(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(tSe(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?NDt(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=tSe(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"?Mi(this.parser.getNodeType(e),r,n,i):new FDt(e,r)}get buffer(){return new $Dt(this.parser.nodeSet)}}function NDt(t,e,r,n,i){let a=t[e].to,o=[],s=[],l=r.from+n;function u(d,h){for(;h?d>=a:d>a;){let f=t[e+1].from-a;n+=f,d+=f,e++,a=t[e].to}}for(let d=r.firstChild;d;d=d.nextSibling){u(d.from+n,!0);let h=d.from+n,f,p=i.get(d.tree);p?f=p:d.to+n>a?(f=NDt(t,e,d,n,i),u(d.to+n,!1)):f=d.toTree(),o.push(f),s.push(h-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 MZ extends OK{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 d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,r,n){let i=new oSn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}configure(e){let r=ZAe(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(),d=this.endLeafBlock.slice(),h=this.wrappers;if(lF(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(Us.define({id:x,name:m,props:w&&[[_n.group,w]]})),b&&(p||(p={}),Array.isArray(b)||b instanceof I0?p[m]=b:Object.assign(p,b))}n=new GR(f),p&&(n=n.extend(y1(p)))}if(lF(r.props)&&(n=n.extend(...r.props)),lF(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(lF(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?IZ(s,f.before):f.after?IZ(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&&d.push(f.endLeaf)}if(lF(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?IZ(u,f.before):f.after?IZ(u,f.after)+1:u.length-1;l.splice(g,0,f.parse),u.splice(g,0,f.name)}}return r.wrap&&(h=h.concat(r.wrap)),new MZ(n,a,o,s,d,i,l,u,h)}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 eSe(this,e,r);e:for(let i=r;i=0){i=s;continue e}}i++}return n.resolveMarkers(0)}}function lF(t){return t!=null&&t.length>0}function ZAe(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=ZAe(t[0]);if(t.length==1)return e;let r=ZAe(t.slice(1));if(!r||!e)return e||r;let n=(o,s)=>(o||h4).concat(s||h4),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 IZ(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let BDt=[Us.none];for(let t=1,e;e=nr[t];t++)BDt[t]=Us.define({id:t,name:e,props:t>=nr.Escape?[]:[[_n.group,t in TDt?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const h4=[];let $Dt=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})}},cF=class{constructor(e,r,n,i=h4){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 $Dt(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class FDt{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 h4}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 Mi(t,e,r,n){return new cF(t,e,r,n)}const zDt={resolve:"Emphasis",mark:"EmphasisMark"},UDt={resolve:"Emphasis",mark:"EmphasisMark"},TC={},PZ={};class nf{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const VDt="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let uF=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{uF=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const JAe={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(Mi(nr.Autolink,r,r+1+i[0].length,[Mi(nr.LinkMark,r,r+1),Mi(nr.URL,r+1,r+i[0].length),Mi(nr.LinkMark,r+i[0].length,r+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(a)return t.append(Mi(nr.Comment,r,r+1+a[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(Mi(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(Mi(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=uF.test(i),s=uF.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),d=!u&&(!s||l||o),h=!l&&(!o||u||s),f=d&&(e==42||!h||o),p=h&&(e==42||!d||s);return t.append(new nf(e==95?zDt:UDt,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Mi(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(Mi(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new nf(TC,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new nf(PZ,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 nf&&(i.type==TC||i.type==PZ)){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]=sSn(t,a,i.type==TC?nr.Link:nr.Image,i.from,r+1);if(i.type==TC)for(let s=0;se?Mi(nr.URL,e+r,a+r):a==t.length?null:!1}}function QDt(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 nf(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 nf&&(r.type==TC||r.type==PZ))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 nf&&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,d=[],h=s.from,f=i.to;if(a){let m=Math.min(2,s.to-s.from,o);h=s.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}s.type.mark&&d.push(this.elt(s.type.mark,h,s.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof nf&&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 nf?r:null}skipSpace(e){return sF(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Mi(this.parser.getNodeType(e),r,n,i):new FDt(e,r)}}eSe.linkStart=TC,eSe.imageStart=PZ;function tSe(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 d=WDt(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,d);else{let h=new ci(e.parser.nodeSet.types[nr.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,r.tree),e.addNode(h,d)}if(r.type.is("Block")&&(lSn.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 WDt(t,e){let r=t;for(let n=1;nLZ[t]),Object.keys(LZ).map(t=>PDt[t]),Object.keys(LZ),iSn,TDt,Object.keys(JAe).map(t=>JAe[t]),Object.keys(JAe),[]);function hSn(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 fSn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:w5t((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:hSn(i.node,i.from,i.to)};return null})}}const pSn={resolve:"Strikethrough",mark:"StrikethroughMark"},gSn={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=uF.test(n),l=uF.test(i);return t.addDelimiter(pSn,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function dF(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,u=!1,d=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let h=r;h-1)&&a++,o=!1,n&&(s>-1&&d(),n.push(t.elt("TableDelimiter",h+i,h+i+1))),s=l=-1):(u||f!=32&&f!=9)&&(s<0&&(s=h),l=h+1),u=!u&&f==92}return s>-1&&(a++,n&&d()),a}function YDt(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class jDt{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)&&qDt.test(i=r.text.slice(r.pos))){let a=[];dF(e,n.content,0,a,n.start)==dF(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=[];dF(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 mSn={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 YDt(e.content,0)?new jDt:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof jDt)||!YDt(e.text,e.basePos))return!1;let n=t.peekLine();return qDt.test(n)&&dF(t,e.text,e.basePos)==dF(t,n,e.basePos)},before:"SetextHeading"}]};class vSn{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 ySn={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 vSn:null},after:"SetextHeading"}]},XDt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,KDt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,bSn=/[\w-]+\.[\w-]+($|[/:])/,ZDt=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,JDt=/\/[a-zA-Z\d@.]+/gy;function eLt(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==")"&&eLt(t,e,n,")")>eLt(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 tLt(t,e){ZDt.lastIndex=e;let r=ZDt.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 wSn=[mSn,ySn,gSn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;XDt.lastIndex=n;let i=XDt.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=xSn(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=tLt(t.text,n):(a=tLt(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(JDt.lastIndex=a,i=JDt.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 rLt(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 fLt=null,pLt=null,gLt=0;function aSe(t,e){let r=t.pos+e;if(gLt==r&&pLt==t)return fLt;let n=t.peek(e),i="";for(;qSn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return pLt=t,gLt=r,fLt=i?i.toLowerCase():n==jSn||n==XSn?void 0:null}const mLt=60,NZ=62,oSe=47,jSn=63,XSn=33,KSn=45;function vLt(t,e){this.name=t,this.parent=e}const ZSn=[rSe,sLt,iLt,aLt,oLt],JSn=new kZ({start:null,shift(t,e,r,n){return ZSn.indexOf(e)>-1?new vLt(aSe(n,1)||"",t):t},reduce(t,e){return e==cLt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==rSe||i==VSn?new vLt(aSe(n,1)||"",t):t},strict:!1}),eTn=new xs((t,e)=>{if(t.next!=mLt){t.next<0&&e.context&&t.acceptToken(nSe);return}t.advance();let r=t.next==oSe;r&&t.advance();let n=aSe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?NSn:PSn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken(LSn);if(i&&YSn[i])return t.acceptToken(nSe,-2);if(e.dialectEnabled(QSn))return t.acceptToken(MSn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(ISn)}else{if(n=="script")return t.acceptToken(iLt);if(n=="style")return t.acceptToken(aLt);if(n=="textarea")return t.acceptToken(oLt);if(WSn.hasOwnProperty(n))return t.acceptToken(sLt);i&&hLt[i]&&hLt[i][n]?t.acceptToken(nSe,-1):t.acceptToken(rSe)}},{contextual:!0}),tTn=new xs(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(lLt);break}if(t.next==KSn)e++;else if(t.next==NZ&&e>=2){r>=3&&t.acceptToken(lLt,-2);break}else e=0;t.advance()}});function rTn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const nTn=new xs((t,e)=>{if(t.next==oSe&&t.peek(1)==NZ){let r=e.dialectEnabled(HSn)||rTn(e.context);t.acceptToken(r?DSn:nLt,2)}else t.next==NZ&&t.acceptToken(nLt,1)});function sSe(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==mLt||a==1&&i.next==oSe||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 iTn=sSe("script",CSn,kSn),aTn=sSe("style",OSn,ESn),oTn=sSe("textarea",_Sn,RSn),sTn=y1({"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}),lTn=S1.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:JSn,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:[sTn],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==FSn)return lSe(s,l,r);if(u==zSn)return lSe(s,l,n);if(u==USn)return lSe(s,l,i);if(u==cLt&&a.length){let d=s.node,h=d.firstChild,f=h&&bLt(h,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=yLt(h,l))))){let m=d.lastChild,v=m.type.id==GSn?m.from:d.to;if(v>h.to)return{parser:g.parser,overlay:[{from:h.to,to:v}]}}}}if(o&&u==uLt){let d=s.node,h;if(h=d.firstChild){let f=o[l.read(h.from,h.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=bLt(d.parent,l))continue;let g=d.lastChild;if(g.type.id==iSe){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==dLt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const cTn=145,wLt=1,uTn=146,dTn=147,ALt=2,hTn=148,fTn=3,pTn=4,SLt=[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],gTn=58,mTn=40,TLt=95,vTn=91,BZ=45,yTn=46,bTn=35,xTn=37,wTn=38,ATn=92,STn=10,TTn=42;function hF(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function cSe(t){return t>=48&&t<=57}function CLt(t){return cSe(t)||t>=97&&t<=102||t>=65&&t<=70}const kLt=(t,e,r)=>(n,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:l}=n;if(hF(l)||l==BZ||l==TLt||a&&cSe(l))!a&&(l!=BZ||s>0)&&(a=!0),o===s&&l==BZ&&o++,n.advance();else if(l==ATn&&n.peek(1)!=STn){if(n.advance(),CLt(n.next)){do n.advance();while(CLt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(o==2&&i.canShift(ALt)?e:l==mTn?r:t);break}}},CTn=new xs(kLt(uTn,ALt,dTn),{contextual:!0}),kTn=new xs(kLt(hTn,fTn,pTn),{contextual:!0}),OTn=new xs(t=>{if(SLt.includes(t.peek(-1))){let{next:e}=t;(hF(e)||e==TLt||e==bTn||e==yTn||e==TTn||e==vTn||e==gTn&&hF(t.peek(1))||e==BZ||e==wTn)&&t.acceptToken(cTn)}}),ETn=new xs(t=>{if(!SLt.includes(t.peek(-1))){let{next:e}=t;if(e==xTn&&(t.advance(),t.acceptToken(wLt)),hF(e)){do t.advance();while(hF(t.next)||cSe(t.next));t.acceptToken(wLt)}}}),_Tn=y1({"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}),RTn={__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},DTn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},LTn={__proto__:null,selector:118,style:124,layer:202},MTn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},ITn={__proto__:null,to:243},PTn=S1.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:[OTn,ETn,CTn,kTn,1,2,3,4,new CZ("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=>RTn[t]||-1},{term:148,get:t=>DTn[t]||-1},{term:4,get:t=>LTn[t]||-1},{term:28,get:t=>MTn[t]||-1},{term:146,get:t=>ITn[t]||-1}],tokenPrec:2405});let uSe=null;function dSe(){if(!uSe&&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)));uSe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return uSe||[]}const OLt=["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})),ELt=["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}))),NTn=["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})),BTn=["@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})),C1=/^(\w[\w-]*|-\w[\w-]*|)$/,$Tn=/^-(-[\w-]*)?$/;function FTn(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 _Lt=new qwe,zTn=["Declaration"];function UTn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function RLt(t,e,r){if(e.to-e.from>4096){let n=_Lt.get(e);if(n)return n;let i=[],a=new Set,o=e.cursor(Zi.IncludeAnonymous);if(o.firstChild())do for(let s of RLt(t,o.node,r))a.has(s.label)||(a.add(s.label),i.push(s));while(o.nextSibling());return _Lt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var o;if(r(a)&&a.matchContext(zTn)&&((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 VTn=(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:dSe(),validFor:C1};if(i.name=="ValueName")return{from:i.from,options:ELt,validFor:C1};if(i.name=="PseudoClassName")return{from:i.from,options:OLt,validFor:C1};if(t(i)||(e.explicit||a)&&FTn(i,r.doc))return{from:t(i)||a?i.from:n,options:RLt(r.doc,UTn(i),t),validFor:$Tn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:dSe(),validFor:C1};return{from:i.from,options:NTn,validFor:C1}}if(i.name=="AtKeyword")return{from:i.from,options:BTn,validFor:C1};if(!e.explicit)return null;let o=i.resolve(n),s=o.childBefore(n);return s&&s.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:OLt,validFor:C1}:s&&s.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:ELt,validFor:C1}:o.name=="Block"||o.name=="Styles"?{from:n,options:dSe(),validFor:C1}:null})(t=>t.name=="VariableName"),$Z=b1.define({name:"css",parser:PTn.configure({props:[w1.add({Declaration:s4()}),A1.add({"Block KeyframeList":K$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function GTn(){return new $w($Z,$Z.data.of({autocomplete:VTn}))}const fF=["_blank","_self","_top","_parent"],hSe=["ascii","utf-8","utf-16","latin1","latin1"],fSe=["get","post","put","delete"],pSe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],af=["true","false"],zr={},QTn={a:{attrs:{href:null,ping:null,type:null,media:null,target:fF,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:fF}},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:pSe,formmethod:fSe,formnovalidate:["novalidate"],formtarget:fF,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":hSe,autocomplete:["on","off"],enctype:pSe,method:fSe,novalidate:["novalidate"],target:fF}},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:pSe,formmethod:fSe,formnovalidate:["novalidate"],formtarget:fF,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:hSe,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:hSe}},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},DLt={accesskey:null,class:null,contenteditable:af,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:af,autocorrect:af,autocapitalize:af,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":af,"aria-autocomplete":["inline","list","both","none"],"aria-busy":af,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":af,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":af,"aria-hidden":af,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":af,"aria-multiselectable":af,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":af,"aria-relevant":null,"aria-required":af,"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},LLt="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 LLt)DLt[t]=null;class pF{constructor(e,r){this.tags={...QTn,...e},this.globalAttrs={...DLt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}pF.default=new pF;function f4(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 p4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function MLt(t,e,r){let n=r.tags[f4(t,p4(e))];return(n==null?void 0:n.children)||r.allTags}function gSe(t,e){let r=[];for(let n=p4(e);n&&!n.type.isTop;n=p4(n.parent)){let i=f4(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 ILt=/^[:\-\.\w\u00b7-\uffff]*$/;function PLt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=p4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:MLt(t.doc,o,e).map(s=>({label:s,type:"type"})).concat(gSe(t.doc,r).map((s,l)=>({label:"/"+s,apply:"/"+s+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function NLt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:gSe(t.doc,e).map((a,o)=>({label:a,apply:a+i,type:"type",boost:99-o})),validFor:ILt}}function HTn(t,e,r,n){let i=[],a=0;for(let o of MLt(t.doc,r,e))i.push({label:"<"+o,type:"type"});for(let o of gSe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function WTn(t,e,r,n,i){let a=p4(r),o=a?e.tags[f4(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:ILt}}function YTn(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),d=e.globalAttrs[u];if(!d){let h=p4(r),f=h?e.tags[f4(t.doc,h)]:null;d=(f==null?void 0:f.attrs)&&f.attrs[u]}if(d){let h=t.sliceDoc(n,i).toLowerCase(),f='"',p='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of d)s.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:s,validFor:l}}function BLt(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.fromBLt(n,i)}const XTn=F0.parser.configure({top:"SingleExpression"}),$Lt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:vDt.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:yDt.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:bDt.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:XTn},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:F0.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:$Z.parser}],FLt=[{name:"style",parser:$Z.parser.configure({top:"Styles"})}].concat(LLt.map(t=>({name:t,parser:F0.parser}))),zLt=b1.define({name:"html",parser:lTn.configure({props:[w1.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:"-_"}}),FZ=zLt.configure({wrap:xLt($Lt,FLt)});function KTn(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=xLt((t.nestedLanguages||[]).concat($Lt),(t.nestedAttributes||[]).concat(FLt)));let n=r?zLt.configure({wrap:r,dialect:e}):e?FZ.configure({dialect:e}):FZ;return new $w(n,[FZ.data.of({autocomplete:jTn(t)}),t.autoCloseTags!==!1?ZTn:[],HAe().support,GTn().support])}const ULt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ZTn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!FZ.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var u,d,h;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(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=f4(o.doc,v.parent,p))&&!ULt.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&&((h=v.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=f4(o.doc,v,p))&&!ULt.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)}),VLt=mZ({commentTokens:{block:{open:""}}}),GLt=new _n,QLt=dSn.configure({props:[A1.add(t=>!t.is("Block")||t.is("Document")||mSe(t)!=null||JTn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),GLt.add(mSe),w1.add({Document:()=>null}),Bw.add({Document:VLt})]});function mSe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function JTn(t){return t.name=="OrderedList"||t.name=="BulletList"}function eCn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=mSe(n.type))!=null&&i<=e)break;r=n}return r.to}const tCn=c3t.of((t,e,r)=>{for(let n=wa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function vSe(t){return new tf(VLt,t,[],"markdown")}const rCn=vSe(QLt),zZ=vSe(QLt.configure([wSn,SSn,ASn,TSn,{props:[A1.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function nCn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=vZ.matchLanguageName(t,r,!0),n instanceof vZ)return n.support?n.support.language.parser:bC.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let ySe=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(+WLt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function HLt(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 ySe(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],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new ySe(a.parent,l,l+d,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],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new ySe(a.parent,l,l+d,o[1],u,h,a))}}return n}function WLt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function bSe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=WLt(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 xSe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(a4)!=" ")return t;let n=Ig(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const iCn=((t={})=>({state:e,dispatch:r})=>{let n=wa(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!zZ.isActiveAt(e,s.from,-1)&&!zZ.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,u=i.lineAt(l),d=HLt(n.resolveInner(l,-1),i);for(;d.length&&d[d.length-1].from>l-u.from;)d.pop();if(!d.length)return a={range:s};let h=d[d.length-1];if(h.to-h.spaceAfter.length>l-u.from)return a={range:s};let f=l>=h.to-h.spaceAfter.length&&!/\S/.test(u.text.slice(h.to));if(h.item&&f){let y=h.node.firstChild,b=h.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to0&&!/[^\s>]/.test(i.lineAt(u.from-1).text)||t.nonTightLists===!1){let x=d.length>1?d[d.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 h.node.name=="OrderedList"&&bSe(h.item,i,S,-2),x&&x.node.name=="OrderedList"&&bSe(x.item,i,S),{range:xt.cursor(w+A.length),changes:S}}else{let x=qLt(d,e,u);return{range:xt.cursor(l+x.length+1),changes:{from:u.from,insert:x+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&u.from){let y=i.lineAt(u.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==h.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:u.from+h.from,to:u.to}]);return{range:s.map(x),changes:x}}}let p=[];h.node.name=="OrderedList"&&bSe(h.item,i,p);let g=h.item&&h.item.from]*/.exec(u.text)[0].length>=h.to)for(let y=0,b=d.length-1;y<=b;y++)m+=y==b&&!g?d[y].marker(i,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return m=xSe(m,e),aCn(h.node,e.doc)&&(m=qLt(d,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 YLt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function aCn(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&&zZ.isActiveAt(t,a.from)){let l=s.lineAt(o),u=HLt(oCn(r,o),s);if(u.length){let d=u[u.length-1],h=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:xt.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(d.item&&l.from<=d.item.from||/^[\s>]*$/.test(l.text.slice(0,d.to)))){let f=l.from+d.from;if(d.item&&d.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),!zZ.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||dCn.test(s.name))&&(o=!0)},leave:s=>{s.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const hkn=new xs((t,e)=>{let r;if(t.next<0)t.acceptToken(mCn);else if(e.context.flags&VZ)CSe(t.next)&&t.acceptToken(gCn,1);else if(((r=t.peek(-1))<0||CSe(r))&&e.canShift(ZLt)){let n=0;for(;t.next==ASe||t.next==UZ;)t.advance(),n++;(t.next==CC||t.next==gF||t.next==SSe)&&t.acceptToken(ZLt,-n)}else CSe(t.next)&&t.acceptToken(pCn,1)},{contextual:!0}),fkn=new xs((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==CC||n==gF){let i=0,a=0;for(;;){if(t.next==ASe)i++;else if(t.next==UZ)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=CC&&t.next!=gF&&t.next!=SSe&&(i[t,e|oMt])),mkn=new kZ({start:pkn,reduce(t,e,r,n){return t.flags&VZ&&dkn.has(e)||(e==MCn||e==tMt)&&t.flags&oMt?t.parent:t},shift(t,e,r,n){return e==XLt?new GZ(t,gkn(n.read(n.pos,r.pos)),0):e==KLt?t.parent:e==bCn||e==SCn||e==kCn||e==JLt?new GZ(t,0,VZ):sMt.has(e)?new GZ(t,0,sMt.get(e)|t.flags&VZ):t},hash(t){return t.hash}}),vkn=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==ASe||r==UZ)){r!=ikn&&r!=akn&&r!=CC&&r!=gF&&r!=SSe&&t.acceptToken(fCn);return}}}),ykn=new xs((t,e)=>{let{flags:r}=e.context,n=r&k1?iMt:nMt,i=(r&O1)>0,a=!(r&E1),o=(r&_1)>0,s=t.pos;for(;!(t.next<0);)if(o&&t.next==TSe)if(t.peek(1)==TSe)t.advance(2);else{if(t.pos==s){t.acceptToken(JLt,1);return}break}else if(a&&t.next==aMt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),bkn(t,l)),t.acceptToken(yCn);return}break}else if(t.next==aMt&&!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(eMt,i?3:1);return}break}else if(t.next==CC){if(i)t.advance();else if(t.pos==s){t.acceptToken(eMt);return}break}else t.advance();t.pos>s&&t.acceptToken(vCn)});function bkn(t,e){if(e==okn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==skn)for(let r=0;r<2&&kSe(t.next);r++)t.advance();else if(e==ckn)for(let r=0;r<4&&kSe(t.next);r++)t.advance();else if(e==ukn)for(let r=0;r<8&&kSe(t.next);r++)t.advance();else if(e==lkn&&t.next==TSe){for(t.advance();t.next>=0&&t.next!=rMt&&t.next!=nMt&&t.next!=iMt&&t.next!=CC;)t.advance();t.next==rMt&&t.advance()}}const xkn=y1({'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}),wkn={__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},Akn=S1.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:[vkn,fkn,hkn,ykn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>wkn[t]||-1}],tokenPrec:7668}),lMt=new qwe,cMt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function QZ(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const Skn={FunctionDefinition:QZ("function"),ClassDefinition:QZ("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:QZ("variable"),AsPattern:QZ("variable"),__proto__:null};function uMt(t,e){let r=lMt.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(Zi.IncludeAnonymous).iterate(o=>{if(o.name){let s=Skn[o.name];if(s&&s(o,a,i)||!i&&cMt.has(o.name))return!1;i=!1}else if(o.to-o.from>8192){for(let s of uMt(t,o.node))n.push(s);return!1}}),lMt.set(e,n),n}const dMt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,hMt=["String","FormatString","Comment","PropertyName"];function Tkn(t){let e=wa(t.state).resolveInner(t.pos,-1);if(hMt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&dMt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)cMt.has(i.name)&&(n=n.concat(uMt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:dMt}}const Ckn=["__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"}))),kkn=[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=DZ.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],h4,h4,(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(tSe(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?NDt(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=tSe(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"?Mi(this.parser.getNodeType(e),r,n,i):new FDt(e,r)}get buffer(){return new $Dt(this.parser.nodeSet)}}function NDt(t,e,r,n,i){let a=t[e].to,o=[],s=[],l=r.from+n;function u(d,h){for(;h?d>=a:d>a;){let f=t[e+1].from-a;n+=f,d+=f,e++,a=t[e].to}}for(let d=r.firstChild;d;d=d.nextSibling){u(d.from+n,!0);let h=d.from+n,f,p=i.get(d.tree);p?f=p:d.to+n>a?(f=NDt(t,e,d,n,i),u(d.to+n,!1)):f=d.toTree(),o.push(f),s.push(h-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 MZ extends OK{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 d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,r,n){let i=new oSn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}configure(e){let r=ZAe(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(),d=this.endLeafBlock.slice(),h=this.wrappers;if(lF(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(Us.define({id:x,name:m,props:w&&[[_n.group,w]]})),b&&(p||(p={}),Array.isArray(b)||b instanceof I0?p[m]=b:Object.assign(p,b))}n=new G5(f),p&&(n=n.extend(y1(p)))}if(lF(r.props)&&(n=n.extend(...r.props)),lF(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(lF(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?IZ(s,f.before):f.after?IZ(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&&d.push(f.endLeaf)}if(lF(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?IZ(u,f.before):f.after?IZ(u,f.after)+1:u.length-1;l.splice(g,0,f.parse),u.splice(g,0,f.name)}}return r.wrap&&(h=h.concat(r.wrap)),new MZ(n,a,o,s,d,i,l,u,h)}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 eSe(this,e,r);e:for(let i=r;i=0){i=s;continue e}}i++}return n.resolveMarkers(0)}}function lF(t){return t!=null&&t.length>0}function ZAe(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=ZAe(t[0]);if(t.length==1)return e;let r=ZAe(t.slice(1));if(!r||!e)return e||r;let n=(o,s)=>(o||h4).concat(s||h4),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 IZ(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let BDt=[Us.none];for(let t=1,e;e=nr[t];t++)BDt[t]=Us.define({id:t,name:e,props:t>=nr.Escape?[]:[[_n.group,t in TDt?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const h4=[];let $Dt=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})}},cF=class{constructor(e,r,n,i=h4){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 $Dt(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class FDt{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 h4}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 Mi(t,e,r,n){return new cF(t,e,r,n)}const zDt={resolve:"Emphasis",mark:"EmphasisMark"},UDt={resolve:"Emphasis",mark:"EmphasisMark"},TC={},PZ={};class nf{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const VDt="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let uF=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{uF=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const JAe={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(Mi(nr.Autolink,r,r+1+i[0].length,[Mi(nr.LinkMark,r,r+1),Mi(nr.URL,r+1,r+i[0].length),Mi(nr.LinkMark,r+i[0].length,r+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(a)return t.append(Mi(nr.Comment,r,r+1+a[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(Mi(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(Mi(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=uF.test(i),s=uF.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),d=!u&&(!s||l||o),h=!l&&(!o||u||s),f=d&&(e==42||!h||o),p=h&&(e==42||!d||s);return t.append(new nf(e==95?zDt:UDt,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Mi(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(Mi(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new nf(TC,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new nf(PZ,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 nf&&(i.type==TC||i.type==PZ)){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]=sSn(t,a,i.type==TC?nr.Link:nr.Image,i.from,r+1);if(i.type==TC)for(let s=0;se?Mi(nr.URL,e+r,a+r):a==t.length?null:!1}}function QDt(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 nf(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 nf&&(r.type==TC||r.type==PZ))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 nf&&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,d=[],h=s.from,f=i.to;if(a){let m=Math.min(2,s.to-s.from,o);h=s.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}s.type.mark&&d.push(this.elt(s.type.mark,h,s.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof nf&&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 nf?r:null}skipSpace(e){return sF(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Mi(this.parser.getNodeType(e),r,n,i):new FDt(e,r)}}eSe.linkStart=TC,eSe.imageStart=PZ;function tSe(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 d=WDt(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,d);else{let h=new ci(e.parser.nodeSet.types[nr.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,r.tree),e.addNode(h,d)}if(r.type.is("Block")&&(lSn.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 WDt(t,e){let r=t;for(let n=1;nLZ[t]),Object.keys(LZ).map(t=>PDt[t]),Object.keys(LZ),iSn,TDt,Object.keys(JAe).map(t=>JAe[t]),Object.keys(JAe),[]);function hSn(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 fSn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:wRt((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:hSn(i.node,i.from,i.to)};return null})}}const pSn={resolve:"Strikethrough",mark:"StrikethroughMark"},gSn={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=uF.test(n),l=uF.test(i);return t.addDelimiter(pSn,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function dF(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,u=!1,d=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let h=r;h-1)&&a++,o=!1,n&&(s>-1&&d(),n.push(t.elt("TableDelimiter",h+i,h+i+1))),s=l=-1):(u||f!=32&&f!=9)&&(s<0&&(s=h),l=h+1),u=!u&&f==92}return s>-1&&(a++,n&&d()),a}function YDt(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class jDt{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)&&qDt.test(i=r.text.slice(r.pos))){let a=[];dF(e,n.content,0,a,n.start)==dF(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=[];dF(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 mSn={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 YDt(e.content,0)?new jDt:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof jDt)||!YDt(e.text,e.basePos))return!1;let n=t.peekLine();return qDt.test(n)&&dF(t,e.text,e.basePos)==dF(t,n,e.basePos)},before:"SetextHeading"}]};class vSn{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 ySn={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 vSn:null},after:"SetextHeading"}]},XDt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,KDt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,bSn=/[\w-]+\.[\w-]+($|[/:])/,ZDt=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,JDt=/\/[a-zA-Z\d@.]+/gy;function eLt(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==")"&&eLt(t,e,n,")")>eLt(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 tLt(t,e){ZDt.lastIndex=e;let r=ZDt.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 wSn=[mSn,ySn,gSn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;XDt.lastIndex=n;let i=XDt.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=xSn(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=tLt(t.text,n):(a=tLt(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(JDt.lastIndex=a,i=JDt.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 rLt(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 fLt=null,pLt=null,gLt=0;function aSe(t,e){let r=t.pos+e;if(gLt==r&&pLt==t)return fLt;let n=t.peek(e),i="";for(;qSn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return pLt=t,gLt=r,fLt=i?i.toLowerCase():n==jSn||n==XSn?void 0:null}const mLt=60,NZ=62,oSe=47,jSn=63,XSn=33,KSn=45;function vLt(t,e){this.name=t,this.parent=e}const ZSn=[rSe,sLt,iLt,aLt,oLt],JSn=new kZ({start:null,shift(t,e,r,n){return ZSn.indexOf(e)>-1?new vLt(aSe(n,1)||"",t):t},reduce(t,e){return e==cLt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==rSe||i==VSn?new vLt(aSe(n,1)||"",t):t},strict:!1}),eTn=new xs((t,e)=>{if(t.next!=mLt){t.next<0&&e.context&&t.acceptToken(nSe);return}t.advance();let r=t.next==oSe;r&&t.advance();let n=aSe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?NSn:PSn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken(LSn);if(i&&YSn[i])return t.acceptToken(nSe,-2);if(e.dialectEnabled(QSn))return t.acceptToken(MSn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(ISn)}else{if(n=="script")return t.acceptToken(iLt);if(n=="style")return t.acceptToken(aLt);if(n=="textarea")return t.acceptToken(oLt);if(WSn.hasOwnProperty(n))return t.acceptToken(sLt);i&&hLt[i]&&hLt[i][n]?t.acceptToken(nSe,-1):t.acceptToken(rSe)}},{contextual:!0}),tTn=new xs(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(lLt);break}if(t.next==KSn)e++;else if(t.next==NZ&&e>=2){r>=3&&t.acceptToken(lLt,-2);break}else e=0;t.advance()}});function rTn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const nTn=new xs((t,e)=>{if(t.next==oSe&&t.peek(1)==NZ){let r=e.dialectEnabled(HSn)||rTn(e.context);t.acceptToken(r?DSn:nLt,2)}else t.next==NZ&&t.acceptToken(nLt,1)});function sSe(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==mLt||a==1&&i.next==oSe||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 iTn=sSe("script",CSn,kSn),aTn=sSe("style",OSn,ESn),oTn=sSe("textarea",_Sn,RSn),sTn=y1({"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}),lTn=S1.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:JSn,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:[sTn],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==FSn)return lSe(s,l,r);if(u==zSn)return lSe(s,l,n);if(u==USn)return lSe(s,l,i);if(u==cLt&&a.length){let d=s.node,h=d.firstChild,f=h&&bLt(h,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=yLt(h,l))))){let m=d.lastChild,v=m.type.id==GSn?m.from:d.to;if(v>h.to)return{parser:g.parser,overlay:[{from:h.to,to:v}]}}}}if(o&&u==uLt){let d=s.node,h;if(h=d.firstChild){let f=o[l.read(h.from,h.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=bLt(d.parent,l))continue;let g=d.lastChild;if(g.type.id==iSe){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==dLt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const cTn=145,wLt=1,uTn=146,dTn=147,ALt=2,hTn=148,fTn=3,pTn=4,SLt=[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],gTn=58,mTn=40,TLt=95,vTn=91,BZ=45,yTn=46,bTn=35,xTn=37,wTn=38,ATn=92,STn=10,TTn=42;function hF(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function cSe(t){return t>=48&&t<=57}function CLt(t){return cSe(t)||t>=97&&t<=102||t>=65&&t<=70}const kLt=(t,e,r)=>(n,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:l}=n;if(hF(l)||l==BZ||l==TLt||a&&cSe(l))!a&&(l!=BZ||s>0)&&(a=!0),o===s&&l==BZ&&o++,n.advance();else if(l==ATn&&n.peek(1)!=STn){if(n.advance(),CLt(n.next)){do n.advance();while(CLt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(o==2&&i.canShift(ALt)?e:l==mTn?r:t);break}}},CTn=new xs(kLt(uTn,ALt,dTn),{contextual:!0}),kTn=new xs(kLt(hTn,fTn,pTn),{contextual:!0}),OTn=new xs(t=>{if(SLt.includes(t.peek(-1))){let{next:e}=t;(hF(e)||e==TLt||e==bTn||e==yTn||e==TTn||e==vTn||e==gTn&&hF(t.peek(1))||e==BZ||e==wTn)&&t.acceptToken(cTn)}}),ETn=new xs(t=>{if(!SLt.includes(t.peek(-1))){let{next:e}=t;if(e==xTn&&(t.advance(),t.acceptToken(wLt)),hF(e)){do t.advance();while(hF(t.next)||cSe(t.next));t.acceptToken(wLt)}}}),_Tn=y1({"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}),RTn={__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},DTn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},LTn={__proto__:null,selector:118,style:124,layer:202},MTn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},ITn={__proto__:null,to:243},PTn=S1.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:[OTn,ETn,CTn,kTn,1,2,3,4,new CZ("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=>RTn[t]||-1},{term:148,get:t=>DTn[t]||-1},{term:4,get:t=>LTn[t]||-1},{term:28,get:t=>MTn[t]||-1},{term:146,get:t=>ITn[t]||-1}],tokenPrec:2405});let uSe=null;function dSe(){if(!uSe&&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)));uSe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return uSe||[]}const OLt=["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})),ELt=["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}))),NTn=["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})),BTn=["@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})),C1=/^(\w[\w-]*|-\w[\w-]*|)$/,$Tn=/^-(-[\w-]*)?$/;function FTn(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 _Lt=new qwe,zTn=["Declaration"];function UTn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function RLt(t,e,r){if(e.to-e.from>4096){let n=_Lt.get(e);if(n)return n;let i=[],a=new Set,o=e.cursor(Zi.IncludeAnonymous);if(o.firstChild())do for(let s of RLt(t,o.node,r))a.has(s.label)||(a.add(s.label),i.push(s));while(o.nextSibling());return _Lt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var o;if(r(a)&&a.matchContext(zTn)&&((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 VTn=(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:dSe(),validFor:C1};if(i.name=="ValueName")return{from:i.from,options:ELt,validFor:C1};if(i.name=="PseudoClassName")return{from:i.from,options:OLt,validFor:C1};if(t(i)||(e.explicit||a)&&FTn(i,r.doc))return{from:t(i)||a?i.from:n,options:RLt(r.doc,UTn(i),t),validFor:$Tn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:dSe(),validFor:C1};return{from:i.from,options:NTn,validFor:C1}}if(i.name=="AtKeyword")return{from:i.from,options:BTn,validFor:C1};if(!e.explicit)return null;let o=i.resolve(n),s=o.childBefore(n);return s&&s.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:OLt,validFor:C1}:s&&s.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:ELt,validFor:C1}:o.name=="Block"||o.name=="Styles"?{from:n,options:dSe(),validFor:C1}:null})(t=>t.name=="VariableName"),$Z=b1.define({name:"css",parser:PTn.configure({props:[w1.add({Declaration:s4()}),A1.add({"Block KeyframeList":K$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function GTn(){return new $w($Z,$Z.data.of({autocomplete:VTn}))}const fF=["_blank","_self","_top","_parent"],hSe=["ascii","utf-8","utf-16","latin1","latin1"],fSe=["get","post","put","delete"],pSe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],af=["true","false"],zr={},QTn={a:{attrs:{href:null,ping:null,type:null,media:null,target:fF,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:fF}},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:pSe,formmethod:fSe,formnovalidate:["novalidate"],formtarget:fF,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":hSe,autocomplete:["on","off"],enctype:pSe,method:fSe,novalidate:["novalidate"],target:fF}},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:pSe,formmethod:fSe,formnovalidate:["novalidate"],formtarget:fF,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:hSe,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:hSe}},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},DLt={accesskey:null,class:null,contenteditable:af,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:af,autocorrect:af,autocapitalize:af,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":af,"aria-autocomplete":["inline","list","both","none"],"aria-busy":af,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":af,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":af,"aria-hidden":af,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":af,"aria-multiselectable":af,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":af,"aria-relevant":null,"aria-required":af,"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},LLt="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 LLt)DLt[t]=null;class pF{constructor(e,r){this.tags={...QTn,...e},this.globalAttrs={...DLt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}pF.default=new pF;function f4(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 p4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function MLt(t,e,r){let n=r.tags[f4(t,p4(e))];return(n==null?void 0:n.children)||r.allTags}function gSe(t,e){let r=[];for(let n=p4(e);n&&!n.type.isTop;n=p4(n.parent)){let i=f4(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 ILt=/^[:\-\.\w\u00b7-\uffff]*$/;function PLt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=p4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:MLt(t.doc,o,e).map(s=>({label:s,type:"type"})).concat(gSe(t.doc,r).map((s,l)=>({label:"/"+s,apply:"/"+s+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function NLt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:gSe(t.doc,e).map((a,o)=>({label:a,apply:a+i,type:"type",boost:99-o})),validFor:ILt}}function HTn(t,e,r,n){let i=[],a=0;for(let o of MLt(t.doc,r,e))i.push({label:"<"+o,type:"type"});for(let o of gSe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function WTn(t,e,r,n,i){let a=p4(r),o=a?e.tags[f4(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:ILt}}function YTn(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),d=e.globalAttrs[u];if(!d){let h=p4(r),f=h?e.tags[f4(t.doc,h)]:null;d=(f==null?void 0:f.attrs)&&f.attrs[u]}if(d){let h=t.sliceDoc(n,i).toLowerCase(),f='"',p='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of d)s.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:s,validFor:l}}function BLt(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.fromBLt(n,i)}const XTn=F0.parser.configure({top:"SingleExpression"}),$Lt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:vDt.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:yDt.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:bDt.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:XTn},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:F0.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:$Z.parser}],FLt=[{name:"style",parser:$Z.parser.configure({top:"Styles"})}].concat(LLt.map(t=>({name:t,parser:F0.parser}))),zLt=b1.define({name:"html",parser:lTn.configure({props:[w1.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:"-_"}}),FZ=zLt.configure({wrap:xLt($Lt,FLt)});function KTn(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=xLt((t.nestedLanguages||[]).concat($Lt),(t.nestedAttributes||[]).concat(FLt)));let n=r?zLt.configure({wrap:r,dialect:e}):e?FZ.configure({dialect:e}):FZ;return new $w(n,[FZ.data.of({autocomplete:jTn(t)}),t.autoCloseTags!==!1?ZTn:[],HAe().support,GTn().support])}const ULt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ZTn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!FZ.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var u,d,h;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(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=f4(o.doc,v.parent,p))&&!ULt.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&&((h=v.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=f4(o.doc,v,p))&&!ULt.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)}),VLt=mZ({commentTokens:{block:{open:""}}}),GLt=new _n,QLt=dSn.configure({props:[A1.add(t=>!t.is("Block")||t.is("Document")||mSe(t)!=null||JTn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),GLt.add(mSe),w1.add({Document:()=>null}),Bw.add({Document:VLt})]});function mSe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function JTn(t){return t.name=="OrderedList"||t.name=="BulletList"}function eCn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=mSe(n.type))!=null&&i<=e)break;r=n}return r.to}const tCn=c3t.of((t,e,r)=>{for(let n=wa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function vSe(t){return new tf(VLt,t,[],"markdown")}const rCn=vSe(QLt),zZ=vSe(QLt.configure([wSn,SSn,ASn,TSn,{props:[A1.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function nCn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=vZ.matchLanguageName(t,r,!0),n instanceof vZ)return n.support?n.support.language.parser:bC.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let ySe=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(+WLt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function HLt(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 ySe(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],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new ySe(a.parent,l,l+d,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],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new ySe(a.parent,l,l+d,o[1],u,h,a))}}return n}function WLt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function bSe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=WLt(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 xSe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(a4)!=" ")return t;let n=Ig(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const iCn=((t={})=>({state:e,dispatch:r})=>{let n=wa(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!zZ.isActiveAt(e,s.from,-1)&&!zZ.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,u=i.lineAt(l),d=HLt(n.resolveInner(l,-1),i);for(;d.length&&d[d.length-1].from>l-u.from;)d.pop();if(!d.length)return a={range:s};let h=d[d.length-1];if(h.to-h.spaceAfter.length>l-u.from)return a={range:s};let f=l>=h.to-h.spaceAfter.length&&!/\S/.test(u.text.slice(h.to));if(h.item&&f){let y=h.node.firstChild,b=h.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to0&&!/[^\s>]/.test(i.lineAt(u.from-1).text)||t.nonTightLists===!1){let x=d.length>1?d[d.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 h.node.name=="OrderedList"&&bSe(h.item,i,S,-2),x&&x.node.name=="OrderedList"&&bSe(x.item,i,S),{range:xt.cursor(w+A.length),changes:S}}else{let x=qLt(d,e,u);return{range:xt.cursor(l+x.length+1),changes:{from:u.from,insert:x+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&u.from){let y=i.lineAt(u.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==h.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:u.from+h.from,to:u.to}]);return{range:s.map(x),changes:x}}}let p=[];h.node.name=="OrderedList"&&bSe(h.item,i,p);let g=h.item&&h.item.from]*/.exec(u.text)[0].length>=h.to)for(let y=0,b=d.length-1;y<=b;y++)m+=y==b&&!g?d[y].marker(i,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return m=xSe(m,e),aCn(h.node,e.doc)&&(m=qLt(d,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 YLt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function aCn(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&&zZ.isActiveAt(t,a.from)){let l=s.lineAt(o),u=HLt(oCn(r,o),s);if(u.length){let d=u[u.length-1],h=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:xt.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(d.item&&l.from<=d.item.from||/^[\s>]*$/.test(l.text.slice(0,d.to)))){let f=l.from+d.from;if(d.item&&d.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),!zZ.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||dCn.test(s.name))&&(o=!0)},leave:s=>{s.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const hkn=new xs((t,e)=>{let r;if(t.next<0)t.acceptToken(mCn);else if(e.context.flags&VZ)CSe(t.next)&&t.acceptToken(gCn,1);else if(((r=t.peek(-1))<0||CSe(r))&&e.canShift(ZLt)){let n=0;for(;t.next==ASe||t.next==UZ;)t.advance(),n++;(t.next==CC||t.next==gF||t.next==SSe)&&t.acceptToken(ZLt,-n)}else CSe(t.next)&&t.acceptToken(pCn,1)},{contextual:!0}),fkn=new xs((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==CC||n==gF){let i=0,a=0;for(;;){if(t.next==ASe)i++;else if(t.next==UZ)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=CC&&t.next!=gF&&t.next!=SSe&&(i[t,e|oMt])),mkn=new kZ({start:pkn,reduce(t,e,r,n){return t.flags&VZ&&dkn.has(e)||(e==MCn||e==tMt)&&t.flags&oMt?t.parent:t},shift(t,e,r,n){return e==XLt?new GZ(t,gkn(n.read(n.pos,r.pos)),0):e==KLt?t.parent:e==bCn||e==SCn||e==kCn||e==JLt?new GZ(t,0,VZ):sMt.has(e)?new GZ(t,0,sMt.get(e)|t.flags&VZ):t},hash(t){return t.hash}}),vkn=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==ASe||r==UZ)){r!=ikn&&r!=akn&&r!=CC&&r!=gF&&r!=SSe&&t.acceptToken(fCn);return}}}),ykn=new xs((t,e)=>{let{flags:r}=e.context,n=r&k1?iMt:nMt,i=(r&O1)>0,a=!(r&E1),o=(r&_1)>0,s=t.pos;for(;!(t.next<0);)if(o&&t.next==TSe)if(t.peek(1)==TSe)t.advance(2);else{if(t.pos==s){t.acceptToken(JLt,1);return}break}else if(a&&t.next==aMt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),bkn(t,l)),t.acceptToken(yCn);return}break}else if(t.next==aMt&&!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(eMt,i?3:1);return}break}else if(t.next==CC){if(i)t.advance();else if(t.pos==s){t.acceptToken(eMt);return}break}else t.advance();t.pos>s&&t.acceptToken(vCn)});function bkn(t,e){if(e==okn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==skn)for(let r=0;r<2&&kSe(t.next);r++)t.advance();else if(e==ckn)for(let r=0;r<4&&kSe(t.next);r++)t.advance();else if(e==ukn)for(let r=0;r<8&&kSe(t.next);r++)t.advance();else if(e==lkn&&t.next==TSe){for(t.advance();t.next>=0&&t.next!=rMt&&t.next!=nMt&&t.next!=iMt&&t.next!=CC;)t.advance();t.next==rMt&&t.advance()}}const xkn=y1({'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}),wkn={__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},Akn=S1.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:[vkn,fkn,hkn,ykn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>wkn[t]||-1}],tokenPrec:7668}),lMt=new qwe,cMt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function QZ(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const Skn={FunctionDefinition:QZ("function"),ClassDefinition:QZ("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:QZ("variable"),AsPattern:QZ("variable"),__proto__:null};function uMt(t,e){let r=lMt.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(Zi.IncludeAnonymous).iterate(o=>{if(o.name){let s=Skn[o.name];if(s&&s(o,a,i)||!i&&cMt.has(o.name))return!1;i=!1}else if(o.to-o.from>8192){for(let s of uMt(t,o.node))n.push(s);return!1}}),lMt.set(e,n),n}const dMt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,hMt=["String","FormatString","Comment","PropertyName"];function Tkn(t){let e=wa(t.state).resolveInner(t.pos,-1);if(hMt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&dMt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)cMt.has(i.name)&&(n=n.concat(uMt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:dMt}}const Ckn=["__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"}))),kkn=[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"})],Okn=W3t(hMt,MAe(Ckn.concat(kkn)));function OSe(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 _Se=b1.define({name:"python",parser:Akn.configure({props:[w1.add({Body:t=>{var e;let r=/^\s*(#|$)/.test(t.textAfter)&&OSe(t)||t.node;return(e=ESe(t,r))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let r=OSe(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":o4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":o4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":o4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let r=OSe(t);return(e=r&&ESe(t,r))!==null&&e!==void 0?e:t.continue()}}),A1.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":K$,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 Ekn(){return new $w(_Se,[_Se.data.of({autocomplete:Tkn}),_Se.data.of({autocomplete:Okn})])}const g4=63,fMt=64,_kn=1,Rkn=2,pMt=3,Dkn=4,gMt=5,Lkn=6,Mkn=7,mMt=65,Ikn=66,Pkn=8,Nkn=9,Bkn=10,$kn=11,Fkn=12,vMt=13,zkn=19,Ukn=20,Vkn=29,Gkn=33,Qkn=34,Hkn=47,Wkn=0,RSe=1,DSe=2,mF=3,LSe=4;class kC{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}}kC.top=new kC(null,-1,Wkn);function vF(t,e){for(let r=0,n=e-t.pos-1;;n--,r++){let i=t.peek(n);if(R1(i)||i==-1)return r}}function MSe(t){return t==32||t==9}function R1(t){return t==10||t==13}function yMt(t){return MSe(t)||R1(t)}function OC(t){return t<0||yMt(t)}const Ykn=new kZ({start:kC.top,reduce(t,e){return t.type==mF&&(e==Ukn||e==Qkn)?t.parent:t},shift(t,e,r,n){if(e==pMt)return new kC(t,vF(n,n.pos),RSe);if(e==mMt||e==gMt)return new kC(t,vF(n,n.pos),DSe);if(e==g4)return t.parent;if(e==zkn||e==Gkn)return new kC(t,0,mF);if(e==vMt&&t.type==LSe)return t.parent;if(e==Hkn){let i=/[1-9]/.exec(n.read(n.pos,r.pos));if(i)return new kC(t,t.depth+ +i[0],LSe)}return t},hash(t){return t.hash}});function m4(t,e,r=0){return t.peek(r)==e&&t.peek(r+1)==e&&t.peek(r+2)==e&&OC(t.peek(r+3))}const qkn=new xs((t,e)=>{if(t.next==-1&&e.canShift(fMt))return t.acceptToken(fMt);let r=t.peek(-1);if((R1(r)||r<0)&&e.context.type!=mF){if(m4(t,45))if(e.canShift(g4))t.acceptToken(g4);else return t.acceptToken(_kn,3);if(m4(t,46))if(e.canShift(g4))t.acceptToken(g4);else return t.acceptToken(Rkn,3);let n=0;for(;t.next==32;)n++,t.advance();(n{if(e.context.type==mF){t.next==63&&(t.advance(),OC(t.next)&&t.acceptToken(Mkn));return}if(t.next==45)t.advance(),OC(t.next)&&t.acceptToken(e.context.type==RSe&&e.context.depth==vF(t,t.pos-1)?Dkn:pMt);else if(t.next==63)t.advance(),OC(t.next)&&t.acceptToken(e.context.type==DSe&&e.context.depth==vF(t,t.pos-1)?Lkn:gMt);else{let r=t.pos;for(;;)if(MSe(t.next)){if(t.pos==r)return;t.advance()}else if(t.next==33)wMt(t);else if(t.next==38)ISe(t);else if(t.next==42){ISe(t);break}else if(t.next==39||t.next==34){if(PSe(t,!0))break;return}else if(t.next==91||t.next==123){if(!Kkn(t))return;break}else{AMt(t,!0,!1,0);break}for(;MSe(t.next);)t.advance();if(t.next==58){if(t.pos==r&&e.canShift(Vkn))return;let n=t.peek(1);OC(n)&&t.acceptTokenTo(e.context.type==DSe&&e.context.depth==vF(t,r)?Ikn:mMt,r)}}},{contextual:!0});function Xkn(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 bMt(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function xMt(t,e){return t.next==37?(t.advance(),bMt(t.next)&&t.advance(),bMt(t.next)&&t.advance(),!0):Xkn(t.next)||e&&t.next==44?(t.advance(),!0):!1}function wMt(t){if(t.advance(),t.next==60){for(t.advance();;)if(!xMt(t,!0)){t.next==62&&t.advance();break}}else for(;xMt(t,!1););}function ISe(t){for(t.advance();!OC(t.next)&&HZ(t.next)!="f";)t.advance()}function PSe(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(R1(a)){if(e)return!1;n=!0}else if(e&&t.pos>=i+1024)return!1}return!n}function Kkn(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(!PSe(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||R1(t.next))return!1;t.advance()}}const Zkn="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function HZ(t){return t<33?"u":t>125?"s":Zkn[t-33]}function NSe(t,e){let r=HZ(t);return r!="u"&&!(e&&r=="f")}function AMt(t,e,r,n){if(HZ(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&NSe(t.peek(1),r))t.advance();else return!1;let i=t.pos;for(;;){let a=t.next,o=0,s=n+1;for(;yMt(a);){if(R1(a)){if(e)return!1;s=0}else s++;a=t.peek(++o)}if(!(a>=0&&(a==58?NSe(t.peek(o+1),r):a==35?t.peek(o-1)!=32:NSe(a,r)))||!r&&s<=n||s==0&&!r&&(m4(t,45,o)||m4(t,46,o)))break;if(e&&HZ(a)=="f")return!1;for(let u=o;u>=0;u--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const Jkn=new xs((t,e)=>{if(t.next==33)wMt(t),t.acceptToken(Fkn);else if(t.next==38||t.next==42){let r=t.next==38?Bkn:$kn;ISe(t),t.acceptToken(r)}else t.next==39||t.next==34?(PSe(t,!1),t.acceptToken(Nkn)):AMt(t,!1,e.context.type==mF,e.context.depth)&&t.acceptToken(Pkn)}),eOn=new xs((t,e)=>{let r=e.context.type==LSe?e.context.depth:-1,n=t.pos;e:for(;;){let i=0,a=t.next;for(;a==32;)a=t.peek(++i);if(!i&&(m4(t,45,i)||m4(t,46,i))||!R1(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:Ykn,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[tOn],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:[qkn,jkn,Jkn,eOn,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),nOn=b1.define({name:"yaml",parser:rOn.configure({props:[w1.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:o4({closing:"}"}),FlowSequence:o4({closing:"]"})}),A1.add({"FlowMapping FlowSequence":K$,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function iOn(){return new $w(nOn)}function aOn(t){SMt(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=FSe(t.state,r.from);return n.line?wOn(t):n.block?SOn(t):!1};function $Se(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 wOn=$Se(kOn,0),AOn=$Se(EMt,0),SOn=$Se((t,e)=>EMt(t,e,COn(e)),0);function FSe(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const yF=50;function TOn(t,{open:e,close:r},n,i){let a=t.sliceDoc(n-yF,n),o=t.sliceDoc(i,i+yF),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 d,h;i-n<=2*yF?d=h=t.sliceDoc(n,i):(d=t.sliceDoc(n,n+yF),h=t.sliceDoc(i-yF,i));let f=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(h)[0].length,g=h.length-p-r.length;return d.slice(f,f+e.length)==e&&h.slice(g,g+r.length)==r?{open:{pos:n+f+e.length,margin:/\s/.test(d.charAt(f+e.length))?1:0},close:{pos:i-p-r.length,margin:/\s/.test(h.charAt(g-1))?1:0}}:null}function COn(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 EMt(t,e,r=e.selection.ranges){let n=r.map(a=>FSe(e,a.from).block);if(!n.every(a=>a))return null;let i=r.map((a,o)=>TOn(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>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,p=f==h.length,g=h.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:d,single:h}of n)(h||!d)&&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,d=u+l.length;o.text[d-o.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const zSe=_0.define(),OOn=_0.define(),EOn=vr.define(),_Mt=vr.define({combine(t){return R0(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)})}}),RMt=Ko.define({create(){return z0.empty},update(t,e){let r=e.state.facet(_Mt),n=e.annotation(zSe);if(n){let l=Zd.fromTransaction(e,n.selection),u=n.side,d=u==0?t.undone:t.done;return l?d=YZ(d,d.length,r.minDepth,l):d=MMt(d,e.startState.selection),new z0(u==0?n.rest:d,u==0?d:n.rest)}let i=e.annotation(OOn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Vs.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Zd.fromTransaction(e),o=e.annotation(Vs.time),s=e.annotation(Vs.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 z0(t.done.map(Zd.fromJSON),t.undone.map(Zd.fromJSON))}});function _On(t={}){return[RMt,_Mt.of(t),er.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?DMt:e.inputType=="historyRedo"?USe:null;return n?(e.preventDefault(),n(r)):!1}})]}function WZ(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(RMt,!1);if(!i)return!1;let a=i.pop(t,r,e);return a?(n(a),!0):!1}}const DMt=WZ(0,!1),USe=WZ(1,!1),ROn=WZ(0,!0),DOn=WZ(1,!0);class Zd{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 Zd(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 Zd(e.changes&&bs.fromJSON(e.changes),[],e.mapped&&E0.fromJSON(e.mapped),e.startSelection&&xt.fromJSON(e.startSelection),e.selectionsAfter.map(xt.fromJSON))}static fromTransaction(e,r){let n=Cp;for(let i of e.startState.facet(EOn)){let a=i(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new Zd(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,Cp)}static selection(e){return new Zd(void 0,Cp,void 0,void 0,e)}}function YZ(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 LOn(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<=d&&(n=!0)}}),n}function MOn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function LMt(t,e){return t.length?e.length?t.concat(e):t:e}const Cp=[],IOn=200;function MMt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-IOn));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),YZ(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Zd.selection([e])]}function POn(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 VSe(t,e){if(!t.length)return t;let r=t.length,n=Cp;for(;r;){let i=NOn(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?[Zd.selection(n)]:Cp}function NOn(t,e,r){let n=LMt(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Cp,r);if(!t.changes)return Zd.selection(n);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(a):a;return new Zd(i,on.mapEffects(t.effects,e),o,t.startSelection.map(a),n)}const BOn=/^(input\.type|delete)($|\.)/;class z0{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 z0(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||BOn.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime0&&r-this.prevTimer.empty?t.moveByChar(r,e):qZ(r,e))}function uu(t){return t.textDirectionAt(t.state.selection.main.head)==Ra.LTR}const PMt=t=>IMt(t,!uu(t)),NMt=t=>IMt(t,uu(t));function BMt(t,e){return Fg(t,r=>r.empty?t.moveByGroup(r,e):qZ(r,e))}const FOn=t=>BMt(t,!uu(t)),zOn=t=>BMt(t,uu(t));function UOn(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 jZ(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;UOn(t,u,i)?n=u:l=r?u.to:u.from}let a=n.type.prop(i),o,s;return a&&(o=r?$0(t,n.from,1):$0(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 VOn=t=>Fg(t,e=>jZ(t.state,e,!uu(t))),GOn=t=>Fg(t,e=>jZ(t.state,e,uu(t)));function $Mt(t,e){return Fg(t,r=>{if(!r.empty)return qZ(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const FMt=t=>$Mt(t,!1),zMt=t=>$Mt(t,!0);function UMt(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,r.height):qZ(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.bottomVMt(t,!1),GSe=t=>VMt(t,!0);function zw(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 QOn=t=>Fg(t,e=>zw(t,e,!0)),HOn=t=>Fg(t,e=>zw(t,e,!1)),WOn=t=>Fg(t,e=>zw(t,e,!uu(t))),YOn=t=>Fg(t,e=>zw(t,e,uu(t))),qOn=t=>Fg(t,e=>xt.cursor(t.lineBlockAt(e.head).from,1)),jOn=t=>Fg(t,e=>xt.cursor(t.lineBlockAt(e.head).to,-1));function XOn(t,e,r){let n=!1,i=v4(t.selection,a=>{let o=$0(t,a.head,-1)||$0(t,a.head,1)||a.head>0&&$0(t,a.head-1,1)||a.headXOn(t,e);function kp(t,e,r){let n=v4(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($g(t.state,n)),!0)}function QMt(t,e){return kp(t,e,r=>t.moveByChar(r,e))}const HMt=t=>QMt(t,!uu(t)),WMt=t=>QMt(t,uu(t));function YMt(t,e){return kp(t,e,r=>t.moveByGroup(r,e))}const ZOn=t=>YMt(t,!uu(t)),JOn=t=>YMt(t,uu(t)),eEn=t=>{let e=!uu(t);return kp(t,e,r=>jZ(t.state,r,e))},tEn=t=>{let e=uu(t);return kp(t,e,r=>jZ(t.state,r,e))};function qMt(t,e){return kp(t,e,r=>t.moveVertically(r,e))}const jMt=t=>qMt(t,!1),XMt=t=>qMt(t,!0);function KMt(t,e){return kp(t,e,r=>t.moveVertically(r,e,UMt(t).height))}const ZMt=t=>KMt(t,!1),JMt=t=>KMt(t,!0),rEn=t=>kp(t,!0,e=>zw(t,e,!0)),nEn=t=>kp(t,!1,e=>zw(t,e,!1)),iEn=t=>{let e=!uu(t);return kp(t,e,r=>zw(t,r,e))},aEn=t=>{let e=uu(t);return kp(t,e,r=>zw(t,r,e))},oEn=t=>kp(t,!1,e=>xt.cursor(t.lineBlockAt(e.head).from)),sEn=t=>kp(t,!0,e=>xt.cursor(t.lineBlockAt(e.head).to)),eIt=({state:t,dispatch:e})=>(e($g(t,{anchor:0})),!0),tIt=({state:t,dispatch:e})=>(e($g(t,{anchor:t.doc.length})),!0),rIt=({state:t,dispatch:e})=>(e($g(t,{anchor:t.selection.main.anchor,head:0})),!0),nIt=({state:t,dispatch:e})=>(e($g(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),lEn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),cEn=({state:t,dispatch:e})=>{let r=KZ(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},uEn=({state:t,dispatch:e})=>{let r=v4(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($g(t,r)),!0)};function iIt(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($g(r,xt.create(i,i.length-1))),!0)}const dEn=t=>iIt(t,!1),hEn=t=>iIt(t,!0),fEn=({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($g(t,n)),!0):!1};function bF(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=XZ(t,l,!0)),o=Math.min(o,l),s=Math.max(s,l)}else o=XZ(t,o,!1),s=XZ(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 aIt=(t,e,r)=>bF(t,n=>{let i=n.from,{state:a}=t,o=a.doc.lineAt(i),s,l;if(r&&!e&&i>o.from&&iaIt(t,!1,!0),oIt=t=>aIt(t,!0,!1),sIt=(t,e)=>bF(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=Vl(a.text,n-a.from,e)+a.from,u=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),d=o(u);if(s!=null&&d!=s)break;(u!=" "||n!=r.head)&&(s=d),n=l}return n}),lIt=t=>sIt(t,!1),pEn=t=>sIt(t,!0),gEn=t=>bF(t,e=>{let r=t.lineBlockAt(e.head).to;return e.headbF(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),vEn=t=>bF(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:Ai.of(["",""])},range:xt.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},bEn=({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:Vl(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:Vl(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 KZ(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 cIt(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let a of KZ(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 xEn=({state:t,dispatch:e})=>cIt(t,e,!1),wEn=({state:t,dispatch:e})=>cIt(t,e,!0);function uIt(t,e,r){if(t.readOnly)return!1;let n=[];for(let a of KZ(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 AEn=({state:t,dispatch:e})=>uIt(t,e,!1),SEn=({state:t,dispatch:e})=>uIt(t,e,!0),TEn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(KZ(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 CEn(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 dIt=hIt(!1),kEn=hIt(!0);function hIt(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&&CEn(e,a);t&&(a=o=(o<=s.to?s:e.doc.lineAt(o)).to);let u=new yZ(e,{simulateBreak:a,simulateDoubleBreak:!!l}),d=vAe(u,a);for(d==null&&(d=Ig(/^\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 OEn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new yZ(t,{overrideIndentation:a=>{let o=r[a];return o??-1}}),i=HSe(t,(a,o,s)=>{let l=vAe(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],d=X$(t,l);(u!=d||s.fromt.readOnly?!1:(e(t.update(HSe(t,(r,n)=>{n.push({from:r.from,insert:t.facet(a4)})}),{userEvent:"input.indent"})),!0),pIt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(HSe(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let a=Ig(i,t.tabSize),o=0,s=X$(t,Math.max(0,a-xC(t)));for(;o(t.setTabFocusMode(),!0),_En=[{key:"Ctrl-b",run:PMt,shift:HMt,preventDefault:!0},{key:"Ctrl-f",run:NMt,shift:WMt},{key:"Ctrl-p",run:FMt,shift:jMt},{key:"Ctrl-n",run:zMt,shift:XMt},{key:"Ctrl-a",run:qOn,shift:oEn},{key:"Ctrl-e",run:jOn,shift:sEn},{key:"Ctrl-d",run:oIt},{key:"Ctrl-h",run:QSe},{key:"Ctrl-k",run:gEn},{key:"Ctrl-Alt-h",run:lIt},{key:"Ctrl-o",run:yEn},{key:"Ctrl-t",run:bEn},{key:"Ctrl-v",run:GSe}],REn=[{key:"ArrowLeft",run:PMt,shift:HMt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:FOn,shift:ZOn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:WOn,shift:iEn,preventDefault:!0},{key:"ArrowRight",run:NMt,shift:WMt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:zOn,shift:JOn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:YOn,shift:aEn,preventDefault:!0},{key:"ArrowUp",run:FMt,shift:jMt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:eIt,shift:rIt},{mac:"Ctrl-ArrowUp",run:GMt,shift:ZMt},{key:"ArrowDown",run:zMt,shift:XMt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:tIt,shift:nIt},{mac:"Ctrl-ArrowDown",run:GSe,shift:JMt},{key:"PageUp",run:GMt,shift:ZMt},{key:"PageDown",run:GSe,shift:JMt},{key:"Home",run:HOn,shift:nEn,preventDefault:!0},{key:"Mod-Home",run:eIt,shift:rIt},{key:"End",run:QOn,shift:rEn,preventDefault:!0},{key:"Mod-End",run:tIt,shift:nIt},{key:"Enter",run:dIt,shift:dIt},{key:"Mod-a",run:lEn},{key:"Backspace",run:QSe,shift:QSe,preventDefault:!0},{key:"Delete",run:oIt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lIt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:pEn,preventDefault:!0},{mac:"Mod-Backspace",run:mEn,preventDefault:!0},{mac:"Mod-Delete",run:vEn,preventDefault:!0}].concat(_En.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),DEn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:VOn,shift:eEn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GOn,shift:tEn},{key:"Alt-ArrowUp",run:xEn},{key:"Shift-Alt-ArrowUp",run:AEn},{key:"Alt-ArrowDown",run:wEn},{key:"Shift-Alt-ArrowDown",run:SEn},{key:"Mod-Alt-ArrowUp",run:dEn},{key:"Mod-Alt-ArrowDown",run:hEn},{key:"Escape",run:fEn},{key:"Mod-Enter",run:kEn},{key:"Alt-l",mac:"Ctrl-l",run:cEn},{key:"Mod-i",run:uEn,preventDefault:!0},{key:"Mod-[",run:pIt},{key:"Mod-]",run:fIt},{key:"Mod-Alt-\\",run:OEn},{key:"Shift-Mod-k",run:TEn},{key:"Shift-Mod-\\",run:KOn},{key:"Mod-/",run:xOn},{key:"Alt-A",run:AOn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:EEn}].concat(REn),LEn={key:"Tab",run:fIt,shift:pIt},gIt=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class y4{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(gIt(s)):gIt,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 qd(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=Zwe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=O0(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=ZZ(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 b4(r,e.sliceString(r,n));return YSe.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=ZZ(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=b4.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(vIt.prototype[Symbol.iterator]=yIt.prototype[Symbol.iterator]=function(){return this});function MEn(t){try{return new RegExp(t,WSe),!0}catch{return!1}}function ZZ(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const IEn=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=nwn(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,d,h]=o,f=d?+d.slice(1):0,p=u?+u:s.number;if(u&&h){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},PEn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},NEn=vr.define({combine(t){return R0(t,PEn,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function BEn(t){return[VEn,UEn]}const $En=Ar.mark({class:"cm-selectionMatch"}),FEn=Ar.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function bIt(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 zEn(t,e,r,n){return t(e.sliceDoc(r,r+1))==Ao.Word&&t(e.sliceDoc(n-1,n))==Ao.Word}const UEn=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(NEn),{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),!(bIt(o,r,i.from,i.to)&&zEn(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 y4(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:d,to:h}=u.value;if((!o||bIt(o,r,d,h))&&(i.empty&&d<=i.from&&h>=i.to?s.push(FEn.range(d,h)):(d>=i.to||h<=i.from)&&s.push($En.range(d,h)),s.length>e.maxMatches))return Ar.none}}return Ar.set(s)}},{decorations:t=>t.decorations}),VEn=er.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GEn=({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 QEn(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 y4(t.doc,e,n[n.length-1].to);;)if(s.next(),s.done){if(o)return null;s=new y4(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 HEn=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(a=>a.from===a.to))return GEn({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=QEn(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},x4=vr.define({combine(t){return R0(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new a_n(e),scrollToMatch:e=>er.scrollIntoView(e)})}});class xIt{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||MEn(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 KEn(this):new qEn(this)}getCursor(e,r=0,n){let i=e.doc?e:ei.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?A4(this,i,r,n):w4(this,i,r,n)}}class wIt{constructor(e){this.spec=e}}function WEn(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 w4(t,e,r,n){let i;return t.wholeWord&&(i=YEn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=WEn(t.test,e,i)),new y4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function YEn(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=w4(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 jEn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function A4(t,e,r,n){let i;return t.wholeWord&&(i=XEn(e.charCategorizer(e.selection.main.head))),t.test&&(i=jEn(t.test,e,i)),new vIt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function JZ(t,e){return t.slice(Vl(t,e,!1),e)}function eJ(t,e){return t.slice(e,Vl(t,e))}function XEn(t){return(e,r,n)=>!n[0].length||(t(JZ(n.input,n.index))!=Ao.Word||t(eJ(n.input,n.index))!=Ao.Word)&&(t(eJ(n.input,n.index+n[0].length))!=Ao.Word||t(JZ(n.input,n.index+n[0].length))!=Ao.Word)}class KEn extends wIt{nextMatch(e,r,n){let i=A4(this.spec,e,n,e.doc.length).next();return i.done&&(i=A4(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=A4(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=A4(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 xF=on.define(),qSe=on.define(),Uw=Ko.define({create(t){return new jSe(KSe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(xF)?t=new jSe(r.value.create(),t.panel):r.is(qSe)&&(t=new jSe(t.query,r.value?XSe:null));return t},provide:t=>H$.from(t,e=>e.panel)});class jSe{constructor(e,r){this.query=e,this.panel=r}}const ZEn=Ar.mark({class:"cm-searchMatch"}),JEn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),e_n=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Uw))}update(t){let e=t.state.field(Uw);(e!=t.startState.field(Uw)||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,d)=>{let h=r.state.selection.ranges.some(f=>f.from==u&&f.to==d);n.add(u,d,h?JEn:ZEn)})}return n.finish()}},{decorations:t=>t.decorations});function wF(t){return e=>{let r=e.state.field(Uw,!1);return r&&r.query.spec.valid?t(e,r):CIt(e)}}const tJ=wF((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(x4);return t.dispatch({selection:i,effects:[ZSe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),TIt(t),!0}),rJ=wF((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(x4);return t.dispatch({selection:a,effects:[ZSe(t,i),o.scrollToMatch(a.main,t)],userEvent:"select.search"}),TIt(t),!0}),t_n=wF((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)}),r_n=({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 y4(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},AIt=wF((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,d=[];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),d.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):o=e.nextMatch(r,o.from,o.to);let h=t.state.changes(s);return o&&(l=xt.single(o.from,o.to).map(h),d.push(ZSe(t,o)),d.push(r.facet(x4).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:d,userEvent:"input.replace"}),!0}),n_n=wF((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 XSe(t){return t.state.facet(x4).createPanel(t)}function KSe(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(x4);return new xIt({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 SIt(t){let e=oAe(t,XSe);return e&&e.dom.querySelector("[main-field]")}function TIt(t){let e=SIt(t);e&&e==t.root.activeElement&&e.select()}const CIt=t=>{let e=t.state.field(Uw,!1);if(e&&e.panel){let r=SIt(t);if(r&&r!=t.root.activeElement){let n=KSe(t.state,e.query.spec);n.valid&&t.dispatch({effects:xF.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[qSe.of(!0),e?xF.of(KSe(t.state,e.query.spec)):on.appendConfig.of(s_n)]});return!0},kIt=t=>{let e=t.state.field(Uw,!1);if(!e||!e.panel)return!1;let r=oAe(t,XSe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:qSe.of(!1)}),!0},i_n=[{key:"Mod-f",run:CIt,scope:"editor search-panel"},{key:"F3",run:tJ,shift:rJ,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tJ,shift:rJ,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kIt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:r_n},{key:"Mod-Alt-g",run:IEn},{key:"Mod-d",run:HEn,preventDefault:!0}];class a_n{constructor(e){this.view=e;let r=this.query=e.state.field(Uw).query.spec;this.commit=this.commit.bind(this),this.searchField=xa("input",{value:r.search,placeholder:of(e,"Find"),"aria-label":of(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:of(e,"Replace"),"aria-label":of(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",()=>tJ(e),[of(e,"next")]),n("prev",()=>rJ(e),[of(e,"previous")]),n("select",()=>t_n(e),[of(e,"all")]),xa("label",null,[this.caseField,of(e,"match case")]),xa("label",null,[this.reField,of(e,"regexp")]),xa("label",null,[this.wordField,of(e,"by word")]),...e.state.readOnly?[]:[xa("br"),this.replaceField,n("replace",()=>AIt(e),[of(e,"replace")]),n("replaceAll",()=>n_n(e),[of(e,"replace all")])],xa("button",{name:"close",onclick:()=>kIt(e),"aria-label":of(e,"close"),type:"button"},["×"])])}commit(){let e=new xIt({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:xF.of(e)}))}keydown(e){hxn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?rJ:tJ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),AIt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(xF)&&!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(x4).top}}function of(t,e){return t.state.phrase(e)}const nJ=30,iJ=/[\s\.,:;?!]/;function ZSe(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-nJ),o=Math.min(i,r+nJ),s=t.state.sliceDoc(a,o);if(a!=n.from){for(let l=0;ls.length-nJ;l--)if(!iJ.test(s[l-1])&&iJ.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 o_n=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"}}),s_n=[Uw,Jh.low(e_n),o_n];class OIt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class EC{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(AF).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(),d=0,h=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>h)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,h);let y=!1;if(s.some(x=>x.from==m&&(x.to==v||v==h))&&(y=m==v,!y&&v-m<10)){let x=m-(d+u.value.length);x>0&&(u.next(x),d=m);for(let w=m;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let b=b_n(s);if(y)o.add(m,m,Ar.widget({widget:new g_n(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==h)break;for(let x=0;x{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new OIt(i,a,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new OIt(n.from,a,n.diagnostic)}}),n}function l_n(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(AF).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(EIt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function c_n(t,e){return t.field(sf,!1)?e:e.concat(on.appendConfig.of(x_n))}const EIt=on.define(),JSe=on.define(),_It=on.define(),sf=Ko.define({create(){return new EC(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=Vw(r,t.selected.diagnostic,a)||Vw(r,null,a)}!r.size&&i&&e.state.facet(AF).autoPanel&&(i=null),t=new EC(r,i,n)}for(let r of e.effects)if(r.is(EIt)){let n=e.state.facet(AF).autoPanel?r.value.length?SF.open:null:t.panel;t=EC.init(r.value,n,e.state)}else r.is(JSe)?t=new EC(t.diagnostics,r.value?SF.open:null,t.selected):r.is(_It)&&(t=new EC(t.diagnostics,t.panel,r.value));return t},provide:t=>[H$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),u_n=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function d_n(t,e,r){let{diagnostics:n}=t.state.field(sf),i,a=-1,o=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(l,u,{spec:d})=>{if(e>=l&&e<=u&&(l==u||(e>l||r>0)&&(eMIt(t,r,!1)))}const f_n=t=>{let e=t.state.field(sf,!1);(!e||!e.panel)&&t.dispatch({effects:c_n(t.state,[JSe.of(!0)])});let r=oAe(t,SF.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},RIt=t=>{let e=t.state.field(sf,!1);return!e||!e.panel?!1:(t.dispatch({effects:JSe.of(!1)}),!0)},p_n=[{key:"Mod-Shift-m",run:f_n,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(sf,!1);if(!e)return!1;let r=t.state.selection.main,n=Vw(e.diagnostics,null,r.to+1);return!n&&(n=Vw(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}),twn(t,n.from,1,{tooltip:PIt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],AF=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...R0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:DIt,tooltipFilter:DIt,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 DIt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function LIt(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 MIt(t,e,r){var n;let i=r?LIt(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=Vw(t.state.field(sf).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,d=i[o]?u.indexOf(i[o]):-1,h=d<0?u:[u.slice(0,d),xa("u",u.slice(d,d+1)),u.slice(d+1)],f=a.markClass?" "+a.markClass:"";return xa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${d<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&xa("div",{class:"cm-diagnosticSource"},e.source))}class g_n extends Wu{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 IIt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=MIt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SF{constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)RIt(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=LIt(a.actions);for(let s=0;s{for(let a=0;aRIt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(sf).selected;if(!e)return-1;for(let r=0;r{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let h=-1,f;for(let p=n;pn&&(this.items.splice(n,h-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(sf),n=Vw(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:_It.of(n)})}static open(e){return new SF(e)}}function m_n(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function aJ(t){return m_n(``,'width="6" height="3"')}const v_n=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:aJ("#f11")},".cm-lintRange-warning":{backgroundImage:aJ("orange")},".cm-lintRange-info":{backgroundImage:aJ("#999")},".cm-lintRange-hint":{backgroundImage:aJ("#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 y_n(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function b_n(t){let e="hint",r=1;for(let n of t){let i=y_n(n.severity);i>r&&(r=i,e=n.severity)}return e}const PIt=ewn(d_n,{hideOn:l_n}),x_n=[sf,er.decorations.compute([sf],t=>{let{selected:e,panel:r}=t.field(sf);return!e||!r||e.from==e.to?Ar.none:Ar.set([u_n.range(e.from,e.to)])}),PIt,v_n];var eTe=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(MAn)),e.defaultKeymap!==!1&&(a=a.concat(DEn)),e.searchKeymap!==!1&&(a=a.concat(i_n)),e.historyKeymap!==!1&&(a=a.concat($On)),e.foldKeymap!==!1&&(a=a.concat(zwn)),e.completionKeymap!==!1&&(a=a.concat(cDt)),e.lintKeymap!==!1&&(a=a.concat(p_n));var o=[];return e.lineNumbers!==!1&&o.push(K4t()),e.highlightActiveLineGutter!==!1&&o.push(gwn()),e.highlightSpecialChars!==!1&&o.push(_xn()),e.history!==!1&&o.push(_On()),e.foldGutter!==!1&&o.push(Qwn()),e.drawSelection!==!1&&o.push(yxn()),e.dropCursor!==!1&&o.push(Sxn()),e.allowMultipleSelections!==!1&&o.push(ei.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(Iwn()),e.syntaxHighlighting!==!1&&o.push(x3t(jwn,{fallback:!0})),e.bracketMatching!==!1&&o.push(t2n()),e.closeBrackets!==!1&&o.push(RAn()),e.autocompletion!==!1&&o.push(zAn()),e.rectangularSelection!==!1&&o.push(Gxn()),i!==!1&&o.push(Wxn()),e.highlightActiveLine!==!1&&o.push(Pxn()),e.highlightSelectionMatches!==!1&&o.push(BEn()),e.tabSize&&typeof e.tabSize=="number"&&o.push(a4.of(" ".repeat(e.tabSize))),o.concat([t4.of(a.flat())]).filter(Boolean)};const w_n="#e5c07b",NIt="#e06c75",A_n="#56b6c2",S_n="#ffffff",oJ="#abb2bf",tTe="#7d8799",T_n="#61afef",C_n="#98c379",BIt="#d19a66",k_n="#c678dd",O_n="#21252b",$It="#2c313a",FIt="#282c34",rTe="#353a42",E_n="#3E4451",zIt="#528bff",__n=er.theme({"&":{color:oJ,backgroundColor:FIt},".cm-content":{caretColor:zIt},".cm-cursor, .cm-dropCursor":{borderLeftColor:zIt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:E_n},".cm-panels":{backgroundColor:O_n,color:oJ},".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:FIt,color:tTe,border:"none"},".cm-activeLineGutter":{backgroundColor:$It},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:rTe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:rTe,borderBottomColor:rTe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$It,color:oJ}}},{dark:!0}),R_n=J$.define([{tag:Re.keyword,color:k_n},{tag:[Re.name,Re.deleted,Re.character,Re.propertyName,Re.macroName],color:NIt},{tag:[Re.function(Re.variableName),Re.labelName],color:T_n},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name)],color:BIt},{tag:[Re.definition(Re.name),Re.separator],color:oJ},{tag:[Re.typeName,Re.className,Re.number,Re.changed,Re.annotation,Re.modifier,Re.self,Re.namespace],color:w_n},{tag:[Re.operator,Re.operatorKeyword,Re.url,Re.escape,Re.regexp,Re.link,Re.special(Re.string)],color:A_n},{tag:[Re.meta,Re.comment],color:tTe},{tag:Re.strong,fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.link,color:tTe,textDecoration:"underline"},{tag:Re.heading,fontWeight:"bold",color:NIt},{tag:[Re.atom,Re.bool,Re.special(Re.variableName)],color:BIt},{tag:[Re.processingInstruction,Re.string,Re.inserted],color:C_n},{tag:Re.invalid,color:S_n}]),UIt=[__n,x3t(R_n)];var D_n=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),L_n=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,d=u===void 0?"light":u,h=r.placeholder,f=h===void 0?"":h,p=r.basicSetup,g=p===void 0?!0:p,m=[];switch(i&&m.unshift(t4.of([LEn])),g&&(typeof g=="boolean"?m.unshift(eTe()):m.unshift(eTe(g))),f&&m.unshift(Fxn(f)),d){case"light":m.push(D_n);break;case"dark":m.push(UIt);break;case"none":break;default:m.push(d);break}return o===!1&&m.push(er.editable.of(!1)),l&&m.push(ei.readOnly.of(!0)),[...m]},M_n=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 I_n{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 VIt{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 nTe=null,P_n=()=>typeof window>"u"?new VIt:(nTe||(nTe=new VIt),nTe),N_n=er.theme({"& .cm-scroller":{height:"100% !important"}}),GIt=null,iTe=null;function B_n(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===GIt||(GIt=o,iTe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),iTe}var QIt=_0.define(),$_n=200,F_n=[];function z_n(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?F_n:s,u=t.autoFocus,d=t.theme,h=d===void 0?"light":d,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,O=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=Y.useState(),V=B[0],z=B[1],U=Y.useState(),G=U[0],H=U[1],j=Y.useState(),q=j[0],ne=j[1],X=Y.useState(()=>({current:null}))[0],J=Y.useState(()=>({current:null}))[0],ee=B_n(p,m,y,x,A,T),te=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(ue=>ue.annotation(QIt))){X.current?X.current.reset():(X.current=new I_n(()=>{if(J.current){var ue=J.current;J.current=null,ue()}X.current=null},$_n),P_n().add(X.current));var Oe=Ce.state.doc,Ee=Oe.toString();n(Ee,Ce)}i&&i(M_n(Ce))}),pe=L_n({theme:h,editable:_,readOnly:L,placeholder:O,indentWithTab:D,basicSetup:I}),ie=[te,...ee?[ee]:[],N_n,...pe];return o&&typeof o=="function"&&ie.push(er.updateListener.of(o)),ie=ie.concat(l),Y.useLayoutEffect(()=>{if(V&&!q){var Ce={doc:e,selection:r,extensions:ie},Oe=F?ei.fromJSON(F.json,Ce,F.fields):ei.create(Ce);if(ne(Oe),!G){var Ee=new er({state:Oe,parent:V,root:N});H(Ee),a&&a(Ee,Oe)}}return()=>{G&&(ne(void 0),H(void 0))}},[V,q]),Y.useEffect(()=>{t.container&&z(t.container)},[t.container]),Y.useEffect(()=>()=>{G&&(G.destroy(),H(void 0)),X.current&&(X.current.cancel(),X.current=null)},[G]),Y.useEffect(()=>{u&&G&&G.focus()},[u,G]),Y.useEffect(()=>{G&&G.dispatch({effects:on.reconfigure.of(ie)})},[h,l,p,m,y,x,A,T,O,_,L,D,I,n,o]),Y.useEffect(()=>{if(e!==void 0){var Ce=G?G.state.doc.toString():"";if(G&&e!==Ce){var Oe=X.current&&!X.current.isDone,Ee=()=>{G&&e!==G.state.doc.toString()&&G.dispatch({changes:{from:0,to:G.state.doc.toString().length,insert:e||""},annotations:[QIt.of(!0)]})};Oe?J.current=Ee:Ee()}}},[e,G]),{state:q,setState:ne,view:G,setView:H,container:V,setContainer:z}}var U_n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],aTe=Y.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,d=t.onCreateEditor,h=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,O=t.readOnly,E=t.root,_=t.initialState,P=bOn(t,U_n),L=Y.useRef(null),R=z_n({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:O,selection:a,onChange:l,onStatistics:u,onCreateEditor:d,onUpdate:h,extensions:s,initialState:_}),D=R.state,M=R.view,I=R.container,N=R.setContainer;Y.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,I,D,M]);var F=Y.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 Q.jsx("div",BSe({ref:F,className:""+B+(r?" "+r:"")},P))});aTe.displayName="CodeMirror";function sJ(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")?[SAe.define(yOn)]:n==="py"||n==="pyi"?[Ekn()]:["ts","tsx","mts","cts"].includes(n??"")?[HAe({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[HAe({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[JAn()]:n==="yaml"||n==="yml"?[iOn()]:["md","markdown"].includes(n??"")?[lCn()]:[]}function V_n({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 d=Y.useMemo(()=>[...sJ(e),...a===1?[]:[K4t({formatNumber:h=>String(h+a-1)})],...u??[]],[a,e,u]);return Q.jsx(aTe,{value:t,height:o,minHeight:s,maxHeight:l,theme:i,extensions:d,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const G_n=Object.freeze(Object.defineProperty({__proto__:null,default:V_n,languageFor:sJ},Symbol.toStringTag,{value:"Module"}));class Gs{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Gs(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function _C(t,e,r,n,i,a){if(t==n)return[];let o=cTe(t,e,r,n,i,a),s=uTe(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 Gs(e,r,i,a)];if(l>u){let h=t.slice(e,r).indexOf(n.slice(i,a));if(h>-1)return[new Gs(e,e+h,i,i),new Gs(e+h+u,r,a,a)]}else if(u>l){let h=n.slice(i,a).indexOf(t.slice(e,r));if(h>-1)return[new Gs(e,e,i,i+h),new Gs(r,r,i+h+l,a)]}if(l==1||u==1)return[new Gs(e,r,i,a)];let d=YIt(t,e,r,n,i,a);if(d){let[h,f,p]=d;return _C(t,e,h,n,i,f).concat(_C(t,h+p,r,n,f+p,a))}return Q_n(t,e,r,n,i,a)}let TF=1e9,CF=0,oTe=!1;function Q_n(t,e,r,n,i,a){let o=r-e,s=a-i;if(TF<1e9&&Math.min(o,s)>TF*16||CF>0&&Date.now()>CF)return Math.min(o,s)>TF*64?[new Gs(e,r,i,a)]:qIt(t,e,r,n,i,a);let l=Math.ceil((o+s)/2);sTe.reset(l),lTe.reset(l);let u=(p,g)=>t.charCodeAt(e+p)==n.charCodeAt(i+g),d=(p,g)=>t.charCodeAt(r-p-1)==n.charCodeAt(a-g-1),h=(o-s)%2!=0?lTe:null,f=h?null:sTe;for(let p=0;pTF||CF>0&&!(p&63)&&Date.now()>CF)return qIt(t,e,r,n,i,a);let g=sTe.advance(p,o,s,l,h,!1,u)||lTe.advance(p,o,s,l,f,!0,d);if(g)return H_n(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Gs(e,r,i,a)]}class HIt{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(h>n)this.start+=2;else if(a){let f=i+(r-n)-l;if(f>=0&&f=r-d)return[p,i+p-f]}else{let p=r-a.vec[f];if(d>=p)return[d,h]}}}return null}}const sTe=new HIt,lTe=new HIt;function H_n(t,e,r,n,i,a,o,s){let l=!1;return!S4(t,n)&&++n==r&&(l=!0),!S4(i,s)&&++s==o&&(l=!0),l?[new Gs(e,r,a,o)]:_C(t,e,n,i,a,s).concat(_C(t,n,r,i,s,o))}function WIt(t,e){let r=1,n=Math.min(t,e);for(;rr||d>a||t.slice(s,u)!=n.slice(l,d)){if(o==1)return s-e-(S4(t,s)?0:1);o=o>>1}else{if(u==r||d==a)return u-e;s=u,l=d}}}function uTe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let o=WIt(r-e,a-i);for(let s=r,l=a;;){let u=s-o,d=l-o;if(u>1}else{if(u==e||d==i)return r-u;s=u,l=d}}}function dTe(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(d,h),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=cTe(t,h,r,n,i+p+f.length,a),m=uTe(t,e,d,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function YIt(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 Gs(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function W_n(t,e,r){for(;;){jIt(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,d=l-a.toA,h=tPt(e,a.fromA,u),f=ePt(e,a.toA,d),p=a.fromA-h,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(h,a.fromA)==v.slice(b-p,b)?(a=t[i]=new Gs(h,h+o,a.fromB-p,a.toB-p),h=a.fromA,f=ePt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Gs(f-o,f,a.fromB+g,a.toB+g),f=a.toA,h=tPt(e,a.fromA,a.fromA-n)),p=a.fromA-h,g=f-a.toA}if(p||g)a=t[i]=new Gs(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(o){if(!s){let m=nPt(e,a.fromA,a.toA),v,y=m<0?-1:rPt(e,a.toA,a.fromA);m>-1&&(v=m-a.fromA)<=d&&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=nPt(r,a.fromB,a.toB),v,y=m<0?-1:rPt(r,a.toB,a.fromB);m>-1&&(v=m-a.fromB)<=d&&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 jIt(t,3),t}let RC;try{RC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function XIt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function KIt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?XIt(r)?1:0:RC?!iPt(r)||e==t.length-1?RC.test(String.fromCharCode(r))?1:0:RC.test(t.slice(e,e+2))?2:0:0}function ZIt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?XIt(r)?1:0:RC?!aPt(r)||e==1?RC.test(String.fromCharCode(r))?1:0:RC.test(t.slice(e-2,e))?2:0:0}const JIt=8;function ePt(t,e,r){if(e==t.length||!ZIt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=o}return e}function tPt(t,e,r){if(!e||!KIt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,aPt=t=>t>=56320&&t<=57343;function S4(t,e){return!e||e==t.length||!iPt(t.charCodeAt(e-1))||!aPt(t.charCodeAt(e))}function q_n(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(TF=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,CF=r!=null&&r.timeout?Date.now()+r.timeout:0,oTe=!1,W_n(t,e,_C(t,0,t.length,e,0,e.length)))}function oPt(){return!oTe}function sPt(t,e,r){return Y_n(q_n(t,e,r),t,e)}const Jd=vr.define({combine:t=>t[0]}),hTe=on.define(),lPt=vr.define(),ju=Ko.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(hTe)&&(t=r.value);for(let r of e.state.facet(lPt))t=r(t,e);return t}});class D1{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 D1(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=sPt(e.toString(),r.toString(),n);return dPt(i,e,r,0,0,oPt())}static updateA(e,r,n,i,a){return pPt(fPt(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return pPt(fPt(e,i,!1,r.length),e,r,n,a)}}function cPt(t,e,r,n){let i=r.lineAt(t),a=n.lineAt(e);return i.to==t&&a.to==e&&th+1&&v>f+1)break;p.push(g.offset(-u+n,-d+i)),[h,f]=uPt(g.toA+n,g.toB+i,e,r),s++}o.push(new D1(p,u,Math.max(u,h),d,Math.max(d,f),a))}return o}const lJ=1e3;function hPt(t,e,r,n){let i=0,a=t.length;for(;;){if(i==a){let d=0,h=0;i&&({toA:d,toB:h}=t[i-1]);let f=e-(r?d:h);return[d+f,h+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 fPt(t,e,r,n){let i=[];return e.iterChangedRanges((a,o,s,l)=>{let u=0,d=r?e.length:n,h=0,f=r?n:e.length;a>lJ&&([u,h]=hPt(t,a-lJ,r,!0)),o=u?i[i.length-1]={fromA:g.fromA,fromB:g.fromB,toA:d,toB:f,diffA:g.diffA+m,diffB:g.diffB+v}:i.push({fromA:u,toA:d,fromB:h,toB:f,diffA:m,diffB:v})}),i}function pPt(t,e,r,n,i){if(!t.length)return e;let a=[];for(let o=0,s=0,l=0,u=0;;o++){let d=o==t.length?null:t[o],h=d?d.fromA+s:r.length,f=d?d.fromB+l:n.length;for(;uh||v.toB+l>f))break;a.push(v.offset(s,l)),u++}if(!d)break;let p=d.toA+s+d.diffA,g=d.toB+l+d.diffB,m=sPt(r.sliceString(h,p),n.sliceString(f,g),i);for(let v of dPt(m,r,n,h,f,oPt()))a.push(v);for(s+=d.diffA,l+=d.diffB;up&&v.fromB+l>g)break;u++}}return a}const gPt={scanLimit:500},cJ=Ro.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=bPt(t))}update(t){(t.docChanged||t.viewportChanged||j_n(t.startState,t.state)||X_n(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=bPt(t.view))}},{decorations:t=>t.deco}),uJ=Jh.low(lAe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(cJ))===null||e===void 0?void 0:e.gutter)||ti.empty}}));function j_n(t,e){return t.field(ju,!1)!=e.field(ju,!1)}function X_n(t,e){return t.facet(Jd)!=e.facet(Jd)}const mPt=Ar.line({class:"cm-changedLine"}),vPt=Ar.mark({class:"cm-changedText"}),K_n=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),Z_n=Ar.mark({tagName:"del",class:"cm-deletedLine"}),yPt=new class extends Ap{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function J_n(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,mPt),i.add(o,s,r?Z_n:K_n),a&&a.add(o,o,yPt);for(let u=e.iterRange(o,s-1),d=o;!u.next().done;){if(u.lineBreak){d++,i.add(d,d,mPt),a&&a.add(d,d,yPt);continue}let h=d+u.value.length;if(n)for(;l=d)break;(o?h.toA:h.toB)>u&&(!a||!a(t.state,h,s,l))&&J_n(h,t.state.doc,o,n,s,l)}return{deco:s.finish(),gutter:l&&l.finish()}}class dJ extends Wu{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 hJ=on.define({map:(t,e)=>t.map(e)}),kF=Ko.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(hJ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),fJ=.01;function xPt(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 e5n(t,e,r){let n=new Qu,i=new Qu,a=t.state.field(kF).iter(),o=e.state.field(kF).iter(),s=0,l=0,u=0,d=0,h=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vfJ&&(d+=S,i.add(l,l,Ar.widget({widget:new dJ(S),block:!0,side:-1})))}if(b>s+1e3&&sh.from&&lf.from){let w=Math.min(h.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.fromfJ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new dJ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();xPt(g,t.state.field(kF))||t.dispatch({effects:hJ.of(g)}),xPt(m,e.state.field(kF))||e.dispatch({effects:hJ.of(m)})}const fTe=on.define({map:(t,e)=>e.mapPos(t)});class t5n extends Wu{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:fTe.of(i)});let{side:a,sibling:o}=e.state.facet(Jd);o&&o().dispatch({effects:fTe.of(r5n(i,e.state.field(ju),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function r5n(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 n5n=Ko.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(fTe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(ju)!=e.startState.field(ju,!1)){let r=e.state.facet(Jd).side=="a",n=[];for(let i of e.state.field(ju))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 pTe({margin:t=3,minSize:e=4}){return n5n.init(r=>i5n(r,t,e))}function i5n(t,e,r){let n=new Qu,i=t.facet(Jd).side=="a",a=t.field(ju),o=1;for(let s=0;;s++){let l=s=r&&n.add(t.doc.line(u).from,t.doc.line(d).to,Ar.replace({widget:new t5n(h),block:!0})),!l)break;o=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const a5n=er.styleModule.of(new p1({".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"}})),wPt=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"}}),APt=new HR,pJ=new HR;class o5n{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||gPt;let r=[Jh.low(cJ),wPt,a5n,kF,er.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(p=>p.is(hJ)))&&this.measure()})],n=[Jd.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(uJ);let i=ei.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),pJ.of(n),r]}),a=[Jd.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(uJ);let o=ei.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),pJ.of(a),r]});this.chunks=D1.build(i.doc,o.doc,this.diffConf);let s=[ju.init(()=>this.chunks),APt.of(e.collapseUnchanged?pTe(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 d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:d),this.editorDOM.appendChild(l=="a-b"?d:u),this.a=new er({state:i,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new er({state:o,parent:d,root:e.root,dispatchTransactions:h=>this.dispatch(h,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?D1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):D1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:hTe.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:hTe.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(Jd),l=n?e.gutter!==!1:s.markGutter,u=r?e.highlightChanges!==!1:s.highlightChanges;a.push(pJ.reconfigure([Jd.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?uJ:[]])),o.push(pJ.reconfigure([Jd.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?uJ:[]]))}if(i){let s=APt.reconfigure(e.collapseUnchanged?pTe(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(){e5n(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 SPt(t){let e=t.nextSibling;return t.remove(),e}const s5n=new class extends Ap{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},l5n=Jh.low(lAe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(cJ))===null||e===void 0?void 0:e.gutter)||ti.empty},widgetMarker:(t,e)=>e instanceof CPt?s5n:null}));function c5n(t){var e;let r=typeof t.original=="string"?Ai.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||gPt;return[Jh.low(cJ),f5n,wPt,er.editorAttributes.of({class:"cm-merge-b"}),lPt.of((i,a)=>{let o=a.effects.find(s=>s.is(gTe));return o&&(i=D1.updateA(i,o.value.doc,a.startState.doc,o.value.changes,n)),a.docChanged&&(i=D1.updateB(i,a.state.field(T4),a.newDoc,a.changes,n)),i}),Jd.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:v5n,side:"b"}),T4.init(()=>r),t.gutter!==!1?l5n:[],t.collapseUnchanged?pTe(t.collapseUnchanged):[],ju.init(i=>D1.build(r,i.doc,n))]}const gTe=on.define(),T4=Ko.define({create:()=>Ai.empty,update(t,e){for(let r of e.effects)r.is(gTe)&&(t=r.value.doc);return t}}),TPt=new WeakMap;class CPt extends Wu{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 u5n(t,e,r){let n=TPt.get(e.changes);if(n)return n;let i=o=>{let{highlightChanges:s,syntaxHighlightDeletions:l,syntaxHighlightDeletionsMaxLength:u,mergeControls:d}=t.facet(Jd),h=document.createElement("div");if(h.className="cm-deletedChunk",d){let w=h.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let A=T=>{T.preventDefault(),d5n(o,o.posAtDOM(h))},S=T=>{T.preventDefault(),h5n(o,o.posAtDOM(h))};if(typeof d=="function")w.appendChild(d("accept",A)),w.appendChild(d("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 h;let f=o.state.field(T4).sliceString(e.fromA,e.endA),p=l&&t.facet(x1),g=b(),m=e.changes,v=0,y=!1;function b(){let w=h.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function x(w,A,S){for(let T=w;T{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 w4(t,e,r,n){let i;return t.wholeWord&&(i=YEn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=WEn(t.test,e,i)),new y4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function YEn(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=w4(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 jEn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function A4(t,e,r,n){let i;return t.wholeWord&&(i=XEn(e.charCategorizer(e.selection.main.head))),t.test&&(i=jEn(t.test,e,i)),new vIt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function JZ(t,e){return t.slice(Vl(t,e,!1),e)}function eJ(t,e){return t.slice(e,Vl(t,e))}function XEn(t){return(e,r,n)=>!n[0].length||(t(JZ(n.input,n.index))!=Ao.Word||t(eJ(n.input,n.index))!=Ao.Word)&&(t(eJ(n.input,n.index+n[0].length))!=Ao.Word||t(JZ(n.input,n.index+n[0].length))!=Ao.Word)}class KEn extends wIt{nextMatch(e,r,n){let i=A4(this.spec,e,n,e.doc.length).next();return i.done&&(i=A4(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=A4(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=A4(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 xF=on.define(),qSe=on.define(),Uw=Ko.define({create(t){return new jSe(KSe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(xF)?t=new jSe(r.value.create(),t.panel):r.is(qSe)&&(t=new jSe(t.query,r.value?XSe:null));return t},provide:t=>H$.from(t,e=>e.panel)});class jSe{constructor(e,r){this.query=e,this.panel=r}}const ZEn=Ar.mark({class:"cm-searchMatch"}),JEn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),e_n=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Uw))}update(t){let e=t.state.field(Uw);(e!=t.startState.field(Uw)||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,d)=>{let h=r.state.selection.ranges.some(f=>f.from==u&&f.to==d);n.add(u,d,h?JEn:ZEn)})}return n.finish()}},{decorations:t=>t.decorations});function wF(t){return e=>{let r=e.state.field(Uw,!1);return r&&r.query.spec.valid?t(e,r):CIt(e)}}const tJ=wF((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(x4);return t.dispatch({selection:i,effects:[ZSe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),TIt(t),!0}),rJ=wF((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(x4);return t.dispatch({selection:a,effects:[ZSe(t,i),o.scrollToMatch(a.main,t)],userEvent:"select.search"}),TIt(t),!0}),t_n=wF((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)}),r_n=({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 y4(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},AIt=wF((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,d=[];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),d.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):o=e.nextMatch(r,o.from,o.to);let h=t.state.changes(s);return o&&(l=xt.single(o.from,o.to).map(h),d.push(ZSe(t,o)),d.push(r.facet(x4).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:d,userEvent:"input.replace"}),!0}),n_n=wF((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 XSe(t){return t.state.facet(x4).createPanel(t)}function KSe(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(x4);return new xIt({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 SIt(t){let e=oAe(t,XSe);return e&&e.dom.querySelector("[main-field]")}function TIt(t){let e=SIt(t);e&&e==t.root.activeElement&&e.select()}const CIt=t=>{let e=t.state.field(Uw,!1);if(e&&e.panel){let r=SIt(t);if(r&&r!=t.root.activeElement){let n=KSe(t.state,e.query.spec);n.valid&&t.dispatch({effects:xF.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[qSe.of(!0),e?xF.of(KSe(t.state,e.query.spec)):on.appendConfig.of(s_n)]});return!0},kIt=t=>{let e=t.state.field(Uw,!1);if(!e||!e.panel)return!1;let r=oAe(t,XSe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:qSe.of(!1)}),!0},i_n=[{key:"Mod-f",run:CIt,scope:"editor search-panel"},{key:"F3",run:tJ,shift:rJ,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tJ,shift:rJ,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kIt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:r_n},{key:"Mod-Alt-g",run:IEn},{key:"Mod-d",run:HEn,preventDefault:!0}];class a_n{constructor(e){this.view=e;let r=this.query=e.state.field(Uw).query.spec;this.commit=this.commit.bind(this),this.searchField=xa("input",{value:r.search,placeholder:of(e,"Find"),"aria-label":of(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:of(e,"Replace"),"aria-label":of(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",()=>tJ(e),[of(e,"next")]),n("prev",()=>rJ(e),[of(e,"previous")]),n("select",()=>t_n(e),[of(e,"all")]),xa("label",null,[this.caseField,of(e,"match case")]),xa("label",null,[this.reField,of(e,"regexp")]),xa("label",null,[this.wordField,of(e,"by word")]),...e.state.readOnly?[]:[xa("br"),this.replaceField,n("replace",()=>AIt(e),[of(e,"replace")]),n("replaceAll",()=>n_n(e),[of(e,"replace all")])],xa("button",{name:"close",onclick:()=>kIt(e),"aria-label":of(e,"close"),type:"button"},["×"])])}commit(){let e=new xIt({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:xF.of(e)}))}keydown(e){hxn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?rJ:tJ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),AIt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(xF)&&!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(x4).top}}function of(t,e){return t.state.phrase(e)}const nJ=30,iJ=/[\s\.,:;?!]/;function ZSe(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-nJ),o=Math.min(i,r+nJ),s=t.state.sliceDoc(a,o);if(a!=n.from){for(let l=0;ls.length-nJ;l--)if(!iJ.test(s[l-1])&&iJ.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 o_n=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"}}),s_n=[Uw,Jh.low(e_n),o_n];class OIt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class EC{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(AF).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(),d=0,h=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>h)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,h);let y=!1;if(s.some(x=>x.from==m&&(x.to==v||v==h))&&(y=m==v,!y&&v-m<10)){let x=m-(d+u.value.length);x>0&&(u.next(x),d=m);for(let w=m;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let b=b_n(s);if(y)o.add(m,m,Ar.widget({widget:new g_n(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==h)break;for(let x=0;x{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new OIt(i,a,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new OIt(n.from,a,n.diagnostic)}}),n}function l_n(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(AF).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(EIt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function c_n(t,e){return t.field(sf,!1)?e:e.concat(on.appendConfig.of(x_n))}const EIt=on.define(),JSe=on.define(),_It=on.define(),sf=Ko.define({create(){return new EC(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=Vw(r,t.selected.diagnostic,a)||Vw(r,null,a)}!r.size&&i&&e.state.facet(AF).autoPanel&&(i=null),t=new EC(r,i,n)}for(let r of e.effects)if(r.is(EIt)){let n=e.state.facet(AF).autoPanel?r.value.length?SF.open:null:t.panel;t=EC.init(r.value,n,e.state)}else r.is(JSe)?t=new EC(t.diagnostics,r.value?SF.open:null,t.selected):r.is(_It)&&(t=new EC(t.diagnostics,t.panel,r.value));return t},provide:t=>[H$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),u_n=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function d_n(t,e,r){let{diagnostics:n}=t.state.field(sf),i,a=-1,o=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(l,u,{spec:d})=>{if(e>=l&&e<=u&&(l==u||(e>l||r>0)&&(eMIt(t,r,!1)))}const f_n=t=>{let e=t.state.field(sf,!1);(!e||!e.panel)&&t.dispatch({effects:c_n(t.state,[JSe.of(!0)])});let r=oAe(t,SF.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},RIt=t=>{let e=t.state.field(sf,!1);return!e||!e.panel?!1:(t.dispatch({effects:JSe.of(!1)}),!0)},p_n=[{key:"Mod-Shift-m",run:f_n,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(sf,!1);if(!e)return!1;let r=t.state.selection.main,n=Vw(e.diagnostics,null,r.to+1);return!n&&(n=Vw(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}),twn(t,n.from,1,{tooltip:PIt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],AF=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...R0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:DIt,tooltipFilter:DIt,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 DIt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function LIt(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 MIt(t,e,r){var n;let i=r?LIt(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=Vw(t.state.field(sf).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,d=i[o]?u.indexOf(i[o]):-1,h=d<0?u:[u.slice(0,d),xa("u",u.slice(d,d+1)),u.slice(d+1)],f=a.markClass?" "+a.markClass:"";return xa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${d<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&xa("div",{class:"cm-diagnosticSource"},e.source))}class g_n extends Wu{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 IIt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=MIt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SF{constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)RIt(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=LIt(a.actions);for(let s=0;s{for(let a=0;aRIt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(sf).selected;if(!e)return-1;for(let r=0;r{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let h=-1,f;for(let p=n;pn&&(this.items.splice(n,h-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(sf),n=Vw(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:_It.of(n)})}static open(e){return new SF(e)}}function m_n(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function aJ(t){return m_n(``,'width="6" height="3"')}const v_n=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:aJ("#f11")},".cm-lintRange-warning":{backgroundImage:aJ("orange")},".cm-lintRange-info":{backgroundImage:aJ("#999")},".cm-lintRange-hint":{backgroundImage:aJ("#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 y_n(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function b_n(t){let e="hint",r=1;for(let n of t){let i=y_n(n.severity);i>r&&(r=i,e=n.severity)}return e}const PIt=ewn(d_n,{hideOn:l_n}),x_n=[sf,er.decorations.compute([sf],t=>{let{selected:e,panel:r}=t.field(sf);return!e||!r||e.from==e.to?Ar.none:Ar.set([u_n.range(e.from,e.to)])}),PIt,v_n];var eTe=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(MAn)),e.defaultKeymap!==!1&&(a=a.concat(DEn)),e.searchKeymap!==!1&&(a=a.concat(i_n)),e.historyKeymap!==!1&&(a=a.concat($On)),e.foldKeymap!==!1&&(a=a.concat(zwn)),e.completionKeymap!==!1&&(a=a.concat(cDt)),e.lintKeymap!==!1&&(a=a.concat(p_n));var o=[];return e.lineNumbers!==!1&&o.push(K4t()),e.highlightActiveLineGutter!==!1&&o.push(gwn()),e.highlightSpecialChars!==!1&&o.push(_xn()),e.history!==!1&&o.push(_On()),e.foldGutter!==!1&&o.push(Qwn()),e.drawSelection!==!1&&o.push(yxn()),e.dropCursor!==!1&&o.push(Sxn()),e.allowMultipleSelections!==!1&&o.push(ei.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(Iwn()),e.syntaxHighlighting!==!1&&o.push(x3t(jwn,{fallback:!0})),e.bracketMatching!==!1&&o.push(t2n()),e.closeBrackets!==!1&&o.push(RAn()),e.autocompletion!==!1&&o.push(zAn()),e.rectangularSelection!==!1&&o.push(Gxn()),i!==!1&&o.push(Wxn()),e.highlightActiveLine!==!1&&o.push(Pxn()),e.highlightSelectionMatches!==!1&&o.push(BEn()),e.tabSize&&typeof e.tabSize=="number"&&o.push(a4.of(" ".repeat(e.tabSize))),o.concat([t4.of(a.flat())]).filter(Boolean)};const w_n="#e5c07b",NIt="#e06c75",A_n="#56b6c2",S_n="#ffffff",oJ="#abb2bf",tTe="#7d8799",T_n="#61afef",C_n="#98c379",BIt="#d19a66",k_n="#c678dd",O_n="#21252b",$It="#2c313a",FIt="#282c34",rTe="#353a42",E_n="#3E4451",zIt="#528bff",__n=er.theme({"&":{color:oJ,backgroundColor:FIt},".cm-content":{caretColor:zIt},".cm-cursor, .cm-dropCursor":{borderLeftColor:zIt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:E_n},".cm-panels":{backgroundColor:O_n,color:oJ},".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:FIt,color:tTe,border:"none"},".cm-activeLineGutter":{backgroundColor:$It},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:rTe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:rTe,borderBottomColor:rTe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$It,color:oJ}}},{dark:!0}),R_n=J$.define([{tag:Re.keyword,color:k_n},{tag:[Re.name,Re.deleted,Re.character,Re.propertyName,Re.macroName],color:NIt},{tag:[Re.function(Re.variableName),Re.labelName],color:T_n},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name)],color:BIt},{tag:[Re.definition(Re.name),Re.separator],color:oJ},{tag:[Re.typeName,Re.className,Re.number,Re.changed,Re.annotation,Re.modifier,Re.self,Re.namespace],color:w_n},{tag:[Re.operator,Re.operatorKeyword,Re.url,Re.escape,Re.regexp,Re.link,Re.special(Re.string)],color:A_n},{tag:[Re.meta,Re.comment],color:tTe},{tag:Re.strong,fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.link,color:tTe,textDecoration:"underline"},{tag:Re.heading,fontWeight:"bold",color:NIt},{tag:[Re.atom,Re.bool,Re.special(Re.variableName)],color:BIt},{tag:[Re.processingInstruction,Re.string,Re.inserted],color:C_n},{tag:Re.invalid,color:S_n}]),UIt=[__n,x3t(R_n)];var D_n=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),L_n=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,d=u===void 0?"light":u,h=r.placeholder,f=h===void 0?"":h,p=r.basicSetup,g=p===void 0?!0:p,m=[];switch(i&&m.unshift(t4.of([LEn])),g&&(typeof g=="boolean"?m.unshift(eTe()):m.unshift(eTe(g))),f&&m.unshift(Fxn(f)),d){case"light":m.push(D_n);break;case"dark":m.push(UIt);break;case"none":break;default:m.push(d);break}return o===!1&&m.push(er.editable.of(!1)),l&&m.push(ei.readOnly.of(!0)),[...m]},M_n=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 I_n{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 VIt{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 nTe=null,P_n=()=>typeof window>"u"?new VIt:(nTe||(nTe=new VIt),nTe),N_n=er.theme({"& .cm-scroller":{height:"100% !important"}}),GIt=null,iTe=null;function B_n(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===GIt||(GIt=o,iTe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),iTe}var QIt=_0.define(),$_n=200,F_n=[];function z_n(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?F_n:s,u=t.autoFocus,d=t.theme,h=d===void 0?"light":d,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,O=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=Y.useState(),V=B[0],z=B[1],U=Y.useState(),G=U[0],H=U[1],j=Y.useState(),q=j[0],ne=j[1],X=Y.useState(()=>({current:null}))[0],J=Y.useState(()=>({current:null}))[0],ee=B_n(p,m,y,x,A,T),te=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(ue=>ue.annotation(QIt))){X.current?X.current.reset():(X.current=new I_n(()=>{if(J.current){var ue=J.current;J.current=null,ue()}X.current=null},$_n),P_n().add(X.current));var Oe=Ce.state.doc,Ee=Oe.toString();n(Ee,Ce)}i&&i(M_n(Ce))}),pe=L_n({theme:h,editable:_,readOnly:L,placeholder:O,indentWithTab:D,basicSetup:I}),ie=[te,...ee?[ee]:[],N_n,...pe];return o&&typeof o=="function"&&ie.push(er.updateListener.of(o)),ie=ie.concat(l),Y.useLayoutEffect(()=>{if(V&&!q){var Ce={doc:e,selection:r,extensions:ie},Oe=F?ei.fromJSON(F.json,Ce,F.fields):ei.create(Ce);if(ne(Oe),!G){var Ee=new er({state:Oe,parent:V,root:N});H(Ee),a&&a(Ee,Oe)}}return()=>{G&&(ne(void 0),H(void 0))}},[V,q]),Y.useEffect(()=>{t.container&&z(t.container)},[t.container]),Y.useEffect(()=>()=>{G&&(G.destroy(),H(void 0)),X.current&&(X.current.cancel(),X.current=null)},[G]),Y.useEffect(()=>{u&&G&&G.focus()},[u,G]),Y.useEffect(()=>{G&&G.dispatch({effects:on.reconfigure.of(ie)})},[h,l,p,m,y,x,A,T,O,_,L,D,I,n,o]),Y.useEffect(()=>{if(e!==void 0){var Ce=G?G.state.doc.toString():"";if(G&&e!==Ce){var Oe=X.current&&!X.current.isDone,Ee=()=>{G&&e!==G.state.doc.toString()&&G.dispatch({changes:{from:0,to:G.state.doc.toString().length,insert:e||""},annotations:[QIt.of(!0)]})};Oe?J.current=Ee:Ee()}}},[e,G]),{state:q,setState:ne,view:G,setView:H,container:V,setContainer:z}}var U_n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],aTe=Y.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,d=t.onCreateEditor,h=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,O=t.readOnly,E=t.root,_=t.initialState,P=bOn(t,U_n),L=Y.useRef(null),R=z_n({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:O,selection:a,onChange:l,onStatistics:u,onCreateEditor:d,onUpdate:h,extensions:s,initialState:_}),D=R.state,M=R.view,I=R.container,N=R.setContainer;Y.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,I,D,M]);var F=Y.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 Q.jsx("div",BSe({ref:F,className:""+B+(r?" "+r:"")},P))});aTe.displayName="CodeMirror";function sJ(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")?[SAe.define(yOn)]:n==="py"||n==="pyi"?[Ekn()]:["ts","tsx","mts","cts"].includes(n??"")?[HAe({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[HAe({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[JAn()]:n==="yaml"||n==="yml"?[iOn()]:["md","markdown"].includes(n??"")?[lCn()]:[]}function V_n({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 d=Y.useMemo(()=>[...sJ(e),...a===1?[]:[K4t({formatNumber:h=>String(h+a-1)})],...u??[]],[a,e,u]);return Q.jsx(aTe,{value:t,height:o,minHeight:s,maxHeight:l,theme:i,extensions:d,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const G_n=Object.freeze(Object.defineProperty({__proto__:null,default:V_n,languageFor:sJ},Symbol.toStringTag,{value:"Module"}));class Gs{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Gs(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function _C(t,e,r,n,i,a){if(t==n)return[];let o=cTe(t,e,r,n,i,a),s=uTe(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 Gs(e,r,i,a)];if(l>u){let h=t.slice(e,r).indexOf(n.slice(i,a));if(h>-1)return[new Gs(e,e+h,i,i),new Gs(e+h+u,r,a,a)]}else if(u>l){let h=n.slice(i,a).indexOf(t.slice(e,r));if(h>-1)return[new Gs(e,e,i,i+h),new Gs(r,r,i+h+l,a)]}if(l==1||u==1)return[new Gs(e,r,i,a)];let d=YIt(t,e,r,n,i,a);if(d){let[h,f,p]=d;return _C(t,e,h,n,i,f).concat(_C(t,h+p,r,n,f+p,a))}return Q_n(t,e,r,n,i,a)}let TF=1e9,CF=0,oTe=!1;function Q_n(t,e,r,n,i,a){let o=r-e,s=a-i;if(TF<1e9&&Math.min(o,s)>TF*16||CF>0&&Date.now()>CF)return Math.min(o,s)>TF*64?[new Gs(e,r,i,a)]:qIt(t,e,r,n,i,a);let l=Math.ceil((o+s)/2);sTe.reset(l),lTe.reset(l);let u=(p,g)=>t.charCodeAt(e+p)==n.charCodeAt(i+g),d=(p,g)=>t.charCodeAt(r-p-1)==n.charCodeAt(a-g-1),h=(o-s)%2!=0?lTe:null,f=h?null:sTe;for(let p=0;pTF||CF>0&&!(p&63)&&Date.now()>CF)return qIt(t,e,r,n,i,a);let g=sTe.advance(p,o,s,l,h,!1,u)||lTe.advance(p,o,s,l,f,!0,d);if(g)return H_n(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Gs(e,r,i,a)]}class HIt{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(h>n)this.start+=2;else if(a){let f=i+(r-n)-l;if(f>=0&&f=r-d)return[p,i+p-f]}else{let p=r-a.vec[f];if(d>=p)return[d,h]}}}return null}}const sTe=new HIt,lTe=new HIt;function H_n(t,e,r,n,i,a,o,s){let l=!1;return!S4(t,n)&&++n==r&&(l=!0),!S4(i,s)&&++s==o&&(l=!0),l?[new Gs(e,r,a,o)]:_C(t,e,n,i,a,s).concat(_C(t,n,r,i,s,o))}function WIt(t,e){let r=1,n=Math.min(t,e);for(;rr||d>a||t.slice(s,u)!=n.slice(l,d)){if(o==1)return s-e-(S4(t,s)?0:1);o=o>>1}else{if(u==r||d==a)return u-e;s=u,l=d}}}function uTe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let o=WIt(r-e,a-i);for(let s=r,l=a;;){let u=s-o,d=l-o;if(u>1}else{if(u==e||d==i)return r-u;s=u,l=d}}}function dTe(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(d,h),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=cTe(t,h,r,n,i+p+f.length,a),m=uTe(t,e,d,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function YIt(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 Gs(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function W_n(t,e,r){for(;;){jIt(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,d=l-a.toA,h=tPt(e,a.fromA,u),f=ePt(e,a.toA,d),p=a.fromA-h,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(h,a.fromA)==v.slice(b-p,b)?(a=t[i]=new Gs(h,h+o,a.fromB-p,a.toB-p),h=a.fromA,f=ePt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Gs(f-o,f,a.fromB+g,a.toB+g),f=a.toA,h=tPt(e,a.fromA,a.fromA-n)),p=a.fromA-h,g=f-a.toA}if(p||g)a=t[i]=new Gs(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(o){if(!s){let m=nPt(e,a.fromA,a.toA),v,y=m<0?-1:rPt(e,a.toA,a.fromA);m>-1&&(v=m-a.fromA)<=d&&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=nPt(r,a.fromB,a.toB),v,y=m<0?-1:rPt(r,a.toB,a.fromB);m>-1&&(v=m-a.fromB)<=d&&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 jIt(t,3),t}let RC;try{RC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function XIt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function KIt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?XIt(r)?1:0:RC?!iPt(r)||e==t.length-1?RC.test(String.fromCharCode(r))?1:0:RC.test(t.slice(e,e+2))?2:0:0}function ZIt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?XIt(r)?1:0:RC?!aPt(r)||e==1?RC.test(String.fromCharCode(r))?1:0:RC.test(t.slice(e-2,e))?2:0:0}const JIt=8;function ePt(t,e,r){if(e==t.length||!ZIt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=o}return e}function tPt(t,e,r){if(!e||!KIt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,aPt=t=>t>=56320&&t<=57343;function S4(t,e){return!e||e==t.length||!iPt(t.charCodeAt(e-1))||!aPt(t.charCodeAt(e))}function q_n(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(TF=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,CF=r!=null&&r.timeout?Date.now()+r.timeout:0,oTe=!1,W_n(t,e,_C(t,0,t.length,e,0,e.length)))}function oPt(){return!oTe}function sPt(t,e,r){return Y_n(q_n(t,e,r),t,e)}const Jd=vr.define({combine:t=>t[0]}),hTe=on.define(),lPt=vr.define(),ju=Ko.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(hTe)&&(t=r.value);for(let r of e.state.facet(lPt))t=r(t,e);return t}});class D1{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 D1(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=sPt(e.toString(),r.toString(),n);return dPt(i,e,r,0,0,oPt())}static updateA(e,r,n,i,a){return pPt(fPt(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return pPt(fPt(e,i,!1,r.length),e,r,n,a)}}function cPt(t,e,r,n){let i=r.lineAt(t),a=n.lineAt(e);return i.to==t&&a.to==e&&th+1&&v>f+1)break;p.push(g.offset(-u+n,-d+i)),[h,f]=uPt(g.toA+n,g.toB+i,e,r),s++}o.push(new D1(p,u,Math.max(u,h),d,Math.max(d,f),a))}return o}const lJ=1e3;function hPt(t,e,r,n){let i=0,a=t.length;for(;;){if(i==a){let d=0,h=0;i&&({toA:d,toB:h}=t[i-1]);let f=e-(r?d:h);return[d+f,h+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 fPt(t,e,r,n){let i=[];return e.iterChangedRanges((a,o,s,l)=>{let u=0,d=r?e.length:n,h=0,f=r?n:e.length;a>lJ&&([u,h]=hPt(t,a-lJ,r,!0)),o=u?i[i.length-1]={fromA:g.fromA,fromB:g.fromB,toA:d,toB:f,diffA:g.diffA+m,diffB:g.diffB+v}:i.push({fromA:u,toA:d,fromB:h,toB:f,diffA:m,diffB:v})}),i}function pPt(t,e,r,n,i){if(!t.length)return e;let a=[];for(let o=0,s=0,l=0,u=0;;o++){let d=o==t.length?null:t[o],h=d?d.fromA+s:r.length,f=d?d.fromB+l:n.length;for(;uh||v.toB+l>f))break;a.push(v.offset(s,l)),u++}if(!d)break;let p=d.toA+s+d.diffA,g=d.toB+l+d.diffB,m=sPt(r.sliceString(h,p),n.sliceString(f,g),i);for(let v of dPt(m,r,n,h,f,oPt()))a.push(v);for(s+=d.diffA,l+=d.diffB;up&&v.fromB+l>g)break;u++}}return a}const gPt={scanLimit:500},cJ=Ro.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=bPt(t))}update(t){(t.docChanged||t.viewportChanged||j_n(t.startState,t.state)||X_n(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=bPt(t.view))}},{decorations:t=>t.deco}),uJ=Jh.low(lAe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(cJ))===null||e===void 0?void 0:e.gutter)||ti.empty}}));function j_n(t,e){return t.field(ju,!1)!=e.field(ju,!1)}function X_n(t,e){return t.facet(Jd)!=e.facet(Jd)}const mPt=Ar.line({class:"cm-changedLine"}),vPt=Ar.mark({class:"cm-changedText"}),K_n=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),Z_n=Ar.mark({tagName:"del",class:"cm-deletedLine"}),yPt=new class extends Ap{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function J_n(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,mPt),i.add(o,s,r?Z_n:K_n),a&&a.add(o,o,yPt);for(let u=e.iterRange(o,s-1),d=o;!u.next().done;){if(u.lineBreak){d++,i.add(d,d,mPt),a&&a.add(d,d,yPt);continue}let h=d+u.value.length;if(n)for(;l=d)break;(o?h.toA:h.toB)>u&&(!a||!a(t.state,h,s,l))&&J_n(h,t.state.doc,o,n,s,l)}return{deco:s.finish(),gutter:l&&l.finish()}}class dJ extends Wu{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 hJ=on.define({map:(t,e)=>t.map(e)}),kF=Ko.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(hJ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),fJ=.01;function xPt(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 eRn(t,e,r){let n=new Qu,i=new Qu,a=t.state.field(kF).iter(),o=e.state.field(kF).iter(),s=0,l=0,u=0,d=0,h=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vfJ&&(d+=S,i.add(l,l,Ar.widget({widget:new dJ(S),block:!0,side:-1})))}if(b>s+1e3&&sh.from&&lf.from){let w=Math.min(h.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.fromfJ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new dJ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();xPt(g,t.state.field(kF))||t.dispatch({effects:hJ.of(g)}),xPt(m,e.state.field(kF))||e.dispatch({effects:hJ.of(m)})}const fTe=on.define({map:(t,e)=>e.mapPos(t)});class tRn extends Wu{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:fTe.of(i)});let{side:a,sibling:o}=e.state.facet(Jd);o&&o().dispatch({effects:fTe.of(rRn(i,e.state.field(ju),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function rRn(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 nRn=Ko.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(fTe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(ju)!=e.startState.field(ju,!1)){let r=e.state.facet(Jd).side=="a",n=[];for(let i of e.state.field(ju))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 pTe({margin:t=3,minSize:e=4}){return nRn.init(r=>iRn(r,t,e))}function iRn(t,e,r){let n=new Qu,i=t.facet(Jd).side=="a",a=t.field(ju),o=1;for(let s=0;;s++){let l=s=r&&n.add(t.doc.line(u).from,t.doc.line(d).to,Ar.replace({widget:new tRn(h),block:!0})),!l)break;o=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const aRn=er.styleModule.of(new p1({".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"}})),wPt=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"}}),APt=new H5,pJ=new H5;class oRn{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||gPt;let r=[Jh.low(cJ),wPt,aRn,kF,er.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(p=>p.is(hJ)))&&this.measure()})],n=[Jd.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(uJ);let i=ei.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),pJ.of(n),r]}),a=[Jd.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(uJ);let o=ei.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),pJ.of(a),r]});this.chunks=D1.build(i.doc,o.doc,this.diffConf);let s=[ju.init(()=>this.chunks),APt.of(e.collapseUnchanged?pTe(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 d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:d),this.editorDOM.appendChild(l=="a-b"?d:u),this.a=new er({state:i,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new er({state:o,parent:d,root:e.root,dispatchTransactions:h=>this.dispatch(h,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?D1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):D1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:hTe.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:hTe.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(Jd),l=n?e.gutter!==!1:s.markGutter,u=r?e.highlightChanges!==!1:s.highlightChanges;a.push(pJ.reconfigure([Jd.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?uJ:[]])),o.push(pJ.reconfigure([Jd.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?uJ:[]]))}if(i){let s=APt.reconfigure(e.collapseUnchanged?pTe(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(){eRn(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 SPt(t){let e=t.nextSibling;return t.remove(),e}const sRn=new class extends Ap{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},lRn=Jh.low(lAe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(cJ))===null||e===void 0?void 0:e.gutter)||ti.empty},widgetMarker:(t,e)=>e instanceof CPt?sRn:null}));function cRn(t){var e;let r=typeof t.original=="string"?Ai.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||gPt;return[Jh.low(cJ),fRn,wPt,er.editorAttributes.of({class:"cm-merge-b"}),lPt.of((i,a)=>{let o=a.effects.find(s=>s.is(gTe));return o&&(i=D1.updateA(i,o.value.doc,a.startState.doc,o.value.changes,n)),a.docChanged&&(i=D1.updateB(i,a.state.field(T4),a.newDoc,a.changes,n)),i}),Jd.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:vRn,side:"b"}),T4.init(()=>r),t.gutter!==!1?lRn:[],t.collapseUnchanged?pTe(t.collapseUnchanged):[],ju.init(i=>D1.build(r,i.doc,n))]}const gTe=on.define(),T4=Ko.define({create:()=>Ai.empty,update(t,e){for(let r of e.effects)r.is(gTe)&&(t=r.value.doc);return t}}),TPt=new WeakMap;class CPt extends Wu{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 uRn(t,e,r){let n=TPt.get(e.changes);if(n)return n;let i=o=>{let{highlightChanges:s,syntaxHighlightDeletions:l,syntaxHighlightDeletionsMaxLength:u,mergeControls:d}=t.facet(Jd),h=document.createElement("div");if(h.className="cm-deletedChunk",d){let w=h.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let A=T=>{T.preventDefault(),dRn(o,o.posAtDOM(h))},S=T=>{T.preventDefault(),hRn(o,o.posAtDOM(h))};if(typeof d=="function")w.appendChild(d("accept",A)),w.appendChild(d("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 h;let f=o.state.field(T4).sliceString(e.fromA,e.endA),p=l&&t.facet(x1),g=b(),m=e.changes,v=0,y=!1;function b(){let w=h.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(O){let L=g.appendChild(document.createElement("span"));L.className=O,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;t3t(w,{style:S=>Wwn(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")),h},a=Ar.widget({block:!0,side:-1,widget:new CPt(i)});return TPt.set(e.changes,a),a}function d5n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(ju).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(T4);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:gTe.of({doc:s.apply(o),changes:s}),userEvent:"accept"}),!0}function h5n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(ju).find(s=>s.fromB<=n&&s.endB>=n);if(!i)return!1;let o=r.field(T4).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 kPt(t){let e=new Qu;for(let r of t.field(ju)){let n=t.facet(Jd).overrideChunk&&EPt(t,r);e.add(r.fromB,r.fromB,u5n(t,r,!!n))}return e.finish()}const f5n=Ko.define({create:t=>kPt(t),update(t,e){return e.state.field(ju,!1)!=e.startState.field(ju,!1)?kPt(e.state):t},provide:t=>er.decorations.from(t)}),OPt=new WeakMap;function EPt(t,e){let r=OPt.get(e);if(r!==void 0)return r;r=null;let n=t.field(T4),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,d=e.fromB;for(let h of e.changes){if(h.fromA=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const _Pt="(max-width: 760px)";function y5n(){const[t,e]=Y.useState(()=>typeof window<"u"&&window.matchMedia(_Pt).matches);return Y.useEffect(()=>{const r=window.matchMedia(_Pt),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function RPt(t,e){return[eTe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...sJ(t),ei.readOnly.of(!0),...e==="dark"?[UIt]:[]]}function b5n({before:t,after:e,path:r,theme:n}){const i=Y.useRef(null);return Y.useEffect(()=>{if(!i.current)return;const a=new o5n({a:{doc:t,extensions:RPt(r,n)},b:{doc:e,extensions:RPt(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]),Q.jsx("div",{ref:i,className:"code-browser-merge"})}function x5n(t){return y5n()?Q.jsx(aTe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...sJ(t.path),...c5n({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}}):Q.jsx(b5n,{...t})}const w5n=Object.freeze(Object.defineProperty({__proto__:null,default:x5n},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 d;a+15t.replace(A5n,"-$1").toLowerCase(),T5n={"&":"&",">":">","<":"<",'"':""","'":"'"},C5n=/[&><"']/g,du=t=>String(t).replace(C5n,e=>T5n[e]),gJ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?gJ(t.body[0]):t:t.type==="font"?gJ(t.body):t,k5n=new Set(["mathord","textord","atom"]),L1=t=>k5n.has(gJ(t).type),O5n=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"},mJ={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 E5n(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 _5n(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return E5n(e)}function R5n(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:_5n(n)}class mTe{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(mJ)){var n=mJ[r];n&&R5n(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=O5n(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Gw{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 U0[D5n[this.id]]}sub(){return U0[L5n[this.id]]}fracNum(){return U0[M5n[this.id]]}fracDen(){return U0[I5n[this.id]]}cramp(){return U0[P5n[this.id]]}text(){return U0[N5n[this.id]]}isTight(){return this.size>=2}}var vTe=0,vJ=1,C4=2,M1=3,OF=4,Op=5,k4=6,Xu=7,U0=[new Gw(vTe,0,!1),new Gw(vJ,0,!0),new Gw(C4,1,!1),new Gw(M1,1,!0),new Gw(OF,2,!1),new Gw(Op,2,!0),new Gw(k4,3,!1),new Gw(Xu,3,!0)],D5n=[OF,Op,OF,Op,k4,Xu,k4,Xu],L5n=[Op,Op,Op,Op,Xu,Xu,Xu,Xu],M5n=[C4,M1,OF,Op,k4,Xu,k4,Xu],I5n=[M1,M1,Op,Op,Xu,Xu,Xu,Xu],P5n=[vJ,vJ,M1,M1,Op,Op,Xu,Xu],N5n=[vTe,vJ,C4,M1,C4,M1,C4,M1],Nn={DISPLAY:U0[vTe],TEXT:U0[C4],SCRIPT:U0[OF],SCRIPTSCRIPT:U0[k4]},yTe=[{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 B5n(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var yJ=[];yTe.forEach(t=>t.blocks.forEach(e=>yJ.push(...e)));function DPt(t){for(var e=0;e=yJ[e]&&t<=yJ[e+1])return!0;return!1}var dl=t=>t+" "+t,O4=80,$5n=function(e,r){return"M95,"+(622+e+r)+` +`,T);if(_>-1&&_T){let P=document.createTextNode(f.slice(T,C));if(O){let L=g.appendChild(document.createElement("span"));L.className=O,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;t3t(w,{style:S=>Wwn(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")),h},a=Ar.widget({block:!0,side:-1,widget:new CPt(i)});return TPt.set(e.changes,a),a}function dRn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(ju).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(T4);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:gTe.of({doc:s.apply(o),changes:s}),userEvent:"accept"}),!0}function hRn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(ju).find(s=>s.fromB<=n&&s.endB>=n);if(!i)return!1;let o=r.field(T4).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 kPt(t){let e=new Qu;for(let r of t.field(ju)){let n=t.facet(Jd).overrideChunk&&EPt(t,r);e.add(r.fromB,r.fromB,uRn(t,r,!!n))}return e.finish()}const fRn=Ko.define({create:t=>kPt(t),update(t,e){return e.state.field(ju,!1)!=e.startState.field(ju,!1)?kPt(e.state):t},provide:t=>er.decorations.from(t)}),OPt=new WeakMap;function EPt(t,e){let r=OPt.get(e);if(r!==void 0)return r;r=null;let n=t.field(T4),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,d=e.fromB;for(let h of e.changes){if(h.fromA=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const _Pt="(max-width: 760px)";function yRn(){const[t,e]=Y.useState(()=>typeof window<"u"&&window.matchMedia(_Pt).matches);return Y.useEffect(()=>{const r=window.matchMedia(_Pt),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function RPt(t,e){return[eTe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...sJ(t),ei.readOnly.of(!0),...e==="dark"?[UIt]:[]]}function bRn({before:t,after:e,path:r,theme:n}){const i=Y.useRef(null);return Y.useEffect(()=>{if(!i.current)return;const a=new oRn({a:{doc:t,extensions:RPt(r,n)},b:{doc:e,extensions:RPt(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]),Q.jsx("div",{ref:i,className:"code-browser-merge"})}function xRn(t){return yRn()?Q.jsx(aTe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...sJ(t.path),...cRn({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}}):Q.jsx(bRn,{...t})}const wRn=Object.freeze(Object.defineProperty({__proto__:null,default:xRn},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 d;a+15t.replace(ARn,"-$1").toLowerCase(),TRn={"&":"&",">":">","<":"<",'"':""","'":"'"},CRn=/[&><"']/g,du=t=>String(t).replace(CRn,e=>TRn[e]),gJ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?gJ(t.body[0]):t:t.type==="font"?gJ(t.body):t,kRn=new Set(["mathord","textord","atom"]),L1=t=>kRn.has(gJ(t).type),ORn=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"},mJ={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 ERn(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 _Rn(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return ERn(e)}function RRn(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:_Rn(n)}class mTe{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(mJ)){var n=mJ[r];n&&RRn(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=ORn(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Gw{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 U0[DRn[this.id]]}sub(){return U0[LRn[this.id]]}fracNum(){return U0[MRn[this.id]]}fracDen(){return U0[IRn[this.id]]}cramp(){return U0[PRn[this.id]]}text(){return U0[NRn[this.id]]}isTight(){return this.size>=2}}var vTe=0,vJ=1,C4=2,M1=3,OF=4,Op=5,k4=6,Xu=7,U0=[new Gw(vTe,0,!1),new Gw(vJ,0,!0),new Gw(C4,1,!1),new Gw(M1,1,!0),new Gw(OF,2,!1),new Gw(Op,2,!0),new Gw(k4,3,!1),new Gw(Xu,3,!0)],DRn=[OF,Op,OF,Op,k4,Xu,k4,Xu],LRn=[Op,Op,Op,Op,Xu,Xu,Xu,Xu],MRn=[C4,M1,OF,Op,k4,Xu,k4,Xu],IRn=[M1,M1,Op,Op,Xu,Xu,Xu,Xu],PRn=[vJ,vJ,M1,M1,Op,Op,Xu,Xu],NRn=[vTe,vJ,C4,M1,C4,M1,C4,M1],Nn={DISPLAY:U0[vTe],TEXT:U0[C4],SCRIPT:U0[OF],SCRIPTSCRIPT:U0[k4]},yTe=[{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 BRn(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var yJ=[];yTe.forEach(t=>t.blocks.forEach(e=>yJ.push(...e)));function DPt(t){for(var e=0;e=yJ[e]&&t<=yJ[e+1])return!0;return!1}var dl=t=>t+" "+t,O4=80,$Rn=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 @@ -756,7 +756,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"},F5n=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"},FRn=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+` @@ -766,7 +766,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"},z5n=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},zRn=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 @@ -775,7 +775,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"},U5n=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},URn=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 @@ -785,18 +785,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"},V5n=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},VRn=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"},G5n=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},Q5n=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"},GRn=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},QRn=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"},H5n=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=$5n(r,O4);break;case"sqrtSize1":i=F5n(r,O4);break;case"sqrtSize2":i=z5n(r,O4);break;case"sqrtSize3":i=U5n(r,O4);break;case"sqrtSize4":i=V5n(r,O4);break;case"sqrtTall":i=Q5n(r,O4,n)}return i},W5n=function(e,r){switch(e){case"⎜":return dl("M291 0 H417 V"+r+" H291z");case"∣":return dl("M145 0 H188 V"+r+" H145z");case"∥":return dl("M145 0 H188 V"+r+" H145z")+dl("M367 0 H410 V"+r+" H367z");case"⎟":return dl("M457 0 H583 V"+r+" H457z");case"⎢":return dl("M319 0 H403 V"+r+" H319z");case"⎥":return dl("M263 0 H347 V"+r+" H263z");case"⎪":return dl("M384 0 H504 V"+r+" H384z");case"⏐":return dl("M312 0 H355 V"+r+" H312z");case"‖":return dl("M257 0 H300 V"+r+" H257z")+dl("M478 0 H521 V"+r+" H478z");default:return""}},LPt={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},HRn=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=$Rn(r,O4);break;case"sqrtSize1":i=FRn(r,O4);break;case"sqrtSize2":i=zRn(r,O4);break;case"sqrtSize3":i=URn(r,O4);break;case"sqrtSize4":i=VRn(r,O4);break;case"sqrtTall":i=QRn(r,O4,n)}return i},WRn=function(e,r){switch(e){case"⎜":return dl("M291 0 H417 V"+r+" H291z");case"∣":return dl("M145 0 H188 V"+r+" H145z");case"∥":return dl("M145 0 H188 V"+r+" H145z")+dl("M367 0 H410 V"+r+" H367z");case"⎟":return dl("M457 0 H583 V"+r+" H457z");case"⎢":return dl("M319 0 H403 V"+r+" H319z");case"⎥":return dl("M263 0 H347 V"+r+" H263z");case"⎪":return dl("M384 0 H504 V"+r+" H384z");case"⏐":return dl("M312 0 H355 V"+r+" H312z");case"‖":return dl("M257 0 H300 V"+r+" H257z")+dl("M478 0 H521 V"+r+" H478z");default:return""}},LPt={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 @@ -967,7 +967,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`},Y5n=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`},YRn=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 @@ -995,16 +995,16 @@ 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 q5n(t){return"toText"in t}class E4{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(q5n(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var bTe={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},j5n={ex:!0,em:!0,mu:!0},MPt=function(e){return typeof e!="string"&&(e=e.unit),e in bTe||e in j5n||e==="ex"},Lo=function(e,r){var n;if(e.unit in bTe)n=bTe[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"},Qw=function(e){return e.filter(r=>r).join(" ")},xTe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=S5n(n)+":"+i+";")}return r},IPt=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)}},PPt=function(e){var r=document.createElement(e);r.className=Qw(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]/,NPt=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+du(Qw(this.classes))+'"');var n=xTe(this.style);n&&(r+=' style="'+du(n)+'"');for(var i of Object.keys(this.attributes)){if(X5n.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+du(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class _4{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,IPt.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return PPt.call(this,"span")}toMarkup(){return NPt.call(this,"span")}}let bJ=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,IPt.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 PPt.call(this,"a")}toMarkup(){return NPt.call(this,"a")}};class K5n{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=''+du(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Qw(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+=xTe(this.style),n&&(e=!0,r+=' style="'+du(n)+'"');var i=du(this.text);return e?(r+=">",r+=i,r+="",r):i}}class I1{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 wTe{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 tRn=t=>t instanceof _4||t instanceof bJ||t instanceof E4,V0={"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]}},xJ={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]},BPt={Å:"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 $Pt(t,e){V0[t]=e}function ATe(t,e,r){if(!V0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=V0[e][n];if(!i&&t[0]in BPt&&(n=BPt[t[0]].charCodeAt(0),i=V0[e][n]),!i&&r==="text"&&DPt(n)&&(i=V0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var STe={};function rRn(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!STe[e]){var r=STe[e]={cssEmPerMu:xJ.quad[e]/18};for(var n in xJ)xJ.hasOwnProperty(n)&&(r[n]=xJ[n][e])}return STe[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 de="math",zt="text",Se="main",qe="ams",To="accent-token",Or="bin",Ku="close",R4="inner",sn="mathord",Qs="op-token",cf="open",EF="punct",Xe="rel",P1="spacing",Je="textord";re(de,Se,Xe,"≡","\\equiv",!0),re(de,Se,Xe,"≺","\\prec",!0),re(de,Se,Xe,"≻","\\succ",!0),re(de,Se,Xe,"∼","\\sim",!0),re(de,Se,Xe,"⊥","\\perp"),re(de,Se,Xe,"⪯","\\preceq",!0),re(de,Se,Xe,"⪰","\\succeq",!0),re(de,Se,Xe,"≃","\\simeq",!0),re(de,Se,Xe,"∣","\\mid",!0),re(de,Se,Xe,"≪","\\ll",!0),re(de,Se,Xe,"≫","\\gg",!0),re(de,Se,Xe,"≍","\\asymp",!0),re(de,Se,Xe,"∥","\\parallel"),re(de,Se,Xe,"⋈","\\bowtie",!0),re(de,Se,Xe,"⌣","\\smile",!0),re(de,Se,Xe,"⊑","\\sqsubseteq",!0),re(de,Se,Xe,"⊒","\\sqsupseteq",!0),re(de,Se,Xe,"≐","\\doteq",!0),re(de,Se,Xe,"⌢","\\frown",!0),re(de,Se,Xe,"∋","\\ni",!0),re(de,Se,Xe,"∝","\\propto",!0),re(de,Se,Xe,"⊢","\\vdash",!0),re(de,Se,Xe,"⊣","\\dashv",!0),re(de,Se,Xe,"∋","\\owns"),re(de,Se,EF,".","\\ldotp"),re(de,Se,EF,"⋅","\\cdotp"),re(de,Se,EF,"⋅","·"),re(zt,Se,Je,"⋅","·"),re(de,Se,Je,"#","\\#"),re(zt,Se,Je,"#","\\#"),re(de,Se,Je,"&","\\&"),re(zt,Se,Je,"&","\\&"),re(de,Se,Je,"ℵ","\\aleph",!0),re(de,Se,Je,"∀","\\forall",!0),re(de,Se,Je,"ℏ","\\hbar",!0),re(de,Se,Je,"∃","\\exists",!0),re(de,Se,Je,"∇","\\nabla",!0),re(de,Se,Je,"♭","\\flat",!0),re(de,Se,Je,"ℓ","\\ell",!0),re(de,Se,Je,"♮","\\natural",!0),re(de,Se,Je,"♣","\\clubsuit",!0),re(de,Se,Je,"℘","\\wp",!0),re(de,Se,Je,"♯","\\sharp",!0),re(de,Se,Je,"♢","\\diamondsuit",!0),re(de,Se,Je,"ℜ","\\Re",!0),re(de,Se,Je,"♡","\\heartsuit",!0),re(de,Se,Je,"ℑ","\\Im",!0),re(de,Se,Je,"♠","\\spadesuit",!0),re(de,Se,Je,"§","\\S",!0),re(zt,Se,Je,"§","\\S"),re(de,Se,Je,"¶","\\P",!0),re(zt,Se,Je,"¶","\\P"),re(de,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\textdagger"),re(de,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\textdaggerdbl"),re(de,Se,Ku,"⎱","\\rmoustache",!0),re(de,Se,cf,"⎰","\\lmoustache",!0),re(de,Se,Ku,"⟯","\\rgroup",!0),re(de,Se,cf,"⟮","\\lgroup",!0),re(de,Se,Or,"∓","\\mp",!0),re(de,Se,Or,"⊖","\\ominus",!0),re(de,Se,Or,"⊎","\\uplus",!0),re(de,Se,Or,"⊓","\\sqcap",!0),re(de,Se,Or,"∗","\\ast"),re(de,Se,Or,"⊔","\\sqcup",!0),re(de,Se,Or,"◯","\\bigcirc",!0),re(de,Se,Or,"∙","\\bullet",!0),re(de,Se,Or,"‡","\\ddagger"),re(de,Se,Or,"≀","\\wr",!0),re(de,Se,Or,"⨿","\\amalg"),re(de,Se,Or,"&","\\And"),re(de,Se,Xe,"⟵","\\longleftarrow",!0),re(de,Se,Xe,"⇐","\\Leftarrow",!0),re(de,Se,Xe,"⟸","\\Longleftarrow",!0),re(de,Se,Xe,"⟶","\\longrightarrow",!0),re(de,Se,Xe,"⇒","\\Rightarrow",!0),re(de,Se,Xe,"⟹","\\Longrightarrow",!0),re(de,Se,Xe,"↔","\\leftrightarrow",!0),re(de,Se,Xe,"⟷","\\longleftrightarrow",!0),re(de,Se,Xe,"⇔","\\Leftrightarrow",!0),re(de,Se,Xe,"⟺","\\Longleftrightarrow",!0),re(de,Se,Xe,"↦","\\mapsto",!0),re(de,Se,Xe,"⟼","\\longmapsto",!0),re(de,Se,Xe,"↗","\\nearrow",!0),re(de,Se,Xe,"↩","\\hookleftarrow",!0),re(de,Se,Xe,"↪","\\hookrightarrow",!0),re(de,Se,Xe,"↘","\\searrow",!0),re(de,Se,Xe,"↼","\\leftharpoonup",!0),re(de,Se,Xe,"⇀","\\rightharpoonup",!0),re(de,Se,Xe,"↙","\\swarrow",!0),re(de,Se,Xe,"↽","\\leftharpoondown",!0),re(de,Se,Xe,"⇁","\\rightharpoondown",!0),re(de,Se,Xe,"↖","\\nwarrow",!0),re(de,Se,Xe,"⇌","\\rightleftharpoons",!0),re(de,qe,Xe,"≮","\\nless",!0),re(de,qe,Xe,"","\\@nleqslant"),re(de,qe,Xe,"","\\@nleqq"),re(de,qe,Xe,"⪇","\\lneq",!0),re(de,qe,Xe,"≨","\\lneqq",!0),re(de,qe,Xe,"","\\@lvertneqq"),re(de,qe,Xe,"⋦","\\lnsim",!0),re(de,qe,Xe,"⪉","\\lnapprox",!0),re(de,qe,Xe,"⊀","\\nprec",!0),re(de,qe,Xe,"⋠","\\npreceq",!0),re(de,qe,Xe,"⋨","\\precnsim",!0),re(de,qe,Xe,"⪹","\\precnapprox",!0),re(de,qe,Xe,"≁","\\nsim",!0),re(de,qe,Xe,"","\\@nshortmid"),re(de,qe,Xe,"∤","\\nmid",!0),re(de,qe,Xe,"⊬","\\nvdash",!0),re(de,qe,Xe,"⊭","\\nvDash",!0),re(de,qe,Xe,"⋪","\\ntriangleleft"),re(de,qe,Xe,"⋬","\\ntrianglelefteq",!0),re(de,qe,Xe,"⊊","\\subsetneq",!0),re(de,qe,Xe,"","\\@varsubsetneq"),re(de,qe,Xe,"⫋","\\subsetneqq",!0),re(de,qe,Xe,"","\\@varsubsetneqq"),re(de,qe,Xe,"≯","\\ngtr",!0),re(de,qe,Xe,"","\\@ngeqslant"),re(de,qe,Xe,"","\\@ngeqq"),re(de,qe,Xe,"⪈","\\gneq",!0),re(de,qe,Xe,"≩","\\gneqq",!0),re(de,qe,Xe,"","\\@gvertneqq"),re(de,qe,Xe,"⋧","\\gnsim",!0),re(de,qe,Xe,"⪊","\\gnapprox",!0),re(de,qe,Xe,"⊁","\\nsucc",!0),re(de,qe,Xe,"⋡","\\nsucceq",!0),re(de,qe,Xe,"⋩","\\succnsim",!0),re(de,qe,Xe,"⪺","\\succnapprox",!0),re(de,qe,Xe,"≆","\\ncong",!0),re(de,qe,Xe,"","\\@nshortparallel"),re(de,qe,Xe,"∦","\\nparallel",!0),re(de,qe,Xe,"⊯","\\nVDash",!0),re(de,qe,Xe,"⋫","\\ntriangleright"),re(de,qe,Xe,"⋭","\\ntrianglerighteq",!0),re(de,qe,Xe,"","\\@nsupseteqq"),re(de,qe,Xe,"⊋","\\supsetneq",!0),re(de,qe,Xe,"","\\@varsupsetneq"),re(de,qe,Xe,"⫌","\\supsetneqq",!0),re(de,qe,Xe,"","\\@varsupsetneqq"),re(de,qe,Xe,"⊮","\\nVdash",!0),re(de,qe,Xe,"⪵","\\precneqq",!0),re(de,qe,Xe,"⪶","\\succneqq",!0),re(de,qe,Xe,"","\\@nsubseteqq"),re(de,qe,Or,"⊴","\\unlhd"),re(de,qe,Or,"⊵","\\unrhd"),re(de,qe,Xe,"↚","\\nleftarrow",!0),re(de,qe,Xe,"↛","\\nrightarrow",!0),re(de,qe,Xe,"⇍","\\nLeftarrow",!0),re(de,qe,Xe,"⇏","\\nRightarrow",!0),re(de,qe,Xe,"↮","\\nleftrightarrow",!0),re(de,qe,Xe,"⇎","\\nLeftrightarrow",!0),re(de,qe,Xe,"△","\\vartriangle"),re(de,qe,Je,"ℏ","\\hslash"),re(de,qe,Je,"▽","\\triangledown"),re(de,qe,Je,"◊","\\lozenge"),re(de,qe,Je,"Ⓢ","\\circledS"),re(de,qe,Je,"®","\\circledR"),re(zt,qe,Je,"®","\\circledR"),re(de,qe,Je,"∡","\\measuredangle",!0),re(de,qe,Je,"∄","\\nexists"),re(de,qe,Je,"℧","\\mho"),re(de,qe,Je,"Ⅎ","\\Finv",!0),re(de,qe,Je,"⅁","\\Game",!0),re(de,qe,Je,"‵","\\backprime"),re(de,qe,Je,"▲","\\blacktriangle"),re(de,qe,Je,"▼","\\blacktriangledown"),re(de,qe,Je,"■","\\blacksquare"),re(de,qe,Je,"⧫","\\blacklozenge"),re(de,qe,Je,"★","\\bigstar"),re(de,qe,Je,"∢","\\sphericalangle",!0),re(de,qe,Je,"∁","\\complement",!0),re(de,qe,Je,"ð","\\eth",!0),re(zt,Se,Je,"ð","ð"),re(de,qe,Je,"╱","\\diagup"),re(de,qe,Je,"╲","\\diagdown"),re(de,qe,Je,"□","\\square"),re(de,qe,Je,"□","\\Box"),re(de,qe,Je,"◊","\\Diamond"),re(de,qe,Je,"¥","\\yen",!0),re(zt,qe,Je,"¥","\\yen",!0),re(de,qe,Je,"✓","\\checkmark",!0),re(zt,qe,Je,"✓","\\checkmark"),re(de,qe,Je,"ℶ","\\beth",!0),re(de,qe,Je,"ℸ","\\daleth",!0),re(de,qe,Je,"ℷ","\\gimel",!0),re(de,qe,Je,"ϝ","\\digamma",!0),re(de,qe,Je,"ϰ","\\varkappa"),re(de,qe,cf,"┌","\\@ulcorner",!0),re(de,qe,Ku,"┐","\\@urcorner",!0),re(de,qe,cf,"└","\\@llcorner",!0),re(de,qe,Ku,"┘","\\@lrcorner",!0),re(de,qe,Xe,"≦","\\leqq",!0),re(de,qe,Xe,"⩽","\\leqslant",!0),re(de,qe,Xe,"⪕","\\eqslantless",!0),re(de,qe,Xe,"≲","\\lesssim",!0),re(de,qe,Xe,"⪅","\\lessapprox",!0),re(de,qe,Xe,"≊","\\approxeq",!0),re(de,qe,Or,"⋖","\\lessdot"),re(de,qe,Xe,"⋘","\\lll",!0),re(de,qe,Xe,"≶","\\lessgtr",!0),re(de,qe,Xe,"⋚","\\lesseqgtr",!0),re(de,qe,Xe,"⪋","\\lesseqqgtr",!0),re(de,qe,Xe,"≑","\\doteqdot"),re(de,qe,Xe,"≓","\\risingdotseq",!0),re(de,qe,Xe,"≒","\\fallingdotseq",!0),re(de,qe,Xe,"∽","\\backsim",!0),re(de,qe,Xe,"⋍","\\backsimeq",!0),re(de,qe,Xe,"⫅","\\subseteqq",!0),re(de,qe,Xe,"⋐","\\Subset",!0),re(de,qe,Xe,"⊏","\\sqsubset",!0),re(de,qe,Xe,"≼","\\preccurlyeq",!0),re(de,qe,Xe,"⋞","\\curlyeqprec",!0),re(de,qe,Xe,"≾","\\precsim",!0),re(de,qe,Xe,"⪷","\\precapprox",!0),re(de,qe,Xe,"⊲","\\vartriangleleft"),re(de,qe,Xe,"⊴","\\trianglelefteq"),re(de,qe,Xe,"⊨","\\vDash",!0),re(de,qe,Xe,"⊪","\\Vvdash",!0),re(de,qe,Xe,"⌣","\\smallsmile"),re(de,qe,Xe,"⌢","\\smallfrown"),re(de,qe,Xe,"≏","\\bumpeq",!0),re(de,qe,Xe,"≎","\\Bumpeq",!0),re(de,qe,Xe,"≧","\\geqq",!0),re(de,qe,Xe,"⩾","\\geqslant",!0),re(de,qe,Xe,"⪖","\\eqslantgtr",!0),re(de,qe,Xe,"≳","\\gtrsim",!0),re(de,qe,Xe,"⪆","\\gtrapprox",!0),re(de,qe,Or,"⋗","\\gtrdot"),re(de,qe,Xe,"⋙","\\ggg",!0),re(de,qe,Xe,"≷","\\gtrless",!0),re(de,qe,Xe,"⋛","\\gtreqless",!0),re(de,qe,Xe,"⪌","\\gtreqqless",!0),re(de,qe,Xe,"≖","\\eqcirc",!0),re(de,qe,Xe,"≗","\\circeq",!0),re(de,qe,Xe,"≜","\\triangleq",!0),re(de,qe,Xe,"∼","\\thicksim"),re(de,qe,Xe,"≈","\\thickapprox"),re(de,qe,Xe,"⫆","\\supseteqq",!0),re(de,qe,Xe,"⋑","\\Supset",!0),re(de,qe,Xe,"⊐","\\sqsupset",!0),re(de,qe,Xe,"≽","\\succcurlyeq",!0),re(de,qe,Xe,"⋟","\\curlyeqsucc",!0),re(de,qe,Xe,"≿","\\succsim",!0),re(de,qe,Xe,"⪸","\\succapprox",!0),re(de,qe,Xe,"⊳","\\vartriangleright"),re(de,qe,Xe,"⊵","\\trianglerighteq"),re(de,qe,Xe,"⊩","\\Vdash",!0),re(de,qe,Xe,"∣","\\shortmid"),re(de,qe,Xe,"∥","\\shortparallel"),re(de,qe,Xe,"≬","\\between",!0),re(de,qe,Xe,"⋔","\\pitchfork",!0),re(de,qe,Xe,"∝","\\varpropto"),re(de,qe,Xe,"◀","\\blacktriangleleft"),re(de,qe,Xe,"∴","\\therefore",!0),re(de,qe,Xe,"∍","\\backepsilon"),re(de,qe,Xe,"▶","\\blacktriangleright"),re(de,qe,Xe,"∵","\\because",!0),re(de,qe,Xe,"⋘","\\llless"),re(de,qe,Xe,"⋙","\\gggtr"),re(de,qe,Or,"⊲","\\lhd"),re(de,qe,Or,"⊳","\\rhd"),re(de,qe,Xe,"≂","\\eqsim",!0),re(de,Se,Xe,"⋈","\\Join"),re(de,qe,Xe,"≑","\\Doteq",!0),re(de,qe,Or,"∔","\\dotplus",!0),re(de,qe,Or,"∖","\\smallsetminus"),re(de,qe,Or,"⋒","\\Cap",!0),re(de,qe,Or,"⋓","\\Cup",!0),re(de,qe,Or,"⩞","\\doublebarwedge",!0),re(de,qe,Or,"⊟","\\boxminus",!0),re(de,qe,Or,"⊞","\\boxplus",!0),re(de,qe,Or,"⋇","\\divideontimes",!0),re(de,qe,Or,"⋉","\\ltimes",!0),re(de,qe,Or,"⋊","\\rtimes",!0),re(de,qe,Or,"⋋","\\leftthreetimes",!0),re(de,qe,Or,"⋌","\\rightthreetimes",!0),re(de,qe,Or,"⋏","\\curlywedge",!0),re(de,qe,Or,"⋎","\\curlyvee",!0),re(de,qe,Or,"⊝","\\circleddash",!0),re(de,qe,Or,"⊛","\\circledast",!0),re(de,qe,Or,"⋅","\\centerdot"),re(de,qe,Or,"⊺","\\intercal",!0),re(de,qe,Or,"⋒","\\doublecap"),re(de,qe,Or,"⋓","\\doublecup"),re(de,qe,Or,"⊠","\\boxtimes",!0),re(de,qe,Xe,"⇢","\\dashrightarrow",!0),re(de,qe,Xe,"⇠","\\dashleftarrow",!0),re(de,qe,Xe,"⇇","\\leftleftarrows",!0),re(de,qe,Xe,"⇆","\\leftrightarrows",!0),re(de,qe,Xe,"⇚","\\Lleftarrow",!0),re(de,qe,Xe,"↞","\\twoheadleftarrow",!0),re(de,qe,Xe,"↢","\\leftarrowtail",!0),re(de,qe,Xe,"↫","\\looparrowleft",!0),re(de,qe,Xe,"⇋","\\leftrightharpoons",!0),re(de,qe,Xe,"↶","\\curvearrowleft",!0),re(de,qe,Xe,"↺","\\circlearrowleft",!0),re(de,qe,Xe,"↰","\\Lsh",!0),re(de,qe,Xe,"⇈","\\upuparrows",!0),re(de,qe,Xe,"↿","\\upharpoonleft",!0),re(de,qe,Xe,"⇃","\\downharpoonleft",!0),re(de,Se,Xe,"⊶","\\origof",!0),re(de,Se,Xe,"⊷","\\imageof",!0),re(de,qe,Xe,"⊸","\\multimap",!0),re(de,qe,Xe,"↭","\\leftrightsquigarrow",!0),re(de,qe,Xe,"⇉","\\rightrightarrows",!0),re(de,qe,Xe,"⇄","\\rightleftarrows",!0),re(de,qe,Xe,"↠","\\twoheadrightarrow",!0),re(de,qe,Xe,"↣","\\rightarrowtail",!0),re(de,qe,Xe,"↬","\\looparrowright",!0),re(de,qe,Xe,"↷","\\curvearrowright",!0),re(de,qe,Xe,"↻","\\circlearrowright",!0),re(de,qe,Xe,"↱","\\Rsh",!0),re(de,qe,Xe,"⇊","\\downdownarrows",!0),re(de,qe,Xe,"↾","\\upharpoonright",!0),re(de,qe,Xe,"⇂","\\downharpoonright",!0),re(de,qe,Xe,"⇝","\\rightsquigarrow",!0),re(de,qe,Xe,"⇝","\\leadsto"),re(de,qe,Xe,"⇛","\\Rrightarrow",!0),re(de,qe,Xe,"↾","\\restriction"),re(de,Se,Je,"‘","`"),re(de,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\textdollar"),re(de,Se,Je,"%","\\%"),re(zt,Se,Je,"%","\\%"),re(de,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\textunderscore"),re(de,Se,Je,"∠","\\angle",!0),re(de,Se,Je,"∞","\\infty",!0),re(de,Se,Je,"′","\\prime"),re(de,Se,Je,"△","\\triangle"),re(de,Se,Je,"Γ","\\Gamma",!0),re(de,Se,Je,"Δ","\\Delta",!0),re(de,Se,Je,"Θ","\\Theta",!0),re(de,Se,Je,"Λ","\\Lambda",!0),re(de,Se,Je,"Ξ","\\Xi",!0),re(de,Se,Je,"Π","\\Pi",!0),re(de,Se,Je,"Σ","\\Sigma",!0),re(de,Se,Je,"Υ","\\Upsilon",!0),re(de,Se,Je,"Φ","\\Phi",!0),re(de,Se,Je,"Ψ","\\Psi",!0),re(de,Se,Je,"Ω","\\Omega",!0),re(de,Se,Je,"A","Α"),re(de,Se,Je,"B","Β"),re(de,Se,Je,"E","Ε"),re(de,Se,Je,"Z","Ζ"),re(de,Se,Je,"H","Η"),re(de,Se,Je,"I","Ι"),re(de,Se,Je,"K","Κ"),re(de,Se,Je,"M","Μ"),re(de,Se,Je,"N","Ν"),re(de,Se,Je,"O","Ο"),re(de,Se,Je,"P","Ρ"),re(de,Se,Je,"T","Τ"),re(de,Se,Je,"X","Χ"),re(de,Se,Je,"¬","\\neg",!0),re(de,Se,Je,"¬","\\lnot"),re(de,Se,Je,"⊤","\\top"),re(de,Se,Je,"⊥","\\bot"),re(de,Se,Je,"∅","\\emptyset"),re(de,qe,Je,"∅","\\varnothing"),re(de,Se,sn,"α","\\alpha",!0),re(de,Se,sn,"β","\\beta",!0),re(de,Se,sn,"γ","\\gamma",!0),re(de,Se,sn,"δ","\\delta",!0),re(de,Se,sn,"ϵ","\\epsilon",!0),re(de,Se,sn,"ζ","\\zeta",!0),re(de,Se,sn,"η","\\eta",!0),re(de,Se,sn,"θ","\\theta",!0),re(de,Se,sn,"ι","\\iota",!0),re(de,Se,sn,"κ","\\kappa",!0),re(de,Se,sn,"λ","\\lambda",!0),re(de,Se,sn,"μ","\\mu",!0),re(de,Se,sn,"ν","\\nu",!0),re(de,Se,sn,"ξ","\\xi",!0),re(de,Se,sn,"ο","\\omicron",!0),re(de,Se,sn,"π","\\pi",!0),re(de,Se,sn,"ρ","\\rho",!0),re(de,Se,sn,"σ","\\sigma",!0),re(de,Se,sn,"τ","\\tau",!0),re(de,Se,sn,"υ","\\upsilon",!0),re(de,Se,sn,"ϕ","\\phi",!0),re(de,Se,sn,"χ","\\chi",!0),re(de,Se,sn,"ψ","\\psi",!0),re(de,Se,sn,"ω","\\omega",!0),re(de,Se,sn,"ε","\\varepsilon",!0),re(de,Se,sn,"ϑ","\\vartheta",!0),re(de,Se,sn,"ϖ","\\varpi",!0),re(de,Se,sn,"ϱ","\\varrho",!0),re(de,Se,sn,"ς","\\varsigma",!0),re(de,Se,sn,"φ","\\varphi",!0),re(de,Se,Or,"∗","*",!0),re(de,Se,Or,"+","+"),re(de,Se,Or,"−","-",!0),re(de,Se,Or,"⋅","\\cdot",!0),re(de,Se,Or,"∘","\\circ",!0),re(de,Se,Or,"÷","\\div",!0),re(de,Se,Or,"±","\\pm",!0),re(de,Se,Or,"×","\\times",!0),re(de,Se,Or,"∩","\\cap",!0),re(de,Se,Or,"∪","\\cup",!0),re(de,Se,Or,"∖","\\setminus",!0),re(de,Se,Or,"∧","\\land"),re(de,Se,Or,"∨","\\lor"),re(de,Se,Or,"∧","\\wedge",!0),re(de,Se,Or,"∨","\\vee",!0),re(de,Se,Je,"√","\\surd"),re(de,Se,cf,"⟨","\\langle",!0),re(de,Se,cf,"∣","\\lvert"),re(de,Se,cf,"∥","\\lVert"),re(de,Se,Ku,"?","?"),re(de,Se,Ku,"!","!"),re(de,Se,Ku,"⟩","\\rangle",!0),re(de,Se,Ku,"∣","\\rvert"),re(de,Se,Ku,"∥","\\rVert"),re(de,Se,Xe,"=","="),re(de,Se,Xe,":",":"),re(de,Se,Xe,"≈","\\approx",!0),re(de,Se,Xe,"≅","\\cong",!0),re(de,Se,Xe,"≥","\\ge"),re(de,Se,Xe,"≥","\\geq",!0),re(de,Se,Xe,"←","\\gets"),re(de,Se,Xe,">","\\gt",!0),re(de,Se,Xe,"∈","\\in",!0),re(de,Se,Xe,"","\\@not"),re(de,Se,Xe,"⊂","\\subset",!0),re(de,Se,Xe,"⊃","\\supset",!0),re(de,Se,Xe,"⊆","\\subseteq",!0),re(de,Se,Xe,"⊇","\\supseteq",!0),re(de,qe,Xe,"⊈","\\nsubseteq",!0),re(de,qe,Xe,"⊉","\\nsupseteq",!0),re(de,Se,Xe,"⊨","\\models"),re(de,Se,Xe,"←","\\leftarrow",!0),re(de,Se,Xe,"≤","\\le"),re(de,Se,Xe,"≤","\\leq",!0),re(de,Se,Xe,"<","\\lt",!0),re(de,Se,Xe,"→","\\rightarrow",!0),re(de,Se,Xe,"→","\\to"),re(de,qe,Xe,"≱","\\ngeq",!0),re(de,qe,Xe,"≰","\\nleq",!0),re(de,Se,P1," ","\\ "),re(de,Se,P1," ","\\space"),re(de,Se,P1," ","\\nobreakspace"),re(zt,Se,P1," ","\\ "),re(zt,Se,P1," "," "),re(zt,Se,P1," ","\\space"),re(zt,Se,P1," ","\\nobreakspace"),re(de,Se,P1,"","\\nobreak"),re(de,Se,P1,"","\\allowbreak"),re(de,Se,EF,",",","),re(de,Se,EF,";",";"),re(de,qe,Or,"⊼","\\barwedge",!0),re(de,qe,Or,"⊻","\\veebar",!0),re(de,Se,Or,"⊙","\\odot",!0),re(de,Se,Or,"⊕","\\oplus",!0),re(de,Se,Or,"⊗","\\otimes",!0),re(de,Se,Je,"∂","\\partial",!0),re(de,Se,Or,"⊘","\\oslash",!0),re(de,qe,Or,"⊚","\\circledcirc",!0),re(de,qe,Or,"⊡","\\boxdot",!0),re(de,Se,Or,"△","\\bigtriangleup"),re(de,Se,Or,"▽","\\bigtriangledown"),re(de,Se,Or,"†","\\dagger"),re(de,Se,Or,"⋄","\\diamond"),re(de,Se,Or,"⋆","\\star"),re(de,Se,Or,"◃","\\triangleleft"),re(de,Se,Or,"▹","\\triangleright"),re(de,Se,cf,"{","\\{"),re(zt,Se,Je,"{","\\{"),re(zt,Se,Je,"{","\\textbraceleft"),re(de,Se,Ku,"}","\\}"),re(zt,Se,Je,"}","\\}"),re(zt,Se,Je,"}","\\textbraceright"),re(de,Se,cf,"{","\\lbrace"),re(de,Se,Ku,"}","\\rbrace"),re(de,Se,cf,"[","\\lbrack",!0),re(zt,Se,Je,"[","\\lbrack",!0),re(de,Se,Ku,"]","\\rbrack",!0),re(zt,Se,Je,"]","\\rbrack",!0),re(de,Se,cf,"(","\\lparen",!0),re(de,Se,Ku,")","\\rparen",!0),re(zt,Se,Je,"<","\\textless",!0),re(zt,Se,Je,">","\\textgreater",!0),re(de,Se,cf,"⌊","\\lfloor",!0),re(de,Se,Ku,"⌋","\\rfloor",!0),re(de,Se,cf,"⌈","\\lceil",!0),re(de,Se,Ku,"⌉","\\rceil",!0),re(de,Se,Je,"\\","\\backslash"),re(de,Se,Je,"∣","|"),re(de,Se,Je,"∣","\\vert"),re(zt,Se,Je,"|","\\textbar",!0),re(de,Se,Je,"∥","\\|"),re(de,Se,Je,"∥","\\Vert"),re(zt,Se,Je,"∥","\\textbardbl"),re(zt,Se,Je,"~","\\textasciitilde"),re(zt,Se,Je,"\\","\\textbackslash"),re(zt,Se,Je,"^","\\textasciicircum"),re(de,Se,Xe,"↑","\\uparrow",!0),re(de,Se,Xe,"⇑","\\Uparrow",!0),re(de,Se,Xe,"↓","\\downarrow",!0),re(de,Se,Xe,"⇓","\\Downarrow",!0),re(de,Se,Xe,"↕","\\updownarrow",!0),re(de,Se,Xe,"⇕","\\Updownarrow",!0),re(de,Se,Qs,"∐","\\coprod"),re(de,Se,Qs,"⋁","\\bigvee"),re(de,Se,Qs,"⋀","\\bigwedge"),re(de,Se,Qs,"⨄","\\biguplus"),re(de,Se,Qs,"⋂","\\bigcap"),re(de,Se,Qs,"⋃","\\bigcup"),re(de,Se,Qs,"∫","\\int"),re(de,Se,Qs,"∫","\\intop"),re(de,Se,Qs,"∬","\\iint"),re(de,Se,Qs,"∭","\\iiint"),re(de,Se,Qs,"∏","\\prod"),re(de,Se,Qs,"∑","\\sum"),re(de,Se,Qs,"⨂","\\bigotimes"),re(de,Se,Qs,"⨁","\\bigoplus"),re(de,Se,Qs,"⨀","\\bigodot"),re(de,Se,Qs,"∮","\\oint"),re(de,Se,Qs,"∯","\\oiint"),re(de,Se,Qs,"∰","\\oiiint"),re(de,Se,Qs,"⨆","\\bigsqcup"),re(de,Se,Qs,"∫","\\smallint"),re(zt,Se,R4,"…","\\textellipsis"),re(de,Se,R4,"…","\\mathellipsis"),re(zt,Se,R4,"…","\\ldots",!0),re(de,Se,R4,"…","\\ldots",!0),re(de,Se,R4,"⋯","\\@cdots",!0),re(de,Se,R4,"⋱","\\ddots",!0),re(de,Se,Je,"⋮","\\varvdots"),re(zt,Se,Je,"⋮","\\varvdots"),re(de,Se,To,"ˊ","\\acute"),re(de,Se,To,"ˋ","\\grave"),re(de,Se,To,"¨","\\ddot"),re(de,Se,To,"~","\\tilde"),re(de,Se,To,"ˉ","\\bar"),re(de,Se,To,"˘","\\breve"),re(de,Se,To,"ˇ","\\check"),re(de,Se,To,"^","\\hat"),re(de,Se,To,"⃗","\\vec"),re(de,Se,To,"˙","\\dot"),re(de,Se,To,"˚","\\mathring"),re(de,Se,sn,"","\\@imath"),re(de,Se,sn,"","\\@jmath"),re(de,Se,Je,"ı","ı"),re(de,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 FPt={"--":!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(de,Se,Je,"°","\\degree",!0),re(zt,Se,Je,"°","\\degree"),re(zt,Se,Je,"°","\\textdegree",!0),re(de,Se,Je,"£","\\pounds"),re(de,Se,Je,"£","\\mathsterling",!0),re(zt,Se,Je,"£","\\pounds"),re(zt,Se,Je,"£","\\textsterling",!0),re(de,qe,Je,"✠","\\maltese"),re(zt,qe,Je,"✠","\\maltese");for(var zPt='0123456789/@."',TTe=0;TTe{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 XPt[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return iRn[a]}else{if(n===120485||n===120486)return XPt[0];if(120486{if(Qw(t.classes)!==Qw(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},KPt=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 _4(e,r,n,i);return ITe(a),a},Yw=(t,e,r,n)=>new _4(t,e,r,n),D4=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},lRn=function(e,r,n,i){var a=new bJ(e,r,n,i);return ITe(a),a},N1=function(e){var r=new E4(e);return ITe(r),r},L4=function(e,r){return e instanceof E4?Yt([],[e],r):e},cRn=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},kJ=(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},PTe={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"}},JPt={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},e6t=function(e,r){var[n,i,a]=JPt[e],o=new Hw(n),s=new I1([o],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Yw(["overlay"],[s],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Mo={number:3,unit:"mu"},MC={number:4,unit:"mu"},B1={number:5,unit:"mu"},uRn={mord:{mop:Mo,mbin:MC,mrel:B1,minner:Mo},mop:{mord:Mo,mop:Mo,mrel:B1,minner:Mo},mbin:{mord:MC,mop:MC,mopen:MC,minner:MC},mrel:{mord:B1,mop:B1,mopen:B1,minner:B1},mopen:{},mclose:{mop:Mo,mbin:MC,mrel:B1,minner:Mo},mpunct:{mord:Mo,mop:Mo,mrel:B1,mopen:Mo,mclose:Mo,mpunct:Mo,minner:Mo},minner:{mord:Mo,mop:Mo,mbin:MC,mrel:B1,mopen:Mo,mpunct:Mo,minner:Mo}},dRn={mord:{mop:Mo},mop:{mord:Mo,mop:Mo},mbin:{},mrel:{},mopen:{},mclose:{mop:Mo},mpunct:{},minner:{mop:Mo}},t6t={},OJ={},EJ={};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"&&fRn.has(y)?m.classes[0]="mord":y==="mbin"&&hRn.has(v)&&(g.classes[0]="mord")},{node:h},f,p),NTe(a,(g,m)=>{var v,y,b=$Te(m),x=$Te(g),w=b&&x?g.hasClass("mtight")?(v=dRn[b])==null?void 0:v[x]:(y=uRn[b])==null?void 0:y[x]:null;if(w)return ZPt(w,u)},{node:h},f,p),a},NTe=function(e,r,n,i,a){i&&e.push(i);for(var o=0;of=>{e.splice(h+1,0,f),o++})(o)}i&&e.pop()},r6t=function(e){return e instanceof E4||e instanceof bJ||e instanceof _4&&e.hasClass("enclosing")?e:null},BTe=function(e,r){var n=r6t(e);if(n){var i=n.children;if(i.length){if(r==="right")return BTe(i[i.length-1],"right");if(r==="left")return BTe(i[0],"left")}}return e},$Te=function(e,r){if(!e)return null;r&&(e=BTe(e,r));var n=e.classes[0];return gRn[n]||null},_F=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Yt(r.concat(n))},ea=function(e,r,n){if(!e)return Yt();if(OJ[e.type]){var i=OJ[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 RJ(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 FTe(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(RJ(o,e)),o=[]),a.push(n[s]));o.length>0&&a.push(RJ(o,e));var u;r?(u=RJ(hl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var d=Yt(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),u){var h=u.children[0];h.style.height=ir(d.height+d.depth),d.depth&&(h.style.verticalAlign=ir(-d.depth))}return d}function n6t(t){return new E4(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=Qw(this.classes));for(var n=0;n0&&(e+=' class ="'+du(Qw(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ws{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return du(this.toText())}toText(){return this.text}}class i6t{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 mRn=new Set(["\\imath","\\jmath"]),vRn=new Set(["mrow","mtable"]),Ep=function(e,r,n){return So[r][e]&&So[r][e].replace&&e.charCodeAt(0)!==55349&&!(FPt.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 Ws(e)},zTe=function(e){return e.length===1?e[0]:new tr("mrow",e)},yRn={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"},UTe=(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=yRn[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(mRn.has(a))return null;if(So[n][a]){var o=So[n][a].replace;o&&(a=o)}var s=PTe[r].fontName;return ATe(a,s,n)?PTe[r].variant:null};function VTe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ws&&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 Ws&&r.text===","}else return!1}var uf=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"||VTe(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 d=o.children[0];if(d instanceof Ws&&d.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof Ws&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(l),o=l}return a},qw=function(e,r,n){return zTe(uf(e,r,n))},La=function(e,r){if(!e)return new tr("mrow");if(EJ[e.type])return EJ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function a6t(t,e,r,n,i){var a=uf(t,r),o;a.length===1&&a[0]instanceof tr&&vRn.has(a[0].type)?o=a[0]:o=new tr("mrow",a);var s=new tr("annotation",[new Ws(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 d=i?"katex":"katex-mathml";return Yt([d],[u])}var bRn=[[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]],o6t=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],s6t=function(e,r){return r.size<2?e:bRn[e-1][r.size-1]};class $1{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||$1.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=o6t[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 $1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:s6t(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:o6t[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=s6t($1.BASESIZE,e);return this.size===r&&this.textSize===$1.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!==$1.BASESIZE?["sizing","reset-size"+this.size,"size"+$1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=rRn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}$1.BASESIZE=6;var l6t=function(e){return new $1({style:e.displayMode?Nn.DISPLAY:Nn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},c6t=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},xRn=function(e,r,n){var i=l6t(n),a;if(n.output==="mathml")return a6t(e,r,i,n.displayMode,!0);if(n.output==="html"){var o=FTe(e,i);a=Yt(["katex"],[o])}else{var s=a6t(e,r,i,n.displayMode,!1),l=FTe(e,i);a=Yt(["katex"],[s,l])}return c6t(a,n)},wRn=function(e,r,n){var i=l6t(n),a=FTe(e,i),o=Yt(["katex"],[a]);return c6t(o,n)},ARn={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":"="},DJ=function(e){var r=new tr("mo",[new Ws(ARn[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},SRn={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]},TRn=new Set(["widehat","widecheck","widetilde","utilde"]),LJ=function(e,r){function n(){var s=4e5,l=e.label.slice(1);if(TRn.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,d,h,f;if(u>5)l==="widehat"||l==="widecheck"?(d=420,s=2364,f=.42,h=l+"4"):(d=312,s=2340,f=.34,h="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][p],d=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],h=l+p):(s=[0,600,1033,2339,2340][p],d=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],h="tilde"+p)}var g=new Hw(h),m=new I1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+s+" "+d,preserveAspectRatio:"none"});return{span:Yw([],[m],r),minWidth:0,height:f}}else{var v=[],y=SRn[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 O=0;O0&&(i.style.minWidth=ir(a)),i},CRn=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 wTe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new wTe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new I1(u,{width:"100%",height:ir(s)});o=Yw([],[d],a)}return o.height=s,o.style.height=ir(s),o},kRn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ORn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function ERn(t){return t in kRn}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 MJ(t){var e=IJ(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 IJ(t){return t&&(t.type==="atom"||ORn.hasOwnProperty(t.type))?t:null}var u6t=t=>{if(t instanceof lf)return t;if(tRn(t)&&t.children.length===1)return u6t(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=eRn(ea(t,e)),t.base=n):(n=jn(t,"accent"),r=n.base);var a=ea(r,e.havingCrampedStyle()),o=n.isShifty&&L1(r),s=0;if(o){var l,u;s=(l=(u=u6t(a))==null?void 0:u.skew)!=null?l:0}var d=n.label==="\\c",h=d?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=LJ(n,e),f=Ji({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=e6t("vec",e),g=JPt.vec[1]):(p=CJ({mode:n.mode,text:n.label},e,"textord"),p=J5n(p),p.italic=0,g=p.width,d&&(h+=p.depth)),f=Yt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),h=a.height);var v=s;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{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},d6t=(t,e)=>{var r=t.isStretchy?DJ(t.label):new tr("mo",[Ep(t.label,t.mode)]),n=new tr("mover",[La(t.base,e),r]);return n.setAttribute("accent","true"),n},_Rn=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=_J(e[0]),n=!_Rn.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:d6t}),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:d6t}),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=ea(t.base,e),n=LJ(t,e),i=t.label==="\\utilde"?.12:0,a=Ji({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=DJ(t.label),n=new tr("munder",[La(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var PJ=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=L4(ea(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=L4(ea(t.below,n,e),e),o.classes.push(a+"-arrow-pad"));var s=LJ(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 d;if(o){var h=-e.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=Ji({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:h}]})}else d=Ji({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]});return Yt(["mrel","x-arrow"],[d],e)},mathmlBuilder(t,e){var r=DJ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=PJ(La(t.body,e));if(t.below){var a=PJ(La(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var o=PJ(La(t.below,e));n=new tr("munder",[r,o])}else n=PJ(),n=new tr("mover",[r,n]);return n}});function h6t(t,e){var r=hl(t.body,e,!0);return Yt([t.mclass],r,e)}function f6t(t,e){var r,n=uf(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:Hs(i),isCharacterBox:L1(i)}},htmlBuilder:h6t,mathmlBuilder:f6t});var NJ=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:NJ(e[0]),body:Hs(e[1]),isCharacterBox:L1(e[1])}}}),xr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],o;n!=="\\stackrel"?o=NJ(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Hs(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:L1(l)}},htmlBuilder:h6t,mathmlBuilder:f6t}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:NJ(e[0]),body:Hs(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=uf(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var RRn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},p6t=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),g6t=t=>t.type==="textord"&&t.text==="@",DRn=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function LRn(t,e,r){var n=RRn[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 MRn(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 h=0;h<2;h++){for(var f=!0,p=l+1;pAV=|." after @',o[l]);var g=LRn(u,d,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),s=p6t()}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=L4(ea(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=L4(ea(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 m6t=(t,e)=>{var r=hl(t.body,e.withColor(t.color),!1);return N1(r)},v6t=(t,e)=>{var r=uf(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:Hs(i)}},htmlBuilder:m6t,mathmlBuilder:v6t}),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:m6t,mathmlBuilder:v6t}),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 QTe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},y6t=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},IRn=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},b6t=(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(QTe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=QTe[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===QTe[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=y6t(e.gullet.popToken());e.gullet.consumeSpaces();var i=IRn(e);return b6t(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=y6t(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return b6t(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var RF=function(e,r,n){var i=So.math[e]&&So.math[e].replace,a=ATe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},HTe=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},x6t=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},PRn=function(e,r,n,i,a,o){var s=Ju(e,"Main-Regular",a,i),l=HTe(s,r,i,o);return x6t(l,i,r),l},NRn=function(e,r,n,i){return Ju(e,"Size"+r+"-Regular",n,i)},w6t=function(e,r,n,i,a,o){var s=NRn(e,r,a,i),l=HTe(Yt(["delimsizing","size"+r],[s],i),Nn.TEXT,i,o);return n&&x6t(l,i,Nn.TEXT),l},WTe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Yt(["delimsizinginner",i],[Yt([],[Ju(e,r,n)])]);return{type:"elem",elem:a}},YTe=function(e,r,n){var i=V0["Size4-Regular"][e.charCodeAt(0)]?V0["Size4-Regular"][e.charCodeAt(0)][4]:V0["Size1-Regular"][e.charCodeAt(0)][4],a=new Hw("inner",W5n(e,Math.round(1e3*r))),o=new I1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=Yw([],[o],n);return s.height=r,s.style.height=ir(r),s.style.width=ir(i),{type:"elem",elem:s}},qTe=.008,BJ={type:"kern",size:-1*qTe},BRn=new Set(["|","\\lvert","\\rvert","\\vert"]),$Rn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),A6t=function(e,r,n,i,a,o){var s,l,u,d,h="",f=0;s=u=d=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=d="⏐":e==="\\Uparrow"?u=d="‖":e==="\\downarrow"?s=u="⏐":e==="\\Downarrow"?s=u="‖":e==="\\updownarrow"?(s="\\uparrow",u="⏐",d="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",u="‖",d="\\Downarrow"):BRn.has(e)?(u="∣",h="vert",f=333):$Rn.has(e)?(u="∥",h="doublevert",f=556):e==="["||e==="\\lbrack"?(s="⎡",u="⎢",d="⎣",p="Size4-Regular",h="lbrack",f=667):e==="]"||e==="\\rbrack"?(s="⎤",u="⎥",d="⎦",p="Size4-Regular",h="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=s="⎢",d="⎣",p="Size4-Regular",h="lfloor",f=667):e==="\\lceil"||e==="⌈"?(s="⎡",u=d="⎢",p="Size4-Regular",h="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=s="⎥",d="⎦",p="Size4-Regular",h="rfloor",f=667):e==="\\rceil"||e==="⌉"?(s="⎤",u=d="⎥",p="Size4-Regular",h="rceil",f=667):e==="("||e==="\\lparen"?(s="⎛",u="⎜",d="⎝",p="Size4-Regular",h="lparen",f=875):e===")"||e==="\\rparen"?(s="⎞",u="⎟",d="⎠",p="Size4-Regular",h="rparen",f=875):e==="\\{"||e==="\\lbrace"?(s="⎧",l="⎨",d="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",l="⎬",d="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",d="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",d="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",d="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",d="⎩",u="⎪",p="Size4-Regular");var g=RF(s,p,a),m=g.height+g.depth,v=RF(u,p,a),y=v.height+v.depth,b=RF(d,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var S=RF(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))),O=T+C*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=O/2-E,P=[];if(h.length>0){var L=O-m-x,R=Math.round(O*1e3),D=Y5n(h,Math.round(L*1e3)),M=new Hw(h,D),I=ir(f/1e3),N=ir(R/1e3),F=new I1([M],{width:I,height:N,viewBox:"0 0 "+f+" "+R}),B=Yw([],[F],i);B.height=R/1e3,B.style.width=I,B.style.height=N,P.push({type:"elem",elem:B})}else{if(P.push(WTe(d,p,a)),P.push(BJ),l===null){var V=O-m-x+2*qTe;P.push(YTe(u,V,i))}else{var z=(O-m-x-w)/2+2*qTe;P.push(YTe(u,z,i)),P.push(BJ),P.push(WTe(l,p,a)),P.push(BJ),P.push(YTe(u,z,i))}P.push(BJ),P.push(WTe(s,p,a))}var U=i.havingBaseStyle(Nn.TEXT),G=Ji({positionType:"bottom",positionData:_,children:P});return HTe(Yt(["delimsizing","mult"],[G],U),Nn.TEXT,i,o)},jTe=80,XTe=.08,KTe=function(e,r,n,i,a){var o=H5n(e,i,n),s=new Hw(e,o),l=new I1([s],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Yw(["hide-tail"],[l],a)},FRn=function(e,r){var n=r.havingBaseSizing(),i=O6t("\\surd",e*n.sizeMultiplier,k6t,n),a=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,l,u,d,h;return i.type==="small"?(d=1e3+1e3*o+jTe,e<1?a=1:e<1.4&&(a=.7),l=(1+o+XTe)/a,u=(1+o)/a,s=KTe("sqrtMain",l,d,o,r),s.style.minWidth="0.853em",h=.833/a):i.type==="large"?(d=(1e3+jTe)*DF[i.size],u=(DF[i.size]+o)/a,l=(DF[i.size]+o+XTe)/a,s=KTe("sqrtSize"+i.size,l,d,o,r),s.style.minWidth="1.02em",h=1/a):(l=e+o+XTe,u=e+o,d=Math.floor(1e3*e+o)+jTe,s=KTe("sqrtTall",l,d,o,r),s.style.minWidth="0.742em",h=1.056),s.height=u,s.style.height=ir(l),{span:s,advanceWidth:h,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*a}},S6t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),zRn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),T6t=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),DF=[0,1.2,1.8,2.4,3],C6t=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),S6t.has(e)||T6t.has(e))return w6t(e,r,!1,n,i,a);if(zRn.has(e))return A6t(e,DF[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},URn=[{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}],VRn=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"stack"}],k6t=[{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"}],GRn=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.")},O6t=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]},ZTe=function(e,r,n,i,a,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;T6t.has(e)?s=URn:S6t.has(e)?s=k6t:s=VRn;var l=O6t(e,r,s,i);return l.type==="small"?PRn(e,l.style,n,i,a,o):l.type==="large"?w6t(e,l.size,n,i,a,o):A6t(e,r,n,i,a,o)},JTe=function(e,r,n,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,d=Math.max(r-s,n+s),h=Math.max(d/500*l,2*d-u);return ZTe(e,h,!0,i,a,o)},E6t={"\\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}},QRn=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 _6t(t){return"isMiddle"in t}function $J(t,e){var r=IJ(t);if(r&&QRn.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=$J(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:E6t[t.funcName].size,mclass:E6t[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Yt([t.mclass]):C6t(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ep(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(DF[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function R6t(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:$J(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$J(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)=>{R6t(t);for(var r=hl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,o=0;o{R6t(t);var r=uf(t.body,e);if(t.left!=="."){var n=new tr("mo",[Ep(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[Ep(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return zTe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$J(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=_F(e,[]):(r=C6t(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Ep("|","text"):Ep(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 FJ=(t,e)=>{var r=L4(ea(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,o,s=L1(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),d=e.havingBaseSizing();i=i/d.sizeMultiplier;var h=r.height+r.depth+l+u;r.style.paddingLeft=ir(h/2+l);var f=Math.floor(1e3*h*i),p=G5n(f),g=new I1([new Hw("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Yw(["hide-tail"],[g],e),a.style.height=ir(h),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=CRn(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=Ji({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=Ji({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)},zJ=(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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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 D6t={};function G0(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.")},HRn=new Set(["gather","gather*"]);function eCe(t){if(!t.includes("ed"))return!t.includes("*")}function jw(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:h,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 df("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(M6t(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(h&&g.length===h){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||!d)&&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=D4("hline",r,d),ze=D4("hdashline",r,d),we=[{type:"elem",elem:xe,shift:0}];u.length>0;){var ke=u.pop(),Be=ke.pos-P;ke.isDashed?we.push({type:"elem",elem:ze,shift:Be}):we.push({type:"elem",elem:ge,shift:Be})}xe=Ji({positionType:"individualShift",children:we})}if(I.length===0)return Yt(["mord"],[xe],r);var Z=Ji({positionType:"individualShift",children:I}),le=Yt(["tag"],[Z],r);return N1([xe,le])},WRn={c:"center ",l:"left ",r:"right "},H0=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+=O[O.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};G0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=IJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(o){var s=MJ(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 jw(t.parser,a,tCe(t.envName))},htmlBuilder:Q0,mathmlBuilder:H0}),G0({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=jw(t.parser,n,tCe(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:Q0,mathmlBuilder:H0}),G0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=jw(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=IJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(s){var l=MJ(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=jw(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:Q0,mathmlBuilder:H0}),G0({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=jw(t.parser,e,tCe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:I6t,htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){HRn.has(t.envName)&&UJ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:eCe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return jw(t.parser,e,"display")},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:I6t,htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){UJ(t);var e={autoTag:eCe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return jw(t.parser,e,"display")},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return UJ(t),MRn(t.parser)},htmlBuilder:Q0,mathmlBuilder:H0}),_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 P6t=D6t;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 ea(t.body,n)},B6t=(t,e)=>{var r=t.font,n=e.withFont(r);return La(t.body,n)},$6t={"\\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=_J(e[0]),a=n;return a in $6t&&(a=$6t[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:N6t,mathmlBuilder:B6t}),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:NJ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:L1(n)}}}),xr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,o=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:N6t,mathmlBuilder:B6t});var YRn=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var o=ea(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):(h>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var v;if(d){var b=e.fontMetrics().axisHeight;p-o.depth-(b+.5*h){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 Ws(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var o=new tr("mo",[new Ws(t.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return zTe(i)}return r},F6t=(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",d=null;return u||n.startsWith("\\d")?d="display":n.startsWith("\\t")&&(d="text"),F6t({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:YRn,mathmlBuilder:qRn}),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 z6t=["display","text","script","scriptscript"],U6t=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=_J(e[0]),o=a.type==="atom"&&a.family==="open"?U6t(a.text):null,s=_J(e[1]),l=s.type==="atom"&&s.family==="close"?U6t(s.text):null,u=jn(e[2],"size"),d,h=null;u.isBlank?d=!0:(h=u.value,d=h.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=z6t[Number(g.text)]}}else p=jn(p,"textord"),f=z6t[Number(p.text)];return F6t({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:d,barSize:h,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 V6t=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?ea(t.sup,e.havingStyle(r.sup()),e):ea(t.sub,e.havingStyle(r.sub()),e),i=jn(t.base,"horizBrace")):i=jn(t,"horizBrace");var a=ea(i.base,e.havingBaseStyle(Nn.DISPLAY)),o=LJ(i,e),s;if(i.isOver?s=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):s=Ji({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=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=Ji({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)},jRn=(t,e)=>{var r=DJ(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:V6t,mathmlBuilder:jRn}),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:Hs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=hl(t.body,e,!1);return lRn(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=qw(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(","),d=0;d{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)=>qw(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:Hs(e[0]),mathml:Hs(e[1])}},htmlBuilder:(t,e)=>{var r=hl(t.html,e,!1);return N1(r)},mathmlBuilder:(t,e)=>qw(t.mathml,e)});var rCe=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(!MPt(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(","),d=0;d{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 K5n(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 ZPt(t.dimension,e)},mathmlBuilder(t,e){var r=Lo(t.dimension,e);return new i6t(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([],[ea(t.body,e)]),r=Yt(["inner"],[r],e)):r=Yt(["inner"],[ea(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 G6t=(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:Hs(e[0]),text:Hs(e[1]),script:Hs(e[2]),scriptscript:Hs(e[3])}},htmlBuilder:(t,e)=>{var r=G6t(t,e),n=hl(r,e,!1);return N1(n)},mathmlBuilder:(t,e)=>{var r=G6t(t,e);return qw(r,e)}});var Q6t=(t,e,r,n,i,a,o)=>{t=Yt([],[t]);var s=r&&L1(r),l,u;if(e){var d=ea(e,n.havingStyle(i.sup()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-d.depth)}}if(r){var h=ea(r,n.havingStyle(i.sub()),n);l={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+o;f=Ji({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=Ji({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=Ji({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)},H6t=new Set(["\\smallint"]),M4=(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&&!H6t.has(a.name)&&(s=!0);var l,u;if(a.symbol){var d=s?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=Ju(a.name,d,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=l.italic,h.length>0){var f=e6t(h+"Size"+(s?"2":"1"),e);l=Ji({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=hl(a.body,e,!0);p.length===1&&p[0]instanceof lf?(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",[Ep(t.name,t.mode)]),H6t.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",uf(t.body,e));else{r=new tr("mi",[new Ws(t.name.slice(1))]);var n=new tr("mo",[Ep("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=n6t([r,n])}return r},XRn={"∏":"\\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=XRn[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:M4,mathmlBuilder:LF}),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:Hs(n)}},htmlBuilder:M4,mathmlBuilder:LF});var KRn={"∫":"\\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:M4,mathmlBuilder:LF}),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:M4,mathmlBuilder:LF}),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=KRn[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:M4,mathmlBuilder:LF});var W6t=(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(h=>{var f="text"in h?h.text:void 0;return typeof f=="string"?{type:"textord",mode:h.mode,text:f}:h}),l=hl(s,e.withFont("mathrm"),!0),u=0;u{for(var r=uf(t.body,e.withFont("mathrm")),n=!0,i=0;id.toText()).join("");r=[new Ws(s)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[Ep("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):n6t([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:Hs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:W6t,mathmlBuilder:ZRn}),_e("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),IC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?N1(hl(t.body,e,!1)):Yt(["mord"],hl(t.body,e,!0),e)},mathmlBuilder(t,e){return qw(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=ea(t.body,e.havingCrampedStyle()),n=D4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ji({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 Ws("‾")]);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:Hs(n)}},htmlBuilder:(t,e)=>{var r=hl(t.body,e.withPhantom(),!1);return N1(r)},mathmlBuilder:(t,e)=>{var r=uf(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"],[ea(t.body,e.withPhantom())]),n=Yt(["fix"],[]);return Yt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=uf(Hs(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=ea(t.body,e),n=Lo(t.dy,e);return Ji({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 Y6t(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 Y6t(t.body,r,e)};xr({type:"sizing",names:q6t,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:q6t.indexOf(n)+1,body:a}},htmlBuilder:JRn,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=uf(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([],[ea(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=ea(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=L4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+o&&(o=(o+h-r.height-r.depth)/2);var f=l.height-r.height-o-u;r.style.paddingLeft=ir(d);var p=Ji({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=ea(t.index,g,e),v=.6*(p.height-p.depth),y=Ji({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 nCe={display:Nn.DISPLAY,text:Nn.TEXT,script:Nn.SCRIPT,scriptscript:Nn.SCRIPTSCRIPT};function e4n(t){return t in nCe}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(!e4n(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(t,e){var r=nCe[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Y6t(t.body,n,e)},mathmlBuilder(t,e){var r=nCe[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=uf(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 t4n=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?M4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Nn.DISPLAY.size||n.limits);return a?W6t:null}else{if(n.type==="accent")return L1(n.base)?GTe:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?V6t:null}else return null}else return null};IC({type:"supsub",htmlBuilder(t,e){var r=t4n(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,o=ea(n,e),s,l,u=e.fontMetrics(),d=0,h=0,f=n&&L1(n);if(i){var p=e.havingStyle(e.style.sup());s=ea(i,p,e),f||(d=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=ea(a,g,e),f||(h=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 lf||x){var w;b=ir(-((w=o.italic)!=null?w:0))}}var A;if(s&&l){d=Math.max(d,m,s.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var S=u.defaultRuleThickness,T=4*S;if(d-s.depth-(l.height-h)0&&(d+=C,h-=C)}var O=[{type:"elem",elem:l,shift:h,marginRight:y,marginLeft:b},{type:"elem",elem:s,shift:-d,marginRight:y}];A=Ji({positionType:"individualShift",children:O})}else if(l){h=Math.max(h,u.sub1,l.height-.8*u.xHeight);var E=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];A=Ji({positionType:"shift",positionData:h,children:E})}else if(s)d=Math.max(d,m,s.depth+.25*u.xHeight),A=Ji({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=$Te(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)}}),IC({type:"atom",htmlBuilder(t,e){return MTe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[Ep(t.text,t.mode)]);if(t.family==="bin"){var n=UTe(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 j6t={mi:"italic",mn:"normal",mtext:"normal"};IC({type:"mathord",htmlBuilder(t,e){return CJ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[Ep(t.text,t.mode,e)]),n=UTe(t,e)||"italic";return n!==j6t[r.type]&&r.setAttribute("mathvariant",n),r}}),IC({type:"textord",htmlBuilder(t,e){return CJ(t,e,"textord")},mathmlBuilder(t,e){var r=Ep(t.text,t.mode,e),n=UTe(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!==j6t[i.type]&&i.setAttribute("mathvariant",n),i}});var iCe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},aCe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};IC({type:"spacing",htmlBuilder(t,e){if(aCe.hasOwnProperty(t.text)){var r=aCe[t.text].className||"";if(t.mode==="text"){var n=CJ(t,e,"textord");return n.classes.push(r),n}else return Yt(["mspace",r],[MTe(t.text,t.mode,e)],e)}else{if(iCe.hasOwnProperty(t.text))return Yt(["mspace",iCe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(aCe.hasOwnProperty(t.text))r=new tr("mtext",[new Ws(" ")]);else{if(iCe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var X6t=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};IC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[X6t(),new tr("mtd",[qw(t.body,e)]),X6t(),new tr("mtd",[qw(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var K6t={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Z6t={"\\textbf":"textbf","\\textmd":"textmd"},r4n={"\\textit":"textit","\\textup":"textup"},J6t=(t,e)=>{var r=t.font;if(r){if(K6t[r])return e.withTextFontFamily(K6t[r]);if(Z6t[r])return e.withTextFontWeight(Z6t[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(r4n[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:Hs(i),font:n}},htmlBuilder(t,e){var r=J6t(t,e),n=hl(t.body,r,!0);return Yt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=J6t(t,e);return qw(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=ea(t.body,e),n=D4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ji({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 Ws("‾")]);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=ea(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Ji({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=eNt(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Xw=t6t,tNt=`[ \r +-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 qRn(t){return"toText"in t}class E4{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(qRn(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var bTe={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},jRn={ex:!0,em:!0,mu:!0},MPt=function(e){return typeof e!="string"&&(e=e.unit),e in bTe||e in jRn||e==="ex"},Lo=function(e,r){var n;if(e.unit in bTe)n=bTe[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"},Qw=function(e){return e.filter(r=>r).join(" ")},xTe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=SRn(n)+":"+i+";")}return r},IPt=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)}},PPt=function(e){var r=document.createElement(e);r.className=Qw(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]/,NPt=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+du(Qw(this.classes))+'"');var n=xTe(this.style);n&&(r+=' style="'+du(n)+'"');for(var i of Object.keys(this.attributes)){if(XRn.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+du(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class _4{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,IPt.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return PPt.call(this,"span")}toMarkup(){return NPt.call(this,"span")}}let bJ=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,IPt.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 PPt.call(this,"a")}toMarkup(){return NPt.call(this,"a")}};class KRn{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=''+du(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Qw(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+=xTe(this.style),n&&(e=!0,r+=' style="'+du(n)+'"');var i=du(this.text);return e?(r+=">",r+=i,r+="",r):i}}class I1{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 wTe{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 t5n=t=>t instanceof _4||t instanceof bJ||t instanceof E4,V0={"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]}},xJ={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]},BPt={Å:"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 $Pt(t,e){V0[t]=e}function ATe(t,e,r){if(!V0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=V0[e][n];if(!i&&t[0]in BPt&&(n=BPt[t[0]].charCodeAt(0),i=V0[e][n]),!i&&r==="text"&&DPt(n)&&(i=V0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var STe={};function r5n(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!STe[e]){var r=STe[e]={cssEmPerMu:xJ.quad[e]/18};for(var n in xJ)xJ.hasOwnProperty(n)&&(r[n]=xJ[n][e])}return STe[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 de="math",zt="text",Se="main",qe="ams",To="accent-token",Or="bin",Ku="close",R4="inner",sn="mathord",Qs="op-token",cf="open",EF="punct",Xe="rel",P1="spacing",Je="textord";re(de,Se,Xe,"≡","\\equiv",!0),re(de,Se,Xe,"≺","\\prec",!0),re(de,Se,Xe,"≻","\\succ",!0),re(de,Se,Xe,"∼","\\sim",!0),re(de,Se,Xe,"⊥","\\perp"),re(de,Se,Xe,"⪯","\\preceq",!0),re(de,Se,Xe,"⪰","\\succeq",!0),re(de,Se,Xe,"≃","\\simeq",!0),re(de,Se,Xe,"∣","\\mid",!0),re(de,Se,Xe,"≪","\\ll",!0),re(de,Se,Xe,"≫","\\gg",!0),re(de,Se,Xe,"≍","\\asymp",!0),re(de,Se,Xe,"∥","\\parallel"),re(de,Se,Xe,"⋈","\\bowtie",!0),re(de,Se,Xe,"⌣","\\smile",!0),re(de,Se,Xe,"⊑","\\sqsubseteq",!0),re(de,Se,Xe,"⊒","\\sqsupseteq",!0),re(de,Se,Xe,"≐","\\doteq",!0),re(de,Se,Xe,"⌢","\\frown",!0),re(de,Se,Xe,"∋","\\ni",!0),re(de,Se,Xe,"∝","\\propto",!0),re(de,Se,Xe,"⊢","\\vdash",!0),re(de,Se,Xe,"⊣","\\dashv",!0),re(de,Se,Xe,"∋","\\owns"),re(de,Se,EF,".","\\ldotp"),re(de,Se,EF,"⋅","\\cdotp"),re(de,Se,EF,"⋅","·"),re(zt,Se,Je,"⋅","·"),re(de,Se,Je,"#","\\#"),re(zt,Se,Je,"#","\\#"),re(de,Se,Je,"&","\\&"),re(zt,Se,Je,"&","\\&"),re(de,Se,Je,"ℵ","\\aleph",!0),re(de,Se,Je,"∀","\\forall",!0),re(de,Se,Je,"ℏ","\\hbar",!0),re(de,Se,Je,"∃","\\exists",!0),re(de,Se,Je,"∇","\\nabla",!0),re(de,Se,Je,"♭","\\flat",!0),re(de,Se,Je,"ℓ","\\ell",!0),re(de,Se,Je,"♮","\\natural",!0),re(de,Se,Je,"♣","\\clubsuit",!0),re(de,Se,Je,"℘","\\wp",!0),re(de,Se,Je,"♯","\\sharp",!0),re(de,Se,Je,"♢","\\diamondsuit",!0),re(de,Se,Je,"ℜ","\\Re",!0),re(de,Se,Je,"♡","\\heartsuit",!0),re(de,Se,Je,"ℑ","\\Im",!0),re(de,Se,Je,"♠","\\spadesuit",!0),re(de,Se,Je,"§","\\S",!0),re(zt,Se,Je,"§","\\S"),re(de,Se,Je,"¶","\\P",!0),re(zt,Se,Je,"¶","\\P"),re(de,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\textdagger"),re(de,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\textdaggerdbl"),re(de,Se,Ku,"⎱","\\rmoustache",!0),re(de,Se,cf,"⎰","\\lmoustache",!0),re(de,Se,Ku,"⟯","\\rgroup",!0),re(de,Se,cf,"⟮","\\lgroup",!0),re(de,Se,Or,"∓","\\mp",!0),re(de,Se,Or,"⊖","\\ominus",!0),re(de,Se,Or,"⊎","\\uplus",!0),re(de,Se,Or,"⊓","\\sqcap",!0),re(de,Se,Or,"∗","\\ast"),re(de,Se,Or,"⊔","\\sqcup",!0),re(de,Se,Or,"◯","\\bigcirc",!0),re(de,Se,Or,"∙","\\bullet",!0),re(de,Se,Or,"‡","\\ddagger"),re(de,Se,Or,"≀","\\wr",!0),re(de,Se,Or,"⨿","\\amalg"),re(de,Se,Or,"&","\\And"),re(de,Se,Xe,"⟵","\\longleftarrow",!0),re(de,Se,Xe,"⇐","\\Leftarrow",!0),re(de,Se,Xe,"⟸","\\Longleftarrow",!0),re(de,Se,Xe,"⟶","\\longrightarrow",!0),re(de,Se,Xe,"⇒","\\Rightarrow",!0),re(de,Se,Xe,"⟹","\\Longrightarrow",!0),re(de,Se,Xe,"↔","\\leftrightarrow",!0),re(de,Se,Xe,"⟷","\\longleftrightarrow",!0),re(de,Se,Xe,"⇔","\\Leftrightarrow",!0),re(de,Se,Xe,"⟺","\\Longleftrightarrow",!0),re(de,Se,Xe,"↦","\\mapsto",!0),re(de,Se,Xe,"⟼","\\longmapsto",!0),re(de,Se,Xe,"↗","\\nearrow",!0),re(de,Se,Xe,"↩","\\hookleftarrow",!0),re(de,Se,Xe,"↪","\\hookrightarrow",!0),re(de,Se,Xe,"↘","\\searrow",!0),re(de,Se,Xe,"↼","\\leftharpoonup",!0),re(de,Se,Xe,"⇀","\\rightharpoonup",!0),re(de,Se,Xe,"↙","\\swarrow",!0),re(de,Se,Xe,"↽","\\leftharpoondown",!0),re(de,Se,Xe,"⇁","\\rightharpoondown",!0),re(de,Se,Xe,"↖","\\nwarrow",!0),re(de,Se,Xe,"⇌","\\rightleftharpoons",!0),re(de,qe,Xe,"≮","\\nless",!0),re(de,qe,Xe,"","\\@nleqslant"),re(de,qe,Xe,"","\\@nleqq"),re(de,qe,Xe,"⪇","\\lneq",!0),re(de,qe,Xe,"≨","\\lneqq",!0),re(de,qe,Xe,"","\\@lvertneqq"),re(de,qe,Xe,"⋦","\\lnsim",!0),re(de,qe,Xe,"⪉","\\lnapprox",!0),re(de,qe,Xe,"⊀","\\nprec",!0),re(de,qe,Xe,"⋠","\\npreceq",!0),re(de,qe,Xe,"⋨","\\precnsim",!0),re(de,qe,Xe,"⪹","\\precnapprox",!0),re(de,qe,Xe,"≁","\\nsim",!0),re(de,qe,Xe,"","\\@nshortmid"),re(de,qe,Xe,"∤","\\nmid",!0),re(de,qe,Xe,"⊬","\\nvdash",!0),re(de,qe,Xe,"⊭","\\nvDash",!0),re(de,qe,Xe,"⋪","\\ntriangleleft"),re(de,qe,Xe,"⋬","\\ntrianglelefteq",!0),re(de,qe,Xe,"⊊","\\subsetneq",!0),re(de,qe,Xe,"","\\@varsubsetneq"),re(de,qe,Xe,"⫋","\\subsetneqq",!0),re(de,qe,Xe,"","\\@varsubsetneqq"),re(de,qe,Xe,"≯","\\ngtr",!0),re(de,qe,Xe,"","\\@ngeqslant"),re(de,qe,Xe,"","\\@ngeqq"),re(de,qe,Xe,"⪈","\\gneq",!0),re(de,qe,Xe,"≩","\\gneqq",!0),re(de,qe,Xe,"","\\@gvertneqq"),re(de,qe,Xe,"⋧","\\gnsim",!0),re(de,qe,Xe,"⪊","\\gnapprox",!0),re(de,qe,Xe,"⊁","\\nsucc",!0),re(de,qe,Xe,"⋡","\\nsucceq",!0),re(de,qe,Xe,"⋩","\\succnsim",!0),re(de,qe,Xe,"⪺","\\succnapprox",!0),re(de,qe,Xe,"≆","\\ncong",!0),re(de,qe,Xe,"","\\@nshortparallel"),re(de,qe,Xe,"∦","\\nparallel",!0),re(de,qe,Xe,"⊯","\\nVDash",!0),re(de,qe,Xe,"⋫","\\ntriangleright"),re(de,qe,Xe,"⋭","\\ntrianglerighteq",!0),re(de,qe,Xe,"","\\@nsupseteqq"),re(de,qe,Xe,"⊋","\\supsetneq",!0),re(de,qe,Xe,"","\\@varsupsetneq"),re(de,qe,Xe,"⫌","\\supsetneqq",!0),re(de,qe,Xe,"","\\@varsupsetneqq"),re(de,qe,Xe,"⊮","\\nVdash",!0),re(de,qe,Xe,"⪵","\\precneqq",!0),re(de,qe,Xe,"⪶","\\succneqq",!0),re(de,qe,Xe,"","\\@nsubseteqq"),re(de,qe,Or,"⊴","\\unlhd"),re(de,qe,Or,"⊵","\\unrhd"),re(de,qe,Xe,"↚","\\nleftarrow",!0),re(de,qe,Xe,"↛","\\nrightarrow",!0),re(de,qe,Xe,"⇍","\\nLeftarrow",!0),re(de,qe,Xe,"⇏","\\nRightarrow",!0),re(de,qe,Xe,"↮","\\nleftrightarrow",!0),re(de,qe,Xe,"⇎","\\nLeftrightarrow",!0),re(de,qe,Xe,"△","\\vartriangle"),re(de,qe,Je,"ℏ","\\hslash"),re(de,qe,Je,"▽","\\triangledown"),re(de,qe,Je,"◊","\\lozenge"),re(de,qe,Je,"Ⓢ","\\circledS"),re(de,qe,Je,"®","\\circledR"),re(zt,qe,Je,"®","\\circledR"),re(de,qe,Je,"∡","\\measuredangle",!0),re(de,qe,Je,"∄","\\nexists"),re(de,qe,Je,"℧","\\mho"),re(de,qe,Je,"Ⅎ","\\Finv",!0),re(de,qe,Je,"⅁","\\Game",!0),re(de,qe,Je,"‵","\\backprime"),re(de,qe,Je,"▲","\\blacktriangle"),re(de,qe,Je,"▼","\\blacktriangledown"),re(de,qe,Je,"■","\\blacksquare"),re(de,qe,Je,"⧫","\\blacklozenge"),re(de,qe,Je,"★","\\bigstar"),re(de,qe,Je,"∢","\\sphericalangle",!0),re(de,qe,Je,"∁","\\complement",!0),re(de,qe,Je,"ð","\\eth",!0),re(zt,Se,Je,"ð","ð"),re(de,qe,Je,"╱","\\diagup"),re(de,qe,Je,"╲","\\diagdown"),re(de,qe,Je,"□","\\square"),re(de,qe,Je,"□","\\Box"),re(de,qe,Je,"◊","\\Diamond"),re(de,qe,Je,"¥","\\yen",!0),re(zt,qe,Je,"¥","\\yen",!0),re(de,qe,Je,"✓","\\checkmark",!0),re(zt,qe,Je,"✓","\\checkmark"),re(de,qe,Je,"ℶ","\\beth",!0),re(de,qe,Je,"ℸ","\\daleth",!0),re(de,qe,Je,"ℷ","\\gimel",!0),re(de,qe,Je,"ϝ","\\digamma",!0),re(de,qe,Je,"ϰ","\\varkappa"),re(de,qe,cf,"┌","\\@ulcorner",!0),re(de,qe,Ku,"┐","\\@urcorner",!0),re(de,qe,cf,"└","\\@llcorner",!0),re(de,qe,Ku,"┘","\\@lrcorner",!0),re(de,qe,Xe,"≦","\\leqq",!0),re(de,qe,Xe,"⩽","\\leqslant",!0),re(de,qe,Xe,"⪕","\\eqslantless",!0),re(de,qe,Xe,"≲","\\lesssim",!0),re(de,qe,Xe,"⪅","\\lessapprox",!0),re(de,qe,Xe,"≊","\\approxeq",!0),re(de,qe,Or,"⋖","\\lessdot"),re(de,qe,Xe,"⋘","\\lll",!0),re(de,qe,Xe,"≶","\\lessgtr",!0),re(de,qe,Xe,"⋚","\\lesseqgtr",!0),re(de,qe,Xe,"⪋","\\lesseqqgtr",!0),re(de,qe,Xe,"≑","\\doteqdot"),re(de,qe,Xe,"≓","\\risingdotseq",!0),re(de,qe,Xe,"≒","\\fallingdotseq",!0),re(de,qe,Xe,"∽","\\backsim",!0),re(de,qe,Xe,"⋍","\\backsimeq",!0),re(de,qe,Xe,"⫅","\\subseteqq",!0),re(de,qe,Xe,"⋐","\\Subset",!0),re(de,qe,Xe,"⊏","\\sqsubset",!0),re(de,qe,Xe,"≼","\\preccurlyeq",!0),re(de,qe,Xe,"⋞","\\curlyeqprec",!0),re(de,qe,Xe,"≾","\\precsim",!0),re(de,qe,Xe,"⪷","\\precapprox",!0),re(de,qe,Xe,"⊲","\\vartriangleleft"),re(de,qe,Xe,"⊴","\\trianglelefteq"),re(de,qe,Xe,"⊨","\\vDash",!0),re(de,qe,Xe,"⊪","\\Vvdash",!0),re(de,qe,Xe,"⌣","\\smallsmile"),re(de,qe,Xe,"⌢","\\smallfrown"),re(de,qe,Xe,"≏","\\bumpeq",!0),re(de,qe,Xe,"≎","\\Bumpeq",!0),re(de,qe,Xe,"≧","\\geqq",!0),re(de,qe,Xe,"⩾","\\geqslant",!0),re(de,qe,Xe,"⪖","\\eqslantgtr",!0),re(de,qe,Xe,"≳","\\gtrsim",!0),re(de,qe,Xe,"⪆","\\gtrapprox",!0),re(de,qe,Or,"⋗","\\gtrdot"),re(de,qe,Xe,"⋙","\\ggg",!0),re(de,qe,Xe,"≷","\\gtrless",!0),re(de,qe,Xe,"⋛","\\gtreqless",!0),re(de,qe,Xe,"⪌","\\gtreqqless",!0),re(de,qe,Xe,"≖","\\eqcirc",!0),re(de,qe,Xe,"≗","\\circeq",!0),re(de,qe,Xe,"≜","\\triangleq",!0),re(de,qe,Xe,"∼","\\thicksim"),re(de,qe,Xe,"≈","\\thickapprox"),re(de,qe,Xe,"⫆","\\supseteqq",!0),re(de,qe,Xe,"⋑","\\Supset",!0),re(de,qe,Xe,"⊐","\\sqsupset",!0),re(de,qe,Xe,"≽","\\succcurlyeq",!0),re(de,qe,Xe,"⋟","\\curlyeqsucc",!0),re(de,qe,Xe,"≿","\\succsim",!0),re(de,qe,Xe,"⪸","\\succapprox",!0),re(de,qe,Xe,"⊳","\\vartriangleright"),re(de,qe,Xe,"⊵","\\trianglerighteq"),re(de,qe,Xe,"⊩","\\Vdash",!0),re(de,qe,Xe,"∣","\\shortmid"),re(de,qe,Xe,"∥","\\shortparallel"),re(de,qe,Xe,"≬","\\between",!0),re(de,qe,Xe,"⋔","\\pitchfork",!0),re(de,qe,Xe,"∝","\\varpropto"),re(de,qe,Xe,"◀","\\blacktriangleleft"),re(de,qe,Xe,"∴","\\therefore",!0),re(de,qe,Xe,"∍","\\backepsilon"),re(de,qe,Xe,"▶","\\blacktriangleright"),re(de,qe,Xe,"∵","\\because",!0),re(de,qe,Xe,"⋘","\\llless"),re(de,qe,Xe,"⋙","\\gggtr"),re(de,qe,Or,"⊲","\\lhd"),re(de,qe,Or,"⊳","\\rhd"),re(de,qe,Xe,"≂","\\eqsim",!0),re(de,Se,Xe,"⋈","\\Join"),re(de,qe,Xe,"≑","\\Doteq",!0),re(de,qe,Or,"∔","\\dotplus",!0),re(de,qe,Or,"∖","\\smallsetminus"),re(de,qe,Or,"⋒","\\Cap",!0),re(de,qe,Or,"⋓","\\Cup",!0),re(de,qe,Or,"⩞","\\doublebarwedge",!0),re(de,qe,Or,"⊟","\\boxminus",!0),re(de,qe,Or,"⊞","\\boxplus",!0),re(de,qe,Or,"⋇","\\divideontimes",!0),re(de,qe,Or,"⋉","\\ltimes",!0),re(de,qe,Or,"⋊","\\rtimes",!0),re(de,qe,Or,"⋋","\\leftthreetimes",!0),re(de,qe,Or,"⋌","\\rightthreetimes",!0),re(de,qe,Or,"⋏","\\curlywedge",!0),re(de,qe,Or,"⋎","\\curlyvee",!0),re(de,qe,Or,"⊝","\\circleddash",!0),re(de,qe,Or,"⊛","\\circledast",!0),re(de,qe,Or,"⋅","\\centerdot"),re(de,qe,Or,"⊺","\\intercal",!0),re(de,qe,Or,"⋒","\\doublecap"),re(de,qe,Or,"⋓","\\doublecup"),re(de,qe,Or,"⊠","\\boxtimes",!0),re(de,qe,Xe,"⇢","\\dashrightarrow",!0),re(de,qe,Xe,"⇠","\\dashleftarrow",!0),re(de,qe,Xe,"⇇","\\leftleftarrows",!0),re(de,qe,Xe,"⇆","\\leftrightarrows",!0),re(de,qe,Xe,"⇚","\\Lleftarrow",!0),re(de,qe,Xe,"↞","\\twoheadleftarrow",!0),re(de,qe,Xe,"↢","\\leftarrowtail",!0),re(de,qe,Xe,"↫","\\looparrowleft",!0),re(de,qe,Xe,"⇋","\\leftrightharpoons",!0),re(de,qe,Xe,"↶","\\curvearrowleft",!0),re(de,qe,Xe,"↺","\\circlearrowleft",!0),re(de,qe,Xe,"↰","\\Lsh",!0),re(de,qe,Xe,"⇈","\\upuparrows",!0),re(de,qe,Xe,"↿","\\upharpoonleft",!0),re(de,qe,Xe,"⇃","\\downharpoonleft",!0),re(de,Se,Xe,"⊶","\\origof",!0),re(de,Se,Xe,"⊷","\\imageof",!0),re(de,qe,Xe,"⊸","\\multimap",!0),re(de,qe,Xe,"↭","\\leftrightsquigarrow",!0),re(de,qe,Xe,"⇉","\\rightrightarrows",!0),re(de,qe,Xe,"⇄","\\rightleftarrows",!0),re(de,qe,Xe,"↠","\\twoheadrightarrow",!0),re(de,qe,Xe,"↣","\\rightarrowtail",!0),re(de,qe,Xe,"↬","\\looparrowright",!0),re(de,qe,Xe,"↷","\\curvearrowright",!0),re(de,qe,Xe,"↻","\\circlearrowright",!0),re(de,qe,Xe,"↱","\\Rsh",!0),re(de,qe,Xe,"⇊","\\downdownarrows",!0),re(de,qe,Xe,"↾","\\upharpoonright",!0),re(de,qe,Xe,"⇂","\\downharpoonright",!0),re(de,qe,Xe,"⇝","\\rightsquigarrow",!0),re(de,qe,Xe,"⇝","\\leadsto"),re(de,qe,Xe,"⇛","\\Rrightarrow",!0),re(de,qe,Xe,"↾","\\restriction"),re(de,Se,Je,"‘","`"),re(de,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\textdollar"),re(de,Se,Je,"%","\\%"),re(zt,Se,Je,"%","\\%"),re(de,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\textunderscore"),re(de,Se,Je,"∠","\\angle",!0),re(de,Se,Je,"∞","\\infty",!0),re(de,Se,Je,"′","\\prime"),re(de,Se,Je,"△","\\triangle"),re(de,Se,Je,"Γ","\\Gamma",!0),re(de,Se,Je,"Δ","\\Delta",!0),re(de,Se,Je,"Θ","\\Theta",!0),re(de,Se,Je,"Λ","\\Lambda",!0),re(de,Se,Je,"Ξ","\\Xi",!0),re(de,Se,Je,"Π","\\Pi",!0),re(de,Se,Je,"Σ","\\Sigma",!0),re(de,Se,Je,"Υ","\\Upsilon",!0),re(de,Se,Je,"Φ","\\Phi",!0),re(de,Se,Je,"Ψ","\\Psi",!0),re(de,Se,Je,"Ω","\\Omega",!0),re(de,Se,Je,"A","Α"),re(de,Se,Je,"B","Β"),re(de,Se,Je,"E","Ε"),re(de,Se,Je,"Z","Ζ"),re(de,Se,Je,"H","Η"),re(de,Se,Je,"I","Ι"),re(de,Se,Je,"K","Κ"),re(de,Se,Je,"M","Μ"),re(de,Se,Je,"N","Ν"),re(de,Se,Je,"O","Ο"),re(de,Se,Je,"P","Ρ"),re(de,Se,Je,"T","Τ"),re(de,Se,Je,"X","Χ"),re(de,Se,Je,"¬","\\neg",!0),re(de,Se,Je,"¬","\\lnot"),re(de,Se,Je,"⊤","\\top"),re(de,Se,Je,"⊥","\\bot"),re(de,Se,Je,"∅","\\emptyset"),re(de,qe,Je,"∅","\\varnothing"),re(de,Se,sn,"α","\\alpha",!0),re(de,Se,sn,"β","\\beta",!0),re(de,Se,sn,"γ","\\gamma",!0),re(de,Se,sn,"δ","\\delta",!0),re(de,Se,sn,"ϵ","\\epsilon",!0),re(de,Se,sn,"ζ","\\zeta",!0),re(de,Se,sn,"η","\\eta",!0),re(de,Se,sn,"θ","\\theta",!0),re(de,Se,sn,"ι","\\iota",!0),re(de,Se,sn,"κ","\\kappa",!0),re(de,Se,sn,"λ","\\lambda",!0),re(de,Se,sn,"μ","\\mu",!0),re(de,Se,sn,"ν","\\nu",!0),re(de,Se,sn,"ξ","\\xi",!0),re(de,Se,sn,"ο","\\omicron",!0),re(de,Se,sn,"π","\\pi",!0),re(de,Se,sn,"ρ","\\rho",!0),re(de,Se,sn,"σ","\\sigma",!0),re(de,Se,sn,"τ","\\tau",!0),re(de,Se,sn,"υ","\\upsilon",!0),re(de,Se,sn,"ϕ","\\phi",!0),re(de,Se,sn,"χ","\\chi",!0),re(de,Se,sn,"ψ","\\psi",!0),re(de,Se,sn,"ω","\\omega",!0),re(de,Se,sn,"ε","\\varepsilon",!0),re(de,Se,sn,"ϑ","\\vartheta",!0),re(de,Se,sn,"ϖ","\\varpi",!0),re(de,Se,sn,"ϱ","\\varrho",!0),re(de,Se,sn,"ς","\\varsigma",!0),re(de,Se,sn,"φ","\\varphi",!0),re(de,Se,Or,"∗","*",!0),re(de,Se,Or,"+","+"),re(de,Se,Or,"−","-",!0),re(de,Se,Or,"⋅","\\cdot",!0),re(de,Se,Or,"∘","\\circ",!0),re(de,Se,Or,"÷","\\div",!0),re(de,Se,Or,"±","\\pm",!0),re(de,Se,Or,"×","\\times",!0),re(de,Se,Or,"∩","\\cap",!0),re(de,Se,Or,"∪","\\cup",!0),re(de,Se,Or,"∖","\\setminus",!0),re(de,Se,Or,"∧","\\land"),re(de,Se,Or,"∨","\\lor"),re(de,Se,Or,"∧","\\wedge",!0),re(de,Se,Or,"∨","\\vee",!0),re(de,Se,Je,"√","\\surd"),re(de,Se,cf,"⟨","\\langle",!0),re(de,Se,cf,"∣","\\lvert"),re(de,Se,cf,"∥","\\lVert"),re(de,Se,Ku,"?","?"),re(de,Se,Ku,"!","!"),re(de,Se,Ku,"⟩","\\rangle",!0),re(de,Se,Ku,"∣","\\rvert"),re(de,Se,Ku,"∥","\\rVert"),re(de,Se,Xe,"=","="),re(de,Se,Xe,":",":"),re(de,Se,Xe,"≈","\\approx",!0),re(de,Se,Xe,"≅","\\cong",!0),re(de,Se,Xe,"≥","\\ge"),re(de,Se,Xe,"≥","\\geq",!0),re(de,Se,Xe,"←","\\gets"),re(de,Se,Xe,">","\\gt",!0),re(de,Se,Xe,"∈","\\in",!0),re(de,Se,Xe,"","\\@not"),re(de,Se,Xe,"⊂","\\subset",!0),re(de,Se,Xe,"⊃","\\supset",!0),re(de,Se,Xe,"⊆","\\subseteq",!0),re(de,Se,Xe,"⊇","\\supseteq",!0),re(de,qe,Xe,"⊈","\\nsubseteq",!0),re(de,qe,Xe,"⊉","\\nsupseteq",!0),re(de,Se,Xe,"⊨","\\models"),re(de,Se,Xe,"←","\\leftarrow",!0),re(de,Se,Xe,"≤","\\le"),re(de,Se,Xe,"≤","\\leq",!0),re(de,Se,Xe,"<","\\lt",!0),re(de,Se,Xe,"→","\\rightarrow",!0),re(de,Se,Xe,"→","\\to"),re(de,qe,Xe,"≱","\\ngeq",!0),re(de,qe,Xe,"≰","\\nleq",!0),re(de,Se,P1," ","\\ "),re(de,Se,P1," ","\\space"),re(de,Se,P1," ","\\nobreakspace"),re(zt,Se,P1," ","\\ "),re(zt,Se,P1," "," "),re(zt,Se,P1," ","\\space"),re(zt,Se,P1," ","\\nobreakspace"),re(de,Se,P1,"","\\nobreak"),re(de,Se,P1,"","\\allowbreak"),re(de,Se,EF,",",","),re(de,Se,EF,";",";"),re(de,qe,Or,"⊼","\\barwedge",!0),re(de,qe,Or,"⊻","\\veebar",!0),re(de,Se,Or,"⊙","\\odot",!0),re(de,Se,Or,"⊕","\\oplus",!0),re(de,Se,Or,"⊗","\\otimes",!0),re(de,Se,Je,"∂","\\partial",!0),re(de,Se,Or,"⊘","\\oslash",!0),re(de,qe,Or,"⊚","\\circledcirc",!0),re(de,qe,Or,"⊡","\\boxdot",!0),re(de,Se,Or,"△","\\bigtriangleup"),re(de,Se,Or,"▽","\\bigtriangledown"),re(de,Se,Or,"†","\\dagger"),re(de,Se,Or,"⋄","\\diamond"),re(de,Se,Or,"⋆","\\star"),re(de,Se,Or,"◃","\\triangleleft"),re(de,Se,Or,"▹","\\triangleright"),re(de,Se,cf,"{","\\{"),re(zt,Se,Je,"{","\\{"),re(zt,Se,Je,"{","\\textbraceleft"),re(de,Se,Ku,"}","\\}"),re(zt,Se,Je,"}","\\}"),re(zt,Se,Je,"}","\\textbraceright"),re(de,Se,cf,"{","\\lbrace"),re(de,Se,Ku,"}","\\rbrace"),re(de,Se,cf,"[","\\lbrack",!0),re(zt,Se,Je,"[","\\lbrack",!0),re(de,Se,Ku,"]","\\rbrack",!0),re(zt,Se,Je,"]","\\rbrack",!0),re(de,Se,cf,"(","\\lparen",!0),re(de,Se,Ku,")","\\rparen",!0),re(zt,Se,Je,"<","\\textless",!0),re(zt,Se,Je,">","\\textgreater",!0),re(de,Se,cf,"⌊","\\lfloor",!0),re(de,Se,Ku,"⌋","\\rfloor",!0),re(de,Se,cf,"⌈","\\lceil",!0),re(de,Se,Ku,"⌉","\\rceil",!0),re(de,Se,Je,"\\","\\backslash"),re(de,Se,Je,"∣","|"),re(de,Se,Je,"∣","\\vert"),re(zt,Se,Je,"|","\\textbar",!0),re(de,Se,Je,"∥","\\|"),re(de,Se,Je,"∥","\\Vert"),re(zt,Se,Je,"∥","\\textbardbl"),re(zt,Se,Je,"~","\\textasciitilde"),re(zt,Se,Je,"\\","\\textbackslash"),re(zt,Se,Je,"^","\\textasciicircum"),re(de,Se,Xe,"↑","\\uparrow",!0),re(de,Se,Xe,"⇑","\\Uparrow",!0),re(de,Se,Xe,"↓","\\downarrow",!0),re(de,Se,Xe,"⇓","\\Downarrow",!0),re(de,Se,Xe,"↕","\\updownarrow",!0),re(de,Se,Xe,"⇕","\\Updownarrow",!0),re(de,Se,Qs,"∐","\\coprod"),re(de,Se,Qs,"⋁","\\bigvee"),re(de,Se,Qs,"⋀","\\bigwedge"),re(de,Se,Qs,"⨄","\\biguplus"),re(de,Se,Qs,"⋂","\\bigcap"),re(de,Se,Qs,"⋃","\\bigcup"),re(de,Se,Qs,"∫","\\int"),re(de,Se,Qs,"∫","\\intop"),re(de,Se,Qs,"∬","\\iint"),re(de,Se,Qs,"∭","\\iiint"),re(de,Se,Qs,"∏","\\prod"),re(de,Se,Qs,"∑","\\sum"),re(de,Se,Qs,"⨂","\\bigotimes"),re(de,Se,Qs,"⨁","\\bigoplus"),re(de,Se,Qs,"⨀","\\bigodot"),re(de,Se,Qs,"∮","\\oint"),re(de,Se,Qs,"∯","\\oiint"),re(de,Se,Qs,"∰","\\oiiint"),re(de,Se,Qs,"⨆","\\bigsqcup"),re(de,Se,Qs,"∫","\\smallint"),re(zt,Se,R4,"…","\\textellipsis"),re(de,Se,R4,"…","\\mathellipsis"),re(zt,Se,R4,"…","\\ldots",!0),re(de,Se,R4,"…","\\ldots",!0),re(de,Se,R4,"⋯","\\@cdots",!0),re(de,Se,R4,"⋱","\\ddots",!0),re(de,Se,Je,"⋮","\\varvdots"),re(zt,Se,Je,"⋮","\\varvdots"),re(de,Se,To,"ˊ","\\acute"),re(de,Se,To,"ˋ","\\grave"),re(de,Se,To,"¨","\\ddot"),re(de,Se,To,"~","\\tilde"),re(de,Se,To,"ˉ","\\bar"),re(de,Se,To,"˘","\\breve"),re(de,Se,To,"ˇ","\\check"),re(de,Se,To,"^","\\hat"),re(de,Se,To,"⃗","\\vec"),re(de,Se,To,"˙","\\dot"),re(de,Se,To,"˚","\\mathring"),re(de,Se,sn,"","\\@imath"),re(de,Se,sn,"","\\@jmath"),re(de,Se,Je,"ı","ı"),re(de,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 FPt={"--":!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(de,Se,Je,"°","\\degree",!0),re(zt,Se,Je,"°","\\degree"),re(zt,Se,Je,"°","\\textdegree",!0),re(de,Se,Je,"£","\\pounds"),re(de,Se,Je,"£","\\mathsterling",!0),re(zt,Se,Je,"£","\\pounds"),re(zt,Se,Je,"£","\\textsterling",!0),re(de,qe,Je,"✠","\\maltese"),re(zt,qe,Je,"✠","\\maltese");for(var zPt='0123456789/@."',TTe=0;TTe{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 XPt[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return i5n[a]}else{if(n===120485||n===120486)return XPt[0];if(120486{if(Qw(t.classes)!==Qw(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},KPt=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 _4(e,r,n,i);return ITe(a),a},Yw=(t,e,r,n)=>new _4(t,e,r,n),D4=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},l5n=function(e,r,n,i){var a=new bJ(e,r,n,i);return ITe(a),a},N1=function(e){var r=new E4(e);return ITe(r),r},L4=function(e,r){return e instanceof E4?Yt([],[e],r):e},c5n=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},kJ=(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},PTe={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"}},JPt={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},e6t=function(e,r){var[n,i,a]=JPt[e],o=new Hw(n),s=new I1([o],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Yw(["overlay"],[s],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Mo={number:3,unit:"mu"},MC={number:4,unit:"mu"},B1={number:5,unit:"mu"},u5n={mord:{mop:Mo,mbin:MC,mrel:B1,minner:Mo},mop:{mord:Mo,mop:Mo,mrel:B1,minner:Mo},mbin:{mord:MC,mop:MC,mopen:MC,minner:MC},mrel:{mord:B1,mop:B1,mopen:B1,minner:B1},mopen:{},mclose:{mop:Mo,mbin:MC,mrel:B1,minner:Mo},mpunct:{mord:Mo,mop:Mo,mrel:B1,mopen:Mo,mclose:Mo,mpunct:Mo,minner:Mo},minner:{mord:Mo,mop:Mo,mbin:MC,mrel:B1,mopen:Mo,mpunct:Mo,minner:Mo}},d5n={mord:{mop:Mo},mop:{mord:Mo,mop:Mo},mbin:{},mrel:{},mopen:{},mclose:{mop:Mo},mpunct:{},minner:{mop:Mo}},t6t={},OJ={},EJ={};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"&&f5n.has(y)?m.classes[0]="mord":y==="mbin"&&h5n.has(v)&&(g.classes[0]="mord")},{node:h},f,p),NTe(a,(g,m)=>{var v,y,b=$Te(m),x=$Te(g),w=b&&x?g.hasClass("mtight")?(v=d5n[b])==null?void 0:v[x]:(y=u5n[b])==null?void 0:y[x]:null;if(w)return ZPt(w,u)},{node:h},f,p),a},NTe=function(e,r,n,i,a){i&&e.push(i);for(var o=0;of=>{e.splice(h+1,0,f),o++})(o)}i&&e.pop()},r6t=function(e){return e instanceof E4||e instanceof bJ||e instanceof _4&&e.hasClass("enclosing")?e:null},BTe=function(e,r){var n=r6t(e);if(n){var i=n.children;if(i.length){if(r==="right")return BTe(i[i.length-1],"right");if(r==="left")return BTe(i[0],"left")}}return e},$Te=function(e,r){if(!e)return null;r&&(e=BTe(e,r));var n=e.classes[0];return g5n[n]||null},_F=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Yt(r.concat(n))},ea=function(e,r,n){if(!e)return Yt();if(OJ[e.type]){var i=OJ[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 RJ(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 FTe(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(RJ(o,e)),o=[]),a.push(n[s]));o.length>0&&a.push(RJ(o,e));var u;r?(u=RJ(hl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var d=Yt(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),u){var h=u.children[0];h.style.height=ir(d.height+d.depth),d.depth&&(h.style.verticalAlign=ir(-d.depth))}return d}function n6t(t){return new E4(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=Qw(this.classes));for(var n=0;n0&&(e+=' class ="'+du(Qw(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ws{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return du(this.toText())}toText(){return this.text}}class i6t{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 m5n=new Set(["\\imath","\\jmath"]),v5n=new Set(["mrow","mtable"]),Ep=function(e,r,n){return So[r][e]&&So[r][e].replace&&e.charCodeAt(0)!==55349&&!(FPt.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 Ws(e)},zTe=function(e){return e.length===1?e[0]:new tr("mrow",e)},y5n={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"},UTe=(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=y5n[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(m5n.has(a))return null;if(So[n][a]){var o=So[n][a].replace;o&&(a=o)}var s=PTe[r].fontName;return ATe(a,s,n)?PTe[r].variant:null};function VTe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ws&&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 Ws&&r.text===","}else return!1}var uf=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"||VTe(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 d=o.children[0];if(d instanceof Ws&&d.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof Ws&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(l),o=l}return a},qw=function(e,r,n){return zTe(uf(e,r,n))},La=function(e,r){if(!e)return new tr("mrow");if(EJ[e.type])return EJ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function a6t(t,e,r,n,i){var a=uf(t,r),o;a.length===1&&a[0]instanceof tr&&v5n.has(a[0].type)?o=a[0]:o=new tr("mrow",a);var s=new tr("annotation",[new Ws(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 d=i?"katex":"katex-mathml";return Yt([d],[u])}var b5n=[[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]],o6t=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],s6t=function(e,r){return r.size<2?e:b5n[e-1][r.size-1]};class $1{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||$1.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=o6t[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 $1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:s6t(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:o6t[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=s6t($1.BASESIZE,e);return this.size===r&&this.textSize===$1.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!==$1.BASESIZE?["sizing","reset-size"+this.size,"size"+$1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=r5n(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}$1.BASESIZE=6;var l6t=function(e){return new $1({style:e.displayMode?Nn.DISPLAY:Nn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},c6t=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},x5n=function(e,r,n){var i=l6t(n),a;if(n.output==="mathml")return a6t(e,r,i,n.displayMode,!0);if(n.output==="html"){var o=FTe(e,i);a=Yt(["katex"],[o])}else{var s=a6t(e,r,i,n.displayMode,!1),l=FTe(e,i);a=Yt(["katex"],[s,l])}return c6t(a,n)},w5n=function(e,r,n){var i=l6t(n),a=FTe(e,i),o=Yt(["katex"],[a]);return c6t(o,n)},A5n={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":"="},DJ=function(e){var r=new tr("mo",[new Ws(A5n[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},S5n={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]},T5n=new Set(["widehat","widecheck","widetilde","utilde"]),LJ=function(e,r){function n(){var s=4e5,l=e.label.slice(1);if(T5n.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,d,h,f;if(u>5)l==="widehat"||l==="widecheck"?(d=420,s=2364,f=.42,h=l+"4"):(d=312,s=2340,f=.34,h="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][p],d=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],h=l+p):(s=[0,600,1033,2339,2340][p],d=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],h="tilde"+p)}var g=new Hw(h),m=new I1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+s+" "+d,preserveAspectRatio:"none"});return{span:Yw([],[m],r),minWidth:0,height:f}}else{var v=[],y=S5n[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 O=0;O0&&(i.style.minWidth=ir(a)),i},C5n=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 wTe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new wTe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new I1(u,{width:"100%",height:ir(s)});o=Yw([],[d],a)}return o.height=s,o.style.height=ir(s),o},k5n={bin:1,close:1,inner:1,open:1,punct:1,rel:1},O5n={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function E5n(t){return t in k5n}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 MJ(t){var e=IJ(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 IJ(t){return t&&(t.type==="atom"||O5n.hasOwnProperty(t.type))?t:null}var u6t=t=>{if(t instanceof lf)return t;if(t5n(t)&&t.children.length===1)return u6t(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=e5n(ea(t,e)),t.base=n):(n=jn(t,"accent"),r=n.base);var a=ea(r,e.havingCrampedStyle()),o=n.isShifty&&L1(r),s=0;if(o){var l,u;s=(l=(u=u6t(a))==null?void 0:u.skew)!=null?l:0}var d=n.label==="\\c",h=d?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=LJ(n,e),f=Ji({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=e6t("vec",e),g=JPt.vec[1]):(p=CJ({mode:n.mode,text:n.label},e,"textord"),p=JRn(p),p.italic=0,g=p.width,d&&(h+=p.depth)),f=Yt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),h=a.height);var v=s;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{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},d6t=(t,e)=>{var r=t.isStretchy?DJ(t.label):new tr("mo",[Ep(t.label,t.mode)]),n=new tr("mover",[La(t.base,e),r]);return n.setAttribute("accent","true"),n},_5n=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=_J(e[0]),n=!_5n.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:d6t}),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:d6t}),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=ea(t.base,e),n=LJ(t,e),i=t.label==="\\utilde"?.12:0,a=Ji({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=DJ(t.label),n=new tr("munder",[La(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var PJ=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=L4(ea(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=L4(ea(t.below,n,e),e),o.classes.push(a+"-arrow-pad"));var s=LJ(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 d;if(o){var h=-e.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=Ji({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:h}]})}else d=Ji({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]});return Yt(["mrel","x-arrow"],[d],e)},mathmlBuilder(t,e){var r=DJ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=PJ(La(t.body,e));if(t.below){var a=PJ(La(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var o=PJ(La(t.below,e));n=new tr("munder",[r,o])}else n=PJ(),n=new tr("mover",[r,n]);return n}});function h6t(t,e){var r=hl(t.body,e,!0);return Yt([t.mclass],r,e)}function f6t(t,e){var r,n=uf(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:Hs(i),isCharacterBox:L1(i)}},htmlBuilder:h6t,mathmlBuilder:f6t});var NJ=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:NJ(e[0]),body:Hs(e[1]),isCharacterBox:L1(e[1])}}}),xr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],o;n!=="\\stackrel"?o=NJ(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Hs(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:L1(l)}},htmlBuilder:h6t,mathmlBuilder:f6t}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:NJ(e[0]),body:Hs(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=uf(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var R5n={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},p6t=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),g6t=t=>t.type==="textord"&&t.text==="@",D5n=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function L5n(t,e,r){var n=R5n[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 M5n(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 h=0;h<2;h++){for(var f=!0,p=l+1;pAV=|." after @',o[l]);var g=L5n(u,d,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),s=p6t()}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=L4(ea(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=L4(ea(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 m6t=(t,e)=>{var r=hl(t.body,e.withColor(t.color),!1);return N1(r)},v6t=(t,e)=>{var r=uf(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:Hs(i)}},htmlBuilder:m6t,mathmlBuilder:v6t}),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:m6t,mathmlBuilder:v6t}),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 QTe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},y6t=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},I5n=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},b6t=(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(QTe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=QTe[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===QTe[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=y6t(e.gullet.popToken());e.gullet.consumeSpaces();var i=I5n(e);return b6t(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=y6t(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return b6t(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var RF=function(e,r,n){var i=So.math[e]&&So.math[e].replace,a=ATe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},HTe=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},x6t=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},P5n=function(e,r,n,i,a,o){var s=Ju(e,"Main-Regular",a,i),l=HTe(s,r,i,o);return x6t(l,i,r),l},N5n=function(e,r,n,i){return Ju(e,"Size"+r+"-Regular",n,i)},w6t=function(e,r,n,i,a,o){var s=N5n(e,r,a,i),l=HTe(Yt(["delimsizing","size"+r],[s],i),Nn.TEXT,i,o);return n&&x6t(l,i,Nn.TEXT),l},WTe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Yt(["delimsizinginner",i],[Yt([],[Ju(e,r,n)])]);return{type:"elem",elem:a}},YTe=function(e,r,n){var i=V0["Size4-Regular"][e.charCodeAt(0)]?V0["Size4-Regular"][e.charCodeAt(0)][4]:V0["Size1-Regular"][e.charCodeAt(0)][4],a=new Hw("inner",WRn(e,Math.round(1e3*r))),o=new I1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=Yw([],[o],n);return s.height=r,s.style.height=ir(r),s.style.width=ir(i),{type:"elem",elem:s}},qTe=.008,BJ={type:"kern",size:-1*qTe},B5n=new Set(["|","\\lvert","\\rvert","\\vert"]),$5n=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),A6t=function(e,r,n,i,a,o){var s,l,u,d,h="",f=0;s=u=d=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=d="⏐":e==="\\Uparrow"?u=d="‖":e==="\\downarrow"?s=u="⏐":e==="\\Downarrow"?s=u="‖":e==="\\updownarrow"?(s="\\uparrow",u="⏐",d="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",u="‖",d="\\Downarrow"):B5n.has(e)?(u="∣",h="vert",f=333):$5n.has(e)?(u="∥",h="doublevert",f=556):e==="["||e==="\\lbrack"?(s="⎡",u="⎢",d="⎣",p="Size4-Regular",h="lbrack",f=667):e==="]"||e==="\\rbrack"?(s="⎤",u="⎥",d="⎦",p="Size4-Regular",h="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=s="⎢",d="⎣",p="Size4-Regular",h="lfloor",f=667):e==="\\lceil"||e==="⌈"?(s="⎡",u=d="⎢",p="Size4-Regular",h="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=s="⎥",d="⎦",p="Size4-Regular",h="rfloor",f=667):e==="\\rceil"||e==="⌉"?(s="⎤",u=d="⎥",p="Size4-Regular",h="rceil",f=667):e==="("||e==="\\lparen"?(s="⎛",u="⎜",d="⎝",p="Size4-Regular",h="lparen",f=875):e===")"||e==="\\rparen"?(s="⎞",u="⎟",d="⎠",p="Size4-Regular",h="rparen",f=875):e==="\\{"||e==="\\lbrace"?(s="⎧",l="⎨",d="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",l="⎬",d="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",d="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",d="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",d="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",d="⎩",u="⎪",p="Size4-Regular");var g=RF(s,p,a),m=g.height+g.depth,v=RF(u,p,a),y=v.height+v.depth,b=RF(d,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var S=RF(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))),O=T+C*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=O/2-E,P=[];if(h.length>0){var L=O-m-x,R=Math.round(O*1e3),D=YRn(h,Math.round(L*1e3)),M=new Hw(h,D),I=ir(f/1e3),N=ir(R/1e3),F=new I1([M],{width:I,height:N,viewBox:"0 0 "+f+" "+R}),B=Yw([],[F],i);B.height=R/1e3,B.style.width=I,B.style.height=N,P.push({type:"elem",elem:B})}else{if(P.push(WTe(d,p,a)),P.push(BJ),l===null){var V=O-m-x+2*qTe;P.push(YTe(u,V,i))}else{var z=(O-m-x-w)/2+2*qTe;P.push(YTe(u,z,i)),P.push(BJ),P.push(WTe(l,p,a)),P.push(BJ),P.push(YTe(u,z,i))}P.push(BJ),P.push(WTe(s,p,a))}var U=i.havingBaseStyle(Nn.TEXT),G=Ji({positionType:"bottom",positionData:_,children:P});return HTe(Yt(["delimsizing","mult"],[G],U),Nn.TEXT,i,o)},jTe=80,XTe=.08,KTe=function(e,r,n,i,a){var o=HRn(e,i,n),s=new Hw(e,o),l=new I1([s],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Yw(["hide-tail"],[l],a)},F5n=function(e,r){var n=r.havingBaseSizing(),i=O6t("\\surd",e*n.sizeMultiplier,k6t,n),a=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,l,u,d,h;return i.type==="small"?(d=1e3+1e3*o+jTe,e<1?a=1:e<1.4&&(a=.7),l=(1+o+XTe)/a,u=(1+o)/a,s=KTe("sqrtMain",l,d,o,r),s.style.minWidth="0.853em",h=.833/a):i.type==="large"?(d=(1e3+jTe)*DF[i.size],u=(DF[i.size]+o)/a,l=(DF[i.size]+o+XTe)/a,s=KTe("sqrtSize"+i.size,l,d,o,r),s.style.minWidth="1.02em",h=1/a):(l=e+o+XTe,u=e+o,d=Math.floor(1e3*e+o)+jTe,s=KTe("sqrtTall",l,d,o,r),s.style.minWidth="0.742em",h=1.056),s.height=u,s.style.height=ir(l),{span:s,advanceWidth:h,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*a}},S6t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),z5n=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),T6t=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),DF=[0,1.2,1.8,2.4,3],C6t=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),S6t.has(e)||T6t.has(e))return w6t(e,r,!1,n,i,a);if(z5n.has(e))return A6t(e,DF[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},U5n=[{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}],V5n=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"stack"}],k6t=[{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"}],G5n=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.")},O6t=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]},ZTe=function(e,r,n,i,a,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;T6t.has(e)?s=U5n:S6t.has(e)?s=k6t:s=V5n;var l=O6t(e,r,s,i);return l.type==="small"?P5n(e,l.style,n,i,a,o):l.type==="large"?w6t(e,l.size,n,i,a,o):A6t(e,r,n,i,a,o)},JTe=function(e,r,n,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,d=Math.max(r-s,n+s),h=Math.max(d/500*l,2*d-u);return ZTe(e,h,!0,i,a,o)},E6t={"\\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}},Q5n=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 _6t(t){return"isMiddle"in t}function $J(t,e){var r=IJ(t);if(r&&Q5n.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=$J(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:E6t[t.funcName].size,mclass:E6t[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Yt([t.mclass]):C6t(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ep(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(DF[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function R6t(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:$J(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$J(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)=>{R6t(t);for(var r=hl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,o=0;o{R6t(t);var r=uf(t.body,e);if(t.left!=="."){var n=new tr("mo",[Ep(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[Ep(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return zTe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$J(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=_F(e,[]):(r=C6t(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Ep("|","text"):Ep(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 FJ=(t,e)=>{var r=L4(ea(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,o,s=L1(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),d=e.havingBaseSizing();i=i/d.sizeMultiplier;var h=r.height+r.depth+l+u;r.style.paddingLeft=ir(h/2+l);var f=Math.floor(1e3*h*i),p=GRn(f),g=new I1([new Hw("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Yw(["hide-tail"],[g],e),a.style.height=ir(h),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=C5n(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=Ji({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=Ji({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)},zJ=(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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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:FJ,mathmlBuilder:zJ}),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 D6t={};function G0(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.")},H5n=new Set(["gather","gather*"]);function eCe(t){if(!t.includes("ed"))return!t.includes("*")}function jw(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:h,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 df("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(M6t(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(h&&g.length===h){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||!d)&&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=D4("hline",r,d),ze=D4("hdashline",r,d),we=[{type:"elem",elem:xe,shift:0}];u.length>0;){var ke=u.pop(),Be=ke.pos-P;ke.isDashed?we.push({type:"elem",elem:ze,shift:Be}):we.push({type:"elem",elem:ge,shift:Be})}xe=Ji({positionType:"individualShift",children:we})}if(I.length===0)return Yt(["mord"],[xe],r);var Z=Ji({positionType:"individualShift",children:I}),le=Yt(["tag"],[Z],r);return N1([xe,le])},W5n={c:"center ",l:"left ",r:"right "},H0=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+=O[O.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};G0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=IJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(o){var s=MJ(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 jw(t.parser,a,tCe(t.envName))},htmlBuilder:Q0,mathmlBuilder:H0}),G0({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=jw(t.parser,n,tCe(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:Q0,mathmlBuilder:H0}),G0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=jw(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=IJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(s){var l=MJ(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=jw(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:Q0,mathmlBuilder:H0}),G0({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=jw(t.parser,e,tCe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:I6t,htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){H5n.has(t.envName)&&UJ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:eCe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return jw(t.parser,e,"display")},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:I6t,htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){UJ(t);var e={autoTag:eCe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return jw(t.parser,e,"display")},htmlBuilder:Q0,mathmlBuilder:H0}),G0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return UJ(t),M5n(t.parser)},htmlBuilder:Q0,mathmlBuilder:H0}),_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 P6t=D6t;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 ea(t.body,n)},B6t=(t,e)=>{var r=t.font,n=e.withFont(r);return La(t.body,n)},$6t={"\\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=_J(e[0]),a=n;return a in $6t&&(a=$6t[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:N6t,mathmlBuilder:B6t}),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:NJ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:L1(n)}}}),xr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,o=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:N6t,mathmlBuilder:B6t});var Y5n=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var o=ea(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):(h>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var v;if(d){var b=e.fontMetrics().axisHeight;p-o.depth-(b+.5*h){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 Ws(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var o=new tr("mo",[new Ws(t.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return zTe(i)}return r},F6t=(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",d=null;return u||n.startsWith("\\d")?d="display":n.startsWith("\\t")&&(d="text"),F6t({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:Y5n,mathmlBuilder:q5n}),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 z6t=["display","text","script","scriptscript"],U6t=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=_J(e[0]),o=a.type==="atom"&&a.family==="open"?U6t(a.text):null,s=_J(e[1]),l=s.type==="atom"&&s.family==="close"?U6t(s.text):null,u=jn(e[2],"size"),d,h=null;u.isBlank?d=!0:(h=u.value,d=h.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=z6t[Number(g.text)]}}else p=jn(p,"textord"),f=z6t[Number(p.text)];return F6t({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:d,barSize:h,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 V6t=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?ea(t.sup,e.havingStyle(r.sup()),e):ea(t.sub,e.havingStyle(r.sub()),e),i=jn(t.base,"horizBrace")):i=jn(t,"horizBrace");var a=ea(i.base,e.havingBaseStyle(Nn.DISPLAY)),o=LJ(i,e),s;if(i.isOver?s=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):s=Ji({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=Ji({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=Ji({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)},j5n=(t,e)=>{var r=DJ(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:V6t,mathmlBuilder:j5n}),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:Hs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=hl(t.body,e,!1);return l5n(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=qw(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(","),d=0;d{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)=>qw(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:Hs(e[0]),mathml:Hs(e[1])}},htmlBuilder:(t,e)=>{var r=hl(t.html,e,!1);return N1(r)},mathmlBuilder:(t,e)=>qw(t.mathml,e)});var rCe=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(!MPt(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(","),d=0;d{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 KRn(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 ZPt(t.dimension,e)},mathmlBuilder(t,e){var r=Lo(t.dimension,e);return new i6t(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([],[ea(t.body,e)]),r=Yt(["inner"],[r],e)):r=Yt(["inner"],[ea(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 G6t=(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:Hs(e[0]),text:Hs(e[1]),script:Hs(e[2]),scriptscript:Hs(e[3])}},htmlBuilder:(t,e)=>{var r=G6t(t,e),n=hl(r,e,!1);return N1(n)},mathmlBuilder:(t,e)=>{var r=G6t(t,e);return qw(r,e)}});var Q6t=(t,e,r,n,i,a,o)=>{t=Yt([],[t]);var s=r&&L1(r),l,u;if(e){var d=ea(e,n.havingStyle(i.sup()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-d.depth)}}if(r){var h=ea(r,n.havingStyle(i.sub()),n);l={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+o;f=Ji({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=Ji({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=Ji({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)},H6t=new Set(["\\smallint"]),M4=(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&&!H6t.has(a.name)&&(s=!0);var l,u;if(a.symbol){var d=s?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=Ju(a.name,d,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=l.italic,h.length>0){var f=e6t(h+"Size"+(s?"2":"1"),e);l=Ji({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=hl(a.body,e,!0);p.length===1&&p[0]instanceof lf?(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",[Ep(t.name,t.mode)]),H6t.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",uf(t.body,e));else{r=new tr("mi",[new Ws(t.name.slice(1))]);var n=new tr("mo",[Ep("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=n6t([r,n])}return r},X5n={"∏":"\\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=X5n[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:M4,mathmlBuilder:LF}),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:Hs(n)}},htmlBuilder:M4,mathmlBuilder:LF});var K5n={"∫":"\\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:M4,mathmlBuilder:LF}),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:M4,mathmlBuilder:LF}),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=K5n[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:M4,mathmlBuilder:LF});var W6t=(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(h=>{var f="text"in h?h.text:void 0;return typeof f=="string"?{type:"textord",mode:h.mode,text:f}:h}),l=hl(s,e.withFont("mathrm"),!0),u=0;u{for(var r=uf(t.body,e.withFont("mathrm")),n=!0,i=0;id.toText()).join("");r=[new Ws(s)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[Ep("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):n6t([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:Hs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:W6t,mathmlBuilder:Z5n}),_e("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),IC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?N1(hl(t.body,e,!1)):Yt(["mord"],hl(t.body,e,!0),e)},mathmlBuilder(t,e){return qw(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=ea(t.body,e.havingCrampedStyle()),n=D4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ji({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 Ws("‾")]);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:Hs(n)}},htmlBuilder:(t,e)=>{var r=hl(t.body,e.withPhantom(),!1);return N1(r)},mathmlBuilder:(t,e)=>{var r=uf(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"],[ea(t.body,e.withPhantom())]),n=Yt(["fix"],[]);return Yt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=uf(Hs(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=ea(t.body,e),n=Lo(t.dy,e);return Ji({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 Y6t(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 Y6t(t.body,r,e)};xr({type:"sizing",names:q6t,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:q6t.indexOf(n)+1,body:a}},htmlBuilder:J5n,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=uf(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([],[ea(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=ea(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=L4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+o&&(o=(o+h-r.height-r.depth)/2);var f=l.height-r.height-o-u;r.style.paddingLeft=ir(d);var p=Ji({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=ea(t.index,g,e),v=.6*(p.height-p.depth),y=Ji({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 nCe={display:Nn.DISPLAY,text:Nn.TEXT,script:Nn.SCRIPT,scriptscript:Nn.SCRIPTSCRIPT};function e4n(t){return t in nCe}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(!e4n(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(t,e){var r=nCe[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Y6t(t.body,n,e)},mathmlBuilder(t,e){var r=nCe[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=uf(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 t4n=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?M4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Nn.DISPLAY.size||n.limits);return a?W6t:null}else{if(n.type==="accent")return L1(n.base)?GTe:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?V6t:null}else return null}else return null};IC({type:"supsub",htmlBuilder(t,e){var r=t4n(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,o=ea(n,e),s,l,u=e.fontMetrics(),d=0,h=0,f=n&&L1(n);if(i){var p=e.havingStyle(e.style.sup());s=ea(i,p,e),f||(d=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=ea(a,g,e),f||(h=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 lf||x){var w;b=ir(-((w=o.italic)!=null?w:0))}}var A;if(s&&l){d=Math.max(d,m,s.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var S=u.defaultRuleThickness,T=4*S;if(d-s.depth-(l.height-h)0&&(d+=C,h-=C)}var O=[{type:"elem",elem:l,shift:h,marginRight:y,marginLeft:b},{type:"elem",elem:s,shift:-d,marginRight:y}];A=Ji({positionType:"individualShift",children:O})}else if(l){h=Math.max(h,u.sub1,l.height-.8*u.xHeight);var E=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];A=Ji({positionType:"shift",positionData:h,children:E})}else if(s)d=Math.max(d,m,s.depth+.25*u.xHeight),A=Ji({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=$Te(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)}}),IC({type:"atom",htmlBuilder(t,e){return MTe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[Ep(t.text,t.mode)]);if(t.family==="bin"){var n=UTe(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 j6t={mi:"italic",mn:"normal",mtext:"normal"};IC({type:"mathord",htmlBuilder(t,e){return CJ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[Ep(t.text,t.mode,e)]),n=UTe(t,e)||"italic";return n!==j6t[r.type]&&r.setAttribute("mathvariant",n),r}}),IC({type:"textord",htmlBuilder(t,e){return CJ(t,e,"textord")},mathmlBuilder(t,e){var r=Ep(t.text,t.mode,e),n=UTe(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!==j6t[i.type]&&i.setAttribute("mathvariant",n),i}});var iCe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},aCe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};IC({type:"spacing",htmlBuilder(t,e){if(aCe.hasOwnProperty(t.text)){var r=aCe[t.text].className||"";if(t.mode==="text"){var n=CJ(t,e,"textord");return n.classes.push(r),n}else return Yt(["mspace",r],[MTe(t.text,t.mode,e)],e)}else{if(iCe.hasOwnProperty(t.text))return Yt(["mspace",iCe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(aCe.hasOwnProperty(t.text))r=new tr("mtext",[new Ws(" ")]);else{if(iCe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var X6t=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};IC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[X6t(),new tr("mtd",[qw(t.body,e)]),X6t(),new tr("mtd",[qw(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var K6t={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Z6t={"\\textbf":"textbf","\\textmd":"textmd"},r4n={"\\textit":"textit","\\textup":"textup"},J6t=(t,e)=>{var r=t.font;if(r){if(K6t[r])return e.withTextFontFamily(K6t[r]);if(Z6t[r])return e.withTextFontWeight(Z6t[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(r4n[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:Hs(i),font:n}},htmlBuilder(t,e){var r=J6t(t,e),n=hl(t.body,r,!0);return Yt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=J6t(t,e);return qw(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=ea(t.body,e),n=D4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ji({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 Ws("‾")]);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=ea(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Ji({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=eNt(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Xw=t6t,tNt=`[ \r ]`,n4n="\\\\[a-zA-Z@]+",i4n="\\\\[^\uD800-\uDFFF]",a4n="("+n4n+")"+tNt+"*",o4n=`\\\\( |[ \r ]+ ?)[ \r ]*`,oCe="[̀-ͯ]",s4n=new RegExp(oCe+"+$"),l4n="("+tNt+"+)|"+(o4n+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(oCe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(oCe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+a4n)+("|"+i4n+")");let rNt=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(l4n,"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 df("EOF",new eh(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Zt("Unexpected character: '"+e[r]+"'",new df(e[r],new eh(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 df(i,new eh(this,r,this.tokenRegex.lastIndex))}};class c4n{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 u4n=L6t;_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 nNt={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=nNt[e.text],n==null||n>=r)throw new Zt("Invalid base-"+r+" digit "+e.text);for(var i;(i=nNt[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=>sCe(t,!1,!0,!1)),_e("\\renewcommand",t=>sCe(t,!0,!1,!1)),_e("\\providecommand",t=>sCe(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),Xw[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 iNt={",":"\\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"},d4n=new Set(["bin","rel"]);_e("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in iNt?e=iNt[r]:(r.slice(0,4)==="\\not"||r in So.math&&d4n.has(So.math[r].group))&&(e="\\dotsb"),e});var lCe={")":!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 lCe?"\\ldots\\,":"\\ldots"}),_e("\\dotsc",function(t){var e=t.future().text;return e in lCe&&e!==","?"\\ldots\\,":"\\ldots"}),_e("\\cdots",function(t){var e=t.future().text;return e in lCe?"\\@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 aNt=ir(V0["Main-Regular"][84][1]-.7*V0["Main-Regular"][65][1]);_e("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+aNt+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),_e("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+aNt+"}{\\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 oNt=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=h=>f=>{t&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",s));var p=h;if(!h&&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,d=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};_e("\\bra@ket",oNt(!1)),_e("\\bra@set",oNt(!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 sNt={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class h4n{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 c4n(u4n,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new rNt(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 df("EOF",n.loc)),this.pushTokens(i),new df("",eh.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 df(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 rNt(i,this.settings),l=[],u=s.lex();u.text!=="EOF";)l.push(u),u=s.lex();l.reverse();var d={tokens:l,numArgs:a};return d}return i}isDefined(e){return this.macros.has(e)||Xw.hasOwnProperty(e)||So.math.hasOwnProperty(e)||So.text.hasOwnProperty(e)||sNt.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Xw.hasOwnProperty(e)&&!Xw[e].primitive}}var lNt=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,VJ=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),cCe={"́":{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"}},cNt={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let uNt=class tlr{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 h4n(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 df("}")),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(tlr.endOfExpression.has(i.text)||r&&i.text===r||e&&Xw[i.text]&&Xw[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&&(DPt(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:eh.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d0){if(++e>=t3n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function P4(t){return function(){return t}}var HJ=function(){try{var t=FC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),a3n=HJ?function(t,e){return HJ(t,"toString",{configurable:!0,enumerable:!1,value:P4(e),writable:!0})}:BC,ENt=i3n(a3n);function _Nt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var u3n=9007199254740991,d3n=/^(?:0|[1-9]\d*)$/;function WJ(t,e){var r=typeof t;return e=e??u3n,!!e&&(r=="number"||r!="symbol"&&d3n.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=p3n}function Kw(t){return t!=null&&pCe(t.length)&&!IF(t)}function NF(t,e,r){if(!hf(r))return!1;var n=typeof e;return(n=="number"?Kw(r)&&WJ(e,r.length):n=="string"&&e in r)?N4(r[e],t):!1}function g3n(t){return jJ(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&&NF(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function TDn(t,e){var r=this.__data__,n=JJ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function F1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=r&_Mn?new VF:void 0;for(a.set(t,e),a.set(e,t);++h2?e[2]:void 0;for(i&&NF(e[0],e[1],i)&&(n=1);++r-1?i[a?e[o]:o]:void 0}}var yIn=Math.max;function bIn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:P4n(r);return i<0&&(i=yIn(n+i,0)),RNt(t,Zw(e),i)}var ICe=vIn(bIn);function _8t(t,e){var r=-1,n=Kw(t)?Array(t.length):[];return aee(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function qs(t,e){var r=Ys(t)?I4:_8t;return r(t,Zw(e))}function xIn(t,e){return t==null?t:_Ce(t,MCe(e),zC)}function wIn(t,e){return t&&RCe(t,MCe(e))}function AIn(t,e){return t>e}var SIn=Object.prototype,TIn=SIn.hasOwnProperty;function CIn(t,e){return t!=null&&TIn.call(t,e)}function R8t(t,e){return t!=null&&T8t(t,e,CIn)}function kIn(t,e){return I4(e,function(r){return t[r]})}function V1(t){return t==null?[]:kIn(t,ff(t))}var OIn="[object Map]",EIn="[object Set]",_In=Object.prototype,RIn=_In.hasOwnProperty;function D8t(t){if(t==null)return!0;if(Kw(t)&&(Ys(t)||typeof t=="string"||typeof t.splice=="function"||$4(t)||ZJ(t)||B4(t)))return!t.length;var e=Rp(t);if(e==OIn||e==EIn)return!t.size;if(XJ(t))return!VNt(t).length;for(var r in t)if(RIn.call(t,r))return!1;return!0}function ws(t){return t===void 0}function L8t(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 NIn(t,e,r){e.length?e=I4(e,function(a){return Ys(a)?function(o){return ree(o,a.length===1?a[0]:a)}:a}):e=[BC];var n=-1;e=I4(e,KJ(Zw));var i=_8t(t,function(a,o,s){var l=I4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return MIn(i,function(a,o){return PIn(a,o,r)})}function BIn(t,e){return LIn(t,e,function(r,n){return C8t(t,n)})}var lee=FDn(function(t,e){return t==null?{}:BIn(t,e)}),$In=Math.ceil,FIn=Math.max;function zIn(t,e,r,n){for(var i=-1,a=FIn($In((e-t)/(r||1)),0),o=Array(a);a--;)o[++i]=t,t+=r;return o}function UIn(t){return function(e,r,n){return n&&typeof n!="number"&&NF(e,r,n)&&(r=n=void 0),e=QJ(e),r===void 0?(r=e,e=0):r=QJ(r),n=n===void 0?e1&&NF(t,e[0],e[1])?e=[]:r>2&&NF(e[0],e[1],e[2])&&(e=[e[0]]),NIn(t,bCe(e),[])}),GIn=1/0,QIn=U4&&1/kCe(new U4([,-0]))[1]==GIn?function(t){return new U4(t)}:e3n,HIn=200;function WIn(t,e,r){var n=-1,i=c3n,a=t.length,o=!0,s=[],l=s;if(a>=HIn){var u=QIn(t);if(u)return kCe(u);o=!1,i=m8t,l=new VF}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]=GC,this._children[e]={},this._children[GC][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(ff(this._in[e]),r),delete this._in[e],delete this._preds[e],Dt(ff(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=GC;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!==GC)return r}}children(e){if(ws(e)&&(e=GC),this._isCompound){var r=this._children[e];if(r)return ff(r)}else{if(e===GC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return ff(r)}successors(e){var r=this._sucs[e];if(r)return ff(r)}neighbors(e){var r=this.predecessors(e);if(r)return YIn(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 IF(e)||(e=P4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return V1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return QF(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=WF(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=ZIn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,I8t(this._preds[r],e),I8t(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?FCe(this._isDirected,arguments[0]):WF(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?FCe(this._isDirected,arguments[0]):WF(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?FCe(this._isDirected,arguments[0]):WF(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],P8t(this._preds[r],e),P8t(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=V1(n);return r?U1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=V1(n);return r?U1(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 I8t(t,e){t[e]?t[e]++:t[e]=1}function P8t(t,e){--t[e]||delete t[e]}function WF(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+M8t+a+M8t+(ws(n)?KIn:n)}function ZIn(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 FCe(t,e){return WF(t,e.v,e.w,e.name)}function G1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:JIn(t),edges:ePn(t)};return ws(t.graph())||(e.value=xMn(t.graph())),e}function JIn(t){return qs(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 ePn(t){return qs(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,Jw=new Map,N8t=new Map,B8t=k(()=>{Jw.clear(),N8t.clear(),Ln.clear()},"clear"),QC=k((t,e)=>{const r=Jw.get(e)||[];return ye.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tPn=k((t,e)=>{const r=Jw.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)||QC(t.v,e)||QC(t.w,e)||r.includes(t.w):(ye.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),zCe=k((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)zCe(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(tPn(l,n)){const d=Jw.get(n)||[],h=d.includes(l.v)||QC(l.v,n)||l.v===n,f=d.includes(l.w)||QC(l.w,n)||l.w===n;if(h&&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=h?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(d){ye.error(d)}})}ye.debug("Removing node",a),e.removeNode(a)})},"copy"),$8t=k((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)N8t.set(i,t),n=[...n,...$8t(i,e)];return n},"extractDescendants"),rPn=k((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"),G4=k((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=G4(a,e,r),s=rPn(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),F8t=k(t=>!Ln.has(t)||!Ln.get(t).externalConnections?t:Ln.has(t)?Ln.get(t).id:t,"getAnchorId"),nPn=k((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: ",G4(n,t,n)),Jw.set(n,$8t(n,t)),Ln.set(n,{id:G4(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,Jw),a.forEach(o=>{const s=QC(o.v,n),l=QC(o.w,n);s^l&&(ye.warn("Edge: ",o," leaves cluster ",n),ye.warn("Descendants of XXX ",n,": ",Jw.get(n)),Ln.get(n).externalConnections=!0)})):ye.debug("Not a cluster ",n,Jw)});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&&V8t(t,i,n)){const s=aPn(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=F8t(n.v),o=F8t(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",G1(t)),z8t(t,0),ye.trace(Ln)},"adjustClustersAndEdges"),z8t=k((t,e)=>{var i,a,o,s;if(ye.warn("extractor - ",e,G1(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,d=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zCe(l,t,d,l);const h=t.node(l)||{};t.setNode(l,{...h,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:d}),ye.warn("Subgraph for cluster with explicit dir created:",l,G1(d))}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 d=t.graph().rankdir==="TB"?"LR":"TB";(s=(o=Ln.get(l))==null?void 0:o.clusterData)!=null&&s.dir&&(d=Ln.get(l).clusterData.dir,ye.warn("Fixing dir",Ln.get(l).clusterData.dir,d));const h=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zCe(l,t,h,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:h}),ye.debug("Old graph after copy",G1(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&&z8t(u.graph,e+1)}},"extractor"),U8t=k((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=U8t(t,i);r=[...r,...a]}),r},"sorter"),iPn=k(t=>U8t(t,t.children()),"sortNodesByHierarchy"),V8t=k((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"),aPn=k((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||QC(i,r))continue;const a=G4(i,t,e);if(a&&!V8t(t,a,e))return a}return null},"findSafeAnchorNode");class oPn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return G8t(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&G8t(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,sPn)),n=n._prev;return"["+e.join(", ")+"]"}}function G8t(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function sPn(t,e){if(t!=="_next"&&t!=="_prev")return e}var lPn=P4(1);function cPn(t,e){if(t.nodeCount()<=1)return[];var r=dPn(t,e||lPn),n=uPn(r.graph,r.buckets,r.zeroIdx);return z4(qs(n,function(i){return t.outEdges(i.v,i.w)}))}function uPn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)UCe(t,e,r,o);for(;o=i.dequeue();)UCe(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(UCe(t,e,r,o,!0));break}}}return n}function UCe(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,VCe(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,VCe(e,r,u)}),t.removeNode(n.v),a}function dPn(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),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=V4(i+n+3).map(function(){return new oPn}),o=n+1;return Dt(r.nodes(),function(s){VCe(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function VCe(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 hPn(t){var e=t.graph().acyclicer==="greedy"?cPn(t,r(t)):fPn(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,$Ce("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function fPn(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 pPn(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 Q4(t,e,r,n){var i;do i=$Ce(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function gPn(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 Q8t(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 H8t(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 cee(t){var e=qs(V4(Y8t(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 mPn(t){var e=GF(qs(t.nodes(),function(r){return t.node(r).rank}));Dt(t.nodes(),function(r){var n=t.node(r);R8t(n,"rank")&&(n.rank-=e)})}function vPn(t){var e=GF(qs(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 W8t(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Q4(t,"border",i,e)}function Y8t(t){return VC(qs(t.nodes(),function(e){var r=t.node(e).rank;if(!ws(r))return r}))}function yPn(t,e){var r={lhs:[],rhs:[]};return Dt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function bPn(t,e){return e()}function xPn(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=U1(e.edges(),function(d){return l===aBt(t,t.node(d.v),s)&&l!==aBt(t,t.node(d.w),s)});return BCe(u,function(d){return YF(e,d)})}function iBt(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),YCe(t),WCe(t,e),PPn(t,e)}function PPn(t,e){var r=ICe(t.nodes(),function(i){return!e.node(i).parent}),n=MPn(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 NPn(t,e,r){return t.hasEdge(e,r)}function aBt(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function BPn(t){switch(t.graph().ranker){case"network-simplex":oBt(t);break;case"tight-tree":FPn(t);break;case"longest-path":$Pn(t);break;default:oBt(t)}}var $Pn=HCe;function FPn(t){HCe(t),K8t(t)}function oBt(t){HC(t)}function zPn(t){var e=Q4(t,"root",{},"_root"),r=UPn(t),n=VC(V1(r))-1,i=2*n+1;t.graph().nestingRoot=e,Dt(t.edges(),function(o){t.edge(o).minlen*=i});var a=VPn(t)+1;Dt(t.children(),function(o){sBt(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function sBt(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=W8t(t,"_bt"),u=W8t(t,"_bb"),d=t.node(o);t.setParent(l,o),d.borderTop=l,t.setParent(u,o),d.borderBottom=u,Dt(s,function(h){sBt(t,e,r,n,i,a,h);var f=t.node(h),p=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,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 UPn(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 VPn(t){return QF(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function GPn(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 QPn(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 HPn(t,e,r){var n=WPn(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,d=i.edge(u,a),h=ws(d)?0:d.weight;i.setEdge(u,a,{weight:t.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function WPn(t){for(var e;t.hasNode(e=$Ce("_root")););return e}function YPn(t,e){for(var r=0,n=1;n0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function jPn(t){var e={},r=U1(t.nodes(),function(s){return!t.children(s).length}),n=VC(qs(r,function(s){return t.node(s).rank})),i=qs(V4(n+1),function(){return[]});function a(s){if(!R8t(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),Dt(t.successors(s),a)}}var o=HF(r,function(s){return t.node(s).rank});return Dt(o,a),i}function XPn(t,e){return qs(e,function(r){var n=t.inEdges(r);if(n.length){var i=QF(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 KPn(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=U1(r,function(i){return!i.indegree});return ZPn(n)}function ZPn(t){var e=[];function r(a){return function(o){o.merged||(ws(o.barycenter)||ws(a.barycenter)||o.barycenter>=a.barycenter)&&JPn(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 qs(U1(e,function(a){return!a.merged}),function(a){return lee(a,["vs","i","barycenter","weight"])})}function JPn(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 e6n(t,e){var r=yPn(t,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=HF(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(t6n(!!e)),l=lBt(a,i,l),Dt(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=lBt(a,i,l)});var u={vs:z4(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function lBt(t,e,r){for(var n;e.length&&(n=oee(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function t6n(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function cBt(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=U1(i,function(g){return g!==o&&g!==s}));var u=XPn(t,i);Dt(u,function(g){if(t.children(g.v).length){var m=cBt(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&n6n(g,m)}});var d=KPn(u,r);r6n(d,l);var h=e6n(d,n);if(o&&(h.vs=z4([o,h.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(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function r6n(t,e){Dt(t,function(r){r.vs=z4(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function n6n(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 i6n(t){var e=Y8t(t),r=uBt(t,V4(1,e+1),"inEdges"),n=uBt(t,V4(e-1,-1,-1),"outEdges"),i=jPn(t);dBt(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){a6n(s%2?r:n,s%4>=2),i=cee(t);var u=YPn(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 l6n(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 c6n(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=oee(a);return Dt(a,function(d,h){var f=d6n(t,d),p=f?t.node(f).order:l;(f||d===u)&&(Dt(a.slice(s,h+1),function(g){Dt(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&hBt(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return Dt(o,function(d,h){if(t.node(d).dummy==="border"){var f=t.predecessors(d);f.length&&(l=t.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return QF(e,i),r}function d6n(t,e){if(t.node(e).dummy)return ICe(t.predecessors(e),function(r){return t.node(r).dummy})}function hBt(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 h6n(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function f6n(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 d=n(u);if(d.length){d=HF(d,function(m){return o[m]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var g=d[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>I6n(t));r(" runLayout",()=>T6n(n,r)),r(" updateInputGraph",()=>C6n(t,n))})}function T6n(t,e){e(" makeSpaceForEdgeLabels",()=>P6n(t)),e(" removeSelfEdges",()=>Q6n(t)),e(" acyclic",()=>hPn(t)),e(" nestingGraph.run",()=>zPn(t)),e(" rank",()=>BPn(Q8t(t))),e(" injectEdgeLabelProxies",()=>N6n(t)),e(" removeEmptyRanks",()=>vPn(t)),e(" nestingGraph.cleanup",()=>GPn(t)),e(" normalizeRanks",()=>mPn(t)),e(" assignRankMinMax",()=>B6n(t)),e(" removeEdgeLabelProxies",()=>$6n(t)),e(" normalize.run",()=>CPn(t)),e(" parentDummyChains",()=>o6n(t)),e(" addBorderSegments",()=>xPn(t)),e(" order",()=>i6n(t)),e(" insertSelfEdges",()=>H6n(t)),e(" adjustCoordinateSystem",()=>wPn(t)),e(" position",()=>A6n(t)),e(" positionSelfEdges",()=>W6n(t)),e(" removeBorderNodes",()=>G6n(t)),e(" normalize.undo",()=>OPn(t)),e(" fixupEdgeLabelCoords",()=>U6n(t)),e(" undoCoordinateSystem",()=>APn(t)),e(" translateGraph",()=>F6n(t)),e(" assignNodeIntersects",()=>z6n(t)),e(" reversePoints",()=>V6n(t)),e(" acyclic.undo",()=>pPn(t))}function C6n(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 k6n=["nodesep","edgesep","ranksep","marginx","marginy"],O6n={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E6n=["acyclicer","ranker","rankdir","align"],_6n=["width","height"],R6n={width:0,height:0},D6n=["minlen","weight","width","height","labeloffset"],L6n={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M6n=["labelpos"];function I6n(t){var e=new hu({multigraph:!0,compound:!0}),r=jCe(t.graph());return e.setGraph(NCe({},O6n,qCe(r,k6n),lee(r,E6n))),Dt(t.nodes(),function(n){var i=jCe(t.node(n));e.setNode(n,fIn(qCe(i,_6n),R6n)),e.setParent(n,t.parent(n))}),Dt(t.edges(),function(n){var i=jCe(t.edge(n));e.setEdge(n,NCe({},L6n,qCe(i,D6n),lee(i,M6n)))}),e}function P6n(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 N6n(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};Q4(t,"edge-proxy",a,"_ep")}})}function B6n(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=VC(e,n.maxRank))}),t.graph().maxRank=e}function $6n(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 F6n(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 d=u.x,h=u.y,f=u.width,p=u.height;e=Math.min(e,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}Dt(t.nodes(),function(u){l(t.node(u))}),Dt(t.edges(),function(u){var d=t.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),e-=o,n-=s,Dt(t.nodes(),function(u){var d=t.node(u);d.x-=e,d.y-=n}),Dt(t.edges(),function(u){var d=t.edge(u);Dt(d.points,function(h){h.x-=e,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=e),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-e+o,a.height=i-n+s}function z6n(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(H8t(n,a)),r.points.push(H8t(i,o))})}function U6n(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 V6n(t){Dt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function G6n(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(oee(r.borderLeft)),o=t.node(oee(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 Q6n(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 H6n(t){var e=cee(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){Q4(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 W6n(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 qCe(t,e){return see(lee(t,e),Number)}function jCe(t){var e={};return Dt(t,function(r,n){e[n.toLowerCase()]=r}),e}var pBt=k((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),gBt=k((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Y6n=k(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),q6n=k((t,e,r,n,i)=>{const a=[],o=new Set;if(r.forEach(({start:d,end:h})=>{d!==n&&o.add(d),h!==n&&o.add(h)}),o.forEach(d=>{const h=t.node(d);typeof(h==null?void 0:h.x)=="number"&&typeof(h==null?void 0:h.y)=="number"&&a.push(h)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(h=>{typeof(h==null?void 0:h.x)=="number"&&typeof(h==null?void 0:h.y)=="number"&&a.push(h)})}),a.length===0)return gBt(i);const s=a.reduce((d,h)=>({x:d.x+h.x/a.length,y:d.y+h.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":gBt(i)},"getSelfLoopSide"),j6n=k((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=pBt(Math.max(n,t.width*.35),36,l),d=pBt(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const h=a+s;return[{x:i-u/2,y:h},{x:i-u/2,y:h+d},{x:i+u/2,y:h+d},{x:i+u/2,y:h}]}case"right":{const h=i+o;return[{x:h,y:a-u/2},{x:h+d,y:a-u/2},{x:h+d,y:a+u/2},{x:h,y:a+u/2}]}case"left":{const h=i-o;return[{x:h,y:a-u/2},{x:h-d,y:a-u/2},{x:h-d,y:a+u/2},{x:h,y:a+u/2}]}case"top":default:{const h=a-s;return[{x:i-u/2,y:h},{x:i-u/2,y:h-d},{x:i+u/2,y:h-d},{x:i+u/2,y:h}]}}},"getSelfLoopPoints"),X6n=k((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(d=>d.y))+u/2+4};case"right":return{x:Math.max(...e.map(d=>d.x))+l/2+4,y:s};case"left":return{x:Math.min(...e.map(d=>d.x))-l/2-4,y:s};case"top":default:return{x:o,y:Math.min(...e.map(d=>d.y))-u/2-4}}},"getSelfLoopLabelPosition"),mBt=k((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,d]=s,h=l.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,f=t.node(h.start);if(!f){s.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=q6n(t,f,s,h.start,a),m=j6n(f,g,e,p.width??0),v=X6n(f,m,g,e,p),y={...u.edge,...h,id:h.id,points:m,start:h.start,end:h.end,x:v.x,y:v.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),vBt=k(async(t,e,r,n,i,a)=>{ye.warn("Graph in recursive render:XAX",G1(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"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes"),f=Y6n(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 + please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}cNt.hasOwnProperty(r[0])&&!So[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=cNt[r[0]]+r.slice(1));var a=s4n.exec(r);a&&(r=r.substring(0,a.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var o;if(So[this.mode][r]){this.settings.strict&&this.mode==="math"&&OTe.includes(r)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var s=So[this.mode][r].group,l=eh.range(e),u;E5n(s)?u={type:"atom",mode:this.mode,family:s,loc:l,text:r}:u={type:s,mode:this.mode,loc:l,text:r},o=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(DPt(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:eh.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d0){if(++e>=t3n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function P4(t){return function(){return t}}var HJ=function(){try{var t=FC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),a3n=HJ?function(t,e){return HJ(t,"toString",{configurable:!0,enumerable:!1,value:P4(e),writable:!0})}:BC,ENt=i3n(a3n);function _Nt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var u3n=9007199254740991,d3n=/^(?:0|[1-9]\d*)$/;function WJ(t,e){var r=typeof t;return e=e??u3n,!!e&&(r=="number"||r!="symbol"&&d3n.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=p3n}function Kw(t){return t!=null&&pCe(t.length)&&!IF(t)}function NF(t,e,r){if(!hf(r))return!1;var n=typeof e;return(n=="number"?Kw(r)&&WJ(e,r.length):n=="string"&&e in r)?N4(r[e],t):!1}function g3n(t){return jJ(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&&NF(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function TDn(t,e){var r=this.__data__,n=JJ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function F1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=r&_Mn?new VF:void 0;for(a.set(t,e),a.set(e,t);++h2?e[2]:void 0;for(i&&NF(e[0],e[1],i)&&(n=1);++r-1?i[a?e[o]:o]:void 0}}var yIn=Math.max;function bIn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:P4n(r);return i<0&&(i=yIn(n+i,0)),RNt(t,Zw(e),i)}var ICe=vIn(bIn);function _8t(t,e){var r=-1,n=Kw(t)?Array(t.length):[];return aee(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function qs(t,e){var r=Ys(t)?I4:_8t;return r(t,Zw(e))}function xIn(t,e){return t==null?t:_Ce(t,MCe(e),zC)}function wIn(t,e){return t&&RCe(t,MCe(e))}function AIn(t,e){return t>e}var SIn=Object.prototype,TIn=SIn.hasOwnProperty;function CIn(t,e){return t!=null&&TIn.call(t,e)}function R8t(t,e){return t!=null&&T8t(t,e,CIn)}function kIn(t,e){return I4(e,function(r){return t[r]})}function V1(t){return t==null?[]:kIn(t,ff(t))}var OIn="[object Map]",EIn="[object Set]",_In=Object.prototype,RIn=_In.hasOwnProperty;function D8t(t){if(t==null)return!0;if(Kw(t)&&(Ys(t)||typeof t=="string"||typeof t.splice=="function"||$4(t)||ZJ(t)||B4(t)))return!t.length;var e=Rp(t);if(e==OIn||e==EIn)return!t.size;if(XJ(t))return!VNt(t).length;for(var r in t)if(RIn.call(t,r))return!1;return!0}function ws(t){return t===void 0}function L8t(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 NIn(t,e,r){e.length?e=I4(e,function(a){return Ys(a)?function(o){return ree(o,a.length===1?a[0]:a)}:a}):e=[BC];var n=-1;e=I4(e,KJ(Zw));var i=_8t(t,function(a,o,s){var l=I4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return MIn(i,function(a,o){return PIn(a,o,r)})}function BIn(t,e){return LIn(t,e,function(r,n){return C8t(t,n)})}var lee=FDn(function(t,e){return t==null?{}:BIn(t,e)}),$In=Math.ceil,FIn=Math.max;function zIn(t,e,r,n){for(var i=-1,a=FIn($In((e-t)/(r||1)),0),o=Array(a);a--;)o[++i]=t,t+=r;return o}function UIn(t){return function(e,r,n){return n&&typeof n!="number"&&NF(e,r,n)&&(r=n=void 0),e=QJ(e),r===void 0?(r=e,e=0):r=QJ(r),n=n===void 0?e1&&NF(t,e[0],e[1])?e=[]:r>2&&NF(e[0],e[1],e[2])&&(e=[e[0]]),NIn(t,bCe(e),[])}),GIn=1/0,QIn=U4&&1/kCe(new U4([,-0]))[1]==GIn?function(t){return new U4(t)}:e3n,HIn=200;function WIn(t,e,r){var n=-1,i=c3n,a=t.length,o=!0,s=[],l=s;if(a>=HIn){var u=QIn(t);if(u)return kCe(u);o=!1,i=m8t,l=new VF}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]=GC,this._children[e]={},this._children[GC][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(ff(this._in[e]),r),delete this._in[e],delete this._preds[e],Dt(ff(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=GC;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!==GC)return r}}children(e){if(ws(e)&&(e=GC),this._isCompound){var r=this._children[e];if(r)return ff(r)}else{if(e===GC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return ff(r)}successors(e){var r=this._sucs[e];if(r)return ff(r)}neighbors(e){var r=this.predecessors(e);if(r)return YIn(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 IF(e)||(e=P4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return V1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return QF(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=WF(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=ZIn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,I8t(this._preds[r],e),I8t(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?FCe(this._isDirected,arguments[0]):WF(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?FCe(this._isDirected,arguments[0]):WF(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?FCe(this._isDirected,arguments[0]):WF(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],P8t(this._preds[r],e),P8t(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=V1(n);return r?U1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=V1(n);return r?U1(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 I8t(t,e){t[e]?t[e]++:t[e]=1}function P8t(t,e){--t[e]||delete t[e]}function WF(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+M8t+a+M8t+(ws(n)?KIn:n)}function ZIn(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 FCe(t,e){return WF(t,e.v,e.w,e.name)}function G1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:JIn(t),edges:ePn(t)};return ws(t.graph())||(e.value=xMn(t.graph())),e}function JIn(t){return qs(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 ePn(t){return qs(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,Jw=new Map,N8t=new Map,B8t=k(()=>{Jw.clear(),N8t.clear(),Ln.clear()},"clear"),QC=k((t,e)=>{const r=Jw.get(e)||[];return ye.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tPn=k((t,e)=>{const r=Jw.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)||QC(t.v,e)||QC(t.w,e)||r.includes(t.w):(ye.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),zCe=k((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)zCe(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(tPn(l,n)){const d=Jw.get(n)||[],h=d.includes(l.v)||QC(l.v,n)||l.v===n,f=d.includes(l.w)||QC(l.w,n)||l.w===n;if(h&&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=h?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(d){ye.error(d)}})}ye.debug("Removing node",a),e.removeNode(a)})},"copy"),$8t=k((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)N8t.set(i,t),n=[...n,...$8t(i,e)];return n},"extractDescendants"),rPn=k((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"),G4=k((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=G4(a,e,r),s=rPn(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),F8t=k(t=>!Ln.has(t)||!Ln.get(t).externalConnections?t:Ln.has(t)?Ln.get(t).id:t,"getAnchorId"),nPn=k((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: ",G4(n,t,n)),Jw.set(n,$8t(n,t)),Ln.set(n,{id:G4(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,Jw),a.forEach(o=>{const s=QC(o.v,n),l=QC(o.w,n);s^l&&(ye.warn("Edge: ",o," leaves cluster ",n),ye.warn("Descendants of XXX ",n,": ",Jw.get(n)),Ln.get(n).externalConnections=!0)})):ye.debug("Not a cluster ",n,Jw)});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&&V8t(t,i,n)){const s=aPn(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=F8t(n.v),o=F8t(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",G1(t)),z8t(t,0),ye.trace(Ln)},"adjustClustersAndEdges"),z8t=k((t,e)=>{var i,a,o,s;if(ye.warn("extractor - ",e,G1(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,d=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zCe(l,t,d,l);const h=t.node(l)||{};t.setNode(l,{...h,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:d}),ye.warn("Subgraph for cluster with explicit dir created:",l,G1(d))}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 d=t.graph().rankdir==="TB"?"LR":"TB";(s=(o=Ln.get(l))==null?void 0:o.clusterData)!=null&&s.dir&&(d=Ln.get(l).clusterData.dir,ye.warn("Fixing dir",Ln.get(l).clusterData.dir,d));const h=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zCe(l,t,h,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:h}),ye.debug("Old graph after copy",G1(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&&z8t(u.graph,e+1)}},"extractor"),U8t=k((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=U8t(t,i);r=[...r,...a]}),r},"sorter"),iPn=k(t=>U8t(t,t.children()),"sortNodesByHierarchy"),V8t=k((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"),aPn=k((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||QC(i,r))continue;const a=G4(i,t,e);if(a&&!V8t(t,a,e))return a}return null},"findSafeAnchorNode");class oPn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return G8t(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&G8t(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,sPn)),n=n._prev;return"["+e.join(", ")+"]"}}function G8t(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function sPn(t,e){if(t!=="_next"&&t!=="_prev")return e}var lPn=P4(1);function cPn(t,e){if(t.nodeCount()<=1)return[];var r=dPn(t,e||lPn),n=uPn(r.graph,r.buckets,r.zeroIdx);return z4(qs(n,function(i){return t.outEdges(i.v,i.w)}))}function uPn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)UCe(t,e,r,o);for(;o=i.dequeue();)UCe(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(UCe(t,e,r,o,!0));break}}}return n}function UCe(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,VCe(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,VCe(e,r,u)}),t.removeNode(n.v),a}function dPn(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),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=V4(i+n+3).map(function(){return new oPn}),o=n+1;return Dt(r.nodes(),function(s){VCe(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function VCe(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 hPn(t){var e=t.graph().acyclicer==="greedy"?cPn(t,r(t)):fPn(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,$Ce("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function fPn(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 pPn(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 Q4(t,e,r,n){var i;do i=$Ce(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function gPn(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 Q8t(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 H8t(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 cee(t){var e=qs(V4(Y8t(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 mPn(t){var e=GF(qs(t.nodes(),function(r){return t.node(r).rank}));Dt(t.nodes(),function(r){var n=t.node(r);R8t(n,"rank")&&(n.rank-=e)})}function vPn(t){var e=GF(qs(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 W8t(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Q4(t,"border",i,e)}function Y8t(t){return VC(qs(t.nodes(),function(e){var r=t.node(e).rank;if(!ws(r))return r}))}function yPn(t,e){var r={lhs:[],rhs:[]};return Dt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function bPn(t,e){return e()}function xPn(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=U1(e.edges(),function(d){return l===aBt(t,t.node(d.v),s)&&l!==aBt(t,t.node(d.w),s)});return BCe(u,function(d){return YF(e,d)})}function iBt(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),YCe(t),WCe(t,e),PPn(t,e)}function PPn(t,e){var r=ICe(t.nodes(),function(i){return!e.node(i).parent}),n=MPn(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 NPn(t,e,r){return t.hasEdge(e,r)}function aBt(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function BPn(t){switch(t.graph().ranker){case"network-simplex":oBt(t);break;case"tight-tree":FPn(t);break;case"longest-path":$Pn(t);break;default:oBt(t)}}var $Pn=HCe;function FPn(t){HCe(t),K8t(t)}function oBt(t){HC(t)}function zPn(t){var e=Q4(t,"root",{},"_root"),r=UPn(t),n=VC(V1(r))-1,i=2*n+1;t.graph().nestingRoot=e,Dt(t.edges(),function(o){t.edge(o).minlen*=i});var a=VPn(t)+1;Dt(t.children(),function(o){sBt(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function sBt(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=W8t(t,"_bt"),u=W8t(t,"_bb"),d=t.node(o);t.setParent(l,o),d.borderTop=l,t.setParent(u,o),d.borderBottom=u,Dt(s,function(h){sBt(t,e,r,n,i,a,h);var f=t.node(h),p=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,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 UPn(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 VPn(t){return QF(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function GPn(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 QPn(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 HPn(t,e,r){var n=WPn(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,d=i.edge(u,a),h=ws(d)?0:d.weight;i.setEdge(u,a,{weight:t.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function WPn(t){for(var e;t.hasNode(e=$Ce("_root")););return e}function YPn(t,e){for(var r=0,n=1;n0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function jPn(t){var e={},r=U1(t.nodes(),function(s){return!t.children(s).length}),n=VC(qs(r,function(s){return t.node(s).rank})),i=qs(V4(n+1),function(){return[]});function a(s){if(!R8t(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),Dt(t.successors(s),a)}}var o=HF(r,function(s){return t.node(s).rank});return Dt(o,a),i}function XPn(t,e){return qs(e,function(r){var n=t.inEdges(r);if(n.length){var i=QF(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 KPn(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=U1(r,function(i){return!i.indegree});return ZPn(n)}function ZPn(t){var e=[];function r(a){return function(o){o.merged||(ws(o.barycenter)||ws(a.barycenter)||o.barycenter>=a.barycenter)&&JPn(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 qs(U1(e,function(a){return!a.merged}),function(a){return lee(a,["vs","i","barycenter","weight"])})}function JPn(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 e6n(t,e){var r=yPn(t,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=HF(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(t6n(!!e)),l=lBt(a,i,l),Dt(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=lBt(a,i,l)});var u={vs:z4(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function lBt(t,e,r){for(var n;e.length&&(n=oee(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function t6n(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function cBt(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=U1(i,function(g){return g!==o&&g!==s}));var u=XPn(t,i);Dt(u,function(g){if(t.children(g.v).length){var m=cBt(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&n6n(g,m)}});var d=KPn(u,r);r6n(d,l);var h=e6n(d,n);if(o&&(h.vs=z4([o,h.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(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function r6n(t,e){Dt(t,function(r){r.vs=z4(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function n6n(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 i6n(t){var e=Y8t(t),r=uBt(t,V4(1,e+1),"inEdges"),n=uBt(t,V4(e-1,-1,-1),"outEdges"),i=jPn(t);dBt(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){a6n(s%2?r:n,s%4>=2),i=cee(t);var u=YPn(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 l6n(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 c6n(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=oee(a);return Dt(a,function(d,h){var f=d6n(t,d),p=f?t.node(f).order:l;(f||d===u)&&(Dt(a.slice(s,h+1),function(g){Dt(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&hBt(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return Dt(o,function(d,h){if(t.node(d).dummy==="border"){var f=t.predecessors(d);f.length&&(l=t.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return QF(e,i),r}function d6n(t,e){if(t.node(e).dummy)return ICe(t.predecessors(e),function(r){return t.node(r).dummy})}function hBt(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 h6n(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function f6n(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 d=n(u);if(d.length){d=HF(d,function(m){return o[m]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var g=d[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>I6n(t));r(" runLayout",()=>T6n(n,r)),r(" updateInputGraph",()=>C6n(t,n))})}function T6n(t,e){e(" makeSpaceForEdgeLabels",()=>P6n(t)),e(" removeSelfEdges",()=>Q6n(t)),e(" acyclic",()=>hPn(t)),e(" nestingGraph.run",()=>zPn(t)),e(" rank",()=>BPn(Q8t(t))),e(" injectEdgeLabelProxies",()=>N6n(t)),e(" removeEmptyRanks",()=>vPn(t)),e(" nestingGraph.cleanup",()=>GPn(t)),e(" normalizeRanks",()=>mPn(t)),e(" assignRankMinMax",()=>B6n(t)),e(" removeEdgeLabelProxies",()=>$6n(t)),e(" normalize.run",()=>CPn(t)),e(" parentDummyChains",()=>o6n(t)),e(" addBorderSegments",()=>xPn(t)),e(" order",()=>i6n(t)),e(" insertSelfEdges",()=>H6n(t)),e(" adjustCoordinateSystem",()=>wPn(t)),e(" position",()=>A6n(t)),e(" positionSelfEdges",()=>W6n(t)),e(" removeBorderNodes",()=>G6n(t)),e(" normalize.undo",()=>OPn(t)),e(" fixupEdgeLabelCoords",()=>U6n(t)),e(" undoCoordinateSystem",()=>APn(t)),e(" translateGraph",()=>F6n(t)),e(" assignNodeIntersects",()=>z6n(t)),e(" reversePoints",()=>V6n(t)),e(" acyclic.undo",()=>pPn(t))}function C6n(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 k6n=["nodesep","edgesep","ranksep","marginx","marginy"],O6n={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E6n=["acyclicer","ranker","rankdir","align"],_6n=["width","height"],R6n={width:0,height:0},D6n=["minlen","weight","width","height","labeloffset"],L6n={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M6n=["labelpos"];function I6n(t){var e=new hu({multigraph:!0,compound:!0}),r=jCe(t.graph());return e.setGraph(NCe({},O6n,qCe(r,k6n),lee(r,E6n))),Dt(t.nodes(),function(n){var i=jCe(t.node(n));e.setNode(n,fIn(qCe(i,_6n),R6n)),e.setParent(n,t.parent(n))}),Dt(t.edges(),function(n){var i=jCe(t.edge(n));e.setEdge(n,NCe({},L6n,qCe(i,D6n),lee(i,M6n)))}),e}function P6n(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 N6n(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};Q4(t,"edge-proxy",a,"_ep")}})}function B6n(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=VC(e,n.maxRank))}),t.graph().maxRank=e}function $6n(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 F6n(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 d=u.x,h=u.y,f=u.width,p=u.height;e=Math.min(e,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}Dt(t.nodes(),function(u){l(t.node(u))}),Dt(t.edges(),function(u){var d=t.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),e-=o,n-=s,Dt(t.nodes(),function(u){var d=t.node(u);d.x-=e,d.y-=n}),Dt(t.edges(),function(u){var d=t.edge(u);Dt(d.points,function(h){h.x-=e,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=e),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-e+o,a.height=i-n+s}function z6n(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(H8t(n,a)),r.points.push(H8t(i,o))})}function U6n(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 V6n(t){Dt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function G6n(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(oee(r.borderLeft)),o=t.node(oee(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 Q6n(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 H6n(t){var e=cee(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){Q4(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 W6n(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 qCe(t,e){return see(lee(t,e),Number)}function jCe(t){var e={};return Dt(t,function(r,n){e[n.toLowerCase()]=r}),e}var pBt=k((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),gBt=k((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Y6n=k(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),q6n=k((t,e,r,n,i)=>{const a=[],o=new Set;if(r.forEach(({start:d,end:h})=>{d!==n&&o.add(d),h!==n&&o.add(h)}),o.forEach(d=>{const h=t.node(d);typeof(h==null?void 0:h.x)=="number"&&typeof(h==null?void 0:h.y)=="number"&&a.push(h)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(h=>{typeof(h==null?void 0:h.x)=="number"&&typeof(h==null?void 0:h.y)=="number"&&a.push(h)})}),a.length===0)return gBt(i);const s=a.reduce((d,h)=>({x:d.x+h.x/a.length,y:d.y+h.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":gBt(i)},"getSelfLoopSide"),j6n=k((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=pBt(Math.max(n,t.width*.35),36,l),d=pBt(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const h=a+s;return[{x:i-u/2,y:h},{x:i-u/2,y:h+d},{x:i+u/2,y:h+d},{x:i+u/2,y:h}]}case"right":{const h=i+o;return[{x:h,y:a-u/2},{x:h+d,y:a-u/2},{x:h+d,y:a+u/2},{x:h,y:a+u/2}]}case"left":{const h=i-o;return[{x:h,y:a-u/2},{x:h-d,y:a-u/2},{x:h-d,y:a+u/2},{x:h,y:a+u/2}]}case"top":default:{const h=a-s;return[{x:i-u/2,y:h},{x:i-u/2,y:h-d},{x:i+u/2,y:h-d},{x:i+u/2,y:h}]}}},"getSelfLoopPoints"),X6n=k((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(d=>d.y))+u/2+4};case"right":return{x:Math.max(...e.map(d=>d.x))+l/2+4,y:s};case"left":return{x:Math.min(...e.map(d=>d.x))-l/2-4,y:s};case"top":default:return{x:o,y:Math.min(...e.map(d=>d.y))-u/2-4}}},"getSelfLoopLabelPosition"),mBt=k((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,d]=s,h=l.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,f=t.node(h.start);if(!f){s.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=q6n(t,f,s,h.start,a),m=j6n(f,g,e,p.width??0),v=X6n(f,m,g,e,p),y={...u.edge,...h,id:h.id,points:m,start:h.start,end:h.end,x:v.x,y:v.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),vBt=k(async(t,e,r,n,i,a)=>{ye.warn("Graph in recursive render:XAX",G1(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"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes"),f=Y6n(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 vBt(h,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),Cgn(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(G4(x.id,e)),Ln.set(x.id,{id:G4(x.id,e),node:x})):(ye.trace("Node - the non recursive path XAX",b,h,e.node(b),o),await f$(h,e.node(b),{config:a,dir:o}))})),await k(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 mK(d,w),w.id=A;return}await mK(d,w)});await Promise.all(b)},"processEdges")(),ye.info("Graph before layout:",JSON.stringify(G1(e))),ye.info("############################################# XXX"),ye.info("### Layout ### XXX"),ye.info("############################################# XXX"),fBt(e),ye.info("Graph after layout:",JSON.stringify(G1(e)));let g=0,{subGraphTitleTotalMargin:m}=DR(a);await Promise.all(iPn(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,gK(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 hK(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),gK(x)}}));const v=m/2;return mBt(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=_we(u,b,Ln,r,A,S,n);KEt(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"),K6n=k(async(t,e)=>{var a,o,s,l,u,d;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)||((d=(u=t.config)==null?void 0:u.flowchart)==null?void 0:d.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");Dwe(n,t.markers,t.type,t.diagramId),WEt(),XEt(),pOt(),B8t(),t.nodes.forEach(h=>{r.setNode(h.id,{...h}),h.parentId&&r.setParent(h.id,h.parentId)}),ye.debug("Edges:",t.edges),t.edges.forEach(h=>{if(h.start===h.end){const f=h.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(h),y=structuredClone(h),b=structuredClone(h),x=structuredClone(h);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(h.start,h.end,{...h},h.id)}),ye.warn("Graph at first:",JSON.stringify(G1(r))),nPn(r),ye.warn("Graph after XAX:",JSON.stringify(G1(r)));const i=Ye();await vBt(n,r,t.type,t.diagramId,void 0,i)},"render");const Z6n=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:mBt,render:K6n},Symbol.toStringTag,{value:"Module"}));async function yBt(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"),d=new Map,h=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(h){const g=await f$(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};d.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(()=>Npi);f(t,e)}return{graph:r,groups:{clusters:o,edgePaths:s,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:d}}k(yBt,"createGraphWithElements");var bBt=5,uee=1e-5,dee=1e-6;function hee(t){const e=[];for(let r=0;r=1-dee||f<=dee||f>=1-dee?null:{point:{x:t.x+h*i,y:t.y+h*a},tA:h,tB:f}}k(xBt,"segmentIntersection");function XCe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}k(XCe,"isHorizontalSeg");function wBt(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}k(ABt,"getArcSweepFlag");var J6n=.001;function SBt(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Ul[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&&Ul[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}k(SBt,"applyMarkerOffsets");function TBt(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${H4(s)}`];return i==="arc"?u.push(`A${Ug(t.r)},${Ug(t.r)} 0 0 ${n} ${H4(l)}`):u.push(`M${H4(l)}`),u}k(TBt,"emitJump");function KCe(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=KCe(i[u-1],i[u],i[u+1]??i[u],bBt);x&&(m=x.cutLen)}let v=h,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}}k(EBt,"decodeDataPoints");function _Bt(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 d=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,h=n.querySelector(`path[data-id="${d}"]`);if(!h)continue;o.set(u.id,h);const p=EBt(h.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const s=wBt(a);if(s.length===0)return;const l=new Map;for(const u of s){const d=l.get(u.jumpEdgeId)??[];d.push(u),l.set(u.jumpEdgeId,d)}for(const u of a){const d=l.get(u.id);if(!d||d.length===0)continue;const h=i.get(u.id),f=h==null?void 0:h.curve;if(f!==void 0&&!OBt(f))continue;const p=o.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!kBt(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=CBt(u,d,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)}}}k(_Bt,"applyLineJumpsToSvg");async function RBt(t,e){var i,a;for(const o of t.nodes)o.isGroup?await hK(e.clusters,o):gK(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=_we(e.edgePaths,{...o},{},t.type,s,l,t.diagramId);o.label&&await mK(e.rootGroups,o),o.label&&DBt(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}));_Bt(e.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}}k(RBt,"adjustLayout");function DBt(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=DR({flowchart:n.flowchart??{}});if(t.label){const a=g$.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})`)}}k(DBt,"positionEdgeLabel");var ZCe="__swimlane_default__",eNn=21,LBt=20;function JCe(t){return Math.max(t.padding??LBt,LBt)}k(JCe,"topLaneHorizontalPadding");function MBt(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(eNn,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}}k(MBt,"assignTopLaneTitleRect");function IBt(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===ZCe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:ZCe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=ZCe}k(IBt,"prepareLayoutForSwimlanes");function PBt(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,d=typeof l.end=="string"?l.end:void 0;!u||!d||l.labelNodeId||r.push({id:l.id,src:u,dst:d,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}}k(PBt,"toGraphView");function NBt(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??[],d=new Map,h=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||h.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*JCe(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,d.set(f.id,{minX:g,maxX:m,minY:v,maxY:y})}}if(h.length>0&&d.size>0){let f=1/0,p=-1/0,g=0;for(const m of h){const v=m.padding??20;v>g&&(g=v);const y=d.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 O of h)O.y=x,O.height=b,O.swimlaneContentTop=f;const w=[...h].sort((O,E)=>{const _=O.x??0,P=E.x??0;return _-P}),A=[],S=[],T=[];for(const O of w){const E=d.get(O.id);if(!E)continue;const _=Math.max(0,E.maxX-E.minX)+2*JCe(O),P=(E.minX+E.maxX)/2;A.push(O.id),S.push(P),T.push(_)}const C=A.length;if(C>0){const O=new Map;if(C===1)O.set(A[0],T[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:Y4(e,r,n,i)}:void 0}k(eke,"measuredNodeRect");function tke(t){if(t.isGroup)return;const e=eke(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}k(tke,"nodeBoundsInfoFor");function Dp(t,e,r=Ql){return Math.abs(t.x-e.x)r}k(es,"isHorizontalSegment");function ts(t,e,r=Ql){return Si(t,e,r)&&Math.abs(t.y-e.y)>r}k(ts,"isVerticalSegment");function ed(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)))}k(ed,"overlapLength");function q0(t,e,r=Ql){return t.horizontal&&e.horizontal&&Ri(t.a,e.a,r)?ed(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Si(t.a,e.a,r)?ed(t.a.y,t.b.y,e.a.y,e.b.y):0}k(q0,"sameAxisSegmentOverlapLength");function W4(t,e=Ql){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Dp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}k(Bi,"dedupeConsecutivePoints");function rke(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}k(rke,"classifyThreeSegmentRoute");function fee(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}k($Bt,"rectContainsRect");function pee(t,e){return t.lefte.left&&t.tope.top}k(pee,"rectsOverlap");function ike(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}k(ike,"inflateRect");function Y4(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}k(Y4,"rectFromCenterSize");function th(t){var e;return(e=eke(t))==null?void 0:e.rect}k(th,"rectOfNodeBounds");function WC(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}}}k(WC,"portForRectSide");function ake(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(Ri(t,r,a))return[t,r];const h=(t.x+r.x)/2;return[t,{x:h,y:t.y},{x:h,y:r.y},r]}if(e===n){if(Ri(t,r,a))return;const h=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:h,y:t.y},{x:h,y:r.y},r]}return}if(!o&&!s){if(e===n){if(Si(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(Si(t,r,a))return[t,r];const h=(t.y+r.y)/2;return[t,{x:t.x,y:h},{x:r.x,y:h},r]}if(o&&!s){const d=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return d&&h?[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}k(ake,"buildOrthogonalPortPath");function oke(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]}k(oke,"buildSameSideTrackPath");function gee(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=tke(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}k(gee,"collectRealNodeBounds");function e2(t){const e=[],r=[];for(const n of t){const i=tke(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}}k(e2,"collectNodeRectEntries");function FBt(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,...Y4(i,a,o,s)})}return r}k(FBt,"collectLayoutNodeRects");function ske(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-d.a.x)i:a&&s&&Ri(t,r,i)?ed(t.x,e.x,r.x,n.x)>i:!1}k(zBt,"sameAxisSegmentsOverlap");function mee(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&&hn+Ql&&t=2?e[e.length-2]:void 0,l=(o?Si(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||!Dp(i,n))&&r.push(n)}return r}k(vee,"orthogonalizePolyline");function j0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=VBt(e);if(e=n.points,!n.changed)break}return e}k(j0,"simplifyPolyline");var mn=.001,rNn=.5,GBt=4;function uke(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=QBt(t[i],t[a],e);return r?[o,...t.slice(i)]:[...t.slice(0,i+1),o]}k(dke,"clipEndpoint");function HBt(t,e){for(const r of t){const n=uke(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=dke(i,n.srcRect,!0)),n.dstRect&&(i=dke(i,n.dstRect,!1)),i=j0(vee(i)),i=mke(i,n.srcRect,n.dstRect),n.edge.points=j0(vee(i))}}k(HBt,"clipEdgeEndpointsToNodeBoundaries");function hke(t,e,r,n=!1){if(Ri(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(Si(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}k(hke,"snapEndpointToBoundary");function yee(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}}k(WBt,"intersectRanges");function pke(t,e){return e==="left"||e==="right"?bee(t.top,t.bottom):bee(t.left,t.right)}k(pke,"clearanceRangeForSide");function xee(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(Ri(t,e,mn)&&n){if(Math.abs(t.x-r.left)0?WBt(a):void 0}k(YBt,"straightClearanceRange");function gke(t,e,r,n,i){const a=YBt(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 Ri(e,r,mn)&&r.xn.right+mn}}k(bke,"leavesOutward");function xke(t,e,r){if(t.length<3)return t;if(r){const a=yke(t[0],t[1],e);return a&&bke(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=yke(t[n-1],t[n],e);return i&&bke(i,t[n-1],t[n-2],e)?t.slice(0,n):t}k(xke,"collapseOwnBorderStub");function XBt(t,e,r){let n=t;if(e){const a=yee(n,0,1);if(a){const o=hke(a,n[0],e);o!==n[0]&&(n=[o,...n.slice(1)])}n=xke(n,e,!0)}if(r){const a=n.length-1,o=yee(n,a,-1);if(o){const s=hke(o,n[a],r,!0);s!==n[a]&&(n=[...n.slice(0,a),s])}n=xke(n,r,!1)}const i=mke(n,e,r);return i!==n||n.length===2?i:(e&&(n=vke(n,e,!0)),r&&(n=vke(n,r,!1)),n)}k(XBt,"snapAndCollapseEndpoints");function wke(t,e){for(const r of t){const n=uke(r,e,2);if(!n)continue;const i=Bi(n.points,mn),a=XBt(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}}k(wke,"prepareEdgeEndpointsForRenderer");function Ake(t){return new Map(t.map(e=>[e.id,e]))}k(Ake,"buildNodeMap");function KBt(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}k(KBt,"resolveTopLevelGroupId");function Ske(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}k(Ske,"groupDepth");function Tke(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}}k(Tke,"boundsForChildren");function ZBt(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}k(ZBt,"applyGroupBounds");function JBt(t){const e=Ake(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>Ske(i,e)-Ske(n,e));for(const n of r){const i=t.filter(o=>o.parentId===n.id),a=Tke(i);a&&ZBt(n,a)}}k(JBt,"recomputeNestedGroupBounds");function wee(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=k(l=>a+o-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=s(u));const d=l.groupTitleRect;d&&(l.groupTitleRect=e==="x"?{...d,left:s(d.right),right:s(d.left)}:{...d,top:s(d.bottom),bottom:s(d.top)})}for(const l of n)for(const u of l.points??[])u[e]=s(u[e]);return!0}k(wee,"mirrorAxis");function e7t(t){return(t.nodes??[]).some(r=>!r.isGroup)?wee(t,"y"):!0}k(e7t,"applyBtDirectionTransform");function t7t(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,d/h):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}JBt(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&wee(t,"x"),!0;const g=Ake(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=KBt(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=Tke(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+Vg||P>=y.right-Vg)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+Vg||P>=y.bottom-Vg)continue;x={x:_,y:P},w={x:s.x,y:P},A={x:s.x,y:s.y}}const S=Dp(x,w,Vg),T=Dp(w,A,Vg);if(S&&T||!S&&As(x,w,n,[d],1)||!T&&As(w,A,n,[h],1))continue;const C=!S&&mee(x,w,t,i,{epsilon:Vg,skipDegenerateOther:!0}),O=!T&&mee(w,A,t,i,{epsilon:Vg,skipDegenerateOther:!0});if(!(C||O)){S?v=[w,A]:T?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}k(r7t,"portSwapToLShape");function n7t(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values());for(const s of t){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<4)continue;const u=Bi(l,.001);if(u.length<4)continue;const d=u.length-1,h=u[d],f=u[d-1],p=u[d-2],g=h.x-f.x,m=h.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,h,.001),A=ts(f,h,.001),S=es(p,f,.001),T=ts(p,f,.001);if(!(w&&T||A&&S))continue;const C=s.end,O=s.start,E=C?e.get(C):void 0;if(!E)continue;const _=E.x??0,P=E.y??0,L=th(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(O){const z=e.get(O),U=z?th(z):void 0;if(U&&nke(R,U,2))continue}const M=k((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 G of t){if(G===s||G.isLayoutOnly)continue;const H=G.points;if(!(!H||H.length<2))for(let j=0;j=0){const z=u[d-3],U=[O,C].filter(G=>!!G);if(As(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,d-2),R,D];s.points=B;const V=s.labelNodeId;if(V){const z=e.get(V);if(z){const U=z.width??0,G=z.height??0;if(U>0&&G>0){let H,j,q=-1;for(let ne=0;ne=U+2||pe&&ee>=G+2)&&ee>q&&(q=ee,H=(X.x+J.x)/2,j=(X.y+J.y)/2)}H!==void 0&&j!==void 0&&(z.x=H,z.y=j)}}}}}k(n7t,"collapseShortTerminalStub");var Lr=.001,Hl=8,Xn=W4,Cke=k((t,e)=>Si(t,e,Lr)||Ri(t,e,Lr),"orthogonallyAligned");function i7t(t,e){const i=k((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=k((p,g)=>{const m=Bi(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?th(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(Cke(w,A)&&(S=w),Si(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(Ri(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=k((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),s=k((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)&&Si(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Ri(p.boundary,g.boundary,1),"sameTerminalFace"),l=k((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:o(p,g)>=Hl&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=k((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"),d=k((p,g)=>{const m=Bi(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(!k(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Ri(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?Si(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&&Dp(m[1],p.railEnd,Lr),T=m.slice(S?2:1),C=T[0];return C&&!Cke(C,y)?void 0:[v,y,...T]}const x=m.length>1&&Dp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!Cke(A,y)))return[...w,y,v]},"shiftedCandidate"),h=k(p=>{const g=p.edge,m=Bi(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,O]=m;return Ri(C,O,Lr)&&Math.abs(A-T)<1&&Math.abs(w-S)>1||Si(C,O,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=h(S),O=h(T);return C!==O?Number(C)-Number(O):+!T.atStart-+!S.atStart});for(const S of A){for(const T of f){const C=d(S,T);if(!C)continue;const O=a({...S.edge,points:C},S.atStart);if(!(!O||g.some(E=>E.edge!==S.edge&&(l(O,E)||w&&u(O,E))))){S.edge.points=C,m=!0;break}}if(m)break}}if(!m)return}}k(i7t,"separateSharedRenderedTerminalLanes");function a7t(t,e){const{realNodeRects:n,labelNodeRects:i}=e2(e.values()),a=k((s,l)=>{const u=s.start,d=s.end,h=Xn(l);if(h.length!==l.length-1)return!1;const f=[u,d].filter(p=>!!p);for(const p of h)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 h)for(const v of Xn(Bi(g)))if(q0(m,v,.5)>=Hl||Q1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),o=k((s,l)=>{if(l+4>=s.length)return;const u=s[l],d=s[l+1],h=s[l+2],f=s[l+3],p=s[l+4],g=es(u,d)&&ts(d,h)&&es(h,f)&&ts(f,p)&&Si(u,f,Lr)&&Si(u,p,Lr)&&Si(d,h,Lr)&&(d.x-u.x)*(f.x-h.x)<0,m=ts(u,d)&&es(d,h)&&ts(h,f)&&es(f,p)&&Ri(u,f,Lr)&&Ri(u,p,Lr)&&Ri(d,h,Lr)&&(d.y-u.y)*(f.y-h.y)<0;if(g||m)return Bi([...s.slice(0,l+1),p,...s.slice(l+5)]);if(l+5>=s.length)return;const v=s[l+5],y=ts(u,d)&&es(d,h)&&ts(h,f)&&es(f,p)&&ts(p,v)&&Si(u,p,Lr)&&Si(u,v,Lr)&&Si(h,f,Lr)&&(h.x-d.x)*(p.x-f.x)<0,b=es(u,d)&&ts(d,h)&&es(h,f)&&ts(f,p)&&es(p,v)&&Ri(u,p,Lr)&&Ri(u,v,Lr)&&Ri(h,f,Lr)&&(h.y-d.y)*(p.y-f.y)<0;if(!(!y&&!b))return Bi([...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 d=Bi(u.points??[]);for(let h=0;h<=d.length-5;h++){const f=o(d,h);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}k(a7t,"collapseRedundantRectangularDoglegs");function kke(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values()),s=t.filter(g=>!g.isLayoutOnly),l=k((g,m,v)=>Bi(g===m?v??[]:g.points??[]),"pointsFor"),u=k((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"),h=k((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?ed(m.a.x,m.b.x,b.left,b.right)>=Hl&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:ed(m.a.y,m.b.y,b.top,b.bottom)>=Hl&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=k((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=j0(Bi(y));return Xn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=k((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(q0(w,A,.5)>=Hl)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=d(b);if(!x)continue;const w=h(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}}k(kke,"liftObstacleHuggingSameSideRails");function Oke(t,e){const n=k(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=k(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,d=typeof u=="string"?u.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT")return;const h=n(l),f=l.y,p=l.height;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=h.right-h.left,m=h.bottom-h.top;if(!(m<=0||g{if(!l.horizontal)return!1;const d=l.a.y;return d<=u.top+Lr||d>=u.bottom-Lr?!1:ed(l.a.x,l.b.x,u.left,u.right)>=Hl},"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=Bi(l.points??[]);for(const d of Xn(u))for(const h of o)a(d,h.rect)&&(s=Math.max(s,h.rect.bottom-d.a.y+4))}if(!(s<=Lr))for(const l of o){const u=l.node.y,d=l.node.height;typeof u!="number"||typeof d!="number"||!Number.isFinite(u)||!Number.isFinite(d)||d<=0||(l.node.y=u-s/2,l.node.height=d+s,l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s})}}k(Oke,"liftTopLaneTitleBandsAboveRails");function Eke(t,e){const n=k(u=>{const d=u.groupTitleRect;if(!(!d||typeof d.left!="number"||typeof d.right!="number"||typeof d.top!="number"||typeof d.bottom!="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top))return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect"),i=k(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const h=n(u),f=u.x,p=u.width;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=h.right-h.left,m=h.bottom-h.top;if(!(g<=0||m{if(!u.vertical)return!1;const h=u.a.x;return h<=d.left+Lr||h>=d.right-Lr?!1:ed(u.a.y,u.b.y,d.top,d.bottom)>=Hl},"verticalSegmentIntersectsTitle"),o=k((u,d)=>{if(!u.horizontal)return!1;const h=u.a.y;return h<=d.top+Lr||h>=d.bottom-Lr?!1:ed(u.a.x,u.b.x,d.left,d.right)>=Hl},"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 d=Bi(u.points??[]);for(const h of Xn(d))for(const f of s)if(a(h,f.rect))l=Math.max(l,f.rect.right-h.a.x+4);else if(o(h,f.rect)){const p=Math.min(h.a.x,h.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Lr))for(const u of s){const d=u.node.x,h=u.node.width;typeof d!="number"||typeof h!="number"||!Number.isFinite(d)||!Number.isFinite(h)||h<=0||(u.node.x=d-l/2,u.node.width=h+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}k(Eke,"shiftLeftLaneTitleBandsLeftOfRails");function o7t(t,e){const{realNodeRects:n}=e2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=k((g,m=new Map)=>Bi(m.get(g)??g.points??[]),"replacementPointsFor"),o=k((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+pf(a(v,g)),0),"totalBends"),l=k(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=k((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=j0(Bi([y,b,x,m.tailStart,m.terminal]));return Xn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),d=k((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"),h=k((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(q0(b,x,.5)>=Hl)return!0}return!1},"pathHasSharedTrack"),f=k((g,m,v)=>!d(g,m)&&!h(g,m,v),"candidateIsSafe"),p=k(()=>{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}}k(o7t,"swapDestinationTerminalTailsToReduceCrossings");function s7t(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values()),s=t.filter(w=>!w.isLayoutOnly),l=k((w,A=new Map)=>Bi(A.get(w)??w.points??[]),"replacementPointsFor"),u=k((w=new Map)=>{let A=0;for(let S=0;Ss.reduce((A,S)=>A+pf(l(S,w)),0),"totalBends"),h=k(w=>{const A=w.start,S=w.end,T=A?e.get(A):void 0,C=S?e.get(S):void 0,O=T?th(T):void 0,E=C?th(C):void 0;return O&&E?{src:O,dst:E}:void 0},"endpointRectsFor"),f=k((w,A,S)=>{if(S.index<=0||S.index+1>=A.length-1)return;const T=h(w);if(T){if(S.vertical){const C=S.a.x,O=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,O=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=k(()=>{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=k((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&ed(w.min,w.max,A.min,A.max)>=Hl,"railsInteract"),m=k(w=>{const A=[],S=new Set;for(const T of w){if(S.has(T))continue;const C=[T],O=[];for(S.add(T);C.length>0;){const E=C.pop();O.push(E);for(const _ of w)!S.has(_)&&g(E,_)&&(S.add(_),C.push(_))}O.length>1&&A.push(O)}return A},"connectedComponents"),v=k(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),O=[],E=k(()=>{if(O.length===w.length){O.some((_,P)=>Math.abs(_-A[P])>=Lr)&&T.push([...O]);return}for(const[_,P]of S.entries())C[_]||(C[_]=!0,O.push(P),E(),O.pop(),C[_]=!1)},"visit");return E(),T}for(let C=0;C{const S=new Map;for(const[C,O]of w.entries()){const E=A[C],_=S.get(O.edge)??O.points.map(P=>({x:P.x,y:P.y}));O.axis==="vertical"?(_[O.segmentIndex].x=E,_[O.segmentIndex+1].x=E):(_[O.segmentIndex].y=E,_[O.segmentIndex+1].y=E),S.set(O.edge,_)}const T=new Map;for(const[C,O]of S){const E=j0(Bi(O));if(Xn(E).length!==E.length-1)return;T.set(C,E)}return T},"replacementsForAssignment"),x=k(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=Hl)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let S,T=A,C=d(),O=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=d(P),D=E.reduce((M,I,N)=>M+Math.abs(_[N]-I.coord),0);L>T||L===T&&(R>C||R===C&&D>=O)||(S=P,T=L,C=R,O=D)}if(!S)return;for(const[E,_]of S)E.points=_}}k(s7t,"reassignCrossingExternalRailChannels");function l7t(t,e){const{realNodeRects:n,labelNodeRects:i}=e2(e.values()),a=t.filter(p=>!p.isLayoutOnly),o=k((p,g,m)=>Bi(p===g?m??[]:p.points??[]),"pointsFor"),s=k(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=k((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)&&ed(p.a.x,p.b.x,g.left,g.right)>=Hl}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&ed(p.a.y,p.b.y,g.top,g.bottom)>=Hl}return!1},"segmentRunsAlongRectBorder"),d=k(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?th(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),h=k((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=Si(m,b,Lr)||Ri(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(O=>[...p.slice(0,g+1),O,...p.slice(g+3)]),C=new Set;return T.map(O=>j0(Bi(O))).filter(O=>{if(Xn(O).length!==O.length-1||!O.some(_=>Dp(_,b,Lr)))return!1;const E=O.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return C.has(E)?!1:(C.add(E),!0)})},"shortcutCandidatesAt"),f=k((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=d(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(q0(x,w,.5)>=Hl)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=pf(A,Lr),T=s(A);for(let C=0;C<=A.length-4;C++)for(const O of h(A,C)){const E=pf(O,Lr),_=s(O);if(!(Ey||L===y&&(E>b||E===b&&_>=x)||(m=w,v=O,y=L,b=E,x=_)}}if(!m||!v)return;m.points=v}}k(l7t,"shortcutRedundantOrthogonalJogs");function c7t(t,e){const o=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const he=ue.x??0,xe=ue.y??0,ge=th(ue);ge&&o.push({id:String(ue.id??""),cx:he,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"],d={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},h=t.filter(ue=>!ue.isLayoutOnly),f=new Map(h.map((ue,he)=>[ue,he])),p=k(ue=>{const he=ue==="left"||ue==="top"?-1:1,xe=[];for(let ge=0;ge<=2;ge++)xe.push(d[ue]+he*20*ge);return xe},"outwardTracksForSide"),g=k((ue,he=new Map)=>Bi(he.get(ue)??ue.points??[]),"replacementPointsFor"),m=k((ue,he)=>{let xe=0;for(const ge of ue)for(const ze of he)Q1(ge.a,ge.b,ze.a,ze.b,Lr)&&xe++;return xe},"crossingCountBetweenSegments"),v=k((ue,he)=>m(Xn(ue),Xn(he)),"crossingCountBetweenPaths"),y=k((ue=new Map)=>{let he=0;const xe=[],ge=new Set,ze=[],we=k(ke=>{ge.has(ke)||(ge.add(ke),ze.push(ke))},"addEdge");for(let ke=0;ke0&&(he+=ae,xe.push({first:Be,second:be,count:ae}),we(Be),we(be))}}return ze.sort((ke,Be)=>(f.get(ke)??0)-(f.get(Be)??0)),{count:he,pairs:xe,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=k((ue,he)=>{const xe=new Set(he.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 he=new Map;for(const ze of ue.pairs){const we=he.get(ze.first)??new Set;we.add(ze.second),he.set(ze.first,we);const ke=he.get(ze.second)??new Set;ke.add(ze.first),he.set(ze.second,ke)}const xe=[],ge=new Set;for(const ze of ue.edges){if(ge.has(ze))continue;const we=[ze],ke=[];for(ge.add(ze);we.length>0;){const Be=we.pop();ke.push(Be);for(const Z of he.get(Be)??[])ge.has(Z)||(ge.add(Z),we.push(Z))}ke.sort((Be,Z)=>(f.get(Be)??0)-(f.get(Z)??0)),ke.length>1&&xe.push(ke)}return xe},"crossingComponents"),w=k(ue=>[ue.start,ue.end].filter(he=>!!he),"endpointIdsFor"),A=k(ue=>{const he=[];for(const xe of x(ue)){const ge=new Set(xe),ze=new Set(xe.flatMap(ke=>w(ke))),we=[...xe];for(const ke of h)ge.has(ke)||w(ke).some(Be=>ze.has(Be))&&we.push(ke);we.sort((ke,Be)=>(f.get(ke)??0)-(f.get(Be)??0)),he.push(we)}return he},"pairSearchGroups"),S=k((ue,he,xe)=>b(ue,new Map([[he,xe]])),"crossingCountWithSingleReplacement"),T=k(ue=>{const he=new Map;for(const xe of ue.pairs)he.set(xe.first,(he.get(xe.first)??0)+xe.count),he.set(xe.second,(he.get(xe.second)??0)+xe.count);return he},"currentCrossingsByEdge"),C=k(ue=>ue.slice(1).reduce((he,xe,ge)=>{const ze=ue[ge];return he+Math.abs(xe.x-ze.x)+Math.abs(xe.y-ze.y)},0),"pathLength"),O=k((ue=new Map)=>h.reduce((he,xe)=>he+pf(g(xe,ue)),0),"totalBends"),E=k((ue=new Map)=>h.reduce((he,xe)=>he+C(g(xe,ue)),0),"totalLength"),_=k((ue,he,xe=new Map)=>{const ge=Xn(he);for(const ze of h)if(ze!==ue){for(const we of ge)for(const ke of Xn(g(ze,xe)))if(q0(we,ke,.5)>=Hl)return!0}return!1},"pathHasSegmentConflict"),P=k((ue,he)=>{const xe=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of Xn(he))if(As(ge.a,ge.b,l,xe,-2))return!0;return!1},"pathHitsNode"),L=k((ue,he)=>{const xe=j0(Bi(he));Xn(xe).length===xe.length-1&&ue.push(xe)},"pushOrthogonalCandidate"),R=k(ue=>ue==="left"||ue==="right","sideIsHorizontal"),D=k((ue,he,xe)=>{switch(he){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=k((ue,he,xe,ge)=>{const ze=xe==="left"||xe==="top"?-1:1,we=[D(he,xe,ge),d[xe]];for(const ke of we)for(let Be=0;Be<=2;Be++)L(ue,oke(he,xe,ge,ke+ze*20*Be))},"addSameSideCandidates"),I=k((ue,he,xe,ge,ze)=>{for(const we of p(xe))for(const ke of p(ze))L(ue,[he,{x:we,y:he.y},{x:we,y:ke},{x:ge.x,y:ke},ge])},"addHorizontalToVerticalCandidates"),N=k((ue,he,xe,ge,ze)=>{for(const we of p(xe))for(const ke of p(ze))L(ue,[he,{x:he.x,y:we},{x:ke,y:we},{x:ke,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=k((ue,he,xe,ge,ze)=>{const we=[...p("top"),...p("bottom")];for(const ke of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[he,{x:ke,y:he.y},{x:ke,y:Z},{x:Be,y:Z},{x:Be,y:ge.y},ge])},"addHorizontalPairCandidates"),B=k((ue,he,xe,ge,ze)=>{const we=[...p("left"),...p("right")];for(const ke of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[he,{x:he.x,y:ke},{x:Z,y:ke},{x:Z,y:Be},{x:ge.x,y:Be},ge])},"addVerticalPairCandidates"),V=k(ue=>{const he=new Set;return ue.map(xe=>Bi(xe)).filter(xe=>{const ge=xe.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return he.has(ge)||xe.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),z=k((ue,he,xe,ge)=>{const ze=[],we=ake(ue,he,xe,ge,20,Lr);we&&L(ze,we),he===ge&&M(ze,ue,he,xe);const ke=R(he),Be=R(ge);return ke&&!Be?I(ze,ue,he,xe,ge):!ke&&Be?N(ze,ue,he,xe,ge):ke?F(ze,ue,he,xe,ge):B(ze,ue,he,xe,ge),V(ze)},"buildCandidatesForSides"),U=k((ue,he,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const ke of u){const Be=WC(ge,ke),Z=ke==="top"||ke==="bottom"?p(ke):we;for(const le of ze){L(ue,[he,xe,{x:le,y:xe.y},{x:le,y:Be.y},Be]);for(const be of Z)L(ue,[he,xe,{x:le,y:xe.y},{x:le,y:be},{x:Be.x,y:be},Be])}}},"addVerticalDepartureOuterTrackCandidates"),G=k((ue,he,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const ke of u){const Be=WC(ge,ke),Z=ke==="left"||ke==="right"?p(ke):ze;for(const le of we){L(ue,[he,xe,{x:xe.x,y:le},{x:Be.x,y:le},Be]);for(const be of Z)L(ue,[he,xe,{x:xe.x,y:le},{x:be,y:le},{x:be,y:Be.y},Be])}}},"addHorizontalDepartureOuterTrackCandidates"),H=k(ue=>{const he=ue.start,xe=ue.end,ge=xe?s.get(xe):void 0;if(!he||!ge)return[];const ze=Bi(ue.points??[]);if(ze.length<4)return[];const we=ze[0],ke=ze[1],Be=[];return ts(we,ke,Lr)?U(Be,we,ke,ge):es(we,ke,Lr)&&G(Be,we,ke,ge),Be},"terminalPreservingOuterTrackCandidates"),j=k(ue=>{const he=ue.start,xe=ue.end,ge=he?s.get(he):void 0,ze=xe?s.get(xe):void 0;if(!ge||!ze)return[];const we=[];for(const ke of u){const Be=WC(ge,ke);for(const Z of u)we.push(...z(Be,ke,WC(ze,Z),Z))}return we.push(...H(ue)),we},"candidatePathsFor"),q=k(()=>new Map(h.map(ue=>[ue,Xn(g(ue))])),"currentSegmentsByEdge"),ne=k((ue,he,xe)=>{const ge=new Set;for(const ze of h){if(ze===ue)continue;const we=xe.get(ze)??Xn(g(ze));he.some(ke=>we.some(Be=>q0(ke,Be,.5)>=Hl))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),X=k((ue,he,xe,ge)=>{const ze=new Set;return j(ue).map(ke=>j0(Bi(ke))).filter(ke=>{if(P(ue,ke))return!1;const Be=ke.map(Z=>`${Z.x.toFixed(3)},${Z.y.toFixed(3)}`).join("|");return ze.has(Be)||ke.length<2?!1:(ze.add(Be),!0)}).map(ke=>{const Be=Xn(ke);let Z=0;for(const le of h)le!==ue&&(Z+=m(Be,xe.get(le)??Xn(g(le))));return{candidate:ke,candidateSegments:Be,crossings:he.count-(ge.get(ue)??0)+Z,bends:pf(ke,Lr),totalBends:pf(ke),length:C(ke)}}).filter(({crossings:ke})=>ke<=he.count).sort((ke,Be)=>ke.crossings-Be.crossings||ke.bends-Be.bends||ke.length-Be.length).slice(0,48).map(ke=>({path:ke.candidate,segments:ke.candidateSegments,sharedTrackConflicts:ne(ue,ke.candidateSegments,xe),totalBends:ke.totalBends,length:ke.length}))},"pairCandidatesFor"),J=k((ue,he,xe,ge,ze,we)=>{let ke=0;for(const Z of ue.pairs)(Z.first===he||Z.second===he||Z.first===ge||Z.second===ge)&&(ke+=Z.count);let Be=m(xe.segments,ze.segments);for(const Z of h){if(Z===he||Z===ge)continue;const le=we.get(Z)??Xn(g(Z));Be+=m(xe.segments,le)+m(ze.segments,le)}return ue.count-ke+Be},"pairCrossingCount"),ee=k((ue,he)=>{for(const xe of ue.sharedTrackConflicts)if(xe!==he)return!1;return!0},"conflictsOnlyWith"),te=k((ue,he)=>ue.segments.some(xe=>he.segments.some(ge=>q0(xe,ge,.5)>=Hl)),"candidatesShareTrack"),pe=k((ue,he,xe,ge)=>ee(he,xe.edge)&&ee(ge,ue.edge)&&!te(he,ge),"pairCandidatesAreCompatible"),ie=k((ue,he,xe,ge,ze)=>{const we=J(ue.current,he.edge,xe,ge.edge,ze,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[he.edge,xe.path],[ge.edge,ze.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(he.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+xe.totalBends+ze.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(he.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+xe.length+ze.length}},"scorePairReplacement"),Ce=k((ue,he)=>ue.crossings{let ze=ge;for(const we of he.candidates)for(const ke of xe.candidates){if(!pe(he,we,xe,ke))continue;const Be=ie(ue,he,we,xe,ke);Be&&Ce(Be,ze)&&(ze=Be)}return ze},"bestScoreForOptionPair"),Ee=k(ue=>{const he=O(),xe=E(),ge=q(),ze=T(ue),we=new Map(h.map(ae=>[ae,pf(g(ae))])),ke=new Map(h.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:he,length:xe};const be={current:ue,currentBends:he,currentLength:xe,baseBendsByEdge:we,baseLengthByEdge:ke,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 he=y(),xe=he.count;if(xe===0)return;let ge,ze,we=xe,ke=Number.POSITIVE_INFINITY;for(const Z of he.edges){const le=pf(g(Z),Lr);for(const be of j(Z)){const ae=P(Z,be),K=!ae&&_(Z,be),se=S(he,Z,be),me=pf(be,Lr);ae||K||!(sewe||se===we&&me>=ke||(ge=Z,ze=be,we=se,ke=me)}}if(ge&&ze){ge.points=ze;continue}const Be=Ee(he);if(!Be)return;for(const[Z,le]of Be)Z.points=le}}k(c7t,"resolveRenderedOrthogonalCrossings");var t2=.001,aNn=8;function u7t(t,e){const{nodeInfoById:r,realNodeRects:n}=gee(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=k((m,v,y,b)=>{const x=[],w=ake(m,v,y,b,a,t2);return w&&x.push(w),v===b&&x.push(oke(m,v,y,o[v])),x},"buildOrthogonalPathCandidates"),l=k((m,v)=>{for(let y=0;y{let b=0;const x=W4(m,t2),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 O=S.points;if(!(!O||O.length<2))for(const E of x)for(const _ of W4(O,t2)){if(lke(E.a,E.b,_.a,_.b,t2,t2)){b++;continue}q0(E,_,t2)>=aNn&&b++}}return b},"pathConflictCount"),d=4,h=k((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,h(v[0],w),y)}if(x){const w=r.get(x);w&&p(x,h(v[v.length-1],w),y)}}const g=k((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=pf(v,t2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&I>=_)continue;E=N,_=I,O=M;continue}u(M,m)>C||I<_&&(_=I,O=M)}}}if(O){m.points=O;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,h(O[0],w),S),p(x,h(O[O.length-1],A),S)}}}k(u7t,"simplifyDetouredEdges");var rh=.001,d7t=10,See=7;function _ke(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&&pee(t,h7t(a)))}k(Rke,"labelOverlapsOwnMarker");function Tee(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=ike(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&pee(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=k((g,m)=>{const v=ike(m,a);for(const y of r)if(y.edgeId!==g&&fee(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),d=k((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),h=[],f=k(g=>{for(const{id:m,rect:v}of i)if($Bt(v,g))return m},"findContainingLane"),p=k((g,m)=>h.some(v=>v.labelId!==g&&pee(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=rh&&H>=rh||w.push({idx:V,length:G+H,orientation:G>=rh?"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=k(V=>[...V].sort((z,U)=>{const G=z.orientation===T,H=U.orientation===T;if(G!==H)return G?-1:1;const j=z.length>=(z.orientation==="horizontal"?b:x)+2,q=U.length>=(U.orientation==="horizontal"?b:x)+2;return j!==q?j?-1:1:U.length-z.length}),"rankSegments"),O=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=k((V,z)=>{const U=y[V.idx],G=y[V.idx+1];return{midX:U.x+(G.x-U.x)*z,midY:U.y+(G.y-U.y)*z}},"anchorAtT"),L=k((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=k((V,z)=>V.midX>=z.left-rh&&V.midX<=z.right+rh&&V.midY>=z.top-rh&&V.midY<=z.bottom+rh,"pointInsideRectInclusive"),D=k(V=>{const z=Y4(V.midX,V.midY,b,x),U=f(z);if(U)return{laneId:U,anchor:V,rect:z};const G=i.find(({rect:ee})=>R(V,ee));if(!G)return;const H=G.rect.left+b/2+o,j=G.rect.right-b/2-o,q=G.rect.top+x/2+o,ne=G.rect.bottom-x/2-o;if(H>j||q>ne)return;const X={midX:L(V.midX,H,j),midY:L(V.midY,q,ne)},J=Y4(X.midX,X.midY,b,x);return R(V,J)?{laneId:G.id,anchor:X,rect:J}:void 0},"placementForAnchor"),M=k((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),I=k((V,z)=>{const G=(V.orientation==="horizontal"?b/2:x/2)+s;if(V===O){const H=y[V.idx];if(M(V,z,H)+rh{const z=C(V);for(const U of z)for(const G of _){const H=P(U,G);if(!I(U,H))continue;const j=D(H);if(j&&!Rke(j.rect,y)&&!p(m,j.rect)&&!d(m,g.id,j.rect))return{laneId:j.laneId,anchor:j.anchor}}},"tryPool"),F=k((V,z,U=!1)=>{const G=C(V);for(const H of G){const j={midX:H.midX,midY:H.midY};if(z&&!I(H,j))continue;const q=D(j);if(q&&!Rke(q.rect,y)&&!p(m,q.rect)&&!l(m,q.rect)&&(U||!u(g.id,q.rect)))return{laneId:q.laneId,anchor:q.anchor}}},"findLaneContainingFallback"),B=N(S)??(S.lengthU.labelId===m);z>=0?h[z]={labelId:m,rect:V}:h.push({labelId:m,rect:V})}}}k(Tee,"anchorLabelsToPolyline");var Dke=1e-6,oNn=8,f7t=oNn/2,sNn=3;function Lke(t,e){return t{const d=Lke(s,l);let h=0;const f=k(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>h&&(h=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||Lke(g,m)===d&&f(p.labelNodeId)}return h>0?h+sNn:0},"labelClearanceFor");for(const o of t){if(o.isLayoutOnly)continue;const s=o.points;if(!rke(s,Dke))continue;const l=ske(o,r,Dke);if(!l)continue;const{srcId:u,dstId:d,srcInfo:h,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,v;if(p){const A=f.cy>h.cy;m={x:h.cx,y:A?h.rect.bottom:h.rect.top},v={x:f.cx,y:A?f.rect.top:f.rect.bottom}}else{const A=f.cx>h.cx;m={x:A?h.rect.right:h.rect.left,y:h.cy},v={x:A?f.rect.left:f.rect.right,y:f.cy}}if(As(m,v,n,[u,d],1))continue;const b=a(o,u,d,p?"x":"y"),x=b>f7t?b:f7t,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<=h.rect.left||S.x>=h.rect.right||T.x<=f.rect.left||T.x>=f.rect.right)continue}else if(S.y+=A,T.y+=A,S.y<=h.rect.top||S.y>=h.rect.bottom||T.y<=f.rect.top||T.y>=f.rect.bottom)continue;if(!As(S,T,n,[u,d],1)&&!mee(S,T,t,o,{epsilon:Dke})){o.points=[S,T];break}}}}k(p7t,"straightenCollinearSiblingDetours");function Mke(t,e){const{realNodeRects:l,labelNodeRects:u}=e2(e.values()),d=k((A,S)=>W4(S,.001).map(T=>({...T,edge:A,interior:T.index>=1&&T.index<=S.length-3})),"segmentsFor"),h=k(()=>{const A=[];for(const S of t){if(S.isLayoutOnly)continue;const T=S.points;!T||T.length<2||A.push(...d(S,Bi(T)))}return A},"allSegments"),f=k((A,S)=>A.horizontal&&S.horizontal?ed(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?ed(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=k((A,S)=>{const T=A.start,C=A.end,O=d(A,S);if(O.length!==S.length-1)return!1;const E=[T,C].filter(P=>!!P),_=A.labelNodeId?[A.labelNodeId]:[];for(const P of O)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 O)for(const D of d(P,Bi(L)))if(f(R,D)||Q1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=k((A,S)=>{const T=Bi(A.edge.points??[]);if(T.length<4||A.index>=T.length-1)return;const C=T.map(O=>({...O}));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 d(A.edge,C).length===C.length-1?C:void 0},"shiftedCandidate"),m=k((A,S)=>({x:A.x??(S.left+S.right)/2,y:A.y??(S.top+S.bottom)/2}),"nodeCenter"),v=k(A=>{const S=A.edge,T=Bi(S.points??[]);if(T.length!==4||A.index!==1)return;const C=S.start?e.get(S.start):void 0,O=S.end?e.get(S.end):void 0,E=C?th(C):void 0,_=O?th(O):void 0,P=T.slice(A.index+2);if(!(!C||!O||!E||!_||P.length===0))return{sourceCenter:m(C,E),targetCenter:m(O,_),sourceRect:E,tail:P}},"sourceDetourContextFor"),y=k((A,S,T,C,O,E)=>{const _=C.y>=T.y,P=_?O.bottom:O.top,L=P+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+S;return Bi([{x:T.x,y:P},{x:T.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=k((A,S,T,C,O,E)=>{const _=C.x>=T.x,P=_?O.right:O.left,L=P+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+S;return Bi([{x:P,y:T.y},{x:L,y:T.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=k((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=h();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}}k(Mke,"nudgeSharedInteriorSubpaths");function g7t(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,d=r.y-t.y,h=(u*s-d*o)/l,f=(u*a-d*i)/l,p=.01;return h>p&&h<1-p&&f>p&&f<1-p}k(g7t,"segmentsIntersect");function m7t(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=FBt(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,d=s.end,h=s.labelNodeId,f=s.id??`${u}->${d}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===d)&&!(h&&p.nodeId===h)){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}k(m7t,"validateSwimlanesLayout");function v7t(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(s=>!s.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!t7t(t,e)||e==="BT"&&i.length>0&&!e7t(t))return;for(const s of n){if(s.isLayoutOnly)continue;const l=s.points;!l||l.length<2||(s.points=j0(vee(l)))}u7t(n,r),p7t(n,r),r7t(n,r);const a=new Map;for(const s of r)a.set(String(s.id),s);Tee(n,a),HBt(n,a),n7t(n,a),Mke(n,a),i7t(n,a),a7t(n,a),kke(n,a),o7t(n,a);const o=k(()=>{c7t(n,a),s7t(n,a),l7t(n,a),Tee(n,a),wke(n,a),kke(n,a),Tee(n,a),wke(n,a)},"finalizeRenderedEdges");o(),Mke(n,a),o(),Oke(n,a),Eke(n,a),Oke(n,a),Eke(n,a)}k(v7t,"postProcessSwimlaneLayout");function r2(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}}k(r2,"normalizeGraph");function Ike(t,e){return t.edges.filter(r=>r.dst===e)}k(Ike,"incoming");function y7t(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}k(y7t,"buildSuccessorMap");function Pke(t){const e=y7t(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}k(Pke,"buildSortedSuccessorMap");function Nke(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}k(Nke,"buildInDegreeMap");function Bke(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}k(Bke,"sortedZeroInDegreeNodes");function Cee(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}}k(Cee,"buildPredecessorSuccessorMaps");function $ke(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}k($ke,"buildLayersFromRanks");function jF(t){const e=Nke(t),r=Bke(e),n=[],i=Pke(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||sh.dst===f.dst?h.id.localeCompare(f.id):h.dst.localeCompare(f.dst));const n=Object.create(null);for(const d of e.nodes)n[d]=0;const i=[],a=k(d=>{n[d]=1;for(const h of r.get(d)??[]){const f=h.dst;n[f]===0?a(f):n[f]===1&&i.push(h)}n[d]=2},"dfs"),o=[...e.nodes].sort((d,h)=>d.localeCompare(h));for(const d of o)n[d]===0&&a(d);const s=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`)),l=e.edges.map(d=>s.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}k(b7t,"removeCycles_DFS");function x7t(t){const e=new Map,r=k(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}k(x7t,"buildTopLaneMap");function H1(t){const e=x7t(t);return r=>e.get(r)??null}k(H1,"createTopLaneResolver");function kee(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}k(kee,"buildTopLaneOrder");function zke(t,e){const r=kee(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}k(zke,"resolveTopLaneOrder");var lNn={EPSILON:1e-6},Oee={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},w7t={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function A7t(t,e){const r=r2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=Cee(r);for(const A of a.values())A.sort((S,T)=>S.localeCompare(T));const o=jF(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=S7t(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 d=new Set;for(const A of r.nodes)(l.get(A)??null)===null&&d.add(A);const h=[...d].sort((A,S)=>{const T=s.get(A)??0,C=s.get(S)??0;return T===C?A.localeCompare(S):T-C}),f=T7t(r),p=new Map;for(const[A,S]of f.entries())p.set(A,[...S].sort((T,C)=>T.localeCompare(C)));const g=C7t(p),m=k7t(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=k(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 h)w(A);for(const A of o)w(A);return{parent:l,children:u,roots:h,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:o}}k(A7t,"buildDrivingTree");function S7t(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,d=l!=null&&l===n;if(u!==d)return u?-1:1;const h=(m=r.rankHint)==null?void 0:m[a],f=(v=r.rankHint)==null?void 0:v[o];if(h!=null&&f!=null&&h!==f)return f-h;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(o)??0;return p!==g?p-g:a.localeCompare(o)})[0]}k(S7t,"chooseParent");function T7t(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}k(T7t,"buildAdjacency");function C7t(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}k(C7t,"assignComponents");function k7t(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const o=k((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(O7t(s,u,n,i.length))))},"visit");for(const s of t.keys())e.has(s)||o(s,null);return i}k(k7t,"computeBlocks");function O7t(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]}}k(O7t,"popBlock");function E7t(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 d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),h=Array.from({length:d},()=>new Array(a).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;s[b]>A&1&&(b=h[A][b],b===-1))return-1;if(b===x)return b;for(let A=d-1;A>=0;A--){const S=h[A][b],T=h[A][x];S===-1||T===-1||S!==T&&(b=S,x=T)}return h[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 O=f(T,C);if(O===-1)continue;const E=p[O];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=k(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),O=e[b];if(O!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=C.get(O)??0;const P=e[T];P!=null&&P>O&&(_+=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}k(E7t,"computeSubtreeCrossCounts");function _7t(t,e,r){const n=new Map,i=k(a=>{let o=r[a]??0;const s=[...e.get(a)??[]];s.sort(Uke(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}k(_7t,"annotateMinimumLayers");function Uke(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}k(Uke,"compareByRankThenId");function R7t(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=k(l=>{if(o.has(l))return;o.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const d of n(l))s(d)},"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}k(R7t,"emitNodesInTreeOrder");function D7t(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}k(D7t,"deduplicateLayers");function L7t(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 d of a){const h=n.get(d)??o;h>o?s.push({child:d,min:h}):l.push(d)}return s.sort((d,h)=>d.min===h.min?d.child.localeCompare(h.child):d.min-h.min),l.sort((d,h)=>{const f=(u==null?void 0:u.get(d))??0,p=(u==null?void 0:u.get(h))??0;if(f!==p)return f-p;const g=n.get(d)??o,m=n.get(h)??o;return g!==m?g-m:d.localeCompare(h)}),[...s.map(d=>d.child),...l]}}k(L7t,"createChildOrderer");function Eee(t,e,r){const n=A7t(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const h of t.nodes)i.has(h)||i.set(h,[]);const o=E7t(t,e,n),s=[...a].sort(Uke(e)),l=_7t(s,i,e),u=L7t(i,e,o,l);let d=R7t(s,t.nodes,e,u);return d=D7t(d),d}k(Eee,"buildMultitreeLayerOrder");function M7t(t,e,r){const n=new Set(t),i=new Set(e),a=q4(e),o=[];for(const s of r)n.has(s.src)&&i.has(s.dst)&&o.push(a.get(s.dst));return Fke(o)}k(M7t,"countCrossingsBetweenAdjacent");function Vke(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,d=o,h=s;o>s&&(l=a.dst,u=a.src,d=s,h=o);for(let f=d;f(r[f]??0)-(r[h]??0));for(const h of d){const f=r[h]??0;if(f===0)continue;let p=0;for(const y of n.get(h)??[])p=Math.max(p,(r[y]??0)+1);if(p>=f)continue;const g=f;r[h]=p;const m=Eee(t,r,i),v=Vke(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,d=!1;for(const m of t.edges){if(m.dst!==i)continue;const v=r(m.src);v&&(v===a?d=!0:u++)}if(u>0||!d)continue;const h=e[i]??0,f=h+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(h,p,f);g!==h&&(e[i]=g)}}k(P7t,"adjustCrossLaneSources");function N7t(t,e){const r=r2(t),n=jF(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=H1(r);let o=Object.create(null);for(const l of n){const u=Ike(r,l),d=e!=null&&e.ignoreCrossLaneEdges?u.filter(h=>{const f=a(h.src),p=a(l);return!f||!p?!0:f===p}):u;if(d.length===0)o[l]=0;else if(i&&d.length===1){const h=d[0].src,f=a(h),p=a(l);f!==p?o[l]=o[h]??0:o[l]=(o[h]??0)+1}else{let h=-1/0;for(const f of d)h=Math.max(h,(o[f.src]??0)+1);o[l]=h===-1/0?0:h}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(o=I7t(r,o)),e!=null&&e.ignoreCrossLaneEdges&&P7t(r,o),{layers:Eee(r,o,a),rankOf:o,dummy:new Set}}k(N7t,"assignLayers_LongestPath");function B7t(t,e){const r=r2(t),i={...N7t(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=H1(r),{preds:o,succs:s}=Cee(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=jF(r)??[...r.nodes],u=[...l].reverse(),d=k((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"),h=Oee.GRAVITY_ITERATIONS,f=k(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=d(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:$ke(r,l,i),rankOf:i,dummy:new Set}}k(B7t,"assignLayers_Gravity");function $7t(t){const e=Nke(t),r=Pke(t);let n=Bke(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}k($7t,"topoSortByGenerationIfAcyclic");function F7t(t,e){const r=r2(t),n=(e==null?void 0:e.direction)==="LR"?$7t(r)??[...r.nodes].sort():jF(r)??[...r.nodes].sort(),i=H1(r),a=k(d=>i(d)??d,"laneOf"),o=Object.create(null),s=new Map,l=k((d,h)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(d)===a(h)?1:0:1,"edgeWeight");for(const d of n){const h=r.nodeById.get(d);if(h!=null&&h.isGroup)continue;const f=Ike(r,d);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,d))}const g=a(d),m=s.get(g)??0,v=Math.max(p,m);o[d]=v,s.set(g,v+1)}return{layers:$ke(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}k(F7t,"assignLayers_LaneAwareCompact");function z7t(t,e){const r=r2(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=k(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)),d=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){d.push(p);continue}let v=p.src;for(let b=g+1,x=0;b!r.nodes.includes(p))],edges:d,layout:r.layout,nodeById:s};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}k(z7t,"makeProperLayering");function Gke(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])}k(Gke,"median");function Qke(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}k(Qke,"barycenter");function U7t(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}k(U7t,"neighborPositionsFor");function V7t(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}k(V7t,"currentOrderTieBreak");function Hke(t,e,r){const n=new Set(t),i=new Set(e),a=q4(t),o=q4(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,d)=>u.u===d.u?u.v-d.v:u.u-d.u);const l=s.map(u=>u.v);return Fke(l)}k(Hke,"countCrossingsBetweenAdjacent");function _ee(t,e,r){return[...t].sort((n,i)=>{const a=Gke(e.get(n)??[]),o=Gke(e.get(i)??[]);return a===o?V7t(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}k(_ee,"sortByHeuristic");function Wke(t,e,r,n,i,a){const o=q4(t),s=q4(e),l=U7t(e,o,r,n);if(!i||!a||a.length===0)return _ee(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 d=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=_ee(p,l,s);d.push(...g)}const h=u.get(null);if(h&&h.length>0){const f=_ee(h,l,s);for(const p of f){const g=Qke(l.get(p)??[]);let m=d.length;if(isFinite(g))for(const[v,y]of d.entries()){const b=Qke(l.get(y)??[]);if(go.has(m.src)&&s.has(m.dst)),d=l?r.filter(m=>s.has(m.src)&&l.has(m.dst)):void 0,h=k(m=>{let v=Hke(t,m,u);return d&&n&&(v+=Hke(m,n,d)),v},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=h(a);for(;p;){p=!1;for(let m=0;m+1[...s]),i=e.edges,a=H1(e),o=zke(e,r==null?void 0:r.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--)n[l]=Wke(n[l+1],n[l],i,"up",a,o),n[l]=Yke(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}k(G7t,"orderLayers");function Q7t(t,e,r){const n=(r==null?void 0:r.layerGap)??w7t.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??w7t.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),d=Object.create(null),h=k(E=>e.nodeById.get(E),"getNode"),f=k(E=>{var _;return((_=h(E))==null?void 0:_.width)??0},"getWidth"),p=k(E=>{var _;return((_=h(E))==null?void 0:_.height)??0},"getHeight"),g=H1(e),m=zke(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,d[z]=C+P/2,B+=U+i}}}const R=y[E]??0;C+=P+n+R}const O=new Map;for(const E of e.edges){const _=E.ref.id;O.has(_)||O.set(_,[]),O.get(_).push(E)}for(const[,E]of O){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:d}}k(Q7t,"assignCoordinates");var H7t=8;function W7t(t){let e=2166136261;for(let r=0;r>>0}k(W7t,"hashString");function Y7t(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}}k(Y7t,"mulberry32");function q7t(t,e){const r=[...t],n=Y7t(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}k(q7t,"deterministicShuffle");function j7t(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}k(j7t,"sourceDistance");function qke(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}k(qke,"laneArrangementCost");function X7t(t){const e=kee(t);if(e.length<2)return[];const r=new Map(e.map((a,o)=>[a,o])),n=H1(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 d=r.get(l),h=r.get(u);if(d==null||h==null)continue;const[f,p]=d<=h?[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()]}k(X7t,"buildWeightedLaneEdges");function jke(t,e,r){const n=[...t];let i=qke(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 W7t(`${t.join("|")}#${n}#${r}`)}k(Z7t,"seedForRestart");function J7t(t,e={}){const r=kee(t);if(r.length<2)return r;const n=X7t(t);if(n.length===0)return r;const i=new Map(r.map((s,l)=>[s,l]));let a=jke(r,n,i);const o=Math.max(0,e.restarts??H7t);for(let s=0;sri&&l*3>=s?o>0?"bottom":"top":s>ri?a>0?"right":"left":r}k(Kke,"chooseOrthogonalSide");function Zke(t,e){return Math.abs(t.to-e.from)Z.isGroup&&!Z.parentId);for(const Z of u){const le={id:Z.id},be=k(ae=>{o.set(ae.id,le),r.filter(K=>K.parentId===ae.id).forEach(be)},"assignLane");be(Z)}const d=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=cNn;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}}),h=k((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=k((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=k((Z,le,be)=>f(Z,Kke(Z,le,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=k((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=k((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!!d.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.minYKke(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 O=k(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=k(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=k((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=O(le),K=O(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=k(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=k(Z=>{var le;return!!((le=i[Z])!=null&&le.labelNodeId)},"edgeHasLabelNode"),F=k((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=k((Z,le,be)=>le==="top"||le==="bottom"?{x:Z.x+be,y:Z.y}:{x:Z.x,y:Z.y+be},"applyPortOffset"),V=k((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+Lp:K.y-Lp}else{const pt=K.x>(be.x??0);ve.x=pt?K.x+Lp:K.x-Lp}if(Le){const pt=se.y>(ae.y??0);ce.y=pt?se.y+Lp:se.y-Lp}else{const pt=se.x>(ae.x??0);ce.x=pt?se.x+Lp:se.x-Lp}const We=k((pt,Ct)=>{for(const or of d)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+YC:Jr.minX-YC,y:Vt?Jr.maxY+j4:Jr.minY-j4,leavesPositiveSide:Vt}}const Rt=pt.x>(Ct.x??0),kt=(or.y??0)>=pt.y;return{x:Rt?Jr.maxX+YC:Jr.minX-YC,y:kt?Jr.maxY+j4:Jr.minY-j4,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+Lp):Math.max(pt.maxY+2,K.y-Lp);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+Lp):Math.max(pt.maxX+2,K.x-Lp);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=YC,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,ra=Rt<=1||mt<=2;if((Ct||or)&&!Jr&&(!kt||kt&&!Tr&&Fe&&ra)&&!w(K,se,le.start,le.end)){le.points=[{...K},{...ve},{...ce},{...se}],v.add(Z);const di=or?"horizontal":"vertical",Bo=or?K.y:K.x,Qn=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),hi={id:`fast-path-${di}-${Bo.toFixed(0)}-${Z}`,orientation:di,coord:Bo,spanMin:Qn,spanMax:fa,tracks:[]};g.push({edgeIndex:Z,segmentIndex:0,orientation:di,pipe:hi,trackIndex:0,from:Qn,to:fa});continue}}const Pe=h("vertical",ve.x,ve.y,ve.y);ve.x=Pe.coord;const yt=h("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,Ot=Math.min(ve.y,ce.y)-50,ut=Math.max(ve.y,ce.y)+50;for(const pt of d){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-Ree),St=Math.max(St,pt.maxX+Ree),Ot=Math.min(Ot,pt.minY-Ree),ut=Math.max(ut,pt.maxY+Ree))}for(const pt of d){if(pt.maxXSt||pt.maxYut)continue;const Ct=YC;h("horizontal",pt.minY-Ct,Ie,St),h("horizontal",pt.maxY+Ct,Ie,St);const or=j4;h("vertical",pt.minX-or,Ot,ut),h("vertical",pt.maxX+or,Ot,ut)}h("horizontal",ve.y,Ie,St),h("horizontal",ce.y,Ie,St);const Qt=s.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=Ot&&pt.coord<=ut),It=s.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Ie&&pt.coord<=St),gt=k((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=k((pt,Ct)=>w(pt,Ct,le.start,le.end),"checkSegmentBlocked"),Tt={x:ce.x,y:ve.y},hr=wt(ve,Tt),jr=wt(Tt,ce),Ir=hr||jr,Zr={x:ve.x,y:ce.y},Ur=wt(ve,Zr),On=wt(Zr,ce);if(Ir?Ur||On||(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=Qt.sort((mt,Tr)=>mt.coord-Tr.coord),kt=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[kt-1].coord}),kt>=0&&ktJs.nodeId===le.start||Js.nodeId===le.end?!1:Tr!==Fe?Js.minYor&&Js.maxX>Tr&&Js.minXCt&&Js.maxY>ra&&Js.minY10&&Ev<-5||yu<-10&&Ev>5)&&(fa=Math.abs(Ev)*100),(hi>10&&cm<-5||hi<-10&&cm>5)&&(fa+=Math.abs(cm)*50);let _O=0;const RO=Mt.get(pt.key)??"n",DO=Math.abs(cm)>ri?"h":"v";RO!=="n"&&RO!==DO&&(_O=50);const wl=Bo+Qn+fa+_O,mh=(Et.get(pt.key)??1/0)+wl,Fc=Math.abs(ce.x-mt.x)+Math.abs(ce.y-mt.y);if(mh<(Et.get(di)??1/0))if(At.set(di,pt.pt),Et.set(di,mh),Mt.set(di,DO),!qr.has(di))Me.push({key:di,f:mh+Fc,pt:mt}),qr.add(di);else{const Js=Me.findIndex(Of=>Of.key===di);Js!==-1&&(Me[Js].f=mh+Fc)}}}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 ra of at)or=Math.min(or,ra.x),Jr=Math.max(Jr,ra.x),Mn=Math.min(Mn,ra.y),Rt=Math.max(Rt,ra.y);const kt=Jr>Math.max(pt.x,Ct.x),Vt=orQn.minXGe&&Qn.minYIn);if(Bo.length>0){let Qn=Math.max(pt.x,Ct.x);for(const fa of Bo){const hi=(fa.minX+fa.maxX)/2;if(fa.visualXHalfExtent===void 0||isNaN(fa.visualXHalfExtent))continue;const yu=hi+fa.visualXHalfExtent+ra;Qn=Math.max(Qn,yu)}isNaN(Qn)||(Jr=Qn)}}if(Vt){const Ge=d.filter(In=>In.minXMath.min(pt.y,Ct.y));if(Ge.length>0){let In=Math.min(pt.x,Ct.x);for(const di of Ge){const Qn=(di.minX+di.maxX)/2-di.visualXHalfExtent-ra;In=Math.min(In,Qn)}or=In}}}const mt=k(ra=>{const Ge=Ct.y>pt.y,In=d.filter(Qn=>{const fa=Math.min(pt.x,Ct.x)Qn.minX,hi=Math.min(pt.y,Ct.y)Qn.minY;return fa&&hi});let di=In;if(l&&In.length>0){const Qn=In.filter(fa=>fa.minXra);Qn.length>0&&(di=Qn)}if(di.length===0)return Ct.y;const Bo=YC;if(Ge){const fa=Math.max(...di.map(hi=>hi.maxY))+Bo;if(fahi.minY))-Bo;if(fa>Ct.y+ri)return fa}return Ct.y},"findBestReturnY"),Tr=k(ra=>{const Ge=mt(ra),In={x:ra,y:pt.y},di={x:ra,y:Ge},Bo={x:Ct.x,y:Ge},Qn=wt(pt,In),fa=wt(In,di),hi=wt(di,Bo),yu=Ge!==Ct.y?wt(Bo,Ct):!1;return!Qn&&!fa&&!hi&&!yu?Math.abs(Ge-Ct.y)=3){const pt=hn[hn.length-1],Ct=hn[hn.length-2],or=hn[hn.length-3],Jr=Math.abs(or.y-Ct.y)Math.abs(pt.x-or.x)&&hn.splice(-2,1)}else if(Mn){const Rt=Math.sign(Ct.y-or.y),kt=Math.sign(pt.y-or.y);Rt!==0&&Rt===kt&&Math.abs(Ct.y-or.y)>Math.abs(pt.y-or.y)&&hn.splice(-2,1)}}const ii=[hn[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(hn[hn.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"),G=k(Z=>{const le=Z.tracks.length;return Z.tracks[le]={index:le,coord:Z.coord,segments:[]},le},"createNewTrack"),H=k((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"),j=k((Z,le)=>{const be=m[Z.edgeIndex];for(const ae of be){const K=g[ae];K.pipe===Z.pipe&&H(K,le)}},"moveSegmentChainToTrack"),q=k(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=k((Z,le)=>{if(Z.trackIndex===le.trackIndex)return z(Z,le);const be=q(Z),ae=q(le);return be.some(K=>ae.some(se=>ne(K,se)))},"segmentsConflict"),ee=k((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:G(Z.pipe))},"resolveTrackConflict"),te=k(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=k(()=>{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=k(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"),Oe=k(()=>{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=k(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=k(()=>{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=k((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*Xke);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*Xke*.5)}Le++}let We=0;for(const Ne of oe)We++,ce(Ne,Z.coord+We*Xke)}}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(qC(We,je)),He&&Ze.orient===We.orient)if(Math.abs(We.coord-Ze.coord)>ri){const et=We.orient==="vertical"?(je+Ze.from)/2:Zke(We,Ze);ae.push(qC(We,et),qC(Ze,et))}else(Le===0||Le===ve.length-2)&&ae.push(qC(We,Zke(We,Ze)));else if(He)ae.push(qC(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=k((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}k(t$t,"routeEdgesOrthogonal");function r$t(t){return t.direction??"TB"}k(r$t,"getSwimlaneDirection");function n$t(t){var d,h,f,p,g;const e=PBt(t),r=((d=t.config.flowchart)==null?void 0:d.nodeSpacing)??40,n=((h=t.config.flowchart)==null?void 0:h.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=r$t(t),{ordered:l,coordinates:u}=e$t(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});NBt(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;t$t(t,s);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return v7t(t,s),m7t(t),s}k(n$t,"runSwimlaneLayoutCore");async function i$t(t,e){const r=e.select("g");Dwe(r,t.markers,t.type,t.diagramId),WEt(),XEt(),pOt(),B8t(),IBt(t);const n=BBt(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await yBt(r,t);n$t(t),await RBt(t,i)}k(i$t,"render");const uNn=Object.freeze(Object.defineProperty({__proto__:null,render:i$t},Symbol.toStringTag,{value:"Module"}));function Jke(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(b)||(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 vBt(h,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),Cgn(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(G4(x.id,e)),Ln.set(x.id,{id:G4(x.id,e),node:x})):(ye.trace("Node - the non recursive path XAX",b,h,e.node(b),o),await f$(h,e.node(b),{config:a,dir:o}))})),await k(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 mK(d,w),w.id=A;return}await mK(d,w)});await Promise.all(b)},"processEdges")(),ye.info("Graph before layout:",JSON.stringify(G1(e))),ye.info("############################################# XXX"),ye.info("### Layout ### XXX"),ye.info("############################################# XXX"),fBt(e),ye.info("Graph after layout:",JSON.stringify(G1(e)));let g=0,{subGraphTitleTotalMargin:m}=D5(a);await Promise.all(iPn(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,gK(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 hK(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),gK(x)}}));const v=m/2;return mBt(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=_we(u,b,Ln,r,A,S,n);KEt(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"),K6n=k(async(t,e)=>{var a,o,s,l,u,d;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)||((d=(u=t.config)==null?void 0:u.flowchart)==null?void 0:d.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");Dwe(n,t.markers,t.type,t.diagramId),WEt(),XEt(),pOt(),B8t(),t.nodes.forEach(h=>{r.setNode(h.id,{...h}),h.parentId&&r.setParent(h.id,h.parentId)}),ye.debug("Edges:",t.edges),t.edges.forEach(h=>{if(h.start===h.end){const f=h.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(h),y=structuredClone(h),b=structuredClone(h),x=structuredClone(h);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(h.start,h.end,{...h},h.id)}),ye.warn("Graph at first:",JSON.stringify(G1(r))),nPn(r),ye.warn("Graph after XAX:",JSON.stringify(G1(r)));const i=Ye();await vBt(n,r,t.type,t.diagramId,void 0,i)},"render");const Z6n=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:mBt,render:K6n},Symbol.toStringTag,{value:"Module"}));async function yBt(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"),d=new Map,h=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(h){const g=await f$(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};d.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(()=>Npi);f(t,e)}return{graph:r,groups:{clusters:o,edgePaths:s,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:d}}k(yBt,"createGraphWithElements");var bBt=5,uee=1e-5,dee=1e-6;function hee(t){const e=[];for(let r=0;r=1-dee||f<=dee||f>=1-dee?null:{point:{x:t.x+h*i,y:t.y+h*a},tA:h,tB:f}}k(xBt,"segmentIntersection");function XCe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}k(XCe,"isHorizontalSeg");function wBt(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}k(ABt,"getArcSweepFlag");var J6n=.001;function SBt(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Ul[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&&Ul[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}k(SBt,"applyMarkerOffsets");function TBt(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${H4(s)}`];return i==="arc"?u.push(`A${Ug(t.r)},${Ug(t.r)} 0 0 ${n} ${H4(l)}`):u.push(`M${H4(l)}`),u}k(TBt,"emitJump");function KCe(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=KCe(i[u-1],i[u],i[u+1]??i[u],bBt);x&&(m=x.cutLen)}let v=h,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}}k(EBt,"decodeDataPoints");function _Bt(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 d=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,h=n.querySelector(`path[data-id="${d}"]`);if(!h)continue;o.set(u.id,h);const p=EBt(h.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const s=wBt(a);if(s.length===0)return;const l=new Map;for(const u of s){const d=l.get(u.jumpEdgeId)??[];d.push(u),l.set(u.jumpEdgeId,d)}for(const u of a){const d=l.get(u.id);if(!d||d.length===0)continue;const h=i.get(u.id),f=h==null?void 0:h.curve;if(f!==void 0&&!OBt(f))continue;const p=o.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!kBt(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=CBt(u,d,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)}}}k(_Bt,"applyLineJumpsToSvg");async function RBt(t,e){var i,a;for(const o of t.nodes)o.isGroup?await hK(e.clusters,o):gK(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=_we(e.edgePaths,{...o},{},t.type,s,l,t.diagramId);o.label&&await mK(e.rootGroups,o),o.label&&DBt(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}));_Bt(e.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}}k(RBt,"adjustLayout");function DBt(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=D5({flowchart:n.flowchart??{}});if(t.label){const a=g$.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})`)}}k(DBt,"positionEdgeLabel");var ZCe="__swimlane_default__",eNn=21,LBt=20;function JCe(t){return Math.max(t.padding??LBt,LBt)}k(JCe,"topLaneHorizontalPadding");function MBt(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(eNn,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}}k(MBt,"assignTopLaneTitleRect");function IBt(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===ZCe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:ZCe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=ZCe}k(IBt,"prepareLayoutForSwimlanes");function PBt(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,d=typeof l.end=="string"?l.end:void 0;!u||!d||l.labelNodeId||r.push({id:l.id,src:u,dst:d,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}}k(PBt,"toGraphView");function NBt(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??[],d=new Map,h=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||h.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*JCe(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,d.set(f.id,{minX:g,maxX:m,minY:v,maxY:y})}}if(h.length>0&&d.size>0){let f=1/0,p=-1/0,g=0;for(const m of h){const v=m.padding??20;v>g&&(g=v);const y=d.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 O of h)O.y=x,O.height=b,O.swimlaneContentTop=f;const w=[...h].sort((O,E)=>{const _=O.x??0,P=E.x??0;return _-P}),A=[],S=[],T=[];for(const O of w){const E=d.get(O.id);if(!E)continue;const _=Math.max(0,E.maxX-E.minX)+2*JCe(O),P=(E.minX+E.maxX)/2;A.push(O.id),S.push(P),T.push(_)}const C=A.length;if(C>0){const O=new Map;if(C===1)O.set(A[0],T[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:Y4(e,r,n,i)}:void 0}k(eke,"measuredNodeRect");function tke(t){if(t.isGroup)return;const e=eke(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}k(tke,"nodeBoundsInfoFor");function Dp(t,e,r=Ql){return Math.abs(t.x-e.x)r}k(es,"isHorizontalSegment");function ts(t,e,r=Ql){return Si(t,e,r)&&Math.abs(t.y-e.y)>r}k(ts,"isVerticalSegment");function ed(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)))}k(ed,"overlapLength");function q0(t,e,r=Ql){return t.horizontal&&e.horizontal&&Ri(t.a,e.a,r)?ed(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Si(t.a,e.a,r)?ed(t.a.y,t.b.y,e.a.y,e.b.y):0}k(q0,"sameAxisSegmentOverlapLength");function W4(t,e=Ql){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Dp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}k(Bi,"dedupeConsecutivePoints");function rke(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}k(rke,"classifyThreeSegmentRoute");function fee(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}k($Bt,"rectContainsRect");function pee(t,e){return t.lefte.left&&t.tope.top}k(pee,"rectsOverlap");function ike(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}k(ike,"inflateRect");function Y4(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}k(Y4,"rectFromCenterSize");function th(t){var e;return(e=eke(t))==null?void 0:e.rect}k(th,"rectOfNodeBounds");function WC(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}}}k(WC,"portForRectSide");function ake(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(Ri(t,r,a))return[t,r];const h=(t.x+r.x)/2;return[t,{x:h,y:t.y},{x:h,y:r.y},r]}if(e===n){if(Ri(t,r,a))return;const h=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:h,y:t.y},{x:h,y:r.y},r]}return}if(!o&&!s){if(e===n){if(Si(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(Si(t,r,a))return[t,r];const h=(t.y+r.y)/2;return[t,{x:t.x,y:h},{x:r.x,y:h},r]}if(o&&!s){const d=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return d&&h?[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}k(ake,"buildOrthogonalPortPath");function oke(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]}k(oke,"buildSameSideTrackPath");function gee(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=tke(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}k(gee,"collectRealNodeBounds");function e2(t){const e=[],r=[];for(const n of t){const i=tke(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}}k(e2,"collectNodeRectEntries");function FBt(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,...Y4(i,a,o,s)})}return r}k(FBt,"collectLayoutNodeRects");function ske(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-d.a.x)i:a&&s&&Ri(t,r,i)?ed(t.x,e.x,r.x,n.x)>i:!1}k(zBt,"sameAxisSegmentsOverlap");function mee(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&&hn+Ql&&t=2?e[e.length-2]:void 0,l=(o?Si(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||!Dp(i,n))&&r.push(n)}return r}k(vee,"orthogonalizePolyline");function j0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=VBt(e);if(e=n.points,!n.changed)break}return e}k(j0,"simplifyPolyline");var mn=.001,rNn=.5,GBt=4;function uke(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=QBt(t[i],t[a],e);return r?[o,...t.slice(i)]:[...t.slice(0,i+1),o]}k(dke,"clipEndpoint");function HBt(t,e){for(const r of t){const n=uke(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=dke(i,n.srcRect,!0)),n.dstRect&&(i=dke(i,n.dstRect,!1)),i=j0(vee(i)),i=mke(i,n.srcRect,n.dstRect),n.edge.points=j0(vee(i))}}k(HBt,"clipEdgeEndpointsToNodeBoundaries");function hke(t,e,r,n=!1){if(Ri(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(Si(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}k(hke,"snapEndpointToBoundary");function yee(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}}k(WBt,"intersectRanges");function pke(t,e){return e==="left"||e==="right"?bee(t.top,t.bottom):bee(t.left,t.right)}k(pke,"clearanceRangeForSide");function xee(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(Ri(t,e,mn)&&n){if(Math.abs(t.x-r.left)0?WBt(a):void 0}k(YBt,"straightClearanceRange");function gke(t,e,r,n,i){const a=YBt(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 Ri(e,r,mn)&&r.xn.right+mn}}k(bke,"leavesOutward");function xke(t,e,r){if(t.length<3)return t;if(r){const a=yke(t[0],t[1],e);return a&&bke(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=yke(t[n-1],t[n],e);return i&&bke(i,t[n-1],t[n-2],e)?t.slice(0,n):t}k(xke,"collapseOwnBorderStub");function XBt(t,e,r){let n=t;if(e){const a=yee(n,0,1);if(a){const o=hke(a,n[0],e);o!==n[0]&&(n=[o,...n.slice(1)])}n=xke(n,e,!0)}if(r){const a=n.length-1,o=yee(n,a,-1);if(o){const s=hke(o,n[a],r,!0);s!==n[a]&&(n=[...n.slice(0,a),s])}n=xke(n,r,!1)}const i=mke(n,e,r);return i!==n||n.length===2?i:(e&&(n=vke(n,e,!0)),r&&(n=vke(n,r,!1)),n)}k(XBt,"snapAndCollapseEndpoints");function wke(t,e){for(const r of t){const n=uke(r,e,2);if(!n)continue;const i=Bi(n.points,mn),a=XBt(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}}k(wke,"prepareEdgeEndpointsForRenderer");function Ake(t){return new Map(t.map(e=>[e.id,e]))}k(Ake,"buildNodeMap");function KBt(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}k(KBt,"resolveTopLevelGroupId");function Ske(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}k(Ske,"groupDepth");function Tke(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}}k(Tke,"boundsForChildren");function ZBt(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}k(ZBt,"applyGroupBounds");function JBt(t){const e=Ake(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>Ske(i,e)-Ske(n,e));for(const n of r){const i=t.filter(o=>o.parentId===n.id),a=Tke(i);a&&ZBt(n,a)}}k(JBt,"recomputeNestedGroupBounds");function wee(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=k(l=>a+o-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=s(u));const d=l.groupTitleRect;d&&(l.groupTitleRect=e==="x"?{...d,left:s(d.right),right:s(d.left)}:{...d,top:s(d.bottom),bottom:s(d.top)})}for(const l of n)for(const u of l.points??[])u[e]=s(u[e]);return!0}k(wee,"mirrorAxis");function e7t(t){return(t.nodes??[]).some(r=>!r.isGroup)?wee(t,"y"):!0}k(e7t,"applyBtDirectionTransform");function t7t(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,d/h):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}JBt(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&wee(t,"x"),!0;const g=Ake(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=KBt(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=Tke(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+Vg||P>=y.right-Vg)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+Vg||P>=y.bottom-Vg)continue;x={x:_,y:P},w={x:s.x,y:P},A={x:s.x,y:s.y}}const S=Dp(x,w,Vg),T=Dp(w,A,Vg);if(S&&T||!S&&As(x,w,n,[d],1)||!T&&As(w,A,n,[h],1))continue;const C=!S&&mee(x,w,t,i,{epsilon:Vg,skipDegenerateOther:!0}),O=!T&&mee(w,A,t,i,{epsilon:Vg,skipDegenerateOther:!0});if(!(C||O)){S?v=[w,A]:T?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}k(r7t,"portSwapToLShape");function n7t(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values());for(const s of t){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<4)continue;const u=Bi(l,.001);if(u.length<4)continue;const d=u.length-1,h=u[d],f=u[d-1],p=u[d-2],g=h.x-f.x,m=h.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,h,.001),A=ts(f,h,.001),S=es(p,f,.001),T=ts(p,f,.001);if(!(w&&T||A&&S))continue;const C=s.end,O=s.start,E=C?e.get(C):void 0;if(!E)continue;const _=E.x??0,P=E.y??0,L=th(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(O){const z=e.get(O),U=z?th(z):void 0;if(U&&nke(R,U,2))continue}const M=k((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 G of t){if(G===s||G.isLayoutOnly)continue;const H=G.points;if(!(!H||H.length<2))for(let j=0;j=0){const z=u[d-3],U=[O,C].filter(G=>!!G);if(As(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,d-2),R,D];s.points=B;const V=s.labelNodeId;if(V){const z=e.get(V);if(z){const U=z.width??0,G=z.height??0;if(U>0&&G>0){let H,j,q=-1;for(let ne=0;ne=U+2||pe&&ee>=G+2)&&ee>q&&(q=ee,H=(X.x+J.x)/2,j=(X.y+J.y)/2)}H!==void 0&&j!==void 0&&(z.x=H,z.y=j)}}}}}k(n7t,"collapseShortTerminalStub");var Lr=.001,Hl=8,Xn=W4,Cke=k((t,e)=>Si(t,e,Lr)||Ri(t,e,Lr),"orthogonallyAligned");function i7t(t,e){const i=k((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=k((p,g)=>{const m=Bi(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?th(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(Cke(w,A)&&(S=w),Si(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(Ri(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=k((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),s=k((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)&&Si(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Ri(p.boundary,g.boundary,1),"sameTerminalFace"),l=k((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:o(p,g)>=Hl&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=k((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"),d=k((p,g)=>{const m=Bi(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(!k(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Ri(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?Si(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&&Dp(m[1],p.railEnd,Lr),T=m.slice(S?2:1),C=T[0];return C&&!Cke(C,y)?void 0:[v,y,...T]}const x=m.length>1&&Dp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!Cke(A,y)))return[...w,y,v]},"shiftedCandidate"),h=k(p=>{const g=p.edge,m=Bi(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,O]=m;return Ri(C,O,Lr)&&Math.abs(A-T)<1&&Math.abs(w-S)>1||Si(C,O,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=h(S),O=h(T);return C!==O?Number(C)-Number(O):+!T.atStart-+!S.atStart});for(const S of A){for(const T of f){const C=d(S,T);if(!C)continue;const O=a({...S.edge,points:C},S.atStart);if(!(!O||g.some(E=>E.edge!==S.edge&&(l(O,E)||w&&u(O,E))))){S.edge.points=C,m=!0;break}}if(m)break}}if(!m)return}}k(i7t,"separateSharedRenderedTerminalLanes");function a7t(t,e){const{realNodeRects:n,labelNodeRects:i}=e2(e.values()),a=k((s,l)=>{const u=s.start,d=s.end,h=Xn(l);if(h.length!==l.length-1)return!1;const f=[u,d].filter(p=>!!p);for(const p of h)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 h)for(const v of Xn(Bi(g)))if(q0(m,v,.5)>=Hl||Q1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),o=k((s,l)=>{if(l+4>=s.length)return;const u=s[l],d=s[l+1],h=s[l+2],f=s[l+3],p=s[l+4],g=es(u,d)&&ts(d,h)&&es(h,f)&&ts(f,p)&&Si(u,f,Lr)&&Si(u,p,Lr)&&Si(d,h,Lr)&&(d.x-u.x)*(f.x-h.x)<0,m=ts(u,d)&&es(d,h)&&ts(h,f)&&es(f,p)&&Ri(u,f,Lr)&&Ri(u,p,Lr)&&Ri(d,h,Lr)&&(d.y-u.y)*(f.y-h.y)<0;if(g||m)return Bi([...s.slice(0,l+1),p,...s.slice(l+5)]);if(l+5>=s.length)return;const v=s[l+5],y=ts(u,d)&&es(d,h)&&ts(h,f)&&es(f,p)&&ts(p,v)&&Si(u,p,Lr)&&Si(u,v,Lr)&&Si(h,f,Lr)&&(h.x-d.x)*(p.x-f.x)<0,b=es(u,d)&&ts(d,h)&&es(h,f)&&ts(f,p)&&es(p,v)&&Ri(u,p,Lr)&&Ri(u,v,Lr)&&Ri(h,f,Lr)&&(h.y-d.y)*(p.y-f.y)<0;if(!(!y&&!b))return Bi([...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 d=Bi(u.points??[]);for(let h=0;h<=d.length-5;h++){const f=o(d,h);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}k(a7t,"collapseRedundantRectangularDoglegs");function kke(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values()),s=t.filter(g=>!g.isLayoutOnly),l=k((g,m,v)=>Bi(g===m?v??[]:g.points??[]),"pointsFor"),u=k((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"),h=k((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?ed(m.a.x,m.b.x,b.left,b.right)>=Hl&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:ed(m.a.y,m.b.y,b.top,b.bottom)>=Hl&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=k((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=j0(Bi(y));return Xn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=k((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(q0(w,A,.5)>=Hl)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=d(b);if(!x)continue;const w=h(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}}k(kke,"liftObstacleHuggingSameSideRails");function Oke(t,e){const n=k(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=k(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,d=typeof u=="string"?u.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT")return;const h=n(l),f=l.y,p=l.height;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=h.right-h.left,m=h.bottom-h.top;if(!(m<=0||g{if(!l.horizontal)return!1;const d=l.a.y;return d<=u.top+Lr||d>=u.bottom-Lr?!1:ed(l.a.x,l.b.x,u.left,u.right)>=Hl},"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=Bi(l.points??[]);for(const d of Xn(u))for(const h of o)a(d,h.rect)&&(s=Math.max(s,h.rect.bottom-d.a.y+4))}if(!(s<=Lr))for(const l of o){const u=l.node.y,d=l.node.height;typeof u!="number"||typeof d!="number"||!Number.isFinite(u)||!Number.isFinite(d)||d<=0||(l.node.y=u-s/2,l.node.height=d+s,l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s})}}k(Oke,"liftTopLaneTitleBandsAboveRails");function Eke(t,e){const n=k(u=>{const d=u.groupTitleRect;if(!(!d||typeof d.left!="number"||typeof d.right!="number"||typeof d.top!="number"||typeof d.bottom!="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top))return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect"),i=k(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const h=n(u),f=u.x,p=u.width;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=h.right-h.left,m=h.bottom-h.top;if(!(g<=0||m{if(!u.vertical)return!1;const h=u.a.x;return h<=d.left+Lr||h>=d.right-Lr?!1:ed(u.a.y,u.b.y,d.top,d.bottom)>=Hl},"verticalSegmentIntersectsTitle"),o=k((u,d)=>{if(!u.horizontal)return!1;const h=u.a.y;return h<=d.top+Lr||h>=d.bottom-Lr?!1:ed(u.a.x,u.b.x,d.left,d.right)>=Hl},"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 d=Bi(u.points??[]);for(const h of Xn(d))for(const f of s)if(a(h,f.rect))l=Math.max(l,f.rect.right-h.a.x+4);else if(o(h,f.rect)){const p=Math.min(h.a.x,h.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Lr))for(const u of s){const d=u.node.x,h=u.node.width;typeof d!="number"||typeof h!="number"||!Number.isFinite(d)||!Number.isFinite(h)||h<=0||(u.node.x=d-l/2,u.node.width=h+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}k(Eke,"shiftLeftLaneTitleBandsLeftOfRails");function o7t(t,e){const{realNodeRects:n}=e2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=k((g,m=new Map)=>Bi(m.get(g)??g.points??[]),"replacementPointsFor"),o=k((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+pf(a(v,g)),0),"totalBends"),l=k(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=k((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=j0(Bi([y,b,x,m.tailStart,m.terminal]));return Xn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),d=k((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"),h=k((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(q0(b,x,.5)>=Hl)return!0}return!1},"pathHasSharedTrack"),f=k((g,m,v)=>!d(g,m)&&!h(g,m,v),"candidateIsSafe"),p=k(()=>{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}}k(o7t,"swapDestinationTerminalTailsToReduceCrossings");function s7t(t,e){const{realNodeRects:a,labelNodeRects:o}=e2(e.values()),s=t.filter(w=>!w.isLayoutOnly),l=k((w,A=new Map)=>Bi(A.get(w)??w.points??[]),"replacementPointsFor"),u=k((w=new Map)=>{let A=0;for(let S=0;Ss.reduce((A,S)=>A+pf(l(S,w)),0),"totalBends"),h=k(w=>{const A=w.start,S=w.end,T=A?e.get(A):void 0,C=S?e.get(S):void 0,O=T?th(T):void 0,E=C?th(C):void 0;return O&&E?{src:O,dst:E}:void 0},"endpointRectsFor"),f=k((w,A,S)=>{if(S.index<=0||S.index+1>=A.length-1)return;const T=h(w);if(T){if(S.vertical){const C=S.a.x,O=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,O=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=k(()=>{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=k((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&ed(w.min,w.max,A.min,A.max)>=Hl,"railsInteract"),m=k(w=>{const A=[],S=new Set;for(const T of w){if(S.has(T))continue;const C=[T],O=[];for(S.add(T);C.length>0;){const E=C.pop();O.push(E);for(const _ of w)!S.has(_)&&g(E,_)&&(S.add(_),C.push(_))}O.length>1&&A.push(O)}return A},"connectedComponents"),v=k(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),O=[],E=k(()=>{if(O.length===w.length){O.some((_,P)=>Math.abs(_-A[P])>=Lr)&&T.push([...O]);return}for(const[_,P]of S.entries())C[_]||(C[_]=!0,O.push(P),E(),O.pop(),C[_]=!1)},"visit");return E(),T}for(let C=0;C{const S=new Map;for(const[C,O]of w.entries()){const E=A[C],_=S.get(O.edge)??O.points.map(P=>({x:P.x,y:P.y}));O.axis==="vertical"?(_[O.segmentIndex].x=E,_[O.segmentIndex+1].x=E):(_[O.segmentIndex].y=E,_[O.segmentIndex+1].y=E),S.set(O.edge,_)}const T=new Map;for(const[C,O]of S){const E=j0(Bi(O));if(Xn(E).length!==E.length-1)return;T.set(C,E)}return T},"replacementsForAssignment"),x=k(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=Hl)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let S,T=A,C=d(),O=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=d(P),D=E.reduce((M,I,N)=>M+Math.abs(_[N]-I.coord),0);L>T||L===T&&(R>C||R===C&&D>=O)||(S=P,T=L,C=R,O=D)}if(!S)return;for(const[E,_]of S)E.points=_}}k(s7t,"reassignCrossingExternalRailChannels");function l7t(t,e){const{realNodeRects:n,labelNodeRects:i}=e2(e.values()),a=t.filter(p=>!p.isLayoutOnly),o=k((p,g,m)=>Bi(p===g?m??[]:p.points??[]),"pointsFor"),s=k(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=k((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)&&ed(p.a.x,p.b.x,g.left,g.right)>=Hl}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&ed(p.a.y,p.b.y,g.top,g.bottom)>=Hl}return!1},"segmentRunsAlongRectBorder"),d=k(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?th(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),h=k((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=Si(m,b,Lr)||Ri(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(O=>[...p.slice(0,g+1),O,...p.slice(g+3)]),C=new Set;return T.map(O=>j0(Bi(O))).filter(O=>{if(Xn(O).length!==O.length-1||!O.some(_=>Dp(_,b,Lr)))return!1;const E=O.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return C.has(E)?!1:(C.add(E),!0)})},"shortcutCandidatesAt"),f=k((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=d(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(q0(x,w,.5)>=Hl)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=pf(A,Lr),T=s(A);for(let C=0;C<=A.length-4;C++)for(const O of h(A,C)){const E=pf(O,Lr),_=s(O);if(!(Ey||L===y&&(E>b||E===b&&_>=x)||(m=w,v=O,y=L,b=E,x=_)}}if(!m||!v)return;m.points=v}}k(l7t,"shortcutRedundantOrthogonalJogs");function c7t(t,e){const o=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const he=ue.x??0,xe=ue.y??0,ge=th(ue);ge&&o.push({id:String(ue.id??""),cx:he,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"],d={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},h=t.filter(ue=>!ue.isLayoutOnly),f=new Map(h.map((ue,he)=>[ue,he])),p=k(ue=>{const he=ue==="left"||ue==="top"?-1:1,xe=[];for(let ge=0;ge<=2;ge++)xe.push(d[ue]+he*20*ge);return xe},"outwardTracksForSide"),g=k((ue,he=new Map)=>Bi(he.get(ue)??ue.points??[]),"replacementPointsFor"),m=k((ue,he)=>{let xe=0;for(const ge of ue)for(const ze of he)Q1(ge.a,ge.b,ze.a,ze.b,Lr)&&xe++;return xe},"crossingCountBetweenSegments"),v=k((ue,he)=>m(Xn(ue),Xn(he)),"crossingCountBetweenPaths"),y=k((ue=new Map)=>{let he=0;const xe=[],ge=new Set,ze=[],we=k(ke=>{ge.has(ke)||(ge.add(ke),ze.push(ke))},"addEdge");for(let ke=0;ke0&&(he+=ae,xe.push({first:Be,second:be,count:ae}),we(Be),we(be))}}return ze.sort((ke,Be)=>(f.get(ke)??0)-(f.get(Be)??0)),{count:he,pairs:xe,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=k((ue,he)=>{const xe=new Set(he.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 he=new Map;for(const ze of ue.pairs){const we=he.get(ze.first)??new Set;we.add(ze.second),he.set(ze.first,we);const ke=he.get(ze.second)??new Set;ke.add(ze.first),he.set(ze.second,ke)}const xe=[],ge=new Set;for(const ze of ue.edges){if(ge.has(ze))continue;const we=[ze],ke=[];for(ge.add(ze);we.length>0;){const Be=we.pop();ke.push(Be);for(const Z of he.get(Be)??[])ge.has(Z)||(ge.add(Z),we.push(Z))}ke.sort((Be,Z)=>(f.get(Be)??0)-(f.get(Z)??0)),ke.length>1&&xe.push(ke)}return xe},"crossingComponents"),w=k(ue=>[ue.start,ue.end].filter(he=>!!he),"endpointIdsFor"),A=k(ue=>{const he=[];for(const xe of x(ue)){const ge=new Set(xe),ze=new Set(xe.flatMap(ke=>w(ke))),we=[...xe];for(const ke of h)ge.has(ke)||w(ke).some(Be=>ze.has(Be))&&we.push(ke);we.sort((ke,Be)=>(f.get(ke)??0)-(f.get(Be)??0)),he.push(we)}return he},"pairSearchGroups"),S=k((ue,he,xe)=>b(ue,new Map([[he,xe]])),"crossingCountWithSingleReplacement"),T=k(ue=>{const he=new Map;for(const xe of ue.pairs)he.set(xe.first,(he.get(xe.first)??0)+xe.count),he.set(xe.second,(he.get(xe.second)??0)+xe.count);return he},"currentCrossingsByEdge"),C=k(ue=>ue.slice(1).reduce((he,xe,ge)=>{const ze=ue[ge];return he+Math.abs(xe.x-ze.x)+Math.abs(xe.y-ze.y)},0),"pathLength"),O=k((ue=new Map)=>h.reduce((he,xe)=>he+pf(g(xe,ue)),0),"totalBends"),E=k((ue=new Map)=>h.reduce((he,xe)=>he+C(g(xe,ue)),0),"totalLength"),_=k((ue,he,xe=new Map)=>{const ge=Xn(he);for(const ze of h)if(ze!==ue){for(const we of ge)for(const ke of Xn(g(ze,xe)))if(q0(we,ke,.5)>=Hl)return!0}return!1},"pathHasSegmentConflict"),P=k((ue,he)=>{const xe=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of Xn(he))if(As(ge.a,ge.b,l,xe,-2))return!0;return!1},"pathHitsNode"),L=k((ue,he)=>{const xe=j0(Bi(he));Xn(xe).length===xe.length-1&&ue.push(xe)},"pushOrthogonalCandidate"),R=k(ue=>ue==="left"||ue==="right","sideIsHorizontal"),D=k((ue,he,xe)=>{switch(he){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=k((ue,he,xe,ge)=>{const ze=xe==="left"||xe==="top"?-1:1,we=[D(he,xe,ge),d[xe]];for(const ke of we)for(let Be=0;Be<=2;Be++)L(ue,oke(he,xe,ge,ke+ze*20*Be))},"addSameSideCandidates"),I=k((ue,he,xe,ge,ze)=>{for(const we of p(xe))for(const ke of p(ze))L(ue,[he,{x:we,y:he.y},{x:we,y:ke},{x:ge.x,y:ke},ge])},"addHorizontalToVerticalCandidates"),N=k((ue,he,xe,ge,ze)=>{for(const we of p(xe))for(const ke of p(ze))L(ue,[he,{x:he.x,y:we},{x:ke,y:we},{x:ke,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=k((ue,he,xe,ge,ze)=>{const we=[...p("top"),...p("bottom")];for(const ke of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[he,{x:ke,y:he.y},{x:ke,y:Z},{x:Be,y:Z},{x:Be,y:ge.y},ge])},"addHorizontalPairCandidates"),B=k((ue,he,xe,ge,ze)=>{const we=[...p("left"),...p("right")];for(const ke of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[he,{x:he.x,y:ke},{x:Z,y:ke},{x:Z,y:Be},{x:ge.x,y:Be},ge])},"addVerticalPairCandidates"),V=k(ue=>{const he=new Set;return ue.map(xe=>Bi(xe)).filter(xe=>{const ge=xe.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return he.has(ge)||xe.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),z=k((ue,he,xe,ge)=>{const ze=[],we=ake(ue,he,xe,ge,20,Lr);we&&L(ze,we),he===ge&&M(ze,ue,he,xe);const ke=R(he),Be=R(ge);return ke&&!Be?I(ze,ue,he,xe,ge):!ke&&Be?N(ze,ue,he,xe,ge):ke?F(ze,ue,he,xe,ge):B(ze,ue,he,xe,ge),V(ze)},"buildCandidatesForSides"),U=k((ue,he,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const ke of u){const Be=WC(ge,ke),Z=ke==="top"||ke==="bottom"?p(ke):we;for(const le of ze){L(ue,[he,xe,{x:le,y:xe.y},{x:le,y:Be.y},Be]);for(const be of Z)L(ue,[he,xe,{x:le,y:xe.y},{x:le,y:be},{x:Be.x,y:be},Be])}}},"addVerticalDepartureOuterTrackCandidates"),G=k((ue,he,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const ke of u){const Be=WC(ge,ke),Z=ke==="left"||ke==="right"?p(ke):ze;for(const le of we){L(ue,[he,xe,{x:xe.x,y:le},{x:Be.x,y:le},Be]);for(const be of Z)L(ue,[he,xe,{x:xe.x,y:le},{x:be,y:le},{x:be,y:Be.y},Be])}}},"addHorizontalDepartureOuterTrackCandidates"),H=k(ue=>{const he=ue.start,xe=ue.end,ge=xe?s.get(xe):void 0;if(!he||!ge)return[];const ze=Bi(ue.points??[]);if(ze.length<4)return[];const we=ze[0],ke=ze[1],Be=[];return ts(we,ke,Lr)?U(Be,we,ke,ge):es(we,ke,Lr)&&G(Be,we,ke,ge),Be},"terminalPreservingOuterTrackCandidates"),j=k(ue=>{const he=ue.start,xe=ue.end,ge=he?s.get(he):void 0,ze=xe?s.get(xe):void 0;if(!ge||!ze)return[];const we=[];for(const ke of u){const Be=WC(ge,ke);for(const Z of u)we.push(...z(Be,ke,WC(ze,Z),Z))}return we.push(...H(ue)),we},"candidatePathsFor"),q=k(()=>new Map(h.map(ue=>[ue,Xn(g(ue))])),"currentSegmentsByEdge"),ne=k((ue,he,xe)=>{const ge=new Set;for(const ze of h){if(ze===ue)continue;const we=xe.get(ze)??Xn(g(ze));he.some(ke=>we.some(Be=>q0(ke,Be,.5)>=Hl))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),X=k((ue,he,xe,ge)=>{const ze=new Set;return j(ue).map(ke=>j0(Bi(ke))).filter(ke=>{if(P(ue,ke))return!1;const Be=ke.map(Z=>`${Z.x.toFixed(3)},${Z.y.toFixed(3)}`).join("|");return ze.has(Be)||ke.length<2?!1:(ze.add(Be),!0)}).map(ke=>{const Be=Xn(ke);let Z=0;for(const le of h)le!==ue&&(Z+=m(Be,xe.get(le)??Xn(g(le))));return{candidate:ke,candidateSegments:Be,crossings:he.count-(ge.get(ue)??0)+Z,bends:pf(ke,Lr),totalBends:pf(ke),length:C(ke)}}).filter(({crossings:ke})=>ke<=he.count).sort((ke,Be)=>ke.crossings-Be.crossings||ke.bends-Be.bends||ke.length-Be.length).slice(0,48).map(ke=>({path:ke.candidate,segments:ke.candidateSegments,sharedTrackConflicts:ne(ue,ke.candidateSegments,xe),totalBends:ke.totalBends,length:ke.length}))},"pairCandidatesFor"),J=k((ue,he,xe,ge,ze,we)=>{let ke=0;for(const Z of ue.pairs)(Z.first===he||Z.second===he||Z.first===ge||Z.second===ge)&&(ke+=Z.count);let Be=m(xe.segments,ze.segments);for(const Z of h){if(Z===he||Z===ge)continue;const le=we.get(Z)??Xn(g(Z));Be+=m(xe.segments,le)+m(ze.segments,le)}return ue.count-ke+Be},"pairCrossingCount"),ee=k((ue,he)=>{for(const xe of ue.sharedTrackConflicts)if(xe!==he)return!1;return!0},"conflictsOnlyWith"),te=k((ue,he)=>ue.segments.some(xe=>he.segments.some(ge=>q0(xe,ge,.5)>=Hl)),"candidatesShareTrack"),pe=k((ue,he,xe,ge)=>ee(he,xe.edge)&&ee(ge,ue.edge)&&!te(he,ge),"pairCandidatesAreCompatible"),ie=k((ue,he,xe,ge,ze)=>{const we=J(ue.current,he.edge,xe,ge.edge,ze,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[he.edge,xe.path],[ge.edge,ze.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(he.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+xe.totalBends+ze.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(he.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+xe.length+ze.length}},"scorePairReplacement"),Ce=k((ue,he)=>ue.crossings{let ze=ge;for(const we of he.candidates)for(const ke of xe.candidates){if(!pe(he,we,xe,ke))continue;const Be=ie(ue,he,we,xe,ke);Be&&Ce(Be,ze)&&(ze=Be)}return ze},"bestScoreForOptionPair"),Ee=k(ue=>{const he=O(),xe=E(),ge=q(),ze=T(ue),we=new Map(h.map(ae=>[ae,pf(g(ae))])),ke=new Map(h.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:he,length:xe};const be={current:ue,currentBends:he,currentLength:xe,baseBendsByEdge:we,baseLengthByEdge:ke,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 he=y(),xe=he.count;if(xe===0)return;let ge,ze,we=xe,ke=Number.POSITIVE_INFINITY;for(const Z of he.edges){const le=pf(g(Z),Lr);for(const be of j(Z)){const ae=P(Z,be),K=!ae&&_(Z,be),se=S(he,Z,be),me=pf(be,Lr);ae||K||!(sewe||se===we&&me>=ke||(ge=Z,ze=be,we=se,ke=me)}}if(ge&&ze){ge.points=ze;continue}const Be=Ee(he);if(!Be)return;for(const[Z,le]of Be)Z.points=le}}k(c7t,"resolveRenderedOrthogonalCrossings");var t2=.001,aNn=8;function u7t(t,e){const{nodeInfoById:r,realNodeRects:n}=gee(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=k((m,v,y,b)=>{const x=[],w=ake(m,v,y,b,a,t2);return w&&x.push(w),v===b&&x.push(oke(m,v,y,o[v])),x},"buildOrthogonalPathCandidates"),l=k((m,v)=>{for(let y=0;y{let b=0;const x=W4(m,t2),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 O=S.points;if(!(!O||O.length<2))for(const E of x)for(const _ of W4(O,t2)){if(lke(E.a,E.b,_.a,_.b,t2,t2)){b++;continue}q0(E,_,t2)>=aNn&&b++}}return b},"pathConflictCount"),d=4,h=k((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,h(v[0],w),y)}if(x){const w=r.get(x);w&&p(x,h(v[v.length-1],w),y)}}const g=k((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=pf(v,t2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&I>=_)continue;E=N,_=I,O=M;continue}u(M,m)>C||I<_&&(_=I,O=M)}}}if(O){m.points=O;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,h(O[0],w),S),p(x,h(O[O.length-1],A),S)}}}k(u7t,"simplifyDetouredEdges");var rh=.001,d7t=10,See=7;function _ke(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&&pee(t,h7t(a)))}k(Rke,"labelOverlapsOwnMarker");function Tee(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=ike(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&pee(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=k((g,m)=>{const v=ike(m,a);for(const y of r)if(y.edgeId!==g&&fee(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),d=k((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),h=[],f=k(g=>{for(const{id:m,rect:v}of i)if($Bt(v,g))return m},"findContainingLane"),p=k((g,m)=>h.some(v=>v.labelId!==g&&pee(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=rh&&H>=rh||w.push({idx:V,length:G+H,orientation:G>=rh?"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=k(V=>[...V].sort((z,U)=>{const G=z.orientation===T,H=U.orientation===T;if(G!==H)return G?-1:1;const j=z.length>=(z.orientation==="horizontal"?b:x)+2,q=U.length>=(U.orientation==="horizontal"?b:x)+2;return j!==q?j?-1:1:U.length-z.length}),"rankSegments"),O=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=k((V,z)=>{const U=y[V.idx],G=y[V.idx+1];return{midX:U.x+(G.x-U.x)*z,midY:U.y+(G.y-U.y)*z}},"anchorAtT"),L=k((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=k((V,z)=>V.midX>=z.left-rh&&V.midX<=z.right+rh&&V.midY>=z.top-rh&&V.midY<=z.bottom+rh,"pointInsideRectInclusive"),D=k(V=>{const z=Y4(V.midX,V.midY,b,x),U=f(z);if(U)return{laneId:U,anchor:V,rect:z};const G=i.find(({rect:ee})=>R(V,ee));if(!G)return;const H=G.rect.left+b/2+o,j=G.rect.right-b/2-o,q=G.rect.top+x/2+o,ne=G.rect.bottom-x/2-o;if(H>j||q>ne)return;const X={midX:L(V.midX,H,j),midY:L(V.midY,q,ne)},J=Y4(X.midX,X.midY,b,x);return R(V,J)?{laneId:G.id,anchor:X,rect:J}:void 0},"placementForAnchor"),M=k((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),I=k((V,z)=>{const G=(V.orientation==="horizontal"?b/2:x/2)+s;if(V===O){const H=y[V.idx];if(M(V,z,H)+rh{const z=C(V);for(const U of z)for(const G of _){const H=P(U,G);if(!I(U,H))continue;const j=D(H);if(j&&!Rke(j.rect,y)&&!p(m,j.rect)&&!d(m,g.id,j.rect))return{laneId:j.laneId,anchor:j.anchor}}},"tryPool"),F=k((V,z,U=!1)=>{const G=C(V);for(const H of G){const j={midX:H.midX,midY:H.midY};if(z&&!I(H,j))continue;const q=D(j);if(q&&!Rke(q.rect,y)&&!p(m,q.rect)&&!l(m,q.rect)&&(U||!u(g.id,q.rect)))return{laneId:q.laneId,anchor:q.anchor}}},"findLaneContainingFallback"),B=N(S)??(S.lengthU.labelId===m);z>=0?h[z]={labelId:m,rect:V}:h.push({labelId:m,rect:V})}}}k(Tee,"anchorLabelsToPolyline");var Dke=1e-6,oNn=8,f7t=oNn/2,sNn=3;function Lke(t,e){return t{const d=Lke(s,l);let h=0;const f=k(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>h&&(h=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||Lke(g,m)===d&&f(p.labelNodeId)}return h>0?h+sNn:0},"labelClearanceFor");for(const o of t){if(o.isLayoutOnly)continue;const s=o.points;if(!rke(s,Dke))continue;const l=ske(o,r,Dke);if(!l)continue;const{srcId:u,dstId:d,srcInfo:h,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,v;if(p){const A=f.cy>h.cy;m={x:h.cx,y:A?h.rect.bottom:h.rect.top},v={x:f.cx,y:A?f.rect.top:f.rect.bottom}}else{const A=f.cx>h.cx;m={x:A?h.rect.right:h.rect.left,y:h.cy},v={x:A?f.rect.left:f.rect.right,y:f.cy}}if(As(m,v,n,[u,d],1))continue;const b=a(o,u,d,p?"x":"y"),x=b>f7t?b:f7t,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<=h.rect.left||S.x>=h.rect.right||T.x<=f.rect.left||T.x>=f.rect.right)continue}else if(S.y+=A,T.y+=A,S.y<=h.rect.top||S.y>=h.rect.bottom||T.y<=f.rect.top||T.y>=f.rect.bottom)continue;if(!As(S,T,n,[u,d],1)&&!mee(S,T,t,o,{epsilon:Dke})){o.points=[S,T];break}}}}k(p7t,"straightenCollinearSiblingDetours");function Mke(t,e){const{realNodeRects:l,labelNodeRects:u}=e2(e.values()),d=k((A,S)=>W4(S,.001).map(T=>({...T,edge:A,interior:T.index>=1&&T.index<=S.length-3})),"segmentsFor"),h=k(()=>{const A=[];for(const S of t){if(S.isLayoutOnly)continue;const T=S.points;!T||T.length<2||A.push(...d(S,Bi(T)))}return A},"allSegments"),f=k((A,S)=>A.horizontal&&S.horizontal?ed(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?ed(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=k((A,S)=>{const T=A.start,C=A.end,O=d(A,S);if(O.length!==S.length-1)return!1;const E=[T,C].filter(P=>!!P),_=A.labelNodeId?[A.labelNodeId]:[];for(const P of O)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 O)for(const D of d(P,Bi(L)))if(f(R,D)||Q1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=k((A,S)=>{const T=Bi(A.edge.points??[]);if(T.length<4||A.index>=T.length-1)return;const C=T.map(O=>({...O}));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 d(A.edge,C).length===C.length-1?C:void 0},"shiftedCandidate"),m=k((A,S)=>({x:A.x??(S.left+S.right)/2,y:A.y??(S.top+S.bottom)/2}),"nodeCenter"),v=k(A=>{const S=A.edge,T=Bi(S.points??[]);if(T.length!==4||A.index!==1)return;const C=S.start?e.get(S.start):void 0,O=S.end?e.get(S.end):void 0,E=C?th(C):void 0,_=O?th(O):void 0,P=T.slice(A.index+2);if(!(!C||!O||!E||!_||P.length===0))return{sourceCenter:m(C,E),targetCenter:m(O,_),sourceRect:E,tail:P}},"sourceDetourContextFor"),y=k((A,S,T,C,O,E)=>{const _=C.y>=T.y,P=_?O.bottom:O.top,L=P+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+S;return Bi([{x:T.x,y:P},{x:T.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=k((A,S,T,C,O,E)=>{const _=C.x>=T.x,P=_?O.right:O.left,L=P+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+S;return Bi([{x:P,y:T.y},{x:L,y:T.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=k((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=h();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}}k(Mke,"nudgeSharedInteriorSubpaths");function g7t(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,d=r.y-t.y,h=(u*s-d*o)/l,f=(u*a-d*i)/l,p=.01;return h>p&&h<1-p&&f>p&&f<1-p}k(g7t,"segmentsIntersect");function m7t(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=FBt(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,d=s.end,h=s.labelNodeId,f=s.id??`${u}->${d}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===d)&&!(h&&p.nodeId===h)){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}k(m7t,"validateSwimlanesLayout");function v7t(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(s=>!s.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!t7t(t,e)||e==="BT"&&i.length>0&&!e7t(t))return;for(const s of n){if(s.isLayoutOnly)continue;const l=s.points;!l||l.length<2||(s.points=j0(vee(l)))}u7t(n,r),p7t(n,r),r7t(n,r);const a=new Map;for(const s of r)a.set(String(s.id),s);Tee(n,a),HBt(n,a),n7t(n,a),Mke(n,a),i7t(n,a),a7t(n,a),kke(n,a),o7t(n,a);const o=k(()=>{c7t(n,a),s7t(n,a),l7t(n,a),Tee(n,a),wke(n,a),kke(n,a),Tee(n,a),wke(n,a)},"finalizeRenderedEdges");o(),Mke(n,a),o(),Oke(n,a),Eke(n,a),Oke(n,a),Eke(n,a)}k(v7t,"postProcessSwimlaneLayout");function r2(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}}k(r2,"normalizeGraph");function Ike(t,e){return t.edges.filter(r=>r.dst===e)}k(Ike,"incoming");function y7t(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}k(y7t,"buildSuccessorMap");function Pke(t){const e=y7t(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}k(Pke,"buildSortedSuccessorMap");function Nke(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}k(Nke,"buildInDegreeMap");function Bke(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}k(Bke,"sortedZeroInDegreeNodes");function Cee(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}}k(Cee,"buildPredecessorSuccessorMaps");function $ke(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}k($ke,"buildLayersFromRanks");function jF(t){const e=Nke(t),r=Bke(e),n=[],i=Pke(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||sh.dst===f.dst?h.id.localeCompare(f.id):h.dst.localeCompare(f.dst));const n=Object.create(null);for(const d of e.nodes)n[d]=0;const i=[],a=k(d=>{n[d]=1;for(const h of r.get(d)??[]){const f=h.dst;n[f]===0?a(f):n[f]===1&&i.push(h)}n[d]=2},"dfs"),o=[...e.nodes].sort((d,h)=>d.localeCompare(h));for(const d of o)n[d]===0&&a(d);const s=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`)),l=e.edges.map(d=>s.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}k(b7t,"removeCycles_DFS");function x7t(t){const e=new Map,r=k(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}k(x7t,"buildTopLaneMap");function H1(t){const e=x7t(t);return r=>e.get(r)??null}k(H1,"createTopLaneResolver");function kee(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}k(kee,"buildTopLaneOrder");function zke(t,e){const r=kee(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}k(zke,"resolveTopLaneOrder");var lNn={EPSILON:1e-6},Oee={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},w7t={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function A7t(t,e){const r=r2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=Cee(r);for(const A of a.values())A.sort((S,T)=>S.localeCompare(T));const o=jF(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=S7t(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 d=new Set;for(const A of r.nodes)(l.get(A)??null)===null&&d.add(A);const h=[...d].sort((A,S)=>{const T=s.get(A)??0,C=s.get(S)??0;return T===C?A.localeCompare(S):T-C}),f=T7t(r),p=new Map;for(const[A,S]of f.entries())p.set(A,[...S].sort((T,C)=>T.localeCompare(C)));const g=C7t(p),m=k7t(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=k(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 h)w(A);for(const A of o)w(A);return{parent:l,children:u,roots:h,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:o}}k(A7t,"buildDrivingTree");function S7t(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,d=l!=null&&l===n;if(u!==d)return u?-1:1;const h=(m=r.rankHint)==null?void 0:m[a],f=(v=r.rankHint)==null?void 0:v[o];if(h!=null&&f!=null&&h!==f)return f-h;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(o)??0;return p!==g?p-g:a.localeCompare(o)})[0]}k(S7t,"chooseParent");function T7t(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}k(T7t,"buildAdjacency");function C7t(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}k(C7t,"assignComponents");function k7t(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const o=k((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(O7t(s,u,n,i.length))))},"visit");for(const s of t.keys())e.has(s)||o(s,null);return i}k(k7t,"computeBlocks");function O7t(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]}}k(O7t,"popBlock");function E7t(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 d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),h=Array.from({length:d},()=>new Array(a).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;s[b]>A&1&&(b=h[A][b],b===-1))return-1;if(b===x)return b;for(let A=d-1;A>=0;A--){const S=h[A][b],T=h[A][x];S===-1||T===-1||S!==T&&(b=S,x=T)}return h[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 O=f(T,C);if(O===-1)continue;const E=p[O];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=k(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),O=e[b];if(O!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=C.get(O)??0;const P=e[T];P!=null&&P>O&&(_+=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}k(E7t,"computeSubtreeCrossCounts");function _7t(t,e,r){const n=new Map,i=k(a=>{let o=r[a]??0;const s=[...e.get(a)??[]];s.sort(Uke(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}k(_7t,"annotateMinimumLayers");function Uke(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}k(Uke,"compareByRankThenId");function R7t(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=k(l=>{if(o.has(l))return;o.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const d of n(l))s(d)},"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}k(R7t,"emitNodesInTreeOrder");function D7t(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}k(D7t,"deduplicateLayers");function L7t(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 d of a){const h=n.get(d)??o;h>o?s.push({child:d,min:h}):l.push(d)}return s.sort((d,h)=>d.min===h.min?d.child.localeCompare(h.child):d.min-h.min),l.sort((d,h)=>{const f=(u==null?void 0:u.get(d))??0,p=(u==null?void 0:u.get(h))??0;if(f!==p)return f-p;const g=n.get(d)??o,m=n.get(h)??o;return g!==m?g-m:d.localeCompare(h)}),[...s.map(d=>d.child),...l]}}k(L7t,"createChildOrderer");function Eee(t,e,r){const n=A7t(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const h of t.nodes)i.has(h)||i.set(h,[]);const o=E7t(t,e,n),s=[...a].sort(Uke(e)),l=_7t(s,i,e),u=L7t(i,e,o,l);let d=R7t(s,t.nodes,e,u);return d=D7t(d),d}k(Eee,"buildMultitreeLayerOrder");function M7t(t,e,r){const n=new Set(t),i=new Set(e),a=q4(e),o=[];for(const s of r)n.has(s.src)&&i.has(s.dst)&&o.push(a.get(s.dst));return Fke(o)}k(M7t,"countCrossingsBetweenAdjacent");function Vke(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,d=o,h=s;o>s&&(l=a.dst,u=a.src,d=s,h=o);for(let f=d;f(r[f]??0)-(r[h]??0));for(const h of d){const f=r[h]??0;if(f===0)continue;let p=0;for(const y of n.get(h)??[])p=Math.max(p,(r[y]??0)+1);if(p>=f)continue;const g=f;r[h]=p;const m=Eee(t,r,i),v=Vke(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,d=!1;for(const m of t.edges){if(m.dst!==i)continue;const v=r(m.src);v&&(v===a?d=!0:u++)}if(u>0||!d)continue;const h=e[i]??0,f=h+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(h,p,f);g!==h&&(e[i]=g)}}k(P7t,"adjustCrossLaneSources");function N7t(t,e){const r=r2(t),n=jF(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=H1(r);let o=Object.create(null);for(const l of n){const u=Ike(r,l),d=e!=null&&e.ignoreCrossLaneEdges?u.filter(h=>{const f=a(h.src),p=a(l);return!f||!p?!0:f===p}):u;if(d.length===0)o[l]=0;else if(i&&d.length===1){const h=d[0].src,f=a(h),p=a(l);f!==p?o[l]=o[h]??0:o[l]=(o[h]??0)+1}else{let h=-1/0;for(const f of d)h=Math.max(h,(o[f.src]??0)+1);o[l]=h===-1/0?0:h}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(o=I7t(r,o)),e!=null&&e.ignoreCrossLaneEdges&&P7t(r,o),{layers:Eee(r,o,a),rankOf:o,dummy:new Set}}k(N7t,"assignLayers_LongestPath");function B7t(t,e){const r=r2(t),i={...N7t(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=H1(r),{preds:o,succs:s}=Cee(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=jF(r)??[...r.nodes],u=[...l].reverse(),d=k((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"),h=Oee.GRAVITY_ITERATIONS,f=k(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=d(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:$ke(r,l,i),rankOf:i,dummy:new Set}}k(B7t,"assignLayers_Gravity");function $7t(t){const e=Nke(t),r=Pke(t);let n=Bke(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}k($7t,"topoSortByGenerationIfAcyclic");function F7t(t,e){const r=r2(t),n=(e==null?void 0:e.direction)==="LR"?$7t(r)??[...r.nodes].sort():jF(r)??[...r.nodes].sort(),i=H1(r),a=k(d=>i(d)??d,"laneOf"),o=Object.create(null),s=new Map,l=k((d,h)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(d)===a(h)?1:0:1,"edgeWeight");for(const d of n){const h=r.nodeById.get(d);if(h!=null&&h.isGroup)continue;const f=Ike(r,d);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,d))}const g=a(d),m=s.get(g)??0,v=Math.max(p,m);o[d]=v,s.set(g,v+1)}return{layers:$ke(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}k(F7t,"assignLayers_LaneAwareCompact");function z7t(t,e){const r=r2(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=k(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)),d=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){d.push(p);continue}let v=p.src;for(let b=g+1,x=0;b!r.nodes.includes(p))],edges:d,layout:r.layout,nodeById:s};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}k(z7t,"makeProperLayering");function Gke(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])}k(Gke,"median");function Qke(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}k(Qke,"barycenter");function U7t(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}k(U7t,"neighborPositionsFor");function V7t(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}k(V7t,"currentOrderTieBreak");function Hke(t,e,r){const n=new Set(t),i=new Set(e),a=q4(t),o=q4(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,d)=>u.u===d.u?u.v-d.v:u.u-d.u);const l=s.map(u=>u.v);return Fke(l)}k(Hke,"countCrossingsBetweenAdjacent");function _ee(t,e,r){return[...t].sort((n,i)=>{const a=Gke(e.get(n)??[]),o=Gke(e.get(i)??[]);return a===o?V7t(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}k(_ee,"sortByHeuristic");function Wke(t,e,r,n,i,a){const o=q4(t),s=q4(e),l=U7t(e,o,r,n);if(!i||!a||a.length===0)return _ee(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 d=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=_ee(p,l,s);d.push(...g)}const h=u.get(null);if(h&&h.length>0){const f=_ee(h,l,s);for(const p of f){const g=Qke(l.get(p)??[]);let m=d.length;if(isFinite(g))for(const[v,y]of d.entries()){const b=Qke(l.get(y)??[]);if(go.has(m.src)&&s.has(m.dst)),d=l?r.filter(m=>s.has(m.src)&&l.has(m.dst)):void 0,h=k(m=>{let v=Hke(t,m,u);return d&&n&&(v+=Hke(m,n,d)),v},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=h(a);for(;p;){p=!1;for(let m=0;m+1[...s]),i=e.edges,a=H1(e),o=zke(e,r==null?void 0:r.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--)n[l]=Wke(n[l+1],n[l],i,"up",a,o),n[l]=Yke(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}k(G7t,"orderLayers");function Q7t(t,e,r){const n=(r==null?void 0:r.layerGap)??w7t.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??w7t.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),d=Object.create(null),h=k(E=>e.nodeById.get(E),"getNode"),f=k(E=>{var _;return((_=h(E))==null?void 0:_.width)??0},"getWidth"),p=k(E=>{var _;return((_=h(E))==null?void 0:_.height)??0},"getHeight"),g=H1(e),m=zke(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,d[z]=C+P/2,B+=U+i}}}const R=y[E]??0;C+=P+n+R}const O=new Map;for(const E of e.edges){const _=E.ref.id;O.has(_)||O.set(_,[]),O.get(_).push(E)}for(const[,E]of O){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:d}}k(Q7t,"assignCoordinates");var H7t=8;function W7t(t){let e=2166136261;for(let r=0;r>>0}k(W7t,"hashString");function Y7t(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}}k(Y7t,"mulberry32");function q7t(t,e){const r=[...t],n=Y7t(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}k(q7t,"deterministicShuffle");function j7t(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}k(j7t,"sourceDistance");function qke(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}k(qke,"laneArrangementCost");function X7t(t){const e=kee(t);if(e.length<2)return[];const r=new Map(e.map((a,o)=>[a,o])),n=H1(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 d=r.get(l),h=r.get(u);if(d==null||h==null)continue;const[f,p]=d<=h?[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()]}k(X7t,"buildWeightedLaneEdges");function jke(t,e,r){const n=[...t];let i=qke(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 W7t(`${t.join("|")}#${n}#${r}`)}k(Z7t,"seedForRestart");function J7t(t,e={}){const r=kee(t);if(r.length<2)return r;const n=X7t(t);if(n.length===0)return r;const i=new Map(r.map((s,l)=>[s,l]));let a=jke(r,n,i);const o=Math.max(0,e.restarts??H7t);for(let s=0;sri&&l*3>=s?o>0?"bottom":"top":s>ri?a>0?"right":"left":r}k(Kke,"chooseOrthogonalSide");function Zke(t,e){return Math.abs(t.to-e.from)Z.isGroup&&!Z.parentId);for(const Z of u){const le={id:Z.id},be=k(ae=>{o.set(ae.id,le),r.filter(K=>K.parentId===ae.id).forEach(be)},"assignLane");be(Z)}const d=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=cNn;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}}),h=k((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=k((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=k((Z,le,be)=>f(Z,Kke(Z,le,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=k((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=k((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!!d.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.minYKke(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 O=k(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=k(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=k((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=O(le),K=O(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=k(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=k(Z=>{var le;return!!((le=i[Z])!=null&&le.labelNodeId)},"edgeHasLabelNode"),F=k((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=k((Z,le,be)=>le==="top"||le==="bottom"?{x:Z.x+be,y:Z.y}:{x:Z.x,y:Z.y+be},"applyPortOffset"),V=k((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+Lp:K.y-Lp}else{const pt=K.x>(be.x??0);ve.x=pt?K.x+Lp:K.x-Lp}if(Le){const pt=se.y>(ae.y??0);ce.y=pt?se.y+Lp:se.y-Lp}else{const pt=se.x>(ae.x??0);ce.x=pt?se.x+Lp:se.x-Lp}const We=k((pt,Ct)=>{for(const or of d)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+YC:Jr.minX-YC,y:Vt?Jr.maxY+j4:Jr.minY-j4,leavesPositiveSide:Vt}}const Rt=pt.x>(Ct.x??0),kt=(or.y??0)>=pt.y;return{x:Rt?Jr.maxX+YC:Jr.minX-YC,y:kt?Jr.maxY+j4:Jr.minY-j4,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+Lp):Math.max(pt.maxY+2,K.y-Lp);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+Lp):Math.max(pt.maxX+2,K.x-Lp);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=YC,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,ra=Rt<=1||mt<=2;if((Ct||or)&&!Jr&&(!kt||kt&&!Tr&&Fe&&ra)&&!w(K,se,le.start,le.end)){le.points=[{...K},{...ve},{...ce},{...se}],v.add(Z);const di=or?"horizontal":"vertical",Bo=or?K.y:K.x,Qn=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),hi={id:`fast-path-${di}-${Bo.toFixed(0)}-${Z}`,orientation:di,coord:Bo,spanMin:Qn,spanMax:fa,tracks:[]};g.push({edgeIndex:Z,segmentIndex:0,orientation:di,pipe:hi,trackIndex:0,from:Qn,to:fa});continue}}const Pe=h("vertical",ve.x,ve.y,ve.y);ve.x=Pe.coord;const yt=h("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,Ot=Math.min(ve.y,ce.y)-50,ut=Math.max(ve.y,ce.y)+50;for(const pt of d){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-Ree),St=Math.max(St,pt.maxX+Ree),Ot=Math.min(Ot,pt.minY-Ree),ut=Math.max(ut,pt.maxY+Ree))}for(const pt of d){if(pt.maxXSt||pt.maxYut)continue;const Ct=YC;h("horizontal",pt.minY-Ct,Ie,St),h("horizontal",pt.maxY+Ct,Ie,St);const or=j4;h("vertical",pt.minX-or,Ot,ut),h("vertical",pt.maxX+or,Ot,ut)}h("horizontal",ve.y,Ie,St),h("horizontal",ce.y,Ie,St);const Qt=s.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=Ot&&pt.coord<=ut),It=s.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Ie&&pt.coord<=St),gt=k((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=k((pt,Ct)=>w(pt,Ct,le.start,le.end),"checkSegmentBlocked"),Tt={x:ce.x,y:ve.y},hr=wt(ve,Tt),jr=wt(Tt,ce),Ir=hr||jr,Zr={x:ve.x,y:ce.y},Ur=wt(ve,Zr),On=wt(Zr,ce);if(Ir?Ur||On||(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=Qt.sort((mt,Tr)=>mt.coord-Tr.coord),kt=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[kt-1].coord}),kt>=0&&ktJs.nodeId===le.start||Js.nodeId===le.end?!1:Tr!==Fe?Js.minYor&&Js.maxX>Tr&&Js.minXCt&&Js.maxY>ra&&Js.minY10&&Ev<-5||yu<-10&&Ev>5)&&(fa=Math.abs(Ev)*100),(hi>10&&cm<-5||hi<-10&&cm>5)&&(fa+=Math.abs(cm)*50);let _O=0;const RO=Mt.get(pt.key)??"n",DO=Math.abs(cm)>ri?"h":"v";RO!=="n"&&RO!==DO&&(_O=50);const wl=Bo+Qn+fa+_O,mh=(Et.get(pt.key)??1/0)+wl,Fc=Math.abs(ce.x-mt.x)+Math.abs(ce.y-mt.y);if(mh<(Et.get(di)??1/0))if(At.set(di,pt.pt),Et.set(di,mh),Mt.set(di,DO),!qr.has(di))Me.push({key:di,f:mh+Fc,pt:mt}),qr.add(di);else{const Js=Me.findIndex(Of=>Of.key===di);Js!==-1&&(Me[Js].f=mh+Fc)}}}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 ra of at)or=Math.min(or,ra.x),Jr=Math.max(Jr,ra.x),Mn=Math.min(Mn,ra.y),Rt=Math.max(Rt,ra.y);const kt=Jr>Math.max(pt.x,Ct.x),Vt=orQn.minXGe&&Qn.minYIn);if(Bo.length>0){let Qn=Math.max(pt.x,Ct.x);for(const fa of Bo){const hi=(fa.minX+fa.maxX)/2;if(fa.visualXHalfExtent===void 0||isNaN(fa.visualXHalfExtent))continue;const yu=hi+fa.visualXHalfExtent+ra;Qn=Math.max(Qn,yu)}isNaN(Qn)||(Jr=Qn)}}if(Vt){const Ge=d.filter(In=>In.minXMath.min(pt.y,Ct.y));if(Ge.length>0){let In=Math.min(pt.x,Ct.x);for(const di of Ge){const Qn=(di.minX+di.maxX)/2-di.visualXHalfExtent-ra;In=Math.min(In,Qn)}or=In}}}const mt=k(ra=>{const Ge=Ct.y>pt.y,In=d.filter(Qn=>{const fa=Math.min(pt.x,Ct.x)Qn.minX,hi=Math.min(pt.y,Ct.y)Qn.minY;return fa&&hi});let di=In;if(l&&In.length>0){const Qn=In.filter(fa=>fa.minXra);Qn.length>0&&(di=Qn)}if(di.length===0)return Ct.y;const Bo=YC;if(Ge){const fa=Math.max(...di.map(hi=>hi.maxY))+Bo;if(fahi.minY))-Bo;if(fa>Ct.y+ri)return fa}return Ct.y},"findBestReturnY"),Tr=k(ra=>{const Ge=mt(ra),In={x:ra,y:pt.y},di={x:ra,y:Ge},Bo={x:Ct.x,y:Ge},Qn=wt(pt,In),fa=wt(In,di),hi=wt(di,Bo),yu=Ge!==Ct.y?wt(Bo,Ct):!1;return!Qn&&!fa&&!hi&&!yu?Math.abs(Ge-Ct.y)=3){const pt=hn[hn.length-1],Ct=hn[hn.length-2],or=hn[hn.length-3],Jr=Math.abs(or.y-Ct.y)Math.abs(pt.x-or.x)&&hn.splice(-2,1)}else if(Mn){const Rt=Math.sign(Ct.y-or.y),kt=Math.sign(pt.y-or.y);Rt!==0&&Rt===kt&&Math.abs(Ct.y-or.y)>Math.abs(pt.y-or.y)&&hn.splice(-2,1)}}const ii=[hn[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(hn[hn.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"),G=k(Z=>{const le=Z.tracks.length;return Z.tracks[le]={index:le,coord:Z.coord,segments:[]},le},"createNewTrack"),H=k((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"),j=k((Z,le)=>{const be=m[Z.edgeIndex];for(const ae of be){const K=g[ae];K.pipe===Z.pipe&&H(K,le)}},"moveSegmentChainToTrack"),q=k(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=k((Z,le)=>{if(Z.trackIndex===le.trackIndex)return z(Z,le);const be=q(Z),ae=q(le);return be.some(K=>ae.some(se=>ne(K,se)))},"segmentsConflict"),ee=k((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:G(Z.pipe))},"resolveTrackConflict"),te=k(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=k(()=>{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=k(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"),Oe=k(()=>{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=k(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=k(()=>{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=k((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*Xke);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*Xke*.5)}Le++}let We=0;for(const Ne of oe)We++,ce(Ne,Z.coord+We*Xke)}}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(qC(We,je)),He&&Ze.orient===We.orient)if(Math.abs(We.coord-Ze.coord)>ri){const et=We.orient==="vertical"?(je+Ze.from)/2:Zke(We,Ze);ae.push(qC(We,et),qC(Ze,et))}else(Le===0||Le===ve.length-2)&&ae.push(qC(We,Zke(We,Ze)));else if(He)ae.push(qC(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=k((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}k(t$t,"routeEdgesOrthogonal");function r$t(t){return t.direction??"TB"}k(r$t,"getSwimlaneDirection");function n$t(t){var d,h,f,p,g;const e=PBt(t),r=((d=t.config.flowchart)==null?void 0:d.nodeSpacing)??40,n=((h=t.config.flowchart)==null?void 0:h.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=r$t(t),{ordered:l,coordinates:u}=e$t(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});NBt(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;t$t(t,s);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return v7t(t,s),m7t(t),s}k(n$t,"runSwimlaneLayoutCore");async function i$t(t,e){const r=e.select("g");Dwe(r,t.markers,t.type,t.diagramId),WEt(),XEt(),pOt(),B8t(),IBt(t);const n=BBt(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await yBt(r,t);n$t(t),await RBt(t,i)}k(i$t,"render");const uNn=Object.freeze(Object.defineProperty({__proto__:null,render:i$t},Symbol.toStringTag,{value:"Module"}));function Jke(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 a$t(t,e,r){return(e=o$t(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pNn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gNn(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(d){u=!0,i=d}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function mNn(){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 vNn(){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 js(t,e){return dNn(t)||gNn(t,e)||eOe(t,e)||mNn()}function Dee(t){return hNn(t)||pNn(t)||eOe(t)||vNn()}function yNn(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 o$t(t){var e=yNn(t,"string");return typeof e=="symbol"?e:e+""}function fl(t){"@babel/helpers - typeof";return fl=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},fl(t)}function eOe(t,e){if(t){if(typeof t=="string")return Jke(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)?Jke(t,e):void 0}}var pl=typeof window>"u"?null:window,s$t=pl?pl.navigator:null;pl&&pl.document;var bNn=fl(""),l$t=fl({}),xNn=fl(function(){}),wNn=typeof HTMLElement>"u"?"undefined":fl(HTMLElement),XF=function(e){return e&&e.instanceString&&Io(e.instanceString)?e.instanceString():null},Yr=function(e){return e!=null&&fl(e)==bNn},Io=function(e){return e!=null&&fl(e)===xNn},Ma=function(e){return!gf(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},$i=function(e){return e!=null&&fl(e)===l$t&&!Ma(e)&&e.constructor===Object},ANn=function(e){return e!=null&&fl(e)===l$t},sr=function(e){return e!=null&&fl(e)===fl(1)&&!isNaN(e)},c$t=function(e){return sr(e)&&Math.floor(e)===e},Lee=function(e){if(wNn!=="undefined")return e!=null&&e instanceof HTMLElement},gf=function(e){return KF(e)||u$t(e)},KF=function(e){return XF(e)==="collection"&&e._private.single},u$t=function(e){return XF(e)==="collection"&&!e._private.single},tOe=function(e){return XF(e)==="core"},d$t=function(e){return XF(e)==="stylesheet"},SNn=function(e){return XF(e)==="event"},a2=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},TNn=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},CNn=function(e){return $i(e)&&sr(e.x1)&&sr(e.x2)&&sr(e.y1)&&sr(e.y2)},kNn=function(e){return ANn(e)&&Io(e.then)},ONn=function(){return s$t&&s$t.userAgent.match(/msie|trident|edge/i)},X4=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},INn=function(e,r){return-1*p$t(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 h=new RegExp("^"+RNn+"$").exec(e);if(h){if(n=parseInt(h[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(h[2]),i<0||i>100||(i=i/100,a=parseFloat(h[3]),a<0||a>100)||(a=a/100,o=h[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*d(p,f,n+1/3)),l=Math.round(255*d(p,f,n)),u=Math.round(255*d(p,f,n-1/3))}r=[s,l,u,o]}return r},BNn=function(e){var r,n=new RegExp("^"+ENn+"$").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},$Nn=function(e){return FNn[e.toLowerCase()]},g$t=function(e){return(Ma(e)?e:null)||$Nn(e)||PNn(e)||BNn(e)||NNn(e)},FNn={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]},m$t=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 O(L);g=setTimeout(C,S(L))}function O(L){return g=void 0,x&&d?w(L):(d=h=void 0,p)}function E(){g!==void 0&&clearTimeout(g),v=0,d=m=h=g=void 0}function _(){return g===void 0?p:O(e())}function P(){var L=e(),R=T(L);if(d=arguments,h=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 vOe=o,vOe}var jNn=qNn(),t9=ZF(jNn),yOe=pl?pl.performance:null,M$t=yOe&&yOe.now?function(){return yOe.now()}:function(){return Date.now()},XNn=function(){if(pl){if(pl.requestAnimationFrame)return function(t){pl.requestAnimationFrame(t)};if(pl.mozRequestAnimationFrame)return function(t){pl.mozRequestAnimationFrame(t)};if(pl.webkitRequestAnimationFrame)return function(t){pl.webkitRequestAnimationFrame(t)};if(pl.msRequestAnimationFrame)return function(t){pl.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(M$t())},1e3/60)}}(),Nee=function(e){return XNn(e)},W1=M$t,jC=9261,I$t=65599,K4=5381,P$t=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jC,n=r,i;i=e.next(),!i.done;)n=n*I$t+i.value|0;return n},r9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jC;return r*I$t+e|0},n9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:K4;return(r<<5)+r+e|0},KNn=function(e,r){return e*2097152+r},s2=function(e){return e[0]*2097152+e[1]},Bee=function(e,r){return[r9(e[0],r[0]),n9(e[1],r[1])]},N$t=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)},wOe=function(e){e.splice(0,e.length)},s8n=function(e,r){for(var n=0;n"u"?"undefined":fl(Set))!==c8n?Set:u8n,Fee=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!tOe(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 Z4,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 d=0,h=u.length;db?1:0},d=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?O++:O--)C.push(O);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 O=S.neighborhood().intersect(g),E=0;E0)for(N.unshift(I);h[B];){var V=h[B];N.unshift(V.edge),N.unshift(V.node),F=V.node,B=F.id()}return s.spawn(N)}}}},v8n={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===d){for(var C=[],O=a,E=d,_=y[E];C.unshift(O),_!=null&&C.unshift(_),O=v[E],O!=null;)E=O.id(),_=y[E];return{found:!0,distance:h[w],path:this.spawn(C),steps:T}}p[w]=!0;for(var P=x._private.edges,L=0;L_&&(g[E]=_,b[E]=O,x[E]=A),!a){var P=O*d+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),ke=we.edge,Be=we.pred;if(ge.unshift(ze[0]),ze.same(he)&&ge.length>0)break;ke!=null&&ge.unshift(ke),ze=Be}return l.spawn(ge)},S=0;S=0;d--){var h=u[d],f=h[1],p=h[2];(r[f]===s&&r[p]===l||r[f]===l&&r[p]===s)&&u.splice(d,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=C8n(a,e,r),n--}return r},k8n={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/T8n);if(a<2){Co("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d1&&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 d=e.length,h=Math.floor(d/2);return d%2!==0?e[h+1+s]:(e[h-1+s]+e[h+s])/2},q$t=function(e,r){return r===0?e:q$t(r,e%r)},L8n=function(e){for(var r=e[0],n=0;n0&&(r=q$t(r,e[n]));else return 0;return r},M8n=function(e){return Math.PI*e/180},Vee=function(e,r){return Math.atan2(r,e)-Math.PI/2},COe=Math.log2||function(t){return Math.log(t)/Math.log(2)},kOe=function(e){return e>0?1:e<0?-1:0},KC=function(e,r){return Math.sqrt(ZC(e,r))},ZC=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},I8n=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}}},N8n=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},B8n=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},$8n=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},j$t=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},Gee=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},Qee=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=js(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},X$t=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},OOe=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},c2=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},K$t=function(e,r){return c2(e,r.x,r.y)},Z$t=function(e,r){return c2(e,r.x1,r.y1)&&c2(e,r.x2,r.y2)},F8n=(TOe=Math.hypot)!==null&&TOe!==void 0?TOe:function(t,e){return Math.sqrt(t*t+e*e)};function z8n(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(C,O){return{x:C.x+O.x,y:C.y+O.y}},n=function(C,O){return{x:C.x-O.x,y:C.y-O.y}},i=function(C,O){return{x:C.x*O,y:C.y*O}},a=function(C,O){return C.x*O.y-C.y*O.x},o=function(C){var O=F8n(C.x,C.y);return O===0?{x:0,y:0}:{x:C.x/O,y:C.y/O}},s=function(C){for(var O=0,E=0;E7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?d2(a,o):l,d=a/2,h=o/2;u=Math.min(u,d,h);var f=u!==d,p=u!==h,g;if(f){var m=n-d+u-s,v=i-h-s,y=n+d-u+s,b=v;if(g=u2(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var x=n+d+s,w=i-h+u-s,A=x,S=i+h-u+s;if(g=u2(e,r,n,i,x,w,A,S,!1),g.length>0)return g}if(f){var T=n-d+u-s,C=i+h+s,O=n+d-u+s,E=C;if(g=u2(e,r,n,i,T,C,O,E,!1),g.length>0)return g}if(p){var _=n-d-s,P=i-h+u-s,L=_,R=i+h-u+s;if(g=u2(e,r,n,i,_,P,L,R,!1),g.length>0)return g}var D;{var M=n-d+u,I=i-h+u;if(D=s9(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+d-u,F=i-h+u;if(D=s9(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+d-u,V=i+h-u;if(D=s9(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-d+u,U=i+h-u;if(D=s9(e,r,n,i,z,U,u+s),D.length>0&&D[0]<=z&&D[1]>=U)return[D[0],D[1]]}return[]},V8n=function(e,r,n,i,a,o,s){var l=s,u=Math.min(n,a),d=Math.max(n,a),h=Math.min(i,o),f=Math.max(i,o);return u-l<=e&&e<=d+l&&h-l<=r&&r<=f+l},G8n=function(e,r,n,i,a,o,s,l,u){var d={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!(ed.x2||rd.y2)},Q8n=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]},H8n=function(e,r,n,i,a){var o=1e-5;e===0&&(e=o),r/=e,n/=e,i/=e;var s,l,u,d,h,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){h=u+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),f=u-Math.sqrt(s),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+h+f,p+=(h+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+h)/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,d=l*l*l,d=Math.acos(u/Math.sqrt(d)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(d/3),a[2]=-p+g*Math.cos((d+2*Math.PI)/3),a[4]=-p+g*Math.cos((d+4*Math.PI)/3)},W8n=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,d=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,h=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=[];H8n(u,d,h,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):d-f},ih=function(e,r,n){for(var i,a,o,s,l,u=0,d=0;d=e&&e>=o||i<=e&&e<=o)l=(e-i)/(o-i)*(s-a)+a,l>r&&u++;else continue;return u%2!==0},q1=function(e,r,n,i,a,o,s,l,u){var d=new Array(n.length),h;l[0]!=null?(h=Math.atan(l[1]/l[0]),l[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=l;for(var f=Math.cos(-h),p=Math.sin(-h),g=0;g0){var v=Wee(d,-u);m=Hee(v)}else m=d;return ih(e,r,m)},q8n=function(e,r,n,i,a,o,s,l){for(var u=new Array(n.length*2),d=0;d=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]},EOe=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},u2=function(e,r,n,i,a,o,s,l,u){var d=e-a,h=n-e,f=s-a,p=r-o,g=i-r,m=l-o,v=f*p-m*d,y=h*p-g*d,b=m*h-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*h,r+x*g]:u?[e+x*h,r+x*g]:[]}else return v===0||y===0?EOe(e,n,s)===s?[s,l]:EOe(e,n,a)===a?[a,o]:EOe(a,s,n)===n?[n,i]:[]:[]},X8n=function(e,r,n,i,a){var o=[],s=i/2,l=a/2,u=r,d=n;o.push({x:u+s*e[0],y:d+l*e[1]});for(var h=1;h0){var m=Wee(h,-l);p=Hee(m)}else p=h}else p=n;for(var v,y,b,x,w=0;w2){for(var g=[d[0],d[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;vd&&(d=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},dBn=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:pBn,s=i,l,u,d=0;d=2?c9(e,r,n,0,lFt,gBn):c9(e,r,n,0,sFt)},squaredEuclidean:function(e,r,n){return c9(e,r,n,0,lFt)},manhattan:function(e,r,n){return c9(e,r,n,0,sFt)},max:function(e,r,n){return c9(e,r,n,-1/0,mBn)}};n3["squared-euclidean"]=n3.squaredEuclidean,n3.squaredeuclidean=n3.squaredEuclidean;function qee(t,e,r,n,i,a){var o;return Io(t)?o=t:o=n3[t]||n3.euclidean,e===0&&Io(t)?o(i,a):o(e,r,n,i,a)}var vBn=Cc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),IOe=function(e){return vBn(e)},jee=function(e,r,n,i,a){var o=a!=="kMedoids",s=o?function(h){return n[h]}:function(h){return i[h](n)},l=function(f){return i[f](r)},u=n,d=r;return qee(e,i.length,s,l,u,d)},POe=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},xBn=function(e,r,n){for(var i=0;is&&(s=r[u][d],l=d);a[l].push(e[u])}for(var h=0;h=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},mFt=function(e,r,n){for(var i=[],a=0;as&&(o=u,s=r[a*e+u])}o>0&&i.push(o)}for(var d=0;du&&(l=d,u=h)}n[a]=o[l]}return i=mFt(e,r,n),i},vFt=function(e){for(var r=this.cy(),n=this.nodes(),i=LBn(e),a={},o=0;o=_?(P=_,_=R,L=D):R>P&&(P=R);for(var M=0;M0?1:0;T[O%i.minIterations*s+z]=U,V+=U}if(V>0&&(O>=i.minIterations-1||O==i.maxIterations-1)){for(var G=0,H=0;H1||S>1)&&(s=!0),h[x]=[],b.outgoers().forEach(function(C){C.isEdge()&&h[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),h[x]=[],b.connectedEdges().forEach(function(A){return h[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(d&&u!=d)return p;d=u}else{if(d&&u!=d&&l!=d)return p;d||(d=u)}else d||(d=o[0].id());var g=function(x){for(var w=x,A=[x],S,T,C;h[w].length;)S=h[w].shift(),T=f[S][0],C=f[S][1],w!=C?(h[C]=h[C].filter(function(O){return O!=S}),w=C):!a&&w!=T&&(h[T]=h[T].filter(function(O){return O!=S}),w=T),A.unshift(S),A.unshift(w);return A},m=[],v=[];for(v=g(d);v.length!=1;)h[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 h)if(h[y].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},Xee=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(h){if(h.isNode()){var f=h.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var d=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(d),components:a}},zBn={hopcroftTarjanBiconnected:Xee,htbc:Xee,htb:Xee,hopcroftTarjanBiconnectedComponents:Xee},Kee=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 d=e.getElementById(u).connectedEdges().intersection(e);if(d.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 h=e.spawn();;){var f=a.pop();if(h.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=h.edgesWith(h),g=h.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}},UBn={tarjanStronglyConnected:Kee,tsc:Kee,tscc:Kee,tarjanStronglyConnectedComponents:Kee},yFt={};[i9,m8n,v8n,b8n,w8n,S8n,k8n,eBn,t3,r3,MOe,fBn,kBn,RBn,BBn,FBn,zBn,UBn].forEach(function(t){ln(yFt,t)});/*! @@ -1334,7 +1334,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),s=r9n(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]:O9.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===Rte.IGNORE)return;if(l==Rte.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),d=nh(u),h;try{for(d.s();!(h=d.n()).done;){var f=h.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(_){d.e(_)}finally{d.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,d=a.tex2,h=u.w/(u.w+d.w);o||(h=1-h);var f=this._getAdjustedBB(l,s,o,h);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;lUt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),d=u.x,h=u.y;_te(r,r,[d,h]),cUt(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;_te(r,r,[o,s]),d_e(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,d=r.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var h=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(h=l-f,o+=h,l=f),{x1:o,y1:s,w:l,h:u,xOffset:h,yOffset:d}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=w3;var s=this.indexBuffer.getView(o);x3(n,s);var l=this.colorBuffer.getView(o);sk([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===Dte||s===E9){var u=a.getBoundingBox(r),d=this._getCornerRadius(r,o.radius,u),h=this.cornerRadiusBuffer.getView(l);h[0]=d,h[1]=d,h[2]=d,h[3]=d,s===E9&&(h[0]=0,h[2]=0)}var f=this.indexBuffer.getView(l);x3(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);sk(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);sk(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 w3;case"ellipse":return _9;case"roundrectangle":case"round-rectangle":return Dte;case"bottom-round-rectangle":return E9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,o=i.h;if(r.pstyle(n).value==="auto")return d2(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 d=r.pstyle(i+"-arrow-color").value,h=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=h*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);lUt(b),_te(b,b,[o,s]),d_e(b,b,[v,v]),cUt(b,b,l),this.vertTypeBuffer.getView(y)[0]=f_e;var x=this.indexBuffer.getView(y);x3(n,x);var w=this.colorBuffer.getView(y);sk(d,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 d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=uUt;var h=this.indexBuffer.getView(d);x3(n,h);var f=this.colorBuffer.getView(d);sk(l,u,f);var p=this.lineWidthBuffer.getView(d);p[0]=s;var g=this.pointAPointBBuffer.getView(d);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(h){var f=h.pstyle("text-events").strValue==="yes";return f?Rte.USE_BB:Rte.IGNORE},l=function(h){var f=h.position(),p=f.x,g=f.y,m=h.outerWidth(),v=h.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:o9n,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:p_e(e.getLabelKey,null),getBoundingBox:g_e(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:p_e(e.getSourceLabelKey,"source"),getBoundingBox:g_e(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:p_e(e.getTargetLabelKey,"target"),getBoundingBox:g_e(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=t9(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(d,h){var f=!1;h&&h.length>0&&(f|=r.drawing.invalidate(h)),f&&u()}),O9n(r)};function k9n(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return g$t(r)}function fUt(t,e){var r=t._private.rscratch;return td(r,"labelWrapCachedLines",e)||[]}var p_e=function(e,r){return function(n){var i=e(n),a=fUt(n,r);return a.length>1?a.map(function(o,s){return"".concat(i,"_").concat(s)}):i}},g_e=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=fUt(n,r),u=a.h/l.length,d=u*s,h=a.y1+d;return{x1:a.x1,w:a.w,y1:h,h:u,yOffset:d}}}return a}};function O9n(t){{var e=t.render;t.render=function(a){a=a||{};var o=t.cy;t.webgl&&(o.zoom()>Yzt?(E9n(t),e.call(t,a)):(_9n(t),gUt(t,a,O9.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 P9n(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 E9n(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function _9n(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 R9n(t){var e=t.canvasWidth,r=t.canvasHeight,n=c_e(t),i=n.pan,a=n.zoom,o=u_e();_te(o,o,[i.x,i.y]),d_e(o,o,[a,a]);var s=u_e();g9n(s,e,r);var l=u_e();return p9n(l,s,o),l}function pUt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=c_e(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 D9n(t,e){t.drawSelectionRectangle(e,function(r){return pUt(t,r)})}function L9n(t){var e=t.data.contexts[t.NODE];e.save(),pUt(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 M9n(t){var e=function(i,a,o){for(var s=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=s.atlases,d=0;d=0&&w.add(T)}return w}function P9n(t,e,r){var n=I9n(t,e,r),i=t.getCachedZSortedEles(),a,o,s=nh(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,d=i[u];if(!a&&d.isNode()&&(a=d),!o&&d.isEdge()&&(o=d),a&&o)break}}catch(h){s.e(h)}finally{s.f()}return[a,o].filter(Boolean)}function m_e(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 gUt(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]&&D9n(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=R9n(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 N9n(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":fl(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},[Zzt,rv,K1,l_e,ok,x2,id,hUt,w2,R9,wUt].forEach(function(t){ln(ni,t)});var F9n=[{name:"null",impl:Tzt},{name:"base",impl:Qzt},{name:"canvas",impl:B9n}],z9n=[{type:"layout",extensions:cFn},{type:"renderer",extensions:F9n}],SUt={},TUt={};function CUt(t,e,r){var n=r,i=function(C){oa("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(x9.prototype[e])return i(e);x9.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),$i(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))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.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 d(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h},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),d=i(1),h=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,O,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),d=this.add(l,u);return this.setRootGraph(d),this.rootGraph},s.prototype.add=function(l,u,d,h,f){if(d==null&&h==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=d,h=u,d=l;var p=h.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 d.isInterGraph=!1,p.add(d,h,f);if(d.isInterGraph=!0,d.source=h,d.target=f,this.edges.indexOf(d)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(d),!(d.source!=null&&d.target!=null))throw"Edge source and/or target is null!";if(!(d.source.edges.indexOf(d)==-1&&d.target.edges.indexOf(d)==-1))throw"Edge already in source and/or target incidency list!";return d.source.edges.push(d),d.target.edges.push(d),d}},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 d=[];d=d.concat(u.getEdges());for(var h,f=d.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]=d,u[1]=m,u[2]=f,u[3]=E,!1;if(hf)return u[0]=g,u[1]=h,u[2]=C,u[3]=p,!1;if(df?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(d>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-I===N?f>d?(u[2]=O,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===N&&(f>d?(u[2]=S,u[3]=T,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(d>f?h>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)):h>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=d+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=h+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=d+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=h+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:G=T,U=f+-L/N,u[2]=U,u[3]=G;break;case 2:U=_,G=p+P*N,u[2]=U,u[3]=G;break;case 3:G=E,U=f+L/N,u[2]=U,u[3]=G;break;case 4:U=O,G=p+-P*N,u[2]=U,u[3]=G;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,d){if(d==null)return this.getIntersection2(s,l,u);var h=s.x,f=s.y,p=l.x,g=l.y,m=u.x,v=u.y,y=d.x,b=d.y,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0,C=void 0,O=void 0,E=void 0,_=void 0;return A=g-f,T=h-p,O=p*f-h*g,S=b-v,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*O)/_,w=(S*O-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,d){var h=void 0;return s!==u?(h=Math.atan((d-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 h(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 O=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()},h.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))},h.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;Sh}}]),u}();r.exports=l},function(r,n,i){var a=function(){function l(u,d){for(var h=0;h2&&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=d,this.match_score=h,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=d.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var d=this.listeners[u];d.event===s&&d.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;ud.coolingFactor*d.maxNodeDisplacement&&(this.displacementX=d.coolingFactor*d.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementY=d.coolingFactor*d.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),d.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(d,h){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()),O=this.nodesWithGravity.filter(function(E){return C.has(E)});this.graphManager.setAllNodesToApplyGravitation(O),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 O=!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(O,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var T=this.graphManager.getAllNodes(),C={},O=0;O1){var R;for(R=0;RE&&(E=Math.floor(L.y)),P=Math.floor(L.x+h.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,O){var E=Math.max(this.maxDiagonalInTree(T),h.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(O.x),P.setWorldOrgY(O.y);for(var L=0;L1;){var G=U[0];U.splice(0,1);var H=N.indexOf(G);H>=0&&N.splice(H,1),V--,F--}C!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var j=Math.abs(E-O)/F,q=z;B!=F;q=++q%V){var ne=N[q].getOtherEnd(T);if(ne!=C){var X=(O+B*j)%360,J=(X+j)%360;A.branchRadialLayout(ne,T,X,J,_+P,P),B++}}},A.maxDiagonalInTree=function(T){for(var C=y.MIN_VALUE,O=0;OC&&(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 O=[],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],O=C.id,E=C.paddingLeft,_=C.paddingTop;this.adjustLocations(this.tiledMemberPack[O],C.rect.x,C.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var T=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(O){var E=T.idToDummyNode[O],_=E.paddingLeft,P=E.paddingTop;T.adjustLocations(C[O],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 O=T.getChild();if(O==null)return this.toBeTiled[C]=!1,!1;for(var E=O.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(),O=0,E=0;ED&&(D=I.rect.height)}O+=D+T.verticalPadding}},A.prototype.tileCompoundMembers=function(T,C){var O=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(E){var _=C[E];O.tiledMemberPack[E]=O.tileNodes(T[E],_.paddingLeft+_.paddingRight),_.rect.width=O.tiledMemberPack[E].width,_.rect.height=O.tiledMemberPack[E].height})},A.prototype.tileNodes=function(T,C){var O=h.TILING_PADDING_VERTICAL,E=h.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,verticalPadding:O,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[O]=L,T.width0&&(R+=T.verticalPadding);var D=0;R>T.rowHeight[O]&&(D=T.rowHeight[O],T.rowHeight[O]=R,D=T.rowHeight[O]-D),T.height+=D,T.rows[O].push(C)},A.prototype.getShortestRowIndex=function(T){for(var C=-1,O=Number.MAX_VALUE,E=0;EO&&(C=E,O=T.rowWidth[E]);return C},A.prototype.canAddHorizontal=function(T,C,O){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=O+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=O+T.verticalPadding;var R;return T.widthP&&C!=O){E.splice(-1,1),T.rows[O].push(_),T.rowWidth[C]=T.rowWidth[C]-P,T.rowWidth[O]=T.rowWidth[O]+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[O];T.rowHeight[C]=L,T.rowHeight[O]<_.height+T.verticalPadding&&(T.rowHeight[O]=_.height+T.verticalPadding);var M=T.rowHeight[C]+T.rowHeight[O];T.height+=M-D,this.shiftToLastRow(T)}},A.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var T=[],C=!0,O;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,G=0;G0){var R;R=w.getGraphManager().add(w.newGraph(),O),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}])})})(OUt);var W9n=OUt.exports;const Y9n=Ad(W9n);iv.use(Y9n);function RUt(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}})})}k(RUt,"addNodes");function DUt(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})})}k(DUt,"addEdges");function LUt(t){return new Promise(e=>{const r=_t("body").append("div").attr("id","cy").attr("style","display:none"),n=iv({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),RUt(t.nodes,n),DUt(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)})})}k(LUt,"createCytoscapeInstance");function MUt(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})}k(MUt,"extractPositionedNodes");function IUt(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})}k(IUt,"extractPositionedEdges");async function PUt(t,e){ye.debug("Starting cose-bilkent layout algorithm");try{NUt(t);const r=await LUt(t),n=MUt(r),i=IUt(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}}k(PUt,"executeCoseBilkentLayout");function NUt(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}k(NUt,"validateLayoutData");var q9n=k(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:l},{algorithm:u})=>{const d={},h={},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};h[x.id]=w,d[x.id]=w,await r(p,x)}else{const w={...x};d[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=d[x.id];return{...x,width:w.width,height:w.height}})},b=await PUt(y,t.config);s.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{const w=d[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=d[x.start??""],A=d[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,h,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,h,t.type,w,A,t.diagramId);l(T,C)}}})),s.debug("Cose-bilkent rendering completed")},"render"),j9n=q9n;const X9n=Object.freeze(Object.defineProperty({__proto__:null,render:j9n},Symbol.toStringTag,{value:"Module"}));var Mte=k((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"),BUt=k((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"};Mte(t,r).lower()},"drawBackgroundRect"),K9n=k((t,e)=>{const r=e.text.replace(uR," "),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"),A_e=k((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=iC(n);i.attr("xlink:href",a)},"drawImage"),S_e=k((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=iC(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),mf=k(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),T_e=k(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),C_e=k(()=>{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"),Ite=function(){var t=k(function(we,ke,Be,Z){for(Be=Be||{},Z=we.length;Z--;Be[we[Z]]=ke);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],d=[1,67],h=[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],O=[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],G=[1,57],H=[1,58],j=[1,59],q=[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],Oe=[12,14,33,42],Ee=[12,14,33,42,76,77,79,80],ue=[12,33],he=[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:k(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:k(function(ke,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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q}),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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q}),t(J,[2,21]),t(J,[2,22]),t(Ce,[2,39]),t(Oe,[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(Oe,[2,72]),t(Ee,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[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:k(function(ke,Be){if(Be.recoverable)this.trace(ke);else{var Z=new Error(ke);throw Z.hash=Be,Z}},"parseError"),parse:k(function(ke){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(ke,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}k(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}k(He,"lex");for(var et,Pe,yt,Ie,St={},Ot,ut,Qt,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(Ot in K[Pe])this.terminals_[Ot]&&Ot>ve&&It.push("'"+this.terminals_[Ot]+"'");Le.showPosition?gt="Parse error on line "+(me+1)+`: + `),s=r9n(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]:O9.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===Rte.IGNORE)return;if(l==Rte.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),d=nh(u),h;try{for(d.s();!(h=d.n()).done;){var f=h.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(_){d.e(_)}finally{d.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,d=a.tex2,h=u.w/(u.w+d.w);o||(h=1-h);var f=this._getAdjustedBB(l,s,o,h);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;lUt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),d=u.x,h=u.y;_te(r,r,[d,h]),cUt(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;_te(r,r,[o,s]),d_e(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,d=r.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var h=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(h=l-f,o+=h,l=f),{x1:o,y1:s,w:l,h:u,xOffset:h,yOffset:d}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=w3;var s=this.indexBuffer.getView(o);x3(n,s);var l=this.colorBuffer.getView(o);sk([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===Dte||s===E9){var u=a.getBoundingBox(r),d=this._getCornerRadius(r,o.radius,u),h=this.cornerRadiusBuffer.getView(l);h[0]=d,h[1]=d,h[2]=d,h[3]=d,s===E9&&(h[0]=0,h[2]=0)}var f=this.indexBuffer.getView(l);x3(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);sk(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);sk(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 w3;case"ellipse":return _9;case"roundrectangle":case"round-rectangle":return Dte;case"bottom-round-rectangle":return E9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,o=i.h;if(r.pstyle(n).value==="auto")return d2(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 d=r.pstyle(i+"-arrow-color").value,h=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=h*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);lUt(b),_te(b,b,[o,s]),d_e(b,b,[v,v]),cUt(b,b,l),this.vertTypeBuffer.getView(y)[0]=f_e;var x=this.indexBuffer.getView(y);x3(n,x);var w=this.colorBuffer.getView(y);sk(d,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 d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=uUt;var h=this.indexBuffer.getView(d);x3(n,h);var f=this.colorBuffer.getView(d);sk(l,u,f);var p=this.lineWidthBuffer.getView(d);p[0]=s;var g=this.pointAPointBBuffer.getView(d);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(h){var f=h.pstyle("text-events").strValue==="yes";return f?Rte.USE_BB:Rte.IGNORE},l=function(h){var f=h.position(),p=f.x,g=f.y,m=h.outerWidth(),v=h.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:o9n,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:p_e(e.getLabelKey,null),getBoundingBox:g_e(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:p_e(e.getSourceLabelKey,"source"),getBoundingBox:g_e(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:p_e(e.getTargetLabelKey,"target"),getBoundingBox:g_e(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=t9(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(d,h){var f=!1;h&&h.length>0&&(f|=r.drawing.invalidate(h)),f&&u()}),O9n(r)};function k9n(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return g$t(r)}function fUt(t,e){var r=t._private.rscratch;return td(r,"labelWrapCachedLines",e)||[]}var p_e=function(e,r){return function(n){var i=e(n),a=fUt(n,r);return a.length>1?a.map(function(o,s){return"".concat(i,"_").concat(s)}):i}},g_e=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=fUt(n,r),u=a.h/l.length,d=u*s,h=a.y1+d;return{x1:a.x1,w:a.w,y1:h,h:u,yOffset:d}}}return a}};function O9n(t){{var e=t.render;t.render=function(a){a=a||{};var o=t.cy;t.webgl&&(o.zoom()>Yzt?(E9n(t),e.call(t,a)):(_9n(t),gUt(t,a,O9.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 P9n(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 E9n(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function _9n(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 R9n(t){var e=t.canvasWidth,r=t.canvasHeight,n=c_e(t),i=n.pan,a=n.zoom,o=u_e();_te(o,o,[i.x,i.y]),d_e(o,o,[a,a]);var s=u_e();g9n(s,e,r);var l=u_e();return p9n(l,s,o),l}function pUt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=c_e(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 D9n(t,e){t.drawSelectionRectangle(e,function(r){return pUt(t,r)})}function L9n(t){var e=t.data.contexts[t.NODE];e.save(),pUt(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 M9n(t){var e=function(i,a,o){for(var s=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=s.atlases,d=0;d=0&&w.add(T)}return w}function P9n(t,e,r){var n=I9n(t,e,r),i=t.getCachedZSortedEles(),a,o,s=nh(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,d=i[u];if(!a&&d.isNode()&&(a=d),!o&&d.isEdge()&&(o=d),a&&o)break}}catch(h){s.e(h)}finally{s.f()}return[a,o].filter(Boolean)}function m_e(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 gUt(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]&&D9n(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=R9n(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 N9n(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":fl(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},[Zzt,rv,K1,l_e,ok,x2,id,hUt,w2,R9,wUt].forEach(function(t){ln(ni,t)});var F9n=[{name:"null",impl:Tzt},{name:"base",impl:Qzt},{name:"canvas",impl:B9n}],z9n=[{type:"layout",extensions:cFn},{type:"renderer",extensions:F9n}],SUt={},TUt={};function CUt(t,e,r){var n=r,i=function(C){oa("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(x9.prototype[e])return i(e);x9.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),$i(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))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.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 d(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h},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),d=i(1),h=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,O,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),d=this.add(l,u);return this.setRootGraph(d),this.rootGraph},s.prototype.add=function(l,u,d,h,f){if(d==null&&h==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=d,h=u,d=l;var p=h.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 d.isInterGraph=!1,p.add(d,h,f);if(d.isInterGraph=!0,d.source=h,d.target=f,this.edges.indexOf(d)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(d),!(d.source!=null&&d.target!=null))throw"Edge source and/or target is null!";if(!(d.source.edges.indexOf(d)==-1&&d.target.edges.indexOf(d)==-1))throw"Edge already in source and/or target incidency list!";return d.source.edges.push(d),d.target.edges.push(d),d}},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 d=[];d=d.concat(u.getEdges());for(var h,f=d.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]=d,u[1]=m,u[2]=f,u[3]=E,!1;if(hf)return u[0]=g,u[1]=h,u[2]=C,u[3]=p,!1;if(df?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(d>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-I===N?f>d?(u[2]=O,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===N&&(f>d?(u[2]=S,u[3]=T,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(d>f?h>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)):h>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=d+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=h+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=d+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=h+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:G=T,U=f+-L/N,u[2]=U,u[3]=G;break;case 2:U=_,G=p+P*N,u[2]=U,u[3]=G;break;case 3:G=E,U=f+L/N,u[2]=U,u[3]=G;break;case 4:U=O,G=p+-P*N,u[2]=U,u[3]=G;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,d){if(d==null)return this.getIntersection2(s,l,u);var h=s.x,f=s.y,p=l.x,g=l.y,m=u.x,v=u.y,y=d.x,b=d.y,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0,C=void 0,O=void 0,E=void 0,_=void 0;return A=g-f,T=h-p,O=p*f-h*g,S=b-v,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*O)/_,w=(S*O-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,d){var h=void 0;return s!==u?(h=Math.atan((d-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 h(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 O=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()},h.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))},h.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;Sh}}]),u}();r.exports=l},function(r,n,i){var a=function(){function l(u,d){for(var h=0;h2&&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=d,this.match_score=h,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=d.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var d=this.listeners[u];d.event===s&&d.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;ud.coolingFactor*d.maxNodeDisplacement&&(this.displacementX=d.coolingFactor*d.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementY=d.coolingFactor*d.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),d.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(d,h){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()),O=this.nodesWithGravity.filter(function(E){return C.has(E)});this.graphManager.setAllNodesToApplyGravitation(O),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 O=!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(O,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var T=this.graphManager.getAllNodes(),C={},O=0;O1){var R;for(R=0;RE&&(E=Math.floor(L.y)),P=Math.floor(L.x+h.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,O){var E=Math.max(this.maxDiagonalInTree(T),h.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(O.x),P.setWorldOrgY(O.y);for(var L=0;L1;){var G=U[0];U.splice(0,1);var H=N.indexOf(G);H>=0&&N.splice(H,1),V--,F--}C!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var j=Math.abs(E-O)/F,q=z;B!=F;q=++q%V){var ne=N[q].getOtherEnd(T);if(ne!=C){var X=(O+B*j)%360,J=(X+j)%360;A.branchRadialLayout(ne,T,X,J,_+P,P),B++}}},A.maxDiagonalInTree=function(T){for(var C=y.MIN_VALUE,O=0;OC&&(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 O=[],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],O=C.id,E=C.paddingLeft,_=C.paddingTop;this.adjustLocations(this.tiledMemberPack[O],C.rect.x,C.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var T=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(O){var E=T.idToDummyNode[O],_=E.paddingLeft,P=E.paddingTop;T.adjustLocations(C[O],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 O=T.getChild();if(O==null)return this.toBeTiled[C]=!1,!1;for(var E=O.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(),O=0,E=0;ED&&(D=I.rect.height)}O+=D+T.verticalPadding}},A.prototype.tileCompoundMembers=function(T,C){var O=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(E){var _=C[E];O.tiledMemberPack[E]=O.tileNodes(T[E],_.paddingLeft+_.paddingRight),_.rect.width=O.tiledMemberPack[E].width,_.rect.height=O.tiledMemberPack[E].height})},A.prototype.tileNodes=function(T,C){var O=h.TILING_PADDING_VERTICAL,E=h.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,verticalPadding:O,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[O]=L,T.width0&&(R+=T.verticalPadding);var D=0;R>T.rowHeight[O]&&(D=T.rowHeight[O],T.rowHeight[O]=R,D=T.rowHeight[O]-D),T.height+=D,T.rows[O].push(C)},A.prototype.getShortestRowIndex=function(T){for(var C=-1,O=Number.MAX_VALUE,E=0;EO&&(C=E,O=T.rowWidth[E]);return C},A.prototype.canAddHorizontal=function(T,C,O){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=O+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=O+T.verticalPadding;var R;return T.widthP&&C!=O){E.splice(-1,1),T.rows[O].push(_),T.rowWidth[C]=T.rowWidth[C]-P,T.rowWidth[O]=T.rowWidth[O]+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[O];T.rowHeight[C]=L,T.rowHeight[O]<_.height+T.verticalPadding&&(T.rowHeight[O]=_.height+T.verticalPadding);var M=T.rowHeight[C]+T.rowHeight[O];T.height+=M-D,this.shiftToLastRow(T)}},A.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var T=[],C=!0,O;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,G=0;G0){var R;R=w.getGraphManager().add(w.newGraph(),O),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}])})})(OUt);var W9n=OUt.exports;const Y9n=Ad(W9n);iv.use(Y9n);function RUt(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}})})}k(RUt,"addNodes");function DUt(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})})}k(DUt,"addEdges");function LUt(t){return new Promise(e=>{const r=_t("body").append("div").attr("id","cy").attr("style","display:none"),n=iv({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),RUt(t.nodes,n),DUt(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)})})}k(LUt,"createCytoscapeInstance");function MUt(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})}k(MUt,"extractPositionedNodes");function IUt(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})}k(IUt,"extractPositionedEdges");async function PUt(t,e){ye.debug("Starting cose-bilkent layout algorithm");try{NUt(t);const r=await LUt(t),n=MUt(r),i=IUt(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}}k(PUt,"executeCoseBilkentLayout");function NUt(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}k(NUt,"validateLayoutData");var q9n=k(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:l},{algorithm:u})=>{const d={},h={},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};h[x.id]=w,d[x.id]=w,await r(p,x)}else{const w={...x};d[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=d[x.id];return{...x,width:w.width,height:w.height}})},b=await PUt(y,t.config);s.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{const w=d[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=d[x.start??""],A=d[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,h,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,h,t.type,w,A,t.diagramId);l(T,C)}}})),s.debug("Cose-bilkent rendering completed")},"render"),j9n=q9n;const X9n=Object.freeze(Object.defineProperty({__proto__:null,render:j9n},Symbol.toStringTag,{value:"Module"}));var Mte=k((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"),BUt=k((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"};Mte(t,r).lower()},"drawBackgroundRect"),K9n=k((t,e)=>{const r=e.text.replace(u5," "),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"),A_e=k((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=iC(n);i.attr("xlink:href",a)},"drawImage"),S_e=k((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=iC(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),mf=k(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),T_e=k(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),C_e=k(()=>{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"),Ite=function(){var t=k(function(we,ke,Be,Z){for(Be=Be||{},Z=we.length;Z--;Be[we[Z]]=ke);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],d=[1,67],h=[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],O=[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],G=[1,57],H=[1,58],j=[1,59],q=[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],Oe=[12,14,33,42],Ee=[12,14,33,42,76,77,79,80],ue=[12,33],he=[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:k(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:k(function(ke,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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q}),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:d,40:h,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:O,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:G,72:H,73:j,74:q},{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:d,40:h,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:O,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:G,72:H,73:j,74:q}),t(J,[2,21]),t(J,[2,22]),t(Ce,[2,39]),t(Oe,[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(Oe,[2,72]),t(Ee,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[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:k(function(ke,Be){if(Be.recoverable)this.trace(ke);else{var Z=new Error(ke);throw Z.hash=Be,Z}},"parseError"),parse:k(function(ke){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(ke,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}k(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}k(He,"lex");for(var et,Pe,yt,Ie,St={},Ot,ut,Qt,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(Ot in K[Pe])this.terminals_[Ot]&&Ot>ve&&It.push("'"+this.terminals_[Ot]+"'");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._$),Qt=K[Z[Z.length-2]][Z[Z.length-1]],Z.push(Qt);break;case 3:return!0}}return!0},"parse")},ge=function(){var we={EOF:1,parseError:k(function(Be,Z){if(this.yy.parser)this.yy.parser.parseError(Be,Z);else throw new Error(Be)},"parseError"),setInput:k(function(ke,Be){return this.yy=Be||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:k(function(){var ke=this._input[0];this.yytext+=ke,this.yyleng++,this.offset++,this.match+=ke,this.matched+=ke;var Be=ke.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),ke},"input"),unput:k(function(ke){var Be=ke.length,Z=ke.split(/(?:\r\n?|\n)/g);this._input=ke+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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(ke){this.unput(this.match.slice(ke))},"less"),pastInput:k(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:k(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:k(function(){var ke=this.pastInput(),Be=new Array(ke.length+1).join("-");return ke+this.upcomingInput()+` @@ -1361,11 +1361,11 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[et]||et)+"'":gt="Parse erro `)?m=l+` `:m=`{ `+l+` -}`,u=zX(m,{schema:FX})}const d=this.edges.find(m=>m.id===e);if(d){const m=u;(m==null?void 0:m.animate)!==void 0&&(d.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(d.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(d.interpolate=m.curve);return}let h,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:qzn+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ye(),h=this.sanitizeText(r.text.trim()),f.labelType=r.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),f.text=h):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(!HEt(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(d=>d.start===s.start&&d.end===s.end);u.length===0?s.id=RR(s.start,s.end,{counter:0,prefix:"L"}):s.id=RR(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=zX(m,{schema:FX})}const d=this.edges.find(m=>m.id===e);if(d){const m=u;(m==null?void 0:m.animate)!==void 0&&(d.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(d.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(d.interpolate=m.curve);return}let h,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:qzn+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ye(),h=this.sanitizeText(r.text.trim()),f.labelType=r.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),f.text=h):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(!HEt(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(d=>d.start===s.start&&d.end===s.end);u.length===0?s.id=R5(s.start,s.end,{counter:0,prefix:"L"}):s.id=R5(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(d=>d==null?void 0:d.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=C_e();_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(Xy.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=k(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,d=u!==void 0,h=Ye().flowchart??{},f=u??(h.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 d;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 h={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:s,padding:((d=a.flowchart)==null?void 0:d.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({...h,isGroup:!0,shape:"rect"}):r.push({...h,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 d=i[u];d.nodes.length>0&&o.set(d.id,!0);for(const h of d.nodes)a.set(h,d.id)}for(let u=i.length-1;u>=0;u--){const d=i[u];r.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:a.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir==="TD"?"TB":d.dir,explicitDir:d.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,d)=>{var m;const{arrowTypeStart:h,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:RR(u.start,u.end,{counter:d,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":h,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 F2t.flowchart}},k(uL,"FlowDB"),uL),Xzn=k(function(t,e){return e.db.getClasses()},"getClasses"),Kzn=k(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=S3(e,a),d=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=b$(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=d,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 BR(l,u,i);const h=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;un.insertTitle(u,"flowchartTitleText",(o==null?void 0:o.titleTopMargin)||0,n.db.getDiagramTitle()),ck(u,h,"flowchart",(o==null?void 0:o.useMaxWidth)||!1)},"draw"),Zzn={getClasses:Xzn,draw:Kzn},M_e=function(){var t=k(function(Mn,Rt,kt,Vt){for(kt=kt||{},Vt=Mn.length;Vt--;kt[Mn[Vt]]=Rt);return kt},"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],d=[1,23],h=[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],O=[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],G=[8,9,11,75,77,78],H=[1,79],j=[1,92],q=[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],Oe=[1,90],Ee=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],he=[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],ke=[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],Ot=[1,155],ut=[1,157],Qt=[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],hr=[1,246],jr=[1,250],Ir=[1,244],Zr=[1,245],Ur=[1,247],On=[1,249],$r=[1,251],hn=[1,269],ii=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],Ct={trace:k(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:k(function(Rt,kt,Vt,mt,Tr,Fe,ra){var Ge=Fe.length-1;switch(Tr){case 2:this.$=[];break;case 3:(!Array.isArray(Fe[Ge])||Fe[Ge].length>0)&&Fe[Ge-1].push(Fe[Ge]),this.$=Fe[Ge-1];break;case 4:case 183:this.$=Fe[Ge];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Fe[Ge-1]),this.$=Fe[Ge-1];break;case 27:this.$=Fe[Ge-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Fe[Ge-6],Fe[Ge-1],Fe[Ge-4]);break;case 34:this.$=mt.addSubGraph(Fe[Ge-3],Fe[Ge-1],Fe[Ge-3]);break;case 35:this.$=mt.addSubGraph(void 0,Fe[Ge-1],void 0);break;case 37:this.$=Fe[Ge].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Fe[Ge].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Fe[Ge-1]+Fe[Ge];break;case 44:this.$=Fe[Ge];break;case 45:mt.addVertex(Fe[Ge-1][Fe[Ge-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge]),mt.addLink(Fe[Ge-3].stmt,Fe[Ge-1],Fe[Ge-2]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1].concat(Fe[Ge-3].nodes)};break;case 46:mt.addLink(Fe[Ge-2].stmt,Fe[Ge],Fe[Ge-1]),this.$={stmt:Fe[Ge],nodes:Fe[Ge].concat(Fe[Ge-2].nodes)};break;case 47:mt.addLink(Fe[Ge-3].stmt,Fe[Ge-1],Fe[Ge-2]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1].concat(Fe[Ge-3].nodes)};break;case 48:this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1]};break;case 49:mt.addVertex(Fe[Ge-1][Fe[Ge-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1],shapeData:Fe[Ge]};break;case 50:this.$={stmt:Fe[Ge],nodes:Fe[Ge]};break;case 51:this.$=[Fe[Ge]];break;case 52:mt.addVertex(Fe[Ge-5][Fe[Ge-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge-4]),this.$=Fe[Ge-5].concat(Fe[Ge]);break;case 53:this.$=Fe[Ge-4].concat(Fe[Ge]);break;case 54:this.$=Fe[Ge];break;case 55:this.$=Fe[Ge-2],mt.setClass(Fe[Ge-2],Fe[Ge]);break;case 56:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"square");break;case 57:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"doublecircle");break;case 58:this.$=Fe[Ge-5],mt.addVertex(Fe[Ge-5],Fe[Ge-2],"circle");break;case 59:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"ellipse");break;case 60:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"stadium");break;case 61:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"subroutine");break;case 62:this.$=Fe[Ge-7],mt.addVertex(Fe[Ge-7],Fe[Ge-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Fe[Ge-5],Fe[Ge-3]]]));break;case 63:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"cylinder");break;case 64:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"round");break;case 65:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"diamond");break;case 66:this.$=Fe[Ge-5],mt.addVertex(Fe[Ge-5],Fe[Ge-2],"hexagon");break;case 67:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"odd");break;case 68:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"trapezoid");break;case 69:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"inv_trapezoid");break;case 70:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"lean_right");break;case 71:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"lean_left");break;case 72:this.$=Fe[Ge],mt.addVertex(Fe[Ge]);break;case 73:Fe[Ge-1].text=Fe[Ge],this.$=Fe[Ge-1];break;case 74:case 75:Fe[Ge-2].text=Fe[Ge-1],this.$=Fe[Ge-2];break;case 76:this.$=Fe[Ge];break;case 77:var In=mt.destructLink(Fe[Ge],Fe[Ge-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Ge-1]};break;case 78:var In=mt.destructLink(Fe[Ge],Fe[Ge-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Ge-1],id:Fe[Ge-3]};break;case 79:this.$={text:Fe[Ge],type:"text"};break;case 80:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 81:this.$={text:Fe[Ge],type:"string"};break;case 82:this.$={text:Fe[Ge],type:"markdown"};break;case 83:var In=mt.destructLink(Fe[Ge]);this.$={type:In.type,stroke:In.stroke,length:In.length};break;case 84:var In=mt.destructLink(Fe[Ge]);this.$={type:In.type,stroke:In.stroke,length:In.length,id:Fe[Ge-1]};break;case 85:this.$=Fe[Ge-1];break;case 86:this.$={text:Fe[Ge],type:"text"};break;case 87:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 88:this.$={text:Fe[Ge],type:"string"};break;case 89:case 104:this.$={text:Fe[Ge],type:"markdown"};break;case 101:this.$={text:Fe[Ge],type:"text"};break;case 102:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 103:this.$={text:Fe[Ge],type:"text"};break;case 105:this.$=Fe[Ge-4],mt.addClass(Fe[Ge-2],Fe[Ge]);break;case 106:this.$=Fe[Ge-4],mt.setClass(Fe[Ge-2],Fe[Ge]);break;case 107:case 115:this.$=Fe[Ge-1],mt.setClickEvent(Fe[Ge-1],Fe[Ge]);break;case 108:case 116:this.$=Fe[Ge-3],mt.setClickEvent(Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-3],Fe[Ge]);break;case 109:this.$=Fe[Ge-2],mt.setClickEvent(Fe[Ge-2],Fe[Ge-1],Fe[Ge]);break;case 110:this.$=Fe[Ge-4],mt.setClickEvent(Fe[Ge-4],Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-4],Fe[Ge]);break;case 111:this.$=Fe[Ge-2],mt.setLink(Fe[Ge-2],Fe[Ge]);break;case 112:this.$=Fe[Ge-4],mt.setLink(Fe[Ge-4],Fe[Ge-2]),mt.setTooltip(Fe[Ge-4],Fe[Ge]);break;case 113:this.$=Fe[Ge-4],mt.setLink(Fe[Ge-4],Fe[Ge-2],Fe[Ge]);break;case 114:this.$=Fe[Ge-6],mt.setLink(Fe[Ge-6],Fe[Ge-4],Fe[Ge]),mt.setTooltip(Fe[Ge-6],Fe[Ge-2]);break;case 117:this.$=Fe[Ge-1],mt.setLink(Fe[Ge-1],Fe[Ge]);break;case 118:this.$=Fe[Ge-3],mt.setLink(Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-3],Fe[Ge]);break;case 119:this.$=Fe[Ge-3],mt.setLink(Fe[Ge-3],Fe[Ge-2],Fe[Ge]);break;case 120:this.$=Fe[Ge-5],mt.setLink(Fe[Ge-5],Fe[Ge-4],Fe[Ge]),mt.setTooltip(Fe[Ge-5],Fe[Ge-2]);break;case 121:this.$=Fe[Ge-4],mt.addVertex(Fe[Ge-2],void 0,void 0,Fe[Ge]);break;case 122:this.$=Fe[Ge-4],mt.updateLink([Fe[Ge-2]],Fe[Ge]);break;case 123:this.$=Fe[Ge-4],mt.updateLink(Fe[Ge-2],Fe[Ge]);break;case 124:this.$=Fe[Ge-8],mt.updateLinkInterpolate([Fe[Ge-6]],Fe[Ge-2]),mt.updateLink([Fe[Ge-6]],Fe[Ge]);break;case 125:this.$=Fe[Ge-8],mt.updateLinkInterpolate(Fe[Ge-6],Fe[Ge-2]),mt.updateLink(Fe[Ge-6],Fe[Ge]);break;case 126:this.$=Fe[Ge-6],mt.updateLinkInterpolate([Fe[Ge-4]],Fe[Ge]);break;case 127:this.$=Fe[Ge-6],mt.updateLinkInterpolate(Fe[Ge-4],Fe[Ge]);break;case 128:case 130:this.$=[Fe[Ge]];break;case 129:case 131:Fe[Ge-2].push(Fe[Ge]),this.$=Fe[Ge-2];break;case 133:this.$=Fe[Ge-1]+Fe[Ge];break;case 181:this.$=Fe[Ge];break;case 182:this.$=Fe[Ge-1]+""+Fe[Ge];break;case 184:this.$=Fe[Ge-1]+""+Fe[Ge];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:d,33:24,34:h,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:O,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(G,[2,50],{18:77,39:78,10:F,40:H}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:j,44:q,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:Oe,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:O,111:E,114:_,115:P,116:L}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[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:O,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:ke,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(G,[2,48],{44:Ot}),t(G,[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:O,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:O,111:E,113:42,114:_,115:P,116:L},{44:g,47:163,60:m,89:A,102:S,105:T,106:C,109:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Qt,[2,115],{120:168,10:[1,167],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[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:O,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(he,[2,182]),t(i,[2,20]),t(xe,[2,25]),t(G,[2,46],{39:192,18:193,10:F,40:H}),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:ke,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:ke,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:d,32:[1,203],33:24,34:h,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:O,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:O,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:O,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:O,111:E,113:113,114:_,115:P,116:L},{80:[1,212]},t(Qt,[2,109],{10:[1,213]}),t(Qt,[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:O,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(G,[2,45],{18:156,10:F,40:ut}),t(G,[2,47],{44:Ot}),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:ke,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:O,111:E,113:42,114:_,115:P,116:L},{10:F,18:240},{10:Tt,60:hr,84:jr,92:241,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:252,104:[1,253],105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:254,104:[1,255],105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{105:[1,256]},{10:Tt,60:hr,84:jr,92:257,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{44:g,47:258,60:m,89:A,102:S,105:T,106:C,109:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Qt,[2,116]),t(Qt,[2,118],{10:[1,262]}),t(Qt,[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:d,32:[1,267],33:24,34:h,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:O,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:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,121],{106:hn}),t(ii,[2,130],{108:270,10:Tt,60:hr,84:jr,105:Ir,109:Zr,110:Ur,111:On,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(Qt,[2,122],{106:hn}),{10:[1,271]},t(Qt,[2,123],{106:hn}),{10:[1,272]},t(at,[2,129]),t(Qt,[2,105],{106:hn}),t(Qt,[2,106],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:O,111:E,114:_,115:P,116:L}),t(Qt,[2,110]),t(Qt,[2,112],{10:[1,273]}),t(Qt,[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:hr,84:jr,105:Ir,107:279,108:243,109:Zr,110:Ur,111:On,112:$r},t(pt,[2,133]),{14:j,44:q,60:ne,89:X,101:280,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe,120:88},{14:j,44:q,60:ne,89:X,101:281,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe,120:88},{98:[1,282]},t(Qt,[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:hr,84:jr,105:Ir,109:Zr,110:Ur,111:On,112:$r}),t(Qt,[2,126],{120:168,10:[1,285],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[2,127],{120:168,10:[1,286],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[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:d,32:[1,288],33:24,34:h,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:O,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:Tt,60:hr,84:jr,92:289,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:290,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},t(ue,[2,62]),t(B,[2,33]),t(Qt,[2,124],{106:hn}),t(Qt,[2,125],{106:hn})],defaultActions:{},parseError:k(function(Rt,kt){if(kt.recoverable)this.trace(Rt);else{var Vt=new Error(Rt);throw Vt.hash=kt,Vt}},"parseError"),parse:k(function(Rt){var kt=this,Vt=[0],mt=[],Tr=[null],Fe=[],ra=this.table,Ge="",In=0,di=0,Bo=2,Qn=1,fa=Fe.slice.call(arguments,1),hi=Object.create(this.lexer),yu={yy:{}};for(var cm in this.yy)Object.prototype.hasOwnProperty.call(this.yy,cm)&&(yu.yy[cm]=this.yy[cm]);hi.setInput(Rt,yu.yy),yu.yy.lexer=hi,yu.yy.parser=this,typeof hi.yylloc>"u"&&(hi.yylloc={});var Ev=hi.yylloc;Fe.push(Ev);var _O=hi.options&&hi.options.ranges;typeof yu.yy.parseError=="function"?this.parseError=yu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function RO(ar){Vt.length=Vt.length-2*ar,Tr.length=Tr.length-ar,Fe.length=Fe.length-ar}k(RO,"popStack");function DO(){var ar;return ar=mt.pop()||hi.lex()||Qn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=kt.symbols_[ar]||ar),ar}k(DO,"lex");for(var wl,mh,Fc,Js,Of={},K2,Ht,Ve,ot;;){if(mh=Vt[Vt.length-1],this.defaultActions[mh]?Fc=this.defaultActions[mh]:((wl===null||typeof wl>"u")&&(wl=DO()),Fc=ra[mh]&&ra[mh][wl]),typeof Fc>"u"||!Fc.length||!Fc[0]){var Nt="";ot=[];for(K2 in ra[mh])this.terminals_[K2]&&K2>Bo&&ot.push("'"+this.terminals_[K2]+"'");hi.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(d=>d==null?void 0:d.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=C_e();_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(Xy.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=k(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,d=u!==void 0,h=Ye().flowchart??{},f=u??(h.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 d;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 h={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:s,padding:((d=a.flowchart)==null?void 0:d.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({...h,isGroup:!0,shape:"rect"}):r.push({...h,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 d=i[u];d.nodes.length>0&&o.set(d.id,!0);for(const h of d.nodes)a.set(h,d.id)}for(let u=i.length-1;u>=0;u--){const d=i[u];r.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:a.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir==="TD"?"TB":d.dir,explicitDir:d.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,d)=>{var m;const{arrowTypeStart:h,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:R5(u.start,u.end,{counter:d,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":h,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 F2t.flowchart}},k(uL,"FlowDB"),uL),Xzn=k(function(t,e){return e.db.getClasses()},"getClasses"),Kzn=k(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=S3(e,a),d=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=b$(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=d,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 B5(l,u,i);const h=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;un.insertTitle(u,"flowchartTitleText",(o==null?void 0:o.titleTopMargin)||0,n.db.getDiagramTitle()),ck(u,h,"flowchart",(o==null?void 0:o.useMaxWidth)||!1)},"draw"),Zzn={getClasses:Xzn,draw:Kzn},M_e=function(){var t=k(function(Mn,Rt,kt,Vt){for(kt=kt||{},Vt=Mn.length;Vt--;kt[Mn[Vt]]=Rt);return kt},"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],d=[1,23],h=[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],O=[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],G=[8,9,11,75,77,78],H=[1,79],j=[1,92],q=[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],Oe=[1,90],Ee=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],he=[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],ke=[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],Ot=[1,155],ut=[1,157],Qt=[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],hr=[1,246],jr=[1,250],Ir=[1,244],Zr=[1,245],Ur=[1,247],On=[1,249],$r=[1,251],hn=[1,269],ii=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],Ct={trace:k(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:k(function(Rt,kt,Vt,mt,Tr,Fe,ra){var Ge=Fe.length-1;switch(Tr){case 2:this.$=[];break;case 3:(!Array.isArray(Fe[Ge])||Fe[Ge].length>0)&&Fe[Ge-1].push(Fe[Ge]),this.$=Fe[Ge-1];break;case 4:case 183:this.$=Fe[Ge];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Fe[Ge-1]),this.$=Fe[Ge-1];break;case 27:this.$=Fe[Ge-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Fe[Ge-6],Fe[Ge-1],Fe[Ge-4]);break;case 34:this.$=mt.addSubGraph(Fe[Ge-3],Fe[Ge-1],Fe[Ge-3]);break;case 35:this.$=mt.addSubGraph(void 0,Fe[Ge-1],void 0);break;case 37:this.$=Fe[Ge].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Fe[Ge].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Fe[Ge-1]+Fe[Ge];break;case 44:this.$=Fe[Ge];break;case 45:mt.addVertex(Fe[Ge-1][Fe[Ge-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge]),mt.addLink(Fe[Ge-3].stmt,Fe[Ge-1],Fe[Ge-2]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1].concat(Fe[Ge-3].nodes)};break;case 46:mt.addLink(Fe[Ge-2].stmt,Fe[Ge],Fe[Ge-1]),this.$={stmt:Fe[Ge],nodes:Fe[Ge].concat(Fe[Ge-2].nodes)};break;case 47:mt.addLink(Fe[Ge-3].stmt,Fe[Ge-1],Fe[Ge-2]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1].concat(Fe[Ge-3].nodes)};break;case 48:this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1]};break;case 49:mt.addVertex(Fe[Ge-1][Fe[Ge-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge]),this.$={stmt:Fe[Ge-1],nodes:Fe[Ge-1],shapeData:Fe[Ge]};break;case 50:this.$={stmt:Fe[Ge],nodes:Fe[Ge]};break;case 51:this.$=[Fe[Ge]];break;case 52:mt.addVertex(Fe[Ge-5][Fe[Ge-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Ge-4]),this.$=Fe[Ge-5].concat(Fe[Ge]);break;case 53:this.$=Fe[Ge-4].concat(Fe[Ge]);break;case 54:this.$=Fe[Ge];break;case 55:this.$=Fe[Ge-2],mt.setClass(Fe[Ge-2],Fe[Ge]);break;case 56:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"square");break;case 57:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"doublecircle");break;case 58:this.$=Fe[Ge-5],mt.addVertex(Fe[Ge-5],Fe[Ge-2],"circle");break;case 59:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"ellipse");break;case 60:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"stadium");break;case 61:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"subroutine");break;case 62:this.$=Fe[Ge-7],mt.addVertex(Fe[Ge-7],Fe[Ge-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Fe[Ge-5],Fe[Ge-3]]]));break;case 63:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"cylinder");break;case 64:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"round");break;case 65:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"diamond");break;case 66:this.$=Fe[Ge-5],mt.addVertex(Fe[Ge-5],Fe[Ge-2],"hexagon");break;case 67:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"odd");break;case 68:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"trapezoid");break;case 69:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"inv_trapezoid");break;case 70:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"lean_right");break;case 71:this.$=Fe[Ge-3],mt.addVertex(Fe[Ge-3],Fe[Ge-1],"lean_left");break;case 72:this.$=Fe[Ge],mt.addVertex(Fe[Ge]);break;case 73:Fe[Ge-1].text=Fe[Ge],this.$=Fe[Ge-1];break;case 74:case 75:Fe[Ge-2].text=Fe[Ge-1],this.$=Fe[Ge-2];break;case 76:this.$=Fe[Ge];break;case 77:var In=mt.destructLink(Fe[Ge],Fe[Ge-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Ge-1]};break;case 78:var In=mt.destructLink(Fe[Ge],Fe[Ge-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Ge-1],id:Fe[Ge-3]};break;case 79:this.$={text:Fe[Ge],type:"text"};break;case 80:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 81:this.$={text:Fe[Ge],type:"string"};break;case 82:this.$={text:Fe[Ge],type:"markdown"};break;case 83:var In=mt.destructLink(Fe[Ge]);this.$={type:In.type,stroke:In.stroke,length:In.length};break;case 84:var In=mt.destructLink(Fe[Ge]);this.$={type:In.type,stroke:In.stroke,length:In.length,id:Fe[Ge-1]};break;case 85:this.$=Fe[Ge-1];break;case 86:this.$={text:Fe[Ge],type:"text"};break;case 87:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 88:this.$={text:Fe[Ge],type:"string"};break;case 89:case 104:this.$={text:Fe[Ge],type:"markdown"};break;case 101:this.$={text:Fe[Ge],type:"text"};break;case 102:this.$={text:Fe[Ge-1].text+""+Fe[Ge],type:Fe[Ge-1].type};break;case 103:this.$={text:Fe[Ge],type:"text"};break;case 105:this.$=Fe[Ge-4],mt.addClass(Fe[Ge-2],Fe[Ge]);break;case 106:this.$=Fe[Ge-4],mt.setClass(Fe[Ge-2],Fe[Ge]);break;case 107:case 115:this.$=Fe[Ge-1],mt.setClickEvent(Fe[Ge-1],Fe[Ge]);break;case 108:case 116:this.$=Fe[Ge-3],mt.setClickEvent(Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-3],Fe[Ge]);break;case 109:this.$=Fe[Ge-2],mt.setClickEvent(Fe[Ge-2],Fe[Ge-1],Fe[Ge]);break;case 110:this.$=Fe[Ge-4],mt.setClickEvent(Fe[Ge-4],Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-4],Fe[Ge]);break;case 111:this.$=Fe[Ge-2],mt.setLink(Fe[Ge-2],Fe[Ge]);break;case 112:this.$=Fe[Ge-4],mt.setLink(Fe[Ge-4],Fe[Ge-2]),mt.setTooltip(Fe[Ge-4],Fe[Ge]);break;case 113:this.$=Fe[Ge-4],mt.setLink(Fe[Ge-4],Fe[Ge-2],Fe[Ge]);break;case 114:this.$=Fe[Ge-6],mt.setLink(Fe[Ge-6],Fe[Ge-4],Fe[Ge]),mt.setTooltip(Fe[Ge-6],Fe[Ge-2]);break;case 117:this.$=Fe[Ge-1],mt.setLink(Fe[Ge-1],Fe[Ge]);break;case 118:this.$=Fe[Ge-3],mt.setLink(Fe[Ge-3],Fe[Ge-2]),mt.setTooltip(Fe[Ge-3],Fe[Ge]);break;case 119:this.$=Fe[Ge-3],mt.setLink(Fe[Ge-3],Fe[Ge-2],Fe[Ge]);break;case 120:this.$=Fe[Ge-5],mt.setLink(Fe[Ge-5],Fe[Ge-4],Fe[Ge]),mt.setTooltip(Fe[Ge-5],Fe[Ge-2]);break;case 121:this.$=Fe[Ge-4],mt.addVertex(Fe[Ge-2],void 0,void 0,Fe[Ge]);break;case 122:this.$=Fe[Ge-4],mt.updateLink([Fe[Ge-2]],Fe[Ge]);break;case 123:this.$=Fe[Ge-4],mt.updateLink(Fe[Ge-2],Fe[Ge]);break;case 124:this.$=Fe[Ge-8],mt.updateLinkInterpolate([Fe[Ge-6]],Fe[Ge-2]),mt.updateLink([Fe[Ge-6]],Fe[Ge]);break;case 125:this.$=Fe[Ge-8],mt.updateLinkInterpolate(Fe[Ge-6],Fe[Ge-2]),mt.updateLink(Fe[Ge-6],Fe[Ge]);break;case 126:this.$=Fe[Ge-6],mt.updateLinkInterpolate([Fe[Ge-4]],Fe[Ge]);break;case 127:this.$=Fe[Ge-6],mt.updateLinkInterpolate(Fe[Ge-4],Fe[Ge]);break;case 128:case 130:this.$=[Fe[Ge]];break;case 129:case 131:Fe[Ge-2].push(Fe[Ge]),this.$=Fe[Ge-2];break;case 133:this.$=Fe[Ge-1]+Fe[Ge];break;case 181:this.$=Fe[Ge];break;case 182:this.$=Fe[Ge-1]+""+Fe[Ge];break;case 184:this.$=Fe[Ge-1]+""+Fe[Ge];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:d,33:24,34:h,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:O,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(G,[2,50],{18:77,39:78,10:F,40:H}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:j,44:q,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:Oe,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:O,111:E,114:_,115:P,116:L}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[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:O,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:ke,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(G,[2,48],{44:Ot}),t(G,[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:O,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:O,111:E,113:42,114:_,115:P,116:L},{44:g,47:163,60:m,89:A,102:S,105:T,106:C,109:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Qt,[2,115],{120:168,10:[1,167],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[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:O,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(he,[2,182]),t(i,[2,20]),t(xe,[2,25]),t(G,[2,46],{39:192,18:193,10:F,40:H}),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:ke,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:ke,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:d,32:[1,203],33:24,34:h,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:O,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:O,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:O,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:O,111:E,113:113,114:_,115:P,116:L},{80:[1,212]},t(Qt,[2,109],{10:[1,213]}),t(Qt,[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:O,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(G,[2,45],{18:156,10:F,40:ut}),t(G,[2,47],{44:Ot}),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:ke,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:O,111:E,113:42,114:_,115:P,116:L},{10:F,18:240},{10:Tt,60:hr,84:jr,92:241,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:252,104:[1,253],105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:254,104:[1,255],105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{105:[1,256]},{10:Tt,60:hr,84:jr,92:257,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{44:g,47:258,60:m,89:A,102:S,105:T,106:C,109:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Qt,[2,116]),t(Qt,[2,118],{10:[1,262]}),t(Qt,[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:d,32:[1,267],33:24,34:h,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:O,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:O,111:E,113:42,114:_,115:P,116:L},t(Qt,[2,121],{106:hn}),t(ii,[2,130],{108:270,10:Tt,60:hr,84:jr,105:Ir,109:Zr,110:Ur,111:On,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(Qt,[2,122],{106:hn}),{10:[1,271]},t(Qt,[2,123],{106:hn}),{10:[1,272]},t(at,[2,129]),t(Qt,[2,105],{106:hn}),t(Qt,[2,106],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:O,111:E,114:_,115:P,116:L}),t(Qt,[2,110]),t(Qt,[2,112],{10:[1,273]}),t(Qt,[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:hr,84:jr,105:Ir,107:279,108:243,109:Zr,110:Ur,111:On,112:$r},t(pt,[2,133]),{14:j,44:q,60:ne,89:X,101:280,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe,120:88},{14:j,44:q,60:ne,89:X,101:281,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe,120:88},{98:[1,282]},t(Qt,[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:hr,84:jr,105:Ir,109:Zr,110:Ur,111:On,112:$r}),t(Qt,[2,126],{120:168,10:[1,285],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[2,127],{120:168,10:[1,286],14:j,44:q,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:Oe}),t(Qt,[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:d,32:[1,288],33:24,34:h,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:O,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:Tt,60:hr,84:jr,92:289,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},{10:Tt,60:hr,84:jr,92:290,105:Ir,107:242,108:243,109:Zr,110:Ur,111:On,112:$r},t(ue,[2,62]),t(B,[2,33]),t(Qt,[2,124],{106:hn}),t(Qt,[2,125],{106:hn})],defaultActions:{},parseError:k(function(Rt,kt){if(kt.recoverable)this.trace(Rt);else{var Vt=new Error(Rt);throw Vt.hash=kt,Vt}},"parseError"),parse:k(function(Rt){var kt=this,Vt=[0],mt=[],Tr=[null],Fe=[],ra=this.table,Ge="",In=0,di=0,Bo=2,Qn=1,fa=Fe.slice.call(arguments,1),hi=Object.create(this.lexer),yu={yy:{}};for(var cm in this.yy)Object.prototype.hasOwnProperty.call(this.yy,cm)&&(yu.yy[cm]=this.yy[cm]);hi.setInput(Rt,yu.yy),yu.yy.lexer=hi,yu.yy.parser=this,typeof hi.yylloc>"u"&&(hi.yylloc={});var Ev=hi.yylloc;Fe.push(Ev);var _O=hi.options&&hi.options.ranges;typeof yu.yy.parseError=="function"?this.parseError=yu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function RO(ar){Vt.length=Vt.length-2*ar,Tr.length=Tr.length-ar,Fe.length=Fe.length-ar}k(RO,"popStack");function DO(){var ar;return ar=mt.pop()||hi.lex()||Qn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=kt.symbols_[ar]||ar),ar}k(DO,"lex");for(var wl,mh,Fc,Js,Of={},K2,Ht,Ve,ot;;){if(mh=Vt[Vt.length-1],this.defaultActions[mh]?Fc=this.defaultActions[mh]:((wl===null||typeof wl>"u")&&(wl=DO()),Fc=ra[mh]&&ra[mh][wl]),typeof Fc>"u"||!Fc.length||!Fc[0]){var Nt="";ot=[];for(K2 in ra[mh])this.terminals_[K2]&&K2>Bo&&ot.push("'"+this.terminals_[K2]+"'");hi.showPosition?Nt="Parse error on line "+(In+1)+`: `+hi.showPosition()+` Expecting `+ot.join(", ")+", got '"+(this.terminals_[wl]||wl)+"'":Nt="Parse error on line "+(In+1)+": Unexpected "+(wl==Qn?"end of input":"'"+(this.terminals_[wl]||wl)+"'"),this.parseError(Nt,{text:hi.match,token:this.terminals_[wl]||wl,line:hi.yylineno,loc:Ev,expected:ot})}if(Fc[0]instanceof Array&&Fc.length>1)throw new Error("Parse Error: multiple actions possible at state: "+mh+", token: "+wl);switch(Fc[0]){case 1:Vt.push(wl),Tr.push(hi.yytext),Fe.push(hi.yylloc),Vt.push(Fc[1]),wl=null,di=hi.yyleng,Ge=hi.yytext,In=hi.yylineno,Ev=hi.yylloc;break;case 2:if(Ht=this.productions_[Fc[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},_O&&(Of._$.range=[Fe[Fe.length-(Ht||1)].range[0],Fe[Fe.length-1].range[1]]),Js=this.performAction.apply(Of,[Ge,di,In,yu.yy,Fc[1],Tr,Fe].concat(fa)),typeof Js<"u")return Js;Ht&&(Vt=Vt.slice(0,-1*Ht*2),Tr=Tr.slice(0,-1*Ht),Fe=Fe.slice(0,-1*Ht)),Vt.push(this.productions_[Fc[1]][0]),Tr.push(Of.$),Fe.push(Of._$),Ve=ra[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:k(function(kt,Vt){if(this.yy.parser)this.yy.parser.parseError(kt,Vt);else throw new Error(kt)},"parseError"),setInput:k(function(Rt,kt){return this.yy=kt||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:k(function(){var Rt=this._input[0];this.yytext+=Rt,this.yyleng++,this.offset++,this.match+=Rt,this.matched+=Rt;var kt=Rt.match(/(?:\r\n?|\n).*/g);return kt?(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:k(function(Rt){var kt=Rt.length,Vt=Rt.split(/(?:\r\n?|\n)/g);this._input=Rt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-kt),this.offset-=kt;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-kt},this.options.ranges&&(this.yylloc.range=[Tr[0],Tr[0]+this.yyleng-kt]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(Rt){this.unput(this.match.slice(Rt))},"less"),pastInput:k(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:k(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:k(function(){var Rt=this.pastInput(),kt=new Array(Rt.length+1).join("-");return Rt+this.upcomingInput()+` @@ -1524,7 +1524,7 @@ Expecting `+ot.join(", ")+", got '"+(this.terminals_[wl]||wl)+"'":Nt="Parse erro Expecting `+et.join(", ")+", got '"+(this.terminals_[De]||De)+"'":Pe="Parse error on line "+(ke+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,ke=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,ke,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:k(function(Ee,ue){if(this.yy.parser)this.yy.parser.parseError(Ee,ue);else throw new Error(Ee)},"parseError"),setInput:k(function(Oe,Ee){return this.yy=Ee||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:k(function(){var Oe=this._input[0];this.yytext+=Oe,this.yyleng++,this.offset++,this.match+=Oe,this.matched+=Oe;var Ee=Oe.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),Oe},"input"),unput:k(function(Oe){var Ee=Oe.length,ue=Oe.split(/(?:\r\n?|\n)/g);this._input=Oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ee),this.offset-=Ee;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),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===he.length?this.yylloc.first_column:0)+he[he.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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(Oe){this.unput(this.match.slice(Oe))},"less"),pastInput:k(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:k(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:k(function(){var Oe=this.pastInput(),Ee=new Array(Oe.length+1).join("-");return Oe+this.upcomingInput()+` `+Ee+"^"},"showPosition"),test_match:k(function(Oe,Ee){var ue,he,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))),he=Oe[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+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],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:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Oe,Ee,ue,he;this._more||(this.yytext="",this.match="");for(var xe=this._currentRules(),ge=0;geEe[0].length)){if(Ee=ue,he=ge,this.options.backtrack_lexer){if(Oe=this.test_match(ue,xe[ge]),Oe!==!1)return Oe;if(this._backtrack){Ee=!1;continue}else return!1}else if(!this.options.flex)break}return Ee?(Oe=this.test_match(Ee,xe[he]),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:k(function(){var Ee=this.next();return Ee||this.lex()},"lex"),begin:k(function(Ee){this.conditionStack.push(Ee)},"begin"),popState:k(function(){var Ee=this.conditionStack.length-1;return Ee>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(Ee){return Ee=this.conditionStack.length-1-Math.abs(Ee||0),Ee>=0?this.conditionStack[Ee]:"INITIAL"},"topState"),pushState:k(function(Ee){this.begin(Ee)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(Ee,ue,he,xe){switch(he){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 k(ie,"Parser"),ie.prototype=te,te.Parser=ie,new ie}();N_e.parser=N_e;var sUn=N_e,lUn=(dL=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=k(()=>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:RR(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"}}},k(dL,"ErDB"),dL),KUt={};Lj(KUt,{draw:()=>cUn});var cUn=k(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=S3(e,i);s.type=n.type,s.layoutAlgorithm=b$(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:d}=u;d==="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 BR(s,l),s.layoutAlgorithm==="elk"&&l.select(".edges").lower();const h=l.selectAll('[id*="-background"]');Array.from(h).length>0&&h.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()),ck(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),ZUt=k((t,e)=>{const r=q1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Tg(n,i,a,e)},"fade"),zte=new Set(["redux-color","redux-dark-color"]),uUn=k(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!zte.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:k(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:k(function(Ee){return Ee=this.conditionStack.length-1-Math.abs(Ee||0),Ee>=0?this.conditionStack[Ee]:"INITIAL"},"topState"),pushState:k(function(Ee){this.begin(Ee)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(Ee,ue,he,xe){switch(he){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 k(ie,"Parser"),ie.prototype=te,te.Parser=ie,new ie}();N_e.parser=N_e;var sUn=N_e,lUn=(dL=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=k(()=>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:R5(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"}}},k(dL,"ErDB"),dL),KUt={};Lj(KUt,{draw:()=>cUn});var cUn=k(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=S3(e,i);s.type=n.type,s.layoutAlgorithm=b$(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:d}=u;d==="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 B5(s,l),s.layoutAlgorithm==="elk"&&l.select(".edges").lower();const h=l.selectAll('[id*="-background"]');Array.from(h).length>0&&h.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()),ck(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),ZUt=k((t,e)=>{const r=q1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Tg(n,i,a,e)},"fade"),zte=new Set(["redux-color","redux-dark-color"]),uUn=k(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!zte.has(e))return"";const a=(n==null?void 0:n.length)>0;let o="";for(let s=0;sI9(t,"name",{value:e,configurable:!0}),bUn=(t,e)=>function(){return t&&(e=(0,t[$_e(t)[0]])(t=0)),e},Fn=(t,e)=>function(){return e||(0,t[$_e(t)[0]])((e={exports:{}}).exports,e),e.exports},T2=(t,e)=>{for(var r in e)I9(t,r,{get:e[r],enumerable:!0})},F_e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $_e(e))!yUn.call(t,i)&&i!==r&&I9(t,i,{get:()=>e[i],enumerable:!(n=mUn(e,i))||n.enumerable});return t},Ute=(t,e,r)=>(F_e(t,e,"default"),r),z_e=(t,e,r)=>(r=t!=null?gUn(vUn(t)):{},F_e(I9(r,"default",{value:t,enumerable:!0}),t)),U_e=t=>F_e(I9({},"__esModule",{value:!0}),t),Vte={};T2(Vte,{AnnotatedTextEdit:()=>J1,ChangeAnnotation:()=>dk,ChangeAnnotationIdentifier:()=>_c,CodeAction:()=>A5e,CodeActionContext:()=>w5e,CodeActionKind:()=>x5e,CodeActionTriggerKind:()=>V9,CodeDescription:()=>K_e,CodeLens:()=>S5e,Color:()=>Qte,ColorInformation:()=>H_e,ColorPresentation:()=>W_e,Command:()=>uk,CompletionItem:()=>l5e,CompletionItemKind:()=>r5e,CompletionItemLabelDetails:()=>s5e,CompletionItemTag:()=>i5e,CompletionList:()=>c5e,CreateFile:()=>T3,DeleteFile:()=>k3,Diagnostic:()=>B9,DiagnosticRelatedInformation:()=>Hte,DiagnosticSeverity:()=>j_e,DiagnosticTag:()=>X_e,DocumentHighlight:()=>p5e,DocumentHighlightKind:()=>f5e,DocumentLink:()=>C5e,DocumentSymbol:()=>b5e,DocumentUri:()=>V_e,EOL:()=>eVt,FoldingRange:()=>q_e,FoldingRangeKind:()=>Y_e,FormattingOptions:()=>T5e,Hover:()=>u5e,InlayHint:()=>I5e,InlayHintKind:()=>qte,InlayHintLabelPart:()=>jte,InlineCompletionContext:()=>z5e,InlineCompletionItem:()=>N5e,InlineCompletionList:()=>B5e,InlineCompletionTriggerKind:()=>$5e,InlineValueContext:()=>M5e,InlineValueEvaluatableExpression:()=>L5e,InlineValueText:()=>R5e,InlineValueVariableLookup:()=>D5e,InsertReplaceEdit:()=>a5e,InsertTextFormat:()=>n5e,InsertTextMode:()=>o5e,Location:()=>N9,LocationLink:()=>Q_e,MarkedString:()=>U9,MarkupContent:()=>O3,MarkupKind:()=>Yte,OptionalVersionedTextDocumentIdentifier:()=>z9,ParameterInformation:()=>d5e,Position:()=>ta,Range:()=>Di,RenameFile:()=>C3,SelectedCompletionInfo:()=>F5e,SelectionRange:()=>k5e,SemanticTokenModifiers:()=>E5e,SemanticTokenTypes:()=>O5e,SemanticTokens:()=>_5e,SignatureInformation:()=>h5e,StringValue:()=>P5e,SymbolInformation:()=>v5e,SymbolKind:()=>g5e,SymbolTag:()=>m5e,TextDocument:()=>V5e,TextDocumentEdit:()=>$9,TextDocumentIdentifier:()=>J_e,TextDocumentItem:()=>t5e,TextEdit:()=>sv,URI:()=>Gte,VersionedTextDocumentIdentifier:()=>e5e,WorkspaceChange:()=>JUt,WorkspaceEdit:()=>Wte,WorkspaceFolder:()=>U5e,WorkspaceSymbol:()=>y5e,integer:()=>G_e,uinteger:()=>P9});var V_e,Gte,G_e,P9,ta,Di,N9,Q_e,Qte,H_e,W_e,Y_e,q_e,Hte,j_e,X_e,K_e,B9,uk,sv,dk,_c,J1,$9,T3,C3,k3,Wte,F9,Z_e,JUt,J_e,e5e,z9,t5e,Yte,O3,r5e,n5e,i5e,a5e,o5e,s5e,l5e,c5e,U9,u5e,d5e,h5e,f5e,p5e,g5e,m5e,v5e,y5e,b5e,x5e,V9,w5e,A5e,S5e,T5e,C5e,k5e,O5e,E5e,_5e,R5e,D5e,L5e,M5e,qte,jte,I5e,P5e,N5e,B5e,$5e,F5e,z5e,U5e,eVt,V5e,tVt,ct,G9=bUn({"../../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})(V_e||(V_e={})),function(i){function a(o){return typeof o=="string"}$(a,"is"),i.is=a}(Gte||(Gte={})),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}(P9||(P9={})),function(i){function a(s,l){return s===Number.MAX_VALUE&&(s=P9.MAX_VALUE),l===Number.MAX_VALUE&&(l=P9.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}(ta||(ta={})),function(i){function a(s,l,u,d){if(ct.uinteger(s)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(d))return{start:ta.create(s,l),end:ta.create(u,d)};if(ta.is(s)&&ta.is(l))return{start:s,end:l};throw new Error(`Range#create called with invalid arguments[${s}, ${l}, ${u}, ${d}]`)}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ta.is(l.start)&&ta.is(l.end)}$(o,"is"),i.is=o}(Di||(Di={})),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)&&Di.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(o,"is"),i.is=o}(N9||(N9={})),function(i){function a(s,l,u,d){return{targetUri:s,targetRange:l,targetSelectionRange:u,originSelectionRange:d}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Di.is(l.targetRange)&&ct.string(l.targetUri)&&Di.is(l.targetSelectionRange)&&(Di.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(o,"is"),i.is=o}(Q_e||(Q_e={})),function(i){function a(s,l,u,d){return{red:s,green:l,blue:u,alpha:d}}$(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}(Qte||(Qte={})),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)&&Di.is(l.range)&&Qte.is(l.color)}$(o,"is"),i.is=o}(H_e||(H_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)||sv.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,sv.is))}$(o,"is"),i.is=o}(W_e||(W_e={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(Y_e||(Y_e={})),function(i){function a(s,l,u,d,h,f){const p={startLine:s,endLine:l};return ct.defined(u)&&(p.startCharacter=u),ct.defined(d)&&(p.endCharacter=d),ct.defined(h)&&(p.kind=h),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}(q_e||(q_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)&&N9.is(l.location)&&ct.string(l.message)}$(o,"is"),i.is=o}(Hte||(Hte={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(j_e||(j_e={})),function(i){i.Unnecessary=1,i.Deprecated=2}(X_e||(X_e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&ct.string(s.href)}$(a,"is"),i.is=a}(K_e||(K_e={})),function(i){function a(s,l,u,d,h,f){let p={range:s,message:l};return ct.defined(u)&&(p.severity=u),ct.defined(d)&&(p.code=d),ct.defined(h)&&(p.source=h),ct.defined(f)&&(p.relatedInformation=f),p}$(a,"create"),i.create=a;function o(s){var l;let u=s;return ct.defined(u)&&Di.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,Hte.is))}$(o,"is"),i.is=o}(B9||(B9={})),function(i){function a(s,l,...u){let d={title:s,command:l};return ct.defined(u)&&u.length>0&&(d.arguments=u),d}$(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}(uk||(uk={})),function(i){function a(u,d){return{range:u,newText:d}}$(a,"replace"),i.replace=a;function o(u,d){return{range:{start:u,end:u},newText:d}}$(o,"insert"),i.insert=o;function s(u){return{range:u,newText:""}}$(s,"del"),i.del=s;function l(u){const d=u;return ct.objectLiteral(d)&&ct.string(d.newText)&&Di.is(d.range)}$(l,"is"),i.is=l}(sv||(sv={})),function(i){function a(s,l,u){const d={label:s};return l!==void 0&&(d.needsConfirmation=l),u!==void 0&&(d.description=u),d}$(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}(dk||(dk={})),function(i){function a(o){const s=o;return ct.string(s)}$(a,"is"),i.is=a}(_c||(_c={})),function(i){function a(u,d,h){return{range:u,newText:d,annotationId:h}}$(a,"replace"),i.replace=a;function o(u,d,h){return{range:{start:u,end:u},newText:d,annotationId:h}}$(o,"insert"),i.insert=o;function s(u,d){return{range:u,newText:"",annotationId:d}}$(s,"del"),i.del=s;function l(u){const d=u;return sv.is(d)&&(dk.is(d.annotationId)||_c.is(d.annotationId))}$(l,"is"),i.is=l}(J1||(J1={})),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)&&z9.is(l.textDocument)&&Array.isArray(l.edits)}$(o,"is"),i.is=o}($9||($9={})),function(i){function a(s,l,u){let d={kind:"create",uri:s};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(T3||(T3={})),function(i){function a(s,l,u,d){let h={kind:"rename",oldUri:s,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(h.options=u),d!==void 0&&(h.annotationId=d),h}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(C3||(C3={})),function(i){function a(s,l,u){let d={kind:"delete",uri:s};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(k3||(k3={})),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)?T3.is(l)||C3.is(l)||k3.is(l):$9.is(l)))}$(a,"is"),i.is=a}(Wte||(Wte={})),F9=(t=class{constructor(a,o){this.edits=a,this.changeAnnotations=o}insert(a,o,s){let l,u;if(s===void 0?l=sv.insert(a,o):_c.is(s)?(u=s,l=J1.insert(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=J1.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=sv.replace(a,o):_c.is(s)?(u=s,l=J1.replace(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=J1.replace(a,o,u)),this.edits.push(l),u!==void 0)return u}delete(a,o){let s,l;if(o===void 0?s=sv.del(a):_c.is(o)?(l=o,s=J1.del(a,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),s=J1.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),Z_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(_c.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),JUt=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new Z_e(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(o=>{if($9.is(o)){const s=new F9(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=s}})):a.changes&&Object.keys(a.changes).forEach(o=>{const s=new F9(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(z9.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 F9(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 F9(s),this._textEditChanges[a]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Z_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;dk.is(o)||_c.is(o)?l=o:s=o;let u,d;if(l===void 0?u=T3.create(a,s):(d=_c.is(l)?l:this._changeAnnotations.manage(l),u=T3.create(a,s,d)),this._workspaceEdit.documentChanges.push(u),d!==void 0)return d}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;dk.is(s)||_c.is(s)?u=s:l=s;let d,h;if(u===void 0?d=C3.create(a,o,l):(h=_c.is(u)?u:this._changeAnnotations.manage(u),d=C3.create(a,o,l,h)),this._workspaceEdit.documentChanges.push(d),h!==void 0)return h}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;dk.is(o)||_c.is(o)?l=o:s=o;let u,d;if(l===void 0?u=k3.create(a,s):(d=_c.is(l)?l:this._changeAnnotations.manage(l),u=k3.create(a,s,d)),this._workspaceEdit.documentChanges.push(u),d!==void 0)return d}},$(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}(J_e||(J_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}(e5e||(e5e={})),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}(z9||(z9={})),function(i){function a(s,l,u,d){return{uri:s,languageId:l,version:u,text:d}}$(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}(t5e||(t5e={})),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}(Yte||(Yte={})),function(i){function a(o){const s=o;return ct.objectLiteral(o)&&Yte.is(s.kind)&&ct.string(s.value)}$(a,"is"),i.is=a}(O3||(O3={})),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}(r5e||(r5e={})),function(i){i.PlainText=1,i.Snippet=2}(n5e||(n5e={})),function(i){i.Deprecated=1}(i5e||(i5e={})),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)&&Di.is(l.insert)&&Di.is(l.replace)}$(o,"is"),i.is=o}(a5e||(a5e={})),function(i){i.asIs=1,i.adjustIndentation=2}(o5e||(o5e={})),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}(s5e||(s5e={})),function(i){function a(o){return{label:o}}$(a,"create"),i.create=a}(l5e||(l5e={})),function(i){function a(o,s){return{items:o||[],isIncomplete:!!s}}$(a,"create"),i.create=a}(c5e||(c5e={})),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}(U9||(U9={})),function(i){function a(o){let s=o;return!!s&&ct.objectLiteral(s)&&(O3.is(s.contents)||U9.is(s.contents)||ct.typedArray(s.contents,U9.is))&&(o.range===void 0||Di.is(o.range))}$(a,"is"),i.is=a}(u5e||(u5e={})),function(i){function a(o,s){return s?{label:o,documentation:s}:{label:o}}$(a,"create"),i.create=a}(d5e||(d5e={})),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}(h5e||(h5e={})),function(i){i.Text=1,i.Read=2,i.Write=3}(f5e||(f5e={})),function(i){function a(o,s){let l={range:o};return ct.number(s)&&(l.kind=s),l}$(a,"create"),i.create=a}(p5e||(p5e={})),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}(g5e||(g5e={})),function(i){i.Deprecated=1}(m5e||(m5e={})),function(i){function a(o,s,l,u,d){let h={name:o,kind:s,location:{uri:u,range:l}};return d&&(h.containerName=d),h}$(a,"create"),i.create=a}(v5e||(v5e={})),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}(y5e||(y5e={})),function(i){function a(s,l,u,d,h,f){let p={name:s,detail:l,kind:u,range:d,selectionRange:h};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)&&Di.is(l.range)&&Di.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}(b5e||(b5e={})),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"}(x5e||(x5e={})),function(i){i.Invoked=1,i.Automatic=2}(V9||(V9={})),function(i){function a(s,l,u){let d={diagnostics:s};return l!=null&&(d.only=l),u!=null&&(d.triggerKind=u),d}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.typedArray(l.diagnostics,B9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===V9.Invoked||l.triggerKind===V9.Automatic)}$(o,"is"),i.is=o}(w5e||(w5e={})),function(i){function a(s,l,u){let d={title:s},h=!0;return typeof l=="string"?(h=!1,d.kind=l):uk.is(l)?d.command=l:d.edit=l,h&&u!==void 0&&(d.kind=u),d}$(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,B9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||uk.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Wte.is(l.edit))}$(o,"is"),i.is=o}(A5e||(A5e={})),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)&&Di.is(l.range)&&(ct.undefined(l.command)||uk.is(l.command))}$(o,"is"),i.is=o}(S5e||(S5e={})),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}(T5e||(T5e={})),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)&&Di.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(o,"is"),i.is=o}(C5e||(C5e={})),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)&&Di.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(o,"is"),i.is=o}(k5e||(k5e={})),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"}(O5e||(O5e={})),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}(_5e||(_5e={})),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&&Di.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&&Di.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(o,"is"),i.is=o}(D5e||(D5e={})),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&&Di.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(o,"is"),i.is=o}(L5e||(L5e={})),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)&&Di.is(s.stoppedLocation)}$(o,"is"),i.is=o}(M5e||(M5e={})),function(i){i.Type=1,i.Parameter=2;function a(o){return o===1||o===2}$(a,"is"),i.is=a}(qte||(qte={})),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)||O3.is(l.tooltip))&&(l.location===void 0||N9.is(l.location))&&(l.command===void 0||uk.is(l.command))}$(o,"is"),i.is=o}(jte||(jte={})),function(i){function a(s,l,u){const d={position:s,label:l};return u!==void 0&&(d.kind=u),d}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ta.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,jte.is))&&(l.kind===void 0||qte.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,sv.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||O3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(o,"is"),i.is=o}(I5e||(I5e={})),function(i){function a(o){return{kind:"snippet",value:o}}$(a,"createSnippet"),i.createSnippet=a}(P5e||(P5e={})),function(i){function a(o,s,l,u){return{insertText:o,filterText:s,range:l,command:u}}$(a,"create"),i.create=a}(N5e||(N5e={})),function(i){function a(o){return{items:o}}$(a,"create"),i.create=a}(B5e||(B5e={})),function(i){i.Invoked=0,i.Automatic=1}($5e||($5e={})),function(i){function a(o,s){return{range:o,text:s}}$(a,"create"),i.create=a}(F5e||(F5e={})),function(i){function a(o,s){return{triggerKind:o,selectedCompletionInfo:s}}$(a,"create"),i.create=a}(z5e||(z5e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&Gte.is(s.uri)&&ct.string(s.name)}$(a,"is"),i.is=a}(U5e||(U5e={})),eVt=[` +`},"getStyles"),hUn=dUn,fUn={parser:sUn,get db(){return new lUn},renderer:KUt,styles:hUn};const pUn=Object.freeze(Object.defineProperty({__proto__:null,diagram:fUn},Symbol.toStringTag,{value:"Module"}));var B_e=(hL=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},k(hL,"ImperativeState"),hL);function od(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))}k(od,"populateCommonDb");var gUn=Object.create,I9=Object.defineProperty,mUn=Object.getOwnPropertyDescriptor,$_e=Object.getOwnPropertyNames,vUn=Object.getPrototypeOf,yUn=Object.prototype.hasOwnProperty,$=(t,e)=>I9(t,"name",{value:e,configurable:!0}),bUn=(t,e)=>function(){return t&&(e=(0,t[$_e(t)[0]])(t=0)),e},Fn=(t,e)=>function(){return e||(0,t[$_e(t)[0]])((e={exports:{}}).exports,e),e.exports},T2=(t,e)=>{for(var r in e)I9(t,r,{get:e[r],enumerable:!0})},F_e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $_e(e))!yUn.call(t,i)&&i!==r&&I9(t,i,{get:()=>e[i],enumerable:!(n=mUn(e,i))||n.enumerable});return t},Ute=(t,e,r)=>(F_e(t,e,"default"),r),z_e=(t,e,r)=>(r=t!=null?gUn(vUn(t)):{},F_e(I9(r,"default",{value:t,enumerable:!0}),t)),U_e=t=>F_e(I9({},"__esModule",{value:!0}),t),Vte={};T2(Vte,{AnnotatedTextEdit:()=>J1,ChangeAnnotation:()=>dk,ChangeAnnotationIdentifier:()=>_c,CodeAction:()=>ARe,CodeActionContext:()=>wRe,CodeActionKind:()=>xRe,CodeActionTriggerKind:()=>V9,CodeDescription:()=>K_e,CodeLens:()=>SRe,Color:()=>Qte,ColorInformation:()=>H_e,ColorPresentation:()=>W_e,Command:()=>uk,CompletionItem:()=>lRe,CompletionItemKind:()=>rRe,CompletionItemLabelDetails:()=>sRe,CompletionItemTag:()=>iRe,CompletionList:()=>cRe,CreateFile:()=>T3,DeleteFile:()=>k3,Diagnostic:()=>B9,DiagnosticRelatedInformation:()=>Hte,DiagnosticSeverity:()=>j_e,DiagnosticTag:()=>X_e,DocumentHighlight:()=>pRe,DocumentHighlightKind:()=>fRe,DocumentLink:()=>CRe,DocumentSymbol:()=>bRe,DocumentUri:()=>V_e,EOL:()=>eVt,FoldingRange:()=>q_e,FoldingRangeKind:()=>Y_e,FormattingOptions:()=>TRe,Hover:()=>uRe,InlayHint:()=>IRe,InlayHintKind:()=>qte,InlayHintLabelPart:()=>jte,InlineCompletionContext:()=>zRe,InlineCompletionItem:()=>NRe,InlineCompletionList:()=>BRe,InlineCompletionTriggerKind:()=>$Re,InlineValueContext:()=>MRe,InlineValueEvaluatableExpression:()=>LRe,InlineValueText:()=>RRe,InlineValueVariableLookup:()=>DRe,InsertReplaceEdit:()=>aRe,InsertTextFormat:()=>nRe,InsertTextMode:()=>oRe,Location:()=>N9,LocationLink:()=>Q_e,MarkedString:()=>U9,MarkupContent:()=>O3,MarkupKind:()=>Yte,OptionalVersionedTextDocumentIdentifier:()=>z9,ParameterInformation:()=>dRe,Position:()=>ta,Range:()=>Di,RenameFile:()=>C3,SelectedCompletionInfo:()=>FRe,SelectionRange:()=>kRe,SemanticTokenModifiers:()=>ERe,SemanticTokenTypes:()=>ORe,SemanticTokens:()=>_Re,SignatureInformation:()=>hRe,StringValue:()=>PRe,SymbolInformation:()=>vRe,SymbolKind:()=>gRe,SymbolTag:()=>mRe,TextDocument:()=>VRe,TextDocumentEdit:()=>$9,TextDocumentIdentifier:()=>J_e,TextDocumentItem:()=>tRe,TextEdit:()=>sv,URI:()=>Gte,VersionedTextDocumentIdentifier:()=>eRe,WorkspaceChange:()=>JUt,WorkspaceEdit:()=>Wte,WorkspaceFolder:()=>URe,WorkspaceSymbol:()=>yRe,integer:()=>G_e,uinteger:()=>P9});var V_e,Gte,G_e,P9,ta,Di,N9,Q_e,Qte,H_e,W_e,Y_e,q_e,Hte,j_e,X_e,K_e,B9,uk,sv,dk,_c,J1,$9,T3,C3,k3,Wte,F9,Z_e,JUt,J_e,eRe,z9,tRe,Yte,O3,rRe,nRe,iRe,aRe,oRe,sRe,lRe,cRe,U9,uRe,dRe,hRe,fRe,pRe,gRe,mRe,vRe,yRe,bRe,xRe,V9,wRe,ARe,SRe,TRe,CRe,kRe,ORe,ERe,_Re,RRe,DRe,LRe,MRe,qte,jte,IRe,PRe,NRe,BRe,$Re,FRe,zRe,URe,eVt,VRe,tVt,ct,G9=bUn({"../../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})(V_e||(V_e={})),function(i){function a(o){return typeof o=="string"}$(a,"is"),i.is=a}(Gte||(Gte={})),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}(P9||(P9={})),function(i){function a(s,l){return s===Number.MAX_VALUE&&(s=P9.MAX_VALUE),l===Number.MAX_VALUE&&(l=P9.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}(ta||(ta={})),function(i){function a(s,l,u,d){if(ct.uinteger(s)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(d))return{start:ta.create(s,l),end:ta.create(u,d)};if(ta.is(s)&&ta.is(l))return{start:s,end:l};throw new Error(`Range#create called with invalid arguments[${s}, ${l}, ${u}, ${d}]`)}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ta.is(l.start)&&ta.is(l.end)}$(o,"is"),i.is=o}(Di||(Di={})),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)&&Di.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(o,"is"),i.is=o}(N9||(N9={})),function(i){function a(s,l,u,d){return{targetUri:s,targetRange:l,targetSelectionRange:u,originSelectionRange:d}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Di.is(l.targetRange)&&ct.string(l.targetUri)&&Di.is(l.targetSelectionRange)&&(Di.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(o,"is"),i.is=o}(Q_e||(Q_e={})),function(i){function a(s,l,u,d){return{red:s,green:l,blue:u,alpha:d}}$(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}(Qte||(Qte={})),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)&&Di.is(l.range)&&Qte.is(l.color)}$(o,"is"),i.is=o}(H_e||(H_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)||sv.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,sv.is))}$(o,"is"),i.is=o}(W_e||(W_e={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(Y_e||(Y_e={})),function(i){function a(s,l,u,d,h,f){const p={startLine:s,endLine:l};return ct.defined(u)&&(p.startCharacter=u),ct.defined(d)&&(p.endCharacter=d),ct.defined(h)&&(p.kind=h),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}(q_e||(q_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)&&N9.is(l.location)&&ct.string(l.message)}$(o,"is"),i.is=o}(Hte||(Hte={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(j_e||(j_e={})),function(i){i.Unnecessary=1,i.Deprecated=2}(X_e||(X_e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&ct.string(s.href)}$(a,"is"),i.is=a}(K_e||(K_e={})),function(i){function a(s,l,u,d,h,f){let p={range:s,message:l};return ct.defined(u)&&(p.severity=u),ct.defined(d)&&(p.code=d),ct.defined(h)&&(p.source=h),ct.defined(f)&&(p.relatedInformation=f),p}$(a,"create"),i.create=a;function o(s){var l;let u=s;return ct.defined(u)&&Di.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,Hte.is))}$(o,"is"),i.is=o}(B9||(B9={})),function(i){function a(s,l,...u){let d={title:s,command:l};return ct.defined(u)&&u.length>0&&(d.arguments=u),d}$(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}(uk||(uk={})),function(i){function a(u,d){return{range:u,newText:d}}$(a,"replace"),i.replace=a;function o(u,d){return{range:{start:u,end:u},newText:d}}$(o,"insert"),i.insert=o;function s(u){return{range:u,newText:""}}$(s,"del"),i.del=s;function l(u){const d=u;return ct.objectLiteral(d)&&ct.string(d.newText)&&Di.is(d.range)}$(l,"is"),i.is=l}(sv||(sv={})),function(i){function a(s,l,u){const d={label:s};return l!==void 0&&(d.needsConfirmation=l),u!==void 0&&(d.description=u),d}$(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}(dk||(dk={})),function(i){function a(o){const s=o;return ct.string(s)}$(a,"is"),i.is=a}(_c||(_c={})),function(i){function a(u,d,h){return{range:u,newText:d,annotationId:h}}$(a,"replace"),i.replace=a;function o(u,d,h){return{range:{start:u,end:u},newText:d,annotationId:h}}$(o,"insert"),i.insert=o;function s(u,d){return{range:u,newText:"",annotationId:d}}$(s,"del"),i.del=s;function l(u){const d=u;return sv.is(d)&&(dk.is(d.annotationId)||_c.is(d.annotationId))}$(l,"is"),i.is=l}(J1||(J1={})),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)&&z9.is(l.textDocument)&&Array.isArray(l.edits)}$(o,"is"),i.is=o}($9||($9={})),function(i){function a(s,l,u){let d={kind:"create",uri:s};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(T3||(T3={})),function(i){function a(s,l,u,d){let h={kind:"rename",oldUri:s,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(h.options=u),d!==void 0&&(h.annotationId=d),h}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(C3||(C3={})),function(i){function a(s,l,u){let d={kind:"delete",uri:s};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}$(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||_c.is(l.annotationId))}$(o,"is"),i.is=o}(k3||(k3={})),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)?T3.is(l)||C3.is(l)||k3.is(l):$9.is(l)))}$(a,"is"),i.is=a}(Wte||(Wte={})),F9=(t=class{constructor(a,o){this.edits=a,this.changeAnnotations=o}insert(a,o,s){let l,u;if(s===void 0?l=sv.insert(a,o):_c.is(s)?(u=s,l=J1.insert(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=J1.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=sv.replace(a,o):_c.is(s)?(u=s,l=J1.replace(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=J1.replace(a,o,u)),this.edits.push(l),u!==void 0)return u}delete(a,o){let s,l;if(o===void 0?s=sv.del(a):_c.is(o)?(l=o,s=J1.del(a,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),s=J1.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),Z_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(_c.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),JUt=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new Z_e(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(o=>{if($9.is(o)){const s=new F9(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=s}})):a.changes&&Object.keys(a.changes).forEach(o=>{const s=new F9(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(z9.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 F9(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 F9(s),this._textEditChanges[a]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Z_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;dk.is(o)||_c.is(o)?l=o:s=o;let u,d;if(l===void 0?u=T3.create(a,s):(d=_c.is(l)?l:this._changeAnnotations.manage(l),u=T3.create(a,s,d)),this._workspaceEdit.documentChanges.push(u),d!==void 0)return d}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;dk.is(s)||_c.is(s)?u=s:l=s;let d,h;if(u===void 0?d=C3.create(a,o,l):(h=_c.is(u)?u:this._changeAnnotations.manage(u),d=C3.create(a,o,l,h)),this._workspaceEdit.documentChanges.push(d),h!==void 0)return h}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;dk.is(o)||_c.is(o)?l=o:s=o;let u,d;if(l===void 0?u=k3.create(a,s):(d=_c.is(l)?l:this._changeAnnotations.manage(l),u=k3.create(a,s,d)),this._workspaceEdit.documentChanges.push(u),d!==void 0)return d}},$(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}(J_e||(J_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}(eRe||(eRe={})),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}(z9||(z9={})),function(i){function a(s,l,u,d){return{uri:s,languageId:l,version:u,text:d}}$(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}(tRe||(tRe={})),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}(Yte||(Yte={})),function(i){function a(o){const s=o;return ct.objectLiteral(o)&&Yte.is(s.kind)&&ct.string(s.value)}$(a,"is"),i.is=a}(O3||(O3={})),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}(rRe||(rRe={})),function(i){i.PlainText=1,i.Snippet=2}(nRe||(nRe={})),function(i){i.Deprecated=1}(iRe||(iRe={})),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)&&Di.is(l.insert)&&Di.is(l.replace)}$(o,"is"),i.is=o}(aRe||(aRe={})),function(i){i.asIs=1,i.adjustIndentation=2}(oRe||(oRe={})),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}(sRe||(sRe={})),function(i){function a(o){return{label:o}}$(a,"create"),i.create=a}(lRe||(lRe={})),function(i){function a(o,s){return{items:o||[],isIncomplete:!!s}}$(a,"create"),i.create=a}(cRe||(cRe={})),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}(U9||(U9={})),function(i){function a(o){let s=o;return!!s&&ct.objectLiteral(s)&&(O3.is(s.contents)||U9.is(s.contents)||ct.typedArray(s.contents,U9.is))&&(o.range===void 0||Di.is(o.range))}$(a,"is"),i.is=a}(uRe||(uRe={})),function(i){function a(o,s){return s?{label:o,documentation:s}:{label:o}}$(a,"create"),i.create=a}(dRe||(dRe={})),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}(hRe||(hRe={})),function(i){i.Text=1,i.Read=2,i.Write=3}(fRe||(fRe={})),function(i){function a(o,s){let l={range:o};return ct.number(s)&&(l.kind=s),l}$(a,"create"),i.create=a}(pRe||(pRe={})),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}(gRe||(gRe={})),function(i){i.Deprecated=1}(mRe||(mRe={})),function(i){function a(o,s,l,u,d){let h={name:o,kind:s,location:{uri:u,range:l}};return d&&(h.containerName=d),h}$(a,"create"),i.create=a}(vRe||(vRe={})),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}(yRe||(yRe={})),function(i){function a(s,l,u,d,h,f){let p={name:s,detail:l,kind:u,range:d,selectionRange:h};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)&&Di.is(l.range)&&Di.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}(bRe||(bRe={})),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"}(xRe||(xRe={})),function(i){i.Invoked=1,i.Automatic=2}(V9||(V9={})),function(i){function a(s,l,u){let d={diagnostics:s};return l!=null&&(d.only=l),u!=null&&(d.triggerKind=u),d}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.typedArray(l.diagnostics,B9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===V9.Invoked||l.triggerKind===V9.Automatic)}$(o,"is"),i.is=o}(wRe||(wRe={})),function(i){function a(s,l,u){let d={title:s},h=!0;return typeof l=="string"?(h=!1,d.kind=l):uk.is(l)?d.command=l:d.edit=l,h&&u!==void 0&&(d.kind=u),d}$(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,B9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||uk.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Wte.is(l.edit))}$(o,"is"),i.is=o}(ARe||(ARe={})),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)&&Di.is(l.range)&&(ct.undefined(l.command)||uk.is(l.command))}$(o,"is"),i.is=o}(SRe||(SRe={})),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}(TRe||(TRe={})),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)&&Di.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(o,"is"),i.is=o}(CRe||(CRe={})),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)&&Di.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(o,"is"),i.is=o}(kRe||(kRe={})),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"}(ORe||(ORe={})),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"}(ERe||(ERe={})),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}(_Re||(_Re={})),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&&Di.is(l.range)&&ct.string(l.text)}$(o,"is"),i.is=o}(RRe||(RRe={})),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&&Di.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(o,"is"),i.is=o}(DRe||(DRe={})),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&&Di.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(o,"is"),i.is=o}(LRe||(LRe={})),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)&&Di.is(s.stoppedLocation)}$(o,"is"),i.is=o}(MRe||(MRe={})),function(i){i.Type=1,i.Parameter=2;function a(o){return o===1||o===2}$(a,"is"),i.is=a}(qte||(qte={})),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)||O3.is(l.tooltip))&&(l.location===void 0||N9.is(l.location))&&(l.command===void 0||uk.is(l.command))}$(o,"is"),i.is=o}(jte||(jte={})),function(i){function a(s,l,u){const d={position:s,label:l};return u!==void 0&&(d.kind=u),d}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ta.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,jte.is))&&(l.kind===void 0||qte.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,sv.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||O3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(o,"is"),i.is=o}(IRe||(IRe={})),function(i){function a(o){return{kind:"snippet",value:o}}$(a,"createSnippet"),i.createSnippet=a}(PRe||(PRe={})),function(i){function a(o,s,l,u){return{insertText:o,filterText:s,range:l,command:u}}$(a,"create"),i.create=a}(NRe||(NRe={})),function(i){function a(o){return{items:o}}$(a,"create"),i.create=a}(BRe||(BRe={})),function(i){i.Invoked=0,i.Automatic=1}($Re||($Re={})),function(i){function a(o,s){return{range:o,text:s}}$(a,"create"),i.create=a}(FRe||(FRe={})),function(i){function a(o,s){return{triggerKind:o,selectedCompletionInfo:s}}$(a,"create"),i.create=a}(zRe||(zRe={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&Gte.is(s.uri)&&ct.string(s.name)}$(a,"is"),i.is=a}(URe||(URe={})),eVt=[` `,`\r -`,"\r"],function(i){function a(u,d,h,f){return new tVt(u,d,h,f)}$(a,"create"),i.create=a;function o(u){let d=u;return!!(ct.defined(d)&&ct.string(d.uri)&&(ct.undefined(d.languageId)||ct.string(d.languageId))&&ct.uinteger(d.lineCount)&&ct.func(d.getText)&&ct.func(d.positionAt)&&ct.func(d.offsetAt))}$(o,"is"),i.is=o;function s(u,d){let h=u.getText(),f=l(d,(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=h.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)h=h.substring(0,v)+m.newText+h.substring(y,h.length);else throw new Error("Overlapping edit");p=v}return h}$(s,"applyEdits"),i.applyEdits=s;function l(u,d){if(u.length<=1)return u;const h=u.length/2|0,f=u.slice(0,h),p=u.slice(h);l(f,d),l(p,d);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=h.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)h=h.substring(0,v)+m.newText+h.substring(y,h.length);else throw new Error("Overlapping edit");p=v}return h}$(s,"applyEdits"),i.applyEdits=s;function l(u,d){if(u.length<=1)return u;const h=u.length/2|0,f=u.slice(0,h),p=u.slice(h);l(f,d),l(p,d);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 ta.create(0,a);for(;sa?l=d:s=d+1}let u=s-1;return ta.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 d(y){return a.call(y)==="[object Number]"}$(d,"number"),i.number=d;function h(y,b,x){return a.call(y)==="[object Number]"&&b<=y&&y<=x}$(h,"numberRange"),i.numberRange=h;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={}))}}),hk=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}}),Q9=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}}),E3=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=hk(),r;(function(s){const l={dispose(){}};s.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,d){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(d)&&d.push({dispose:$(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let d=!1;for(let h=0,f=this._callbacks.length;h{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const h={dispose:$(()=>{this._callbacks&&(this._callbacks.remove(l,u),h.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(d)&&d.push(h),h}),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(){}}}),Xte=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=hk(),r=Q9(),n=E3(),i;(function(d){d.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),d.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function h(f){const p=f;return p&&(p===d.None||p===d.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}$(h,"is"),d.is=h})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(d,h){const f=(0,e.default)().timer.setTimeout(d.bind(h),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}}),rVt=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,G,H,j,q,ne,X,J,ee,te,pe,ie,Ce,Oe,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=Q9(),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(he,xe,ge){super(xe),this.code=e.number(he)?he:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,L.prototype)}toJson(){const he={code:this.code,message:this.message};return this.data!==void 0&&(he.data=this.data),he}},$(L,"ResponseError"),L);t.ResponseError=n;var i=(R=class{constructor(he){this.kind=he}static is(he){return he===R.auto||he===R.byName||he===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(he,xe){this.method=he,this.numberOfParams=xe}get parameterStructures(){return i.auto}},$(D,"AbstractMessageSignature"),D);t.AbstractMessageSignature=a;var o=(M=class extends a{constructor(he){super(he,0)}},$(M,"RequestType0"),M);t.RequestType0=o;var s=(I=class extends a{constructor(he,xe=i.auto){super(he,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(I,"RequestType"),I);t.RequestType=s;var l=(N=class extends a{constructor(he,xe=i.auto){super(he,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(he){super(he,2)}},$(F,"RequestType2"),F);t.RequestType2=u;var d=(B=class extends a{constructor(he){super(he,3)}},$(B,"RequestType3"),B);t.RequestType3=d;var h=(V=class extends a{constructor(he){super(he,4)}},$(V,"RequestType4"),V);t.RequestType4=h;var f=(z=class extends a{constructor(he){super(he,5)}},$(z,"RequestType5"),z);t.RequestType5=f;var p=(U=class extends a{constructor(he){super(he,6)}},$(U,"RequestType6"),U);t.RequestType6=p;var g=(G=class extends a{constructor(he){super(he,7)}},$(G,"RequestType7"),G);t.RequestType7=g;var m=(H=class extends a{constructor(he){super(he,8)}},$(H,"RequestType8"),H);t.RequestType8=m;var v=(j=class extends a{constructor(he){super(he,9)}},$(j,"RequestType9"),j);t.RequestType9=v;var y=(q=class extends a{constructor(he,xe=i.auto){super(he,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(q,"NotificationType"),q);t.NotificationType=y;var b=(ne=class extends a{constructor(he){super(he,0)}},$(ne,"NotificationType0"),ne);t.NotificationType0=b;var x=(X=class extends a{constructor(he,xe=i.auto){super(he,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(X,"NotificationType1"),X);t.NotificationType1=x;var w=(J=class extends a{constructor(he){super(he,2)}},$(J,"NotificationType2"),J);t.NotificationType2=w;var A=(ee=class extends a{constructor(he){super(he,3)}},$(ee,"NotificationType3"),ee);t.NotificationType3=A;var S=(te=class extends a{constructor(he){super(he,4)}},$(te,"NotificationType4"),te);t.NotificationType4=S;var T=(pe=class extends a{constructor(he){super(he,5)}},$(pe,"NotificationType5"),pe);t.NotificationType5=T;var C=(ie=class extends a{constructor(he){super(he,6)}},$(ie,"NotificationType6"),ie);t.NotificationType6=C;var O=(Ce=class extends a{constructor(he){super(he,7)}},$(Ce,"NotificationType7"),Ce);t.NotificationType7=O;var E=(Oe=class extends a{constructor(he){super(he,8)}},$(Oe,"NotificationType8"),Oe);t.NotificationType8=E;var _=(Ee=class extends a{constructor(he){super(he,9)}},$(Ee,"NotificationType9"),Ee);t.NotificationType9=_;var P;(function(ue){function he(ze){const we=ze;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}$(he,"isRequest"),ue.isRequest=he;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={}))}}),nVt=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 d=this._map.get(l);if(d)return u!==r.None&&this.touch(d,u),d.value}set(l,u,d=r.None){let h=this._map.get(l);if(h)h.value=u,d!==r.None&&this.touch(h,d);else{switch(h={key:l,value:u,next:void 0,previous:void 0},d){case r.None:this.addItemLast(h);break;case r.First:this.addItemFirst(h);break;case r.Last:this.addItemLast(h);break;default:this.addItemLast(h);break}this._map.set(l,h),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 d=this._state;let h=this._head;for(;h;){if(u?l.bind(u)(h.value,h.key,this):l(h.value,h.key,this),this._state!==d)throw new Error("LinkedMap got modified during iteration.");h=h.next}}keys(){const l=this._state;let u=this._head;const d={[Symbol.iterator]:()=>d,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const h={value:u.key,done:!1};return u=u.next,h}else return{value:void 0,done:!0}},"next")};return d}values(){const l=this._state;let u=this._head;const d={[Symbol.iterator]:()=>d,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const h={value:u.value,done:!1};return u=u.next,h}else return{value:void 0,done:!0}},"next")};return d}entries(){const l=this._state;let u=this._head;const d={[Symbol.iterator]:()=>d,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const h={value:[u.key,u.value],done:!1};return u=u.next,h}else return{value:void 0,done:!0}},"next")};return d}[(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,d=this.size;for(;u&&d>l;)this._map.delete(u.key),u=u.next,d--;this._head=u,this._size=d,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,d=l.previous;if(!u||!d)throw new Error("Invalid list");u.previous=d,d.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 d=l.next,h=l.previous;l===this._tail?(h.next=void 0,this._tail=h):(d.previous=h,h.next=d),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 d=l.next,h=l.previous;l===this._head?(d.previous=void 0,this._head=d):(d.previous=h,h.next=d),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,d)=>{l.push([d,u])}),l}fromJSON(l){this.clear();for(const[u,d]of l)this.set(u,d)}},$(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}}),xUn=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={}))}}),wUn=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var s,l,u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Xte(),r;(function(h){h.Continue=0,h.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=(d=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},$(d,"SharedArrayReceiverStrategy"),d);t.SharedArrayReceiverStrategy=o}}),iVt=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=hk(),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}}),AUn=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=hk(),r=Q9(),n=E3(),i=iVt(),a;(function(h){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"),h.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(h){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"),h.fromOptions=f})(s||(s={}));var l=(d=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))}},$(d,"ReadableStreamMessageReader"),d);t.ReadableStreamMessageReader=l}}),SUn=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var h,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=hk(),r=Q9(),n=iVt(),i=E3(),a="Content-Length: ",o=`\r @@ -1637,18 +1637,18 @@ ${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}).`:"";Oe.log(`Received response '${at.method} - (${Me.id})' in ${Date.now()-at.timerStart}ms.${Tt}`,wt)}else Oe.log(`Received response ${Me.id} without active response promise.`,wt)}else ut("receive-response",Me)}$(Ot,"traceReceivedResponse");function ut(Me,at){if(!Oe||ie===f.Off)return;const wt={isLSPMessage:!0,type:Me,message:at,timestamp:Date.now()};Oe.log(wt)}$(ut,"logLSPMessage");function Qt(){if(K())throw new b(y.Closed,"Connection is closed.");if(se())throw new b(y.Disposed,"Connection is disposed.")}$(Qt,"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 hr=0;hr{Qt();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 On=Ur-Ir;switch(On){case 0:Tt=void 0;break;case 1:Tt=At(Zr,at[Ir]);break;default:if(Zr===n.ParameterStructures.byName)throw new Error(`Received ${On} 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 hr={jsonrpc:U,method:wt,params:Tt};return Pe(hr),M.write(hr).catch(jr=>{throw F.error("Sending notification failed."),jr})},"sendNotification"),onNotification:$((Me,at)=>{Qt();let wt;return r.func(Me)?j=Me:at&&(r.string(Me)?(wt=Me,q.set(Me,{type:void 0,handler:at})):(wt=Me.method,q.set(Me.method,{type:Me,handler:at}))),{dispose:$(()=>{wt!==void 0?q.delete(wt):j=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)=>{Qt(),gt();let wt,Tt,hr;if(r.string(Me)){wt=Me;const Ur=at[0],On=at[at.length-1];let $r=0,hn=n.ParameterStructures.auto;n.ParameterStructures.is(Ur)&&($r=1,hn=Ur);let ii=at.length;o.CancellationToken.is(On)&&(ii=ii-1,hr=On);const pt=ii-$r;switch(pt){case 0:Tt=void 0;break;case 1:Tt=At(hn,at[$r]);break;default:if(hn===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 On=Me.numberOfParams;hr=o.CancellationToken.is(Ur[On])?Ur[On]:void 0}const jr=B++;let Ir;hr&&(Ir=hr.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,On)=>{const $r=$(pt=>{Ur(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"resolveWithCleanup"),hn=$(pt=>{On(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"rejectWithCleanup"),ii={method:wt,timerStart:Date.now(),resolve:$r,reject:hn};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)=>{Qt();let wt=null;return h.is(Me)?(wt=void 0,G=Me):r.string(Me)?(wt=null,at!==void 0&&(wt=Me,H.set(Me,{handler:at,type:void 0}))):at!==void 0&&(wt=Me.method,H.set(Me.method,{type:Me,handler:at})),{dispose:$(()=>{wt!==null&&(wt!==void 0?H.delete(wt):G=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Me,at,wt)=>{let Tt=!1,hr=g.Text;wt!==void 0&&(r.boolean(wt)?Tt=wt:(Tt=wt.sendNotification||!1,hr=wt.traceFormat||g.Text)),ie=Me,Ce=hr,ie===f.Off?Oe=void 0:Oe=at,Tt&&!K()&&!se()&&await qr.sendNotification(m.type,{value:f.toString(Me)})},"trace"),onError:ue.event,onClose:he.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:$(()=>{Qt(),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||!Oe)return;const at=ie===f.Verbose||ie===f.Compact;Oe.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=rVt();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=nVt();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=xUn();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=E3();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=Xte();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=wUn();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=AUn();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=SUn();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=TUn();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var d=CUn();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:$(function(){return d.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:$(function(){return d.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:$(function(){return d.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:$(function(){return d.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:$(function(){return d.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:$(function(){return d.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:$(function(){return d.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:$(function(){return d.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:$(function(){return d.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:$(function(){return d.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:$(function(){return d.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:$(function(){return d.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:$(function(){return d.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:$(function(){return d.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:$(function(){return d.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:$(function(){return d.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:$(function(){return d.MessageStrategy},"get")});var h=hk();t.RAL=h.default}}),kUn=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,d;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=(d=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()}},$(d,"WritableStreamWrapper"),d),a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:$(h=>new r(h),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:$((h,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(h,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:$((h,f)=>{if(!(h instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(h)))},"decode")})}),stream:Object.freeze({asReadableStream:$(h=>new n(h),"asReadableStream"),asWritableStream:$(h=>new i(h),"asWritableStream")}),console,timer:Object.freeze({setTimeout(h,f,...p){const g=setTimeout(h,f,...p);return{dispose:$(()=>clearTimeout(g),"dispose")}},setImmediate(h,...f){const p=setTimeout(h,0,...f);return{dispose:$(()=>clearTimeout(p),"dispose")}},setInterval(h,f,...p){const g=setInterval(h,f,...p);return{dispose:$(()=>clearInterval(g),"dispose")}}})});function s(){return o}$(s,"RIL"),function(h){function f(){e.RAL.install(o)}$(f,"install"),h.install=f}(s||(s={})),t.default=s}}),_3=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(d,h,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(h,f);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:$(function(){return h[f]},"get")}),Object.defineProperty(d,p,g)}:function(d,h,f,p){p===void 0&&(p=f),d[p]=h[f]}),r=t&&t.__exportStar||function(d,h){for(var f in d)f!=="default"&&!Object.prototype.hasOwnProperty.call(h,f)&&e(h,d,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=kUn();n.default.install();var i=G5e();r(G5e(),t);var a=(l=class extends i.AbstractMessageReader{constructor(h){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},h.addEventListener("error",f=>this.fireError(f)),h.onmessage=this._messageListener}listen(h){return this._onData.event(h)}},$(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var o=(u=class extends i.AbstractMessageWriter{constructor(h){super(),this.port=h,this.errorCount=0,h.addEventListener("error",f=>this.fireError(f))}write(h){try{return this.port.postMessage(h),Promise.resolve()}catch(f){return this.handleError(f,h),Promise.reject(f)}}handleError(h,f){this.errorCount++,this.fireError(h,f,this.errorCount)}end(){}},$(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=o;function s(d,h,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(d,h,f,p)}$(s,"createMessageConnection"),t.createMessageConnection=s}}),aVt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=_3()}}),Po=Fn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,d,h,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=_3(),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=(d=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},$(d,"ProtocolRequestType"),d);t.ProtocolRequestType=a;var o=(h=class extends e.NotificationType0{constructor(g){super(g)}},$(h,"ProtocolNotificationType0"),h);t.ProtocolNotificationType0=o;var s=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=s}}),Q5e=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(d){return d===!0||d===!1}$(e,"boolean"),t.boolean=e;function r(d){return typeof d=="string"||d instanceof String}$(r,"string"),t.string=r;function n(d){return typeof d=="number"||d instanceof Number}$(n,"number"),t.number=n;function i(d){return d instanceof Error}$(i,"error"),t.error=i;function a(d){return typeof d=="function"}$(a,"func"),t.func=a;function o(d){return Array.isArray(d)}$(o,"array"),t.array=o;function s(d){return o(d)&&d.every(h=>r(h))}$(s,"stringArray"),t.stringArray=s;function l(d,h){return Array.isArray(d)&&d.every(h)}$(l,"typedArray"),t.typedArray=l;function u(d){return d!==null&&typeof d=="object"}$(u,"objectLiteral"),t.objectLiteral=u}}),OUn=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={}))}}),EUn=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={}))}}),_Un=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={}))}}),RUn=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={}))}}),DUn=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={}))}}),LUn=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={}))}}),MUn=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={}))}}),IUn=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={}))}}),PUn=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=_3(),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={}))}}),NUn=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={}))}}),BUn=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={}))}}),$Un=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={}))}}),FUn=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={}))}}),zUn=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={}))}}),UUn=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={}))}}),VUn=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={}))}}),GUn=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={}))}}),QUn=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={}))}}),HUn=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=_3(),r=Q5e(),n=Po(),i;(function(u){function d(h){const f=h;return f&&r.boolean(f.retriggerRequest)}$(d,"is"),u.is=d})(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={}))}}),WUn=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=(G9(),U_e(Vte)),r=Q5e(),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 G;(function(Te){Te.method="shutdown",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType0(Te.method)})(G||(t.ShutdownRequest=G={}));var H;(function(Te){Te.method="exit",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType0(Te.method)})(H||(t.ExitNotification=H={}));var j;(function(Te){Te.method="workspace/didChangeConfiguration",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(j||(t.DidChangeConfigurationNotification=j={}));var q;(function(Te){Te.Error=1,Te.Warning=2,Te.Info=3,Te.Log=4,Te.Debug=5})(q||(t.MessageType=q={}));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 Oe;(function(Te){Te.method="textDocument/didClose",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));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 he;(function(Te){Te.method="textDocument/willSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(he||(t.WillSaveTextDocumentNotification=he={}));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 ke;(function(Te){Te.Create=1,Te.Change=2,Te.Delete=4})(ke||(t.WatchKind=ke={}));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 Ot;(function(Te){Te.Identifier=1})(Ot||(t.PrepareSupportDefaultBehavior=Ot={}));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 Qt;(function(Te){Te.method="textDocument/prepareRename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Qt||(t.PrepareRenameRequest=Qt={}));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={}))}}),jUn=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=_3();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}}),XUn=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(_3(),t),r((G9(),U_e(Vte)),t),r(Po(),t),r(qUn(),t);var n=jUn();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={}))}}),KUn=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=aVt();r(aVt(),t),r(XUn(),t);function i(a,o,s,l){return(0,n.createMessageConnection)(a,o,s,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),oVt={};T2(oVt,{AbstractAstReflection:()=>Y5e,AbstractCstNode:()=>D3e,AbstractLangiumParser:()=>M3e,AbstractParserErrorMessageProvider:()=>fJt,AbstractThreadedAsyncParser:()=>wJn,AstUtils:()=>q5e,BiMap:()=>Zne,Cancellation:()=>Ha,CompositeCstNodeImpl:()=>zne,ContextCache:()=>eie,CstNodeBuilder:()=>cJt,CstUtils:()=>H5e,DEFAULT_TOKENIZE_OPTIONS:()=>eDe,DONE_RESULT:()=>ld,DatatypeSymbol:()=>Une,DefaultAstNodeDescriptionProvider:()=>QJt,DefaultAstNodeLocator:()=>WJt,DefaultAsyncParser:()=>her,DefaultCommentProvider:()=>der,DefaultConfigurationProvider:()=>YJt,DefaultDocumentBuilder:()=>qJt,DefaultDocumentValidator:()=>GJt,DefaultHydrator:()=>per,DefaultIndexManager:()=>jJt,DefaultJsonSerializer:()=>FJt,DefaultLangiumDocumentFactory:()=>RJt,DefaultLangiumDocuments:()=>DJt,DefaultLangiumProfiler:()=>kJn,DefaultLexer:()=>tDe,DefaultLexerErrorMessageProvider:()=>KJt,DefaultLinker:()=>LJt,DefaultNameProvider:()=>MJt,DefaultReferenceDescriptionProvider:()=>HJt,DefaultReferences:()=>IJt,DefaultScopeComputation:()=>PJt,DefaultScopeProvider:()=>$Jt,DefaultServiceRegistry:()=>zJt,DefaultTokenBuilder:()=>Wne,DefaultValueConverter:()=>z3e,DefaultWorkspaceLock:()=>fer,DefaultWorkspaceManager:()=>XJt,Deferred:()=>gb,Disposable:()=>nO,DisposableCache:()=>Jne,DocumentCache:()=>BJt,DocumentState:()=>ui,DocumentValidator:()=>Gp,EMPTY_SCOPE:()=>vJn,EMPTY_STREAM:()=>R3,EmptyFileSystem:()=>Mc,EmptyFileSystemProvider:()=>yer,ErrorWithLocation:()=>Are,GrammarAST:()=>cVt,GrammarUtils:()=>CRe,IndentationAwareLexer:()=>SJn,IndentationAwareTokenBuilder:()=>ver,JSDocDocumentationProvider:()=>uer,LangiumCompletionParser:()=>pJt,LangiumParser:()=>hJt,LangiumParserErrorMessageProvider:()=>I3e,LeafCstNodeImpl:()=>Fne,LexingMode:()=>iO,MapScope:()=>mJn,Module:()=>dDe,MultiMap:()=>mb,MultiMapScope:()=>NJt,OperationCancelled:()=>bv,ParserWorker:()=>AJn,ProfilingTask:()=>xer,Reduction:()=>W9,RefResolving:()=>tO,RegExpUtils:()=>ORe,RootCstNodeImpl:()=>L3e,SimpleCache:()=>q3e,StreamImpl:()=>cv,StreamScope:()=>Y3e,TextDocument:()=>Xne,TreeStreamImpl:()=>D3,URI:()=>Sf,UriTrie:()=>H3e,UriUtils:()=>gd,VALIDATE_EACH_NODE:()=>VJt,ValidationCategory:()=>tie,ValidationRegistry:()=>UJt,ValueConverter:()=>yv,WorkspaceCache:()=>j3e,assertCondition:()=>kRe,assertUnreachable:()=>D2,createCompletionParser:()=>B3e,createDefaultCoreModule:()=>Kl,createDefaultSharedCoreModule:()=>Zl,createGrammarConfig:()=>WRe,createLangiumParser:()=>$3e,createParser:()=>Gne,delayNextTick:()=>Yne,diagnosticData:()=>rO,eagerLoad:()=>hDe,getDiagnosticRange:()=>Z3e,indentationBuilderDefaultOptions:()=>gDe,inject:()=>Ii,interruptAndCheck:()=>Xl,isAstNode:()=>Ks,isAstNodeDescription:()=>W5e,isAstNodeWithComment:()=>X3e,isCompositeCstNode:()=>eb,isIMultiModeLexerDefinition:()=>aie,isJSDoc:()=>nDe,isLeafCstNode:()=>pk,isLinkingError:()=>fk,isMultiReference:()=>lv,isNamed:()=>W3e,isOperationCancelled:()=>eO,isReference:()=>sd,isRootCstNode:()=>Kte,isTokenTypeArray:()=>iie,isTokenTypeDictionary:()=>oie,loadGrammarFromJson:()=>Jl,parseJSDoc:()=>rDe,prepareLangiumParser:()=>F3e,setInterruptionPeriod:()=>U3e,startCancelableOperation:()=>jne,stream:()=>ha,toDiagnosticData:()=>J3e,toDiagnosticSeverity:()=>qz});var H5e={};T2(H5e,{DefaultNameRegexp:()=>bRe,RangeComparison:()=>dv,compareRange:()=>vRe,findCommentNode:()=>xRe,findDeclarationNodeAtOffset:()=>EVt,findLeafNodeAtOffset:()=>wre,findLeafNodeBeforeOffset:()=>wRe,flattenCst:()=>OVt,getDatatypeNode:()=>kVt,getInteriorNodes:()=>DVt,getNextNode:()=>_Vt,getPreviousNode:()=>SRe,getStartlineNode:()=>RVt,inRange:()=>yRe,isChildNode:()=>mRe,isCommentNode:()=>xre,streamCst:()=>G3,toDocumentSegment:()=>Q3,tokenToRange:()=>nz});function Ks(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(Ks,"isAstNode");function sd(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(sd,"isReference");function lv(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(lv,"isMultiReference");function W5e(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(W5e,"isAstNodeDescription");function fk(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$(fk,"isLinkingError");var Y5e=(fL=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 Ks(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}}},$(fL,"AbstractAstReflection"),fL);function eb(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(eb,"isCompositeCstNode");function pk(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(pk,"isLeafCstNode");function Kte(t){return eb(t)&&typeof t.fullText=="string"}$(Kte,"isRootCstNode");var cv=(gh=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 gh(()=>({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 ld})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=sVt(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 gh(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ld:{done:!1,value:e(i)}})}filter(e){return new gh(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ld})}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 gh(()=>({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(H9(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ld})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new gh(()=>({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(H9(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ld})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new gh(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ld:this.nextFn(r.state)))}distinct(e){return new gh(()=>({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 ld})}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)})}},$(gh,"StreamImpl"),gh);function sVt(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(sVt,"toString");function H9(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(H9,"isIterable");var R3=new cv(()=>{},()=>ld),ld=Object.freeze({done:!0,value:void 0});function ha(...t){if(t.length===1){const e=t[0];if(e instanceof cv)return e;if(H9(e))return new cv(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new cv(()=>({index:0}),r=>r.index1?new cv(()=>({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 ld})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(pL,"TreeStreamImpl"),pL),W9;(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})(W9||(W9={}));var q5e={};T2(q5e,{assignMandatoryProperties:()=>j5e,copyAstNode:()=>ere,findRootNode:()=>M3,getContainerOfType:()=>gk,getDocument:()=>qg,getReferenceNodes:()=>Zte,hasContainerOfType:()=>lVt,linkContentToContainer:()=>L3,streamAllContents:()=>tb,streamAst:()=>jg,streamContents:()=>Y9,streamReferences:()=>I3});function L3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ks(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&L3(i,e))}):Ks(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&L3(n,e)))}$(L3,"linkContentToContainer");function gk(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(gk,"getContainerOfType");function lVt(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(lVt,"hasContainerOfType");function qg(t){const r=M3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(qg,"getDocument");function M3(t){for(;t.$container;)t=t.$container;return t}$(M3,"findRootNode");function Zte(t){return sd(t)?t.ref?[t.ref]:[]:lv(t)?t.items.map(e=>e.ref):[]}$(Zte,"getReferenceNodes");function Y9(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new cv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexY9(r,e))}$(tb,"streamAllContents");function jg(t,e){if(t){if(e!=null&&e.range&&!Jte(t,e.range))return new D3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new D3(t,r=>Y9(r,e),{includeRoot:!0})}$(jg,"streamAst");function Jte(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?yRe(r,e):!1}$(Jte,"isAstNodeInRange");function I3(t){return new cv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexah,AbstractParserRule:()=>q9,AbstractRule:()=>P3,AbstractType:()=>vf,Action:()=>C2,Alternatives:()=>j9,ArrayLiteral:()=>nre,ArrayType:()=>ire,Assignment:()=>O2,BooleanLiteral:()=>are,CharacterRange:()=>E2,Condition:()=>_2,Conjunction:()=>X9,CrossReference:()=>R2,Disjunction:()=>K9,EndOfFile:()=>ore,Grammar:()=>nb,GrammarImport:()=>sre,Group:()=>yk,InferredType:()=>lre,InfixRule:()=>uv,InfixRuleOperatorList:()=>J9,InfixRuleOperators:()=>cre,Interface:()=>B3,Keyword:()=>$3,LangiumGrammarAstReflection:()=>gRe,LangiumGrammarTerminals:()=>ZUn,NamedArgument:()=>F3,NegatedToken:()=>xk,Negation:()=>ure,NumberLiteral:()=>dre,Parameter:()=>z3,ParameterReference:()=>hre,ParserRule:()=>Xg,ReferenceType:()=>ez,RegexToken:()=>wk,ReturnType:()=>fre,RuleCall:()=>Ak,SimpleType:()=>U3,StringLiteral:()=>gre,TerminalAlternatives:()=>Sk,TerminalElement:()=>oh,TerminalGroup:()=>Tk,TerminalRule:()=>ob,TerminalRuleCall:()=>Ck,Type:()=>tz,TypeAttribute:()=>kk,TypeDefinition:()=>Ok,UnionType:()=>yre,UnorderedGroup:()=>rz,UntilToken:()=>Ek,ValueLiteral:()=>_k,Wildcard:()=>V3,isAbstractElement:()=>tre,isAbstractParserRule:()=>mk,isAbstractRule:()=>uVt,isAbstractType:()=>dVt,isAction:()=>k2,isAlternatives:()=>rre,isArrayLiteral:()=>hVt,isArrayType:()=>K5e,isAssignment:()=>rb,isBooleanLiteral:()=>Z5e,isCharacterRange:()=>J5e,isCondition:()=>fVt,isConjunction:()=>eRe,isCrossReference:()=>vk,isDisjunction:()=>tRe,isEndOfFile:()=>rRe,isGrammar:()=>pVt,isGrammarImport:()=>gVt,isGroup:()=>bk,isInferredType:()=>Z9,isInfixRule:()=>N3,isInfixRuleOperatorList:()=>mVt,isInfixRuleOperators:()=>vVt,isInterface:()=>nRe,isKeyword:()=>ib,isNamedArgument:()=>yVt,isNegatedToken:()=>iRe,isNegation:()=>aRe,isNumberLiteral:()=>bVt,isParameter:()=>xVt,isParameterReference:()=>oRe,isParserRule:()=>cd,isReferenceType:()=>sRe,isRegexToken:()=>lRe,isReturnType:()=>cRe,isRuleCall:()=>ab,isSimpleType:()=>pre,isStringLiteral:()=>wVt,isTerminalAlternatives:()=>uRe,isTerminalElement:()=>AVt,isTerminalGroup:()=>dRe,isTerminalRule:()=>$p,isTerminalRuleCall:()=>mre,isType:()=>vre,isTypeAttribute:()=>SVt,isTypeDefinition:()=>TVt,isUnionType:()=>hRe,isUnorderedGroup:()=>bre,isUntilToken:()=>fRe,isValueLiteral:()=>CVt,isWildcard:()=>pRe,reflection:()=>cn});var ZUn={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]*/},ah={$type:"AbstractElement",cardinality:"cardinality"};function tre(t){return cn.isInstance(t,ah.$type)}$(tre,"isAbstractElement");var q9={$type:"AbstractParserRule"};function mk(t){return cn.isInstance(t,q9.$type)}$(mk,"isAbstractParserRule");var P3={$type:"AbstractRule"};function uVt(t){return cn.isInstance(t,P3.$type)}$(uVt,"isAbstractRule");var vf={$type:"AbstractType"};function dVt(t){return cn.isInstance(t,vf.$type)}$(dVt,"isAbstractType");var C2={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function k2(t){return cn.isInstance(t,C2.$type)}$(k2,"isAction");var j9={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function rre(t){return cn.isInstance(t,j9.$type)}$(rre,"isAlternatives");var nre={$type:"ArrayLiteral",elements:"elements"};function hVt(t){return cn.isInstance(t,nre.$type)}$(hVt,"isArrayLiteral");var ire={$type:"ArrayType",elementType:"elementType"};function K5e(t){return cn.isInstance(t,ire.$type)}$(K5e,"isArrayType");var O2={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function rb(t){return cn.isInstance(t,O2.$type)}$(rb,"isAssignment");var are={$type:"BooleanLiteral",true:"true"};function Z5e(t){return cn.isInstance(t,are.$type)}$(Z5e,"isBooleanLiteral");var E2={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function J5e(t){return cn.isInstance(t,E2.$type)}$(J5e,"isCharacterRange");var _2={$type:"Condition"};function fVt(t){return cn.isInstance(t,_2.$type)}$(fVt,"isCondition");var X9={$type:"Conjunction",left:"left",right:"right"};function eRe(t){return cn.isInstance(t,X9.$type)}$(eRe,"isConjunction");var R2={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function vk(t){return cn.isInstance(t,R2.$type)}$(vk,"isCrossReference");var K9={$type:"Disjunction",left:"left",right:"right"};function tRe(t){return cn.isInstance(t,K9.$type)}$(tRe,"isDisjunction");var ore={$type:"EndOfFile",cardinality:"cardinality"};function rRe(t){return cn.isInstance(t,ore.$type)}$(rRe,"isEndOfFile");var nb={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function pVt(t){return cn.isInstance(t,nb.$type)}$(pVt,"isGrammar");var sre={$type:"GrammarImport",path:"path"};function gVt(t){return cn.isInstance(t,sre.$type)}$(gVt,"isGrammarImport");var yk={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function bk(t){return cn.isInstance(t,yk.$type)}$(bk,"isGroup");var lre={$type:"InferredType",name:"name"};function Z9(t){return cn.isInstance(t,lre.$type)}$(Z9,"isInferredType");var uv={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function N3(t){return cn.isInstance(t,uv.$type)}$(N3,"isInfixRule");var J9={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function mVt(t){return cn.isInstance(t,J9.$type)}$(mVt,"isInfixRuleOperatorList");var cre={$type:"InfixRuleOperators",precedences:"precedences"};function vVt(t){return cn.isInstance(t,cre.$type)}$(vVt,"isInfixRuleOperators");var B3={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function nRe(t){return cn.isInstance(t,B3.$type)}$(nRe,"isInterface");var $3={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function ib(t){return cn.isInstance(t,$3.$type)}$(ib,"isKeyword");var F3={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function yVt(t){return cn.isInstance(t,F3.$type)}$(yVt,"isNamedArgument");var xk={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function iRe(t){return cn.isInstance(t,xk.$type)}$(iRe,"isNegatedToken");var ure={$type:"Negation",value:"value"};function aRe(t){return cn.isInstance(t,ure.$type)}$(aRe,"isNegation");var dre={$type:"NumberLiteral",value:"value"};function bVt(t){return cn.isInstance(t,dre.$type)}$(bVt,"isNumberLiteral");var z3={$type:"Parameter",name:"name"};function xVt(t){return cn.isInstance(t,z3.$type)}$(xVt,"isParameter");var hre={$type:"ParameterReference",parameter:"parameter"};function oRe(t){return cn.isInstance(t,hre.$type)}$(oRe,"isParameterReference");var Xg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function cd(t){return cn.isInstance(t,Xg.$type)}$(cd,"isParserRule");var ez={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function sRe(t){return cn.isInstance(t,ez.$type)}$(sRe,"isReferenceType");var wk={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function lRe(t){return cn.isInstance(t,wk.$type)}$(lRe,"isRegexToken");var fre={$type:"ReturnType",name:"name"};function cRe(t){return cn.isInstance(t,fre.$type)}$(cRe,"isReturnType");var Ak={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ab(t){return cn.isInstance(t,Ak.$type)}$(ab,"isRuleCall");var U3={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function pre(t){return cn.isInstance(t,U3.$type)}$(pre,"isSimpleType");var gre={$type:"StringLiteral",value:"value"};function wVt(t){return cn.isInstance(t,gre.$type)}$(wVt,"isStringLiteral");var Sk={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function uRe(t){return cn.isInstance(t,Sk.$type)}$(uRe,"isTerminalAlternatives");var oh={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function AVt(t){return cn.isInstance(t,oh.$type)}$(AVt,"isTerminalElement");var Tk={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function dRe(t){return cn.isInstance(t,Tk.$type)}$(dRe,"isTerminalGroup");var ob={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function $p(t){return cn.isInstance(t,ob.$type)}$($p,"isTerminalRule");var Ck={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function mre(t){return cn.isInstance(t,Ck.$type)}$(mre,"isTerminalRuleCall");var tz={$type:"Type",name:"name",type:"type"};function vre(t){return cn.isInstance(t,tz.$type)}$(vre,"isType");var kk={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function SVt(t){return cn.isInstance(t,kk.$type)}$(SVt,"isTypeAttribute");var Ok={$type:"TypeDefinition"};function TVt(t){return cn.isInstance(t,Ok.$type)}$(TVt,"isTypeDefinition");var yre={$type:"UnionType",types:"types"};function hRe(t){return cn.isInstance(t,yre.$type)}$(hRe,"isUnionType");var rz={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function bre(t){return cn.isInstance(t,rz.$type)}$(bre,"isUnorderedGroup");var Ek={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function fRe(t){return cn.isInstance(t,Ek.$type)}$(fRe,"isUntilToken");var _k={$type:"ValueLiteral"};function CVt(t){return cn.isInstance(t,_k.$type)}$(CVt,"isValueLiteral");var V3={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function pRe(t){return cn.isInstance(t,V3.$type)}$(pRe,"isWildcard");var gRe=(gL=class extends Y5e{constructor(){super(...arguments),this.types={AbstractElement:{name:ah.$type,properties:{cardinality:{name:ah.cardinality}},superTypes:[]},AbstractParserRule:{name:q9.$type,properties:{},superTypes:[P3.$type,vf.$type]},AbstractRule:{name:P3.$type,properties:{},superTypes:[]},AbstractType:{name:vf.$type,properties:{},superTypes:[]},Action:{name:C2.$type,properties:{cardinality:{name:C2.cardinality},feature:{name:C2.feature},inferredType:{name:C2.inferredType},operator:{name:C2.operator},type:{name:C2.type,referenceType:vf.$type}},superTypes:[ah.$type]},Alternatives:{name:j9.$type,properties:{cardinality:{name:j9.cardinality},elements:{name:j9.elements,defaultValue:[]}},superTypes:[ah.$type]},ArrayLiteral:{name:nre.$type,properties:{elements:{name:nre.elements,defaultValue:[]}},superTypes:[_k.$type]},ArrayType:{name:ire.$type,properties:{elementType:{name:ire.elementType}},superTypes:[Ok.$type]},Assignment:{name:O2.$type,properties:{cardinality:{name:O2.cardinality},feature:{name:O2.feature},operator:{name:O2.operator},predicate:{name:O2.predicate},terminal:{name:O2.terminal}},superTypes:[ah.$type]},BooleanLiteral:{name:are.$type,properties:{true:{name:are.true,defaultValue:!1}},superTypes:[_2.$type,_k.$type]},CharacterRange:{name:E2.$type,properties:{cardinality:{name:E2.cardinality},left:{name:E2.left},lookahead:{name:E2.lookahead},parenthesized:{name:E2.parenthesized,defaultValue:!1},right:{name:E2.right}},superTypes:[oh.$type]},Condition:{name:_2.$type,properties:{},superTypes:[]},Conjunction:{name:X9.$type,properties:{left:{name:X9.left},right:{name:X9.right}},superTypes:[_2.$type]},CrossReference:{name:R2.$type,properties:{cardinality:{name:R2.cardinality},deprecatedSyntax:{name:R2.deprecatedSyntax,defaultValue:!1},isMulti:{name:R2.isMulti,defaultValue:!1},terminal:{name:R2.terminal},type:{name:R2.type,referenceType:vf.$type}},superTypes:[ah.$type]},Disjunction:{name:K9.$type,properties:{left:{name:K9.left},right:{name:K9.right}},superTypes:[_2.$type]},EndOfFile:{name:ore.$type,properties:{cardinality:{name:ore.cardinality}},superTypes:[ah.$type]},Grammar:{name:nb.$type,properties:{imports:{name:nb.imports,defaultValue:[]},interfaces:{name:nb.interfaces,defaultValue:[]},isDeclared:{name:nb.isDeclared,defaultValue:!1},name:{name:nb.name},rules:{name:nb.rules,defaultValue:[]},types:{name:nb.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:sre.$type,properties:{path:{name:sre.path}},superTypes:[]},Group:{name:yk.$type,properties:{cardinality:{name:yk.cardinality},elements:{name:yk.elements,defaultValue:[]},guardCondition:{name:yk.guardCondition},predicate:{name:yk.predicate}},superTypes:[ah.$type]},InferredType:{name:lre.$type,properties:{name:{name:lre.name}},superTypes:[vf.$type]},InfixRule:{name:uv.$type,properties:{call:{name:uv.call},dataType:{name:uv.dataType},inferredType:{name:uv.inferredType},name:{name:uv.name},operators:{name:uv.operators},parameters:{name:uv.parameters,defaultValue:[]},returnType:{name:uv.returnType,referenceType:vf.$type}},superTypes:[q9.$type]},InfixRuleOperatorList:{name:J9.$type,properties:{associativity:{name:J9.associativity},operators:{name:J9.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:cre.$type,properties:{precedences:{name:cre.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:B3.$type,properties:{attributes:{name:B3.attributes,defaultValue:[]},name:{name:B3.name},superTypes:{name:B3.superTypes,defaultValue:[],referenceType:vf.$type}},superTypes:[vf.$type]},Keyword:{name:$3.$type,properties:{cardinality:{name:$3.cardinality},predicate:{name:$3.predicate},value:{name:$3.value}},superTypes:[ah.$type]},NamedArgument:{name:F3.$type,properties:{calledByName:{name:F3.calledByName,defaultValue:!1},parameter:{name:F3.parameter,referenceType:z3.$type},value:{name:F3.value}},superTypes:[]},NegatedToken:{name:xk.$type,properties:{cardinality:{name:xk.cardinality},lookahead:{name:xk.lookahead},parenthesized:{name:xk.parenthesized,defaultValue:!1},terminal:{name:xk.terminal}},superTypes:[oh.$type]},Negation:{name:ure.$type,properties:{value:{name:ure.value}},superTypes:[_2.$type]},NumberLiteral:{name:dre.$type,properties:{value:{name:dre.value}},superTypes:[_k.$type]},Parameter:{name:z3.$type,properties:{name:{name:z3.name}},superTypes:[]},ParameterReference:{name:hre.$type,properties:{parameter:{name:hre.parameter,referenceType:z3.$type}},superTypes:[_2.$type]},ParserRule:{name:Xg.$type,properties:{dataType:{name:Xg.dataType},definition:{name:Xg.definition},entry:{name:Xg.entry,defaultValue:!1},fragment:{name:Xg.fragment,defaultValue:!1},inferredType:{name:Xg.inferredType},name:{name:Xg.name},parameters:{name:Xg.parameters,defaultValue:[]},returnType:{name:Xg.returnType,referenceType:vf.$type}},superTypes:[q9.$type]},ReferenceType:{name:ez.$type,properties:{isMulti:{name:ez.isMulti,defaultValue:!1},referenceType:{name:ez.referenceType}},superTypes:[Ok.$type]},RegexToken:{name:wk.$type,properties:{cardinality:{name:wk.cardinality},lookahead:{name:wk.lookahead},parenthesized:{name:wk.parenthesized,defaultValue:!1},regex:{name:wk.regex}},superTypes:[oh.$type]},ReturnType:{name:fre.$type,properties:{name:{name:fre.name}},superTypes:[]},RuleCall:{name:Ak.$type,properties:{arguments:{name:Ak.arguments,defaultValue:[]},cardinality:{name:Ak.cardinality},predicate:{name:Ak.predicate},rule:{name:Ak.rule,referenceType:P3.$type}},superTypes:[ah.$type]},SimpleType:{name:U3.$type,properties:{primitiveType:{name:U3.primitiveType},stringType:{name:U3.stringType},typeRef:{name:U3.typeRef,referenceType:vf.$type}},superTypes:[Ok.$type]},StringLiteral:{name:gre.$type,properties:{value:{name:gre.value}},superTypes:[_k.$type]},TerminalAlternatives:{name:Sk.$type,properties:{cardinality:{name:Sk.cardinality},elements:{name:Sk.elements,defaultValue:[]},lookahead:{name:Sk.lookahead},parenthesized:{name:Sk.parenthesized,defaultValue:!1}},superTypes:[oh.$type]},TerminalElement:{name:oh.$type,properties:{cardinality:{name:oh.cardinality},lookahead:{name:oh.lookahead},parenthesized:{name:oh.parenthesized,defaultValue:!1}},superTypes:[ah.$type]},TerminalGroup:{name:Tk.$type,properties:{cardinality:{name:Tk.cardinality},elements:{name:Tk.elements,defaultValue:[]},lookahead:{name:Tk.lookahead},parenthesized:{name:Tk.parenthesized,defaultValue:!1}},superTypes:[oh.$type]},TerminalRule:{name:ob.$type,properties:{definition:{name:ob.definition},fragment:{name:ob.fragment,defaultValue:!1},hidden:{name:ob.hidden,defaultValue:!1},name:{name:ob.name},type:{name:ob.type}},superTypes:[P3.$type]},TerminalRuleCall:{name:Ck.$type,properties:{cardinality:{name:Ck.cardinality},lookahead:{name:Ck.lookahead},parenthesized:{name:Ck.parenthesized,defaultValue:!1},rule:{name:Ck.rule,referenceType:ob.$type}},superTypes:[oh.$type]},Type:{name:tz.$type,properties:{name:{name:tz.name},type:{name:tz.type}},superTypes:[vf.$type]},TypeAttribute:{name:kk.$type,properties:{defaultValue:{name:kk.defaultValue},isOptional:{name:kk.isOptional,defaultValue:!1},name:{name:kk.name},type:{name:kk.type}},superTypes:[]},TypeDefinition:{name:Ok.$type,properties:{},superTypes:[]},UnionType:{name:yre.$type,properties:{types:{name:yre.types,defaultValue:[]}},superTypes:[Ok.$type]},UnorderedGroup:{name:rz.$type,properties:{cardinality:{name:rz.cardinality},elements:{name:rz.elements,defaultValue:[]}},superTypes:[ah.$type]},UntilToken:{name:Ek.$type,properties:{cardinality:{name:Ek.cardinality},lookahead:{name:Ek.lookahead},parenthesized:{name:Ek.parenthesized,defaultValue:!1},terminal:{name:Ek.terminal}},superTypes:[oh.$type]},ValueLiteral:{name:_k.$type,properties:{},superTypes:[]},Wildcard:{name:V3.$type,properties:{cardinality:{name:V3.cardinality},lookahead:{name:V3.lookahead},parenthesized:{name:V3.parenthesized,defaultValue:!1}},superTypes:[oh.$type]}}}},$(gL,"LangiumGrammarAstReflection"),gL),cn=new gRe;function kVt(t){let e=t,r=!1;for(;e;){const n=gk(e.grammarSource,cd);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(kVt,"getDatatypeNode");function G3(t){return new D3(t,e=>eb(e)?e.content:[],{includeRoot:!0})}$(G3,"streamCst");function OVt(t){return G3(t).filter(pk)}$(OVt,"flattenCst");function mRe(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(mRe,"isChildNode");function nz(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(nz,"tokenToRange");function Q3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(Q3,"toDocumentSegment");var dv;(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"})(dv||(dv={}));function vRe(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return dv.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linedv.After}$(yRe,"inRange");var bRe=/^[\w\p{L}]$/u;function EVt(t,e,r=bRe){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return wre(t,e)}}$(EVt,"findDeclarationNodeAtOffset");function xRe(t,e){if(t){const r=SRe(t,!0);if(r&&xre(r,e))return r;if(Kte(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(xre(a,e))return a}}}}$(xRe,"findCommentNode");function xre(t,e){return pk(t)&&e.includes(t.tokenType.name)}$(xre,"isCommentNode");function wre(t,e){if(pk(t))return t;if(eb(t)){const r=ARe(t,e,!1);if(r)return wre(r,e)}}$(wre,"findLeafNodeAtOffset");function wRe(t,e){if(pk(t))return t;if(eb(t)){const r=ARe(t,e,!0);if(r)return wRe(r,e)}}$(wRe,"findLeafNodeBeforeOffset");function ARe(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}$(ARe,"binarySearch");function SRe(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}}$(SRe,"getPreviousNode");function _Vt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nFRe,findNameAssignment:()=>Mre,findNodeForKeyword:()=>$Re,findNodeForProperty:()=>Rre,findNodesForKeyword:()=>UVt,findNodesForKeywordInternal:()=>Lre,findNodesForProperty:()=>BRe,getActionAtElement:()=>URe,getActionType:()=>GRe,getAllReachableRules:()=>_re,getAllRulesUsedForCrossReferences:()=>zVt,getCrossReferenceTerminal:()=>PRe,getEntryRule:()=>LRe,getExplicitRuleType:()=>az,getHiddenRules:()=>MRe,getRuleType:()=>QRe,getRuleTypeName:()=>WVt,getTypeName:()=>Lk,isArrayCardinality:()=>GVt,isArrayOperator:()=>QVt,isCommentTerminal:()=>NRe,isDataType:()=>HVt,isDataTypeRule:()=>iz,isOptionalCardinality:()=>VVt,terminalRegex:()=>oz});var Are=(mL=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(mL,"ErrorWithLocation"),mL);function D2(t,e="Error: Got unexpected value."){throw new Error(e)}$(D2,"assertUnreachable");function kRe(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(kRe,"assertCondition");var ORe={};T2(ORe,{NEWLINE_REGEXP:()=>NVt,escapeRegExp:()=>W3,getTerminalParts:()=>$Vt,isMultilineComment:()=>_Re,isWhitespace:()=>Ere,partialMatches:()=>RRe,partialRegExp:()=>DRe,whitespaceCharacters:()=>FVt});function An(t){return t.charCodeAt(0)}$(An,"cc");function Sre(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(Sre,"insertToSet");function H3(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$(H3,"addFlag");function Rk(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(Rk,"ASSERT_EXISTS");function MVt(){throw Error("Internal Error - Should never get here!")}$(MVt,"ASSERT_NEVER_REACH_HERE");function ERe(t){return t.type==="Character"}$(ERe,"isCharacter");var Tre=[];for(let t=An("0");t<=An("9");t++)Tre.push(t);var Cre=[An("_")].concat(Tre);for(let t=An("a");t<=An("z");t++)Cre.push(t);for(let t=An("A");t<=An("Z");t++)Cre.push(t);var IVt=[An(" "),An("\f"),An(` +`)),at){const Tt=Me.error?` Request failed: ${Me.error.message} (${Me.error.code}).`:"";Oe.log(`Received response '${at.method} - (${Me.id})' in ${Date.now()-at.timerStart}ms.${Tt}`,wt)}else Oe.log(`Received response ${Me.id} without active response promise.`,wt)}else ut("receive-response",Me)}$(Ot,"traceReceivedResponse");function ut(Me,at){if(!Oe||ie===f.Off)return;const wt={isLSPMessage:!0,type:Me,message:at,timestamp:Date.now()};Oe.log(wt)}$(ut,"logLSPMessage");function Qt(){if(K())throw new b(y.Closed,"Connection is closed.");if(se())throw new b(y.Disposed,"Connection is disposed.")}$(Qt,"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 hr=0;hr{Qt();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 On=Ur-Ir;switch(On){case 0:Tt=void 0;break;case 1:Tt=At(Zr,at[Ir]);break;default:if(Zr===n.ParameterStructures.byName)throw new Error(`Received ${On} 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 hr={jsonrpc:U,method:wt,params:Tt};return Pe(hr),M.write(hr).catch(jr=>{throw F.error("Sending notification failed."),jr})},"sendNotification"),onNotification:$((Me,at)=>{Qt();let wt;return r.func(Me)?j=Me:at&&(r.string(Me)?(wt=Me,q.set(Me,{type:void 0,handler:at})):(wt=Me.method,q.set(Me.method,{type:Me,handler:at}))),{dispose:$(()=>{wt!==void 0?q.delete(wt):j=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)=>{Qt(),gt();let wt,Tt,hr;if(r.string(Me)){wt=Me;const Ur=at[0],On=at[at.length-1];let $r=0,hn=n.ParameterStructures.auto;n.ParameterStructures.is(Ur)&&($r=1,hn=Ur);let ii=at.length;o.CancellationToken.is(On)&&(ii=ii-1,hr=On);const pt=ii-$r;switch(pt){case 0:Tt=void 0;break;case 1:Tt=At(hn,at[$r]);break;default:if(hn===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 On=Me.numberOfParams;hr=o.CancellationToken.is(Ur[On])?Ur[On]:void 0}const jr=B++;let Ir;hr&&(Ir=hr.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,On)=>{const $r=$(pt=>{Ur(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"resolveWithCleanup"),hn=$(pt=>{On(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"rejectWithCleanup"),ii={method:wt,timerStart:Date.now(),resolve:$r,reject:hn};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)=>{Qt();let wt=null;return h.is(Me)?(wt=void 0,G=Me):r.string(Me)?(wt=null,at!==void 0&&(wt=Me,H.set(Me,{handler:at,type:void 0}))):at!==void 0&&(wt=Me.method,H.set(Me.method,{type:Me,handler:at})),{dispose:$(()=>{wt!==null&&(wt!==void 0?H.delete(wt):G=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Me,at,wt)=>{let Tt=!1,hr=g.Text;wt!==void 0&&(r.boolean(wt)?Tt=wt:(Tt=wt.sendNotification||!1,hr=wt.traceFormat||g.Text)),ie=Me,Ce=hr,ie===f.Off?Oe=void 0:Oe=at,Tt&&!K()&&!se()&&await qr.sendNotification(m.type,{value:f.toString(Me)})},"trace"),onError:ue.event,onClose:he.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:$(()=>{Qt(),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||!Oe)return;const at=ie===f.Verbose||ie===f.Compact;Oe.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}}),GRe=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=rVt();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=nVt();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=xUn();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=E3();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=Xte();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=wUn();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=AUn();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=SUn();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=TUn();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var d=CUn();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:$(function(){return d.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:$(function(){return d.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:$(function(){return d.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:$(function(){return d.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:$(function(){return d.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:$(function(){return d.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:$(function(){return d.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:$(function(){return d.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:$(function(){return d.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:$(function(){return d.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:$(function(){return d.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:$(function(){return d.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:$(function(){return d.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:$(function(){return d.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:$(function(){return d.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:$(function(){return d.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:$(function(){return d.MessageStrategy},"get")});var h=hk();t.RAL=h.default}}),kUn=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,d;Object.defineProperty(t,"__esModule",{value:!0});var e=GRe(),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=(d=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()}},$(d,"WritableStreamWrapper"),d),a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:$(h=>new r(h),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:$((h,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(h,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:$((h,f)=>{if(!(h instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(h)))},"decode")})}),stream:Object.freeze({asReadableStream:$(h=>new n(h),"asReadableStream"),asWritableStream:$(h=>new i(h),"asWritableStream")}),console,timer:Object.freeze({setTimeout(h,f,...p){const g=setTimeout(h,f,...p);return{dispose:$(()=>clearTimeout(g),"dispose")}},setImmediate(h,...f){const p=setTimeout(h,0,...f);return{dispose:$(()=>clearTimeout(p),"dispose")}},setInterval(h,f,...p){const g=setInterval(h,f,...p);return{dispose:$(()=>clearInterval(g),"dispose")}}})});function s(){return o}$(s,"RIL"),function(h){function f(){e.RAL.install(o)}$(f,"install"),h.install=f}(s||(s={})),t.default=s}}),_3=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(d,h,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(h,f);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:$(function(){return h[f]},"get")}),Object.defineProperty(d,p,g)}:function(d,h,f,p){p===void 0&&(p=f),d[p]=h[f]}),r=t&&t.__exportStar||function(d,h){for(var f in d)f!=="default"&&!Object.prototype.hasOwnProperty.call(h,f)&&e(h,d,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=kUn();n.default.install();var i=GRe();r(GRe(),t);var a=(l=class extends i.AbstractMessageReader{constructor(h){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},h.addEventListener("error",f=>this.fireError(f)),h.onmessage=this._messageListener}listen(h){return this._onData.event(h)}},$(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var o=(u=class extends i.AbstractMessageWriter{constructor(h){super(),this.port=h,this.errorCount=0,h.addEventListener("error",f=>this.fireError(f))}write(h){try{return this.port.postMessage(h),Promise.resolve()}catch(f){return this.handleError(f,h),Promise.reject(f)}}handleError(h,f){this.errorCount++,this.fireError(h,f,this.errorCount)}end(){}},$(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=o;function s(d,h,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(d,h,f,p)}$(s,"createMessageConnection"),t.createMessageConnection=s}}),aVt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=_3()}}),Po=Fn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,d,h,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=_3(),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=(d=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},$(d,"ProtocolRequestType"),d);t.ProtocolRequestType=a;var o=(h=class extends e.NotificationType0{constructor(g){super(g)}},$(h,"ProtocolNotificationType0"),h);t.ProtocolNotificationType0=o;var s=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=s}}),QRe=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(d){return d===!0||d===!1}$(e,"boolean"),t.boolean=e;function r(d){return typeof d=="string"||d instanceof String}$(r,"string"),t.string=r;function n(d){return typeof d=="number"||d instanceof Number}$(n,"number"),t.number=n;function i(d){return d instanceof Error}$(i,"error"),t.error=i;function a(d){return typeof d=="function"}$(a,"func"),t.func=a;function o(d){return Array.isArray(d)}$(o,"array"),t.array=o;function s(d){return o(d)&&d.every(h=>r(h))}$(s,"stringArray"),t.stringArray=s;function l(d,h){return Array.isArray(d)&&d.every(h)}$(l,"typedArray"),t.typedArray=l;function u(d){return d!==null&&typeof d=="object"}$(u,"objectLiteral"),t.objectLiteral=u}}),OUn=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={}))}}),EUn=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={}))}}),_Un=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={}))}}),RUn=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={}))}}),DUn=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={}))}}),LUn=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={}))}}),MUn=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={}))}}),IUn=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={}))}}),PUn=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=_3(),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={}))}}),NUn=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={}))}}),BUn=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={}))}}),$Un=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={}))}}),FUn=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={}))}}),zUn=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={}))}}),UUn=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={}))}}),VUn=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={}))}}),GUn=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={}))}}),QUn=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={}))}}),HUn=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=_3(),r=QRe(),n=Po(),i;(function(u){function d(h){const f=h;return f&&r.boolean(f.retriggerRequest)}$(d,"is"),u.is=d})(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={}))}}),WUn=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=(G9(),U_e(Vte)),r=QRe(),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 G;(function(Te){Te.method="shutdown",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType0(Te.method)})(G||(t.ShutdownRequest=G={}));var H;(function(Te){Te.method="exit",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType0(Te.method)})(H||(t.ExitNotification=H={}));var j;(function(Te){Te.method="workspace/didChangeConfiguration",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(j||(t.DidChangeConfigurationNotification=j={}));var q;(function(Te){Te.Error=1,Te.Warning=2,Te.Info=3,Te.Log=4,Te.Debug=5})(q||(t.MessageType=q={}));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 Oe;(function(Te){Te.method="textDocument/didClose",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));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 he;(function(Te){Te.method="textDocument/willSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(he||(t.WillSaveTextDocumentNotification=he={}));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 ke;(function(Te){Te.Create=1,Te.Change=2,Te.Delete=4})(ke||(t.WatchKind=ke={}));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 Ot;(function(Te){Te.Identifier=1})(Ot||(t.PrepareSupportDefaultBehavior=Ot={}));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 Qt;(function(Te){Te.method="textDocument/prepareRename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Qt||(t.PrepareRenameRequest=Qt={}));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={}))}}),jUn=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=_3();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}}),XUn=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(_3(),t),r((G9(),U_e(Vte)),t),r(Po(),t),r(qUn(),t);var n=jUn();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={}))}}),KUn=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=aVt();r(aVt(),t),r(XUn(),t);function i(a,o,s,l){return(0,n.createMessageConnection)(a,o,s,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),oVt={};T2(oVt,{AbstractAstReflection:()=>YRe,AbstractCstNode:()=>D3e,AbstractLangiumParser:()=>M3e,AbstractParserErrorMessageProvider:()=>fJt,AbstractThreadedAsyncParser:()=>wJn,AstUtils:()=>qRe,BiMap:()=>Zne,Cancellation:()=>Ha,CompositeCstNodeImpl:()=>zne,ContextCache:()=>eie,CstNodeBuilder:()=>cJt,CstUtils:()=>HRe,DEFAULT_TOKENIZE_OPTIONS:()=>eDe,DONE_RESULT:()=>ld,DatatypeSymbol:()=>Une,DefaultAstNodeDescriptionProvider:()=>QJt,DefaultAstNodeLocator:()=>WJt,DefaultAsyncParser:()=>her,DefaultCommentProvider:()=>der,DefaultConfigurationProvider:()=>YJt,DefaultDocumentBuilder:()=>qJt,DefaultDocumentValidator:()=>GJt,DefaultHydrator:()=>per,DefaultIndexManager:()=>jJt,DefaultJsonSerializer:()=>FJt,DefaultLangiumDocumentFactory:()=>RJt,DefaultLangiumDocuments:()=>DJt,DefaultLangiumProfiler:()=>kJn,DefaultLexer:()=>tDe,DefaultLexerErrorMessageProvider:()=>KJt,DefaultLinker:()=>LJt,DefaultNameProvider:()=>MJt,DefaultReferenceDescriptionProvider:()=>HJt,DefaultReferences:()=>IJt,DefaultScopeComputation:()=>PJt,DefaultScopeProvider:()=>$Jt,DefaultServiceRegistry:()=>zJt,DefaultTokenBuilder:()=>Wne,DefaultValueConverter:()=>z3e,DefaultWorkspaceLock:()=>fer,DefaultWorkspaceManager:()=>XJt,Deferred:()=>gb,Disposable:()=>nO,DisposableCache:()=>Jne,DocumentCache:()=>BJt,DocumentState:()=>ui,DocumentValidator:()=>Gp,EMPTY_SCOPE:()=>vJn,EMPTY_STREAM:()=>R3,EmptyFileSystem:()=>Mc,EmptyFileSystemProvider:()=>yer,ErrorWithLocation:()=>Are,GrammarAST:()=>cVt,GrammarUtils:()=>C5e,IndentationAwareLexer:()=>SJn,IndentationAwareTokenBuilder:()=>ver,JSDocDocumentationProvider:()=>uer,LangiumCompletionParser:()=>pJt,LangiumParser:()=>hJt,LangiumParserErrorMessageProvider:()=>I3e,LeafCstNodeImpl:()=>Fne,LexingMode:()=>iO,MapScope:()=>mJn,Module:()=>dDe,MultiMap:()=>mb,MultiMapScope:()=>NJt,OperationCancelled:()=>bv,ParserWorker:()=>AJn,ProfilingTask:()=>xer,Reduction:()=>W9,RefResolving:()=>tO,RegExpUtils:()=>O5e,RootCstNodeImpl:()=>L3e,SimpleCache:()=>q3e,StreamImpl:()=>cv,StreamScope:()=>Y3e,TextDocument:()=>Xne,TreeStreamImpl:()=>D3,URI:()=>Sf,UriTrie:()=>H3e,UriUtils:()=>gd,VALIDATE_EACH_NODE:()=>VJt,ValidationCategory:()=>tie,ValidationRegistry:()=>UJt,ValueConverter:()=>yv,WorkspaceCache:()=>j3e,assertCondition:()=>k5e,assertUnreachable:()=>D2,createCompletionParser:()=>B3e,createDefaultCoreModule:()=>Kl,createDefaultSharedCoreModule:()=>Zl,createGrammarConfig:()=>W5e,createLangiumParser:()=>$3e,createParser:()=>Gne,delayNextTick:()=>Yne,diagnosticData:()=>rO,eagerLoad:()=>hDe,getDiagnosticRange:()=>Z3e,indentationBuilderDefaultOptions:()=>gDe,inject:()=>Ii,interruptAndCheck:()=>Xl,isAstNode:()=>Ks,isAstNodeDescription:()=>WRe,isAstNodeWithComment:()=>X3e,isCompositeCstNode:()=>eb,isIMultiModeLexerDefinition:()=>aie,isJSDoc:()=>nDe,isLeafCstNode:()=>pk,isLinkingError:()=>fk,isMultiReference:()=>lv,isNamed:()=>W3e,isOperationCancelled:()=>eO,isReference:()=>sd,isRootCstNode:()=>Kte,isTokenTypeArray:()=>iie,isTokenTypeDictionary:()=>oie,loadGrammarFromJson:()=>Jl,parseJSDoc:()=>rDe,prepareLangiumParser:()=>F3e,setInterruptionPeriod:()=>U3e,startCancelableOperation:()=>jne,stream:()=>ha,toDiagnosticData:()=>J3e,toDiagnosticSeverity:()=>qz});var HRe={};T2(HRe,{DefaultNameRegexp:()=>b5e,RangeComparison:()=>dv,compareRange:()=>v5e,findCommentNode:()=>x5e,findDeclarationNodeAtOffset:()=>EVt,findLeafNodeAtOffset:()=>wre,findLeafNodeBeforeOffset:()=>w5e,flattenCst:()=>OVt,getDatatypeNode:()=>kVt,getInteriorNodes:()=>DVt,getNextNode:()=>_Vt,getPreviousNode:()=>S5e,getStartlineNode:()=>RVt,inRange:()=>y5e,isChildNode:()=>m5e,isCommentNode:()=>xre,streamCst:()=>G3,toDocumentSegment:()=>Q3,tokenToRange:()=>nz});function Ks(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(Ks,"isAstNode");function sd(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(sd,"isReference");function lv(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(lv,"isMultiReference");function WRe(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(WRe,"isAstNodeDescription");function fk(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$(fk,"isLinkingError");var YRe=(fL=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 Ks(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}}},$(fL,"AbstractAstReflection"),fL);function eb(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(eb,"isCompositeCstNode");function pk(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(pk,"isLeafCstNode");function Kte(t){return eb(t)&&typeof t.fullText=="string"}$(Kte,"isRootCstNode");var cv=(gh=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 gh(()=>({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 ld})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=sVt(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 gh(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ld:{done:!1,value:e(i)}})}filter(e){return new gh(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ld})}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 gh(()=>({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(H9(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ld})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new gh(()=>({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(H9(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ld})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new gh(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ld:this.nextFn(r.state)))}distinct(e){return new gh(()=>({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 ld})}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)})}},$(gh,"StreamImpl"),gh);function sVt(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(sVt,"toString");function H9(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(H9,"isIterable");var R3=new cv(()=>{},()=>ld),ld=Object.freeze({done:!0,value:void 0});function ha(...t){if(t.length===1){const e=t[0];if(e instanceof cv)return e;if(H9(e))return new cv(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new cv(()=>({index:0}),r=>r.index1?new cv(()=>({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 ld})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(pL,"TreeStreamImpl"),pL),W9;(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})(W9||(W9={}));var qRe={};T2(qRe,{assignMandatoryProperties:()=>jRe,copyAstNode:()=>ere,findRootNode:()=>M3,getContainerOfType:()=>gk,getDocument:()=>qg,getReferenceNodes:()=>Zte,hasContainerOfType:()=>lVt,linkContentToContainer:()=>L3,streamAllContents:()=>tb,streamAst:()=>jg,streamContents:()=>Y9,streamReferences:()=>I3});function L3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ks(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&L3(i,e))}):Ks(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&L3(n,e)))}$(L3,"linkContentToContainer");function gk(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(gk,"getContainerOfType");function lVt(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(lVt,"hasContainerOfType");function qg(t){const r=M3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(qg,"getDocument");function M3(t){for(;t.$container;)t=t.$container;return t}$(M3,"findRootNode");function Zte(t){return sd(t)?t.ref?[t.ref]:[]:lv(t)?t.items.map(e=>e.ref):[]}$(Zte,"getReferenceNodes");function Y9(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new cv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexY9(r,e))}$(tb,"streamAllContents");function jg(t,e){if(t){if(e!=null&&e.range&&!Jte(t,e.range))return new D3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new D3(t,r=>Y9(r,e),{includeRoot:!0})}$(jg,"streamAst");function Jte(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?y5e(r,e):!1}$(Jte,"isAstNodeInRange");function I3(t){return new cv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexah,AbstractParserRule:()=>q9,AbstractRule:()=>P3,AbstractType:()=>vf,Action:()=>C2,Alternatives:()=>j9,ArrayLiteral:()=>nre,ArrayType:()=>ire,Assignment:()=>O2,BooleanLiteral:()=>are,CharacterRange:()=>E2,Condition:()=>_2,Conjunction:()=>X9,CrossReference:()=>R2,Disjunction:()=>K9,EndOfFile:()=>ore,Grammar:()=>nb,GrammarImport:()=>sre,Group:()=>yk,InferredType:()=>lre,InfixRule:()=>uv,InfixRuleOperatorList:()=>J9,InfixRuleOperators:()=>cre,Interface:()=>B3,Keyword:()=>$3,LangiumGrammarAstReflection:()=>g5e,LangiumGrammarTerminals:()=>ZUn,NamedArgument:()=>F3,NegatedToken:()=>xk,Negation:()=>ure,NumberLiteral:()=>dre,Parameter:()=>z3,ParameterReference:()=>hre,ParserRule:()=>Xg,ReferenceType:()=>ez,RegexToken:()=>wk,ReturnType:()=>fre,RuleCall:()=>Ak,SimpleType:()=>U3,StringLiteral:()=>gre,TerminalAlternatives:()=>Sk,TerminalElement:()=>oh,TerminalGroup:()=>Tk,TerminalRule:()=>ob,TerminalRuleCall:()=>Ck,Type:()=>tz,TypeAttribute:()=>kk,TypeDefinition:()=>Ok,UnionType:()=>yre,UnorderedGroup:()=>rz,UntilToken:()=>Ek,ValueLiteral:()=>_k,Wildcard:()=>V3,isAbstractElement:()=>tre,isAbstractParserRule:()=>mk,isAbstractRule:()=>uVt,isAbstractType:()=>dVt,isAction:()=>k2,isAlternatives:()=>rre,isArrayLiteral:()=>hVt,isArrayType:()=>KRe,isAssignment:()=>rb,isBooleanLiteral:()=>ZRe,isCharacterRange:()=>JRe,isCondition:()=>fVt,isConjunction:()=>e5e,isCrossReference:()=>vk,isDisjunction:()=>t5e,isEndOfFile:()=>r5e,isGrammar:()=>pVt,isGrammarImport:()=>gVt,isGroup:()=>bk,isInferredType:()=>Z9,isInfixRule:()=>N3,isInfixRuleOperatorList:()=>mVt,isInfixRuleOperators:()=>vVt,isInterface:()=>n5e,isKeyword:()=>ib,isNamedArgument:()=>yVt,isNegatedToken:()=>i5e,isNegation:()=>a5e,isNumberLiteral:()=>bVt,isParameter:()=>xVt,isParameterReference:()=>o5e,isParserRule:()=>cd,isReferenceType:()=>s5e,isRegexToken:()=>l5e,isReturnType:()=>c5e,isRuleCall:()=>ab,isSimpleType:()=>pre,isStringLiteral:()=>wVt,isTerminalAlternatives:()=>u5e,isTerminalElement:()=>AVt,isTerminalGroup:()=>d5e,isTerminalRule:()=>$p,isTerminalRuleCall:()=>mre,isType:()=>vre,isTypeAttribute:()=>SVt,isTypeDefinition:()=>TVt,isUnionType:()=>h5e,isUnorderedGroup:()=>bre,isUntilToken:()=>f5e,isValueLiteral:()=>CVt,isWildcard:()=>p5e,reflection:()=>cn});var ZUn={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]*/},ah={$type:"AbstractElement",cardinality:"cardinality"};function tre(t){return cn.isInstance(t,ah.$type)}$(tre,"isAbstractElement");var q9={$type:"AbstractParserRule"};function mk(t){return cn.isInstance(t,q9.$type)}$(mk,"isAbstractParserRule");var P3={$type:"AbstractRule"};function uVt(t){return cn.isInstance(t,P3.$type)}$(uVt,"isAbstractRule");var vf={$type:"AbstractType"};function dVt(t){return cn.isInstance(t,vf.$type)}$(dVt,"isAbstractType");var C2={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function k2(t){return cn.isInstance(t,C2.$type)}$(k2,"isAction");var j9={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function rre(t){return cn.isInstance(t,j9.$type)}$(rre,"isAlternatives");var nre={$type:"ArrayLiteral",elements:"elements"};function hVt(t){return cn.isInstance(t,nre.$type)}$(hVt,"isArrayLiteral");var ire={$type:"ArrayType",elementType:"elementType"};function KRe(t){return cn.isInstance(t,ire.$type)}$(KRe,"isArrayType");var O2={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function rb(t){return cn.isInstance(t,O2.$type)}$(rb,"isAssignment");var are={$type:"BooleanLiteral",true:"true"};function ZRe(t){return cn.isInstance(t,are.$type)}$(ZRe,"isBooleanLiteral");var E2={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function JRe(t){return cn.isInstance(t,E2.$type)}$(JRe,"isCharacterRange");var _2={$type:"Condition"};function fVt(t){return cn.isInstance(t,_2.$type)}$(fVt,"isCondition");var X9={$type:"Conjunction",left:"left",right:"right"};function e5e(t){return cn.isInstance(t,X9.$type)}$(e5e,"isConjunction");var R2={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function vk(t){return cn.isInstance(t,R2.$type)}$(vk,"isCrossReference");var K9={$type:"Disjunction",left:"left",right:"right"};function t5e(t){return cn.isInstance(t,K9.$type)}$(t5e,"isDisjunction");var ore={$type:"EndOfFile",cardinality:"cardinality"};function r5e(t){return cn.isInstance(t,ore.$type)}$(r5e,"isEndOfFile");var nb={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function pVt(t){return cn.isInstance(t,nb.$type)}$(pVt,"isGrammar");var sre={$type:"GrammarImport",path:"path"};function gVt(t){return cn.isInstance(t,sre.$type)}$(gVt,"isGrammarImport");var yk={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function bk(t){return cn.isInstance(t,yk.$type)}$(bk,"isGroup");var lre={$type:"InferredType",name:"name"};function Z9(t){return cn.isInstance(t,lre.$type)}$(Z9,"isInferredType");var uv={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function N3(t){return cn.isInstance(t,uv.$type)}$(N3,"isInfixRule");var J9={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function mVt(t){return cn.isInstance(t,J9.$type)}$(mVt,"isInfixRuleOperatorList");var cre={$type:"InfixRuleOperators",precedences:"precedences"};function vVt(t){return cn.isInstance(t,cre.$type)}$(vVt,"isInfixRuleOperators");var B3={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function n5e(t){return cn.isInstance(t,B3.$type)}$(n5e,"isInterface");var $3={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function ib(t){return cn.isInstance(t,$3.$type)}$(ib,"isKeyword");var F3={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function yVt(t){return cn.isInstance(t,F3.$type)}$(yVt,"isNamedArgument");var xk={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function i5e(t){return cn.isInstance(t,xk.$type)}$(i5e,"isNegatedToken");var ure={$type:"Negation",value:"value"};function a5e(t){return cn.isInstance(t,ure.$type)}$(a5e,"isNegation");var dre={$type:"NumberLiteral",value:"value"};function bVt(t){return cn.isInstance(t,dre.$type)}$(bVt,"isNumberLiteral");var z3={$type:"Parameter",name:"name"};function xVt(t){return cn.isInstance(t,z3.$type)}$(xVt,"isParameter");var hre={$type:"ParameterReference",parameter:"parameter"};function o5e(t){return cn.isInstance(t,hre.$type)}$(o5e,"isParameterReference");var Xg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function cd(t){return cn.isInstance(t,Xg.$type)}$(cd,"isParserRule");var ez={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function s5e(t){return cn.isInstance(t,ez.$type)}$(s5e,"isReferenceType");var wk={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function l5e(t){return cn.isInstance(t,wk.$type)}$(l5e,"isRegexToken");var fre={$type:"ReturnType",name:"name"};function c5e(t){return cn.isInstance(t,fre.$type)}$(c5e,"isReturnType");var Ak={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ab(t){return cn.isInstance(t,Ak.$type)}$(ab,"isRuleCall");var U3={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function pre(t){return cn.isInstance(t,U3.$type)}$(pre,"isSimpleType");var gre={$type:"StringLiteral",value:"value"};function wVt(t){return cn.isInstance(t,gre.$type)}$(wVt,"isStringLiteral");var Sk={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function u5e(t){return cn.isInstance(t,Sk.$type)}$(u5e,"isTerminalAlternatives");var oh={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function AVt(t){return cn.isInstance(t,oh.$type)}$(AVt,"isTerminalElement");var Tk={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function d5e(t){return cn.isInstance(t,Tk.$type)}$(d5e,"isTerminalGroup");var ob={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function $p(t){return cn.isInstance(t,ob.$type)}$($p,"isTerminalRule");var Ck={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function mre(t){return cn.isInstance(t,Ck.$type)}$(mre,"isTerminalRuleCall");var tz={$type:"Type",name:"name",type:"type"};function vre(t){return cn.isInstance(t,tz.$type)}$(vre,"isType");var kk={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function SVt(t){return cn.isInstance(t,kk.$type)}$(SVt,"isTypeAttribute");var Ok={$type:"TypeDefinition"};function TVt(t){return cn.isInstance(t,Ok.$type)}$(TVt,"isTypeDefinition");var yre={$type:"UnionType",types:"types"};function h5e(t){return cn.isInstance(t,yre.$type)}$(h5e,"isUnionType");var rz={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function bre(t){return cn.isInstance(t,rz.$type)}$(bre,"isUnorderedGroup");var Ek={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function f5e(t){return cn.isInstance(t,Ek.$type)}$(f5e,"isUntilToken");var _k={$type:"ValueLiteral"};function CVt(t){return cn.isInstance(t,_k.$type)}$(CVt,"isValueLiteral");var V3={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function p5e(t){return cn.isInstance(t,V3.$type)}$(p5e,"isWildcard");var g5e=(gL=class extends YRe{constructor(){super(...arguments),this.types={AbstractElement:{name:ah.$type,properties:{cardinality:{name:ah.cardinality}},superTypes:[]},AbstractParserRule:{name:q9.$type,properties:{},superTypes:[P3.$type,vf.$type]},AbstractRule:{name:P3.$type,properties:{},superTypes:[]},AbstractType:{name:vf.$type,properties:{},superTypes:[]},Action:{name:C2.$type,properties:{cardinality:{name:C2.cardinality},feature:{name:C2.feature},inferredType:{name:C2.inferredType},operator:{name:C2.operator},type:{name:C2.type,referenceType:vf.$type}},superTypes:[ah.$type]},Alternatives:{name:j9.$type,properties:{cardinality:{name:j9.cardinality},elements:{name:j9.elements,defaultValue:[]}},superTypes:[ah.$type]},ArrayLiteral:{name:nre.$type,properties:{elements:{name:nre.elements,defaultValue:[]}},superTypes:[_k.$type]},ArrayType:{name:ire.$type,properties:{elementType:{name:ire.elementType}},superTypes:[Ok.$type]},Assignment:{name:O2.$type,properties:{cardinality:{name:O2.cardinality},feature:{name:O2.feature},operator:{name:O2.operator},predicate:{name:O2.predicate},terminal:{name:O2.terminal}},superTypes:[ah.$type]},BooleanLiteral:{name:are.$type,properties:{true:{name:are.true,defaultValue:!1}},superTypes:[_2.$type,_k.$type]},CharacterRange:{name:E2.$type,properties:{cardinality:{name:E2.cardinality},left:{name:E2.left},lookahead:{name:E2.lookahead},parenthesized:{name:E2.parenthesized,defaultValue:!1},right:{name:E2.right}},superTypes:[oh.$type]},Condition:{name:_2.$type,properties:{},superTypes:[]},Conjunction:{name:X9.$type,properties:{left:{name:X9.left},right:{name:X9.right}},superTypes:[_2.$type]},CrossReference:{name:R2.$type,properties:{cardinality:{name:R2.cardinality},deprecatedSyntax:{name:R2.deprecatedSyntax,defaultValue:!1},isMulti:{name:R2.isMulti,defaultValue:!1},terminal:{name:R2.terminal},type:{name:R2.type,referenceType:vf.$type}},superTypes:[ah.$type]},Disjunction:{name:K9.$type,properties:{left:{name:K9.left},right:{name:K9.right}},superTypes:[_2.$type]},EndOfFile:{name:ore.$type,properties:{cardinality:{name:ore.cardinality}},superTypes:[ah.$type]},Grammar:{name:nb.$type,properties:{imports:{name:nb.imports,defaultValue:[]},interfaces:{name:nb.interfaces,defaultValue:[]},isDeclared:{name:nb.isDeclared,defaultValue:!1},name:{name:nb.name},rules:{name:nb.rules,defaultValue:[]},types:{name:nb.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:sre.$type,properties:{path:{name:sre.path}},superTypes:[]},Group:{name:yk.$type,properties:{cardinality:{name:yk.cardinality},elements:{name:yk.elements,defaultValue:[]},guardCondition:{name:yk.guardCondition},predicate:{name:yk.predicate}},superTypes:[ah.$type]},InferredType:{name:lre.$type,properties:{name:{name:lre.name}},superTypes:[vf.$type]},InfixRule:{name:uv.$type,properties:{call:{name:uv.call},dataType:{name:uv.dataType},inferredType:{name:uv.inferredType},name:{name:uv.name},operators:{name:uv.operators},parameters:{name:uv.parameters,defaultValue:[]},returnType:{name:uv.returnType,referenceType:vf.$type}},superTypes:[q9.$type]},InfixRuleOperatorList:{name:J9.$type,properties:{associativity:{name:J9.associativity},operators:{name:J9.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:cre.$type,properties:{precedences:{name:cre.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:B3.$type,properties:{attributes:{name:B3.attributes,defaultValue:[]},name:{name:B3.name},superTypes:{name:B3.superTypes,defaultValue:[],referenceType:vf.$type}},superTypes:[vf.$type]},Keyword:{name:$3.$type,properties:{cardinality:{name:$3.cardinality},predicate:{name:$3.predicate},value:{name:$3.value}},superTypes:[ah.$type]},NamedArgument:{name:F3.$type,properties:{calledByName:{name:F3.calledByName,defaultValue:!1},parameter:{name:F3.parameter,referenceType:z3.$type},value:{name:F3.value}},superTypes:[]},NegatedToken:{name:xk.$type,properties:{cardinality:{name:xk.cardinality},lookahead:{name:xk.lookahead},parenthesized:{name:xk.parenthesized,defaultValue:!1},terminal:{name:xk.terminal}},superTypes:[oh.$type]},Negation:{name:ure.$type,properties:{value:{name:ure.value}},superTypes:[_2.$type]},NumberLiteral:{name:dre.$type,properties:{value:{name:dre.value}},superTypes:[_k.$type]},Parameter:{name:z3.$type,properties:{name:{name:z3.name}},superTypes:[]},ParameterReference:{name:hre.$type,properties:{parameter:{name:hre.parameter,referenceType:z3.$type}},superTypes:[_2.$type]},ParserRule:{name:Xg.$type,properties:{dataType:{name:Xg.dataType},definition:{name:Xg.definition},entry:{name:Xg.entry,defaultValue:!1},fragment:{name:Xg.fragment,defaultValue:!1},inferredType:{name:Xg.inferredType},name:{name:Xg.name},parameters:{name:Xg.parameters,defaultValue:[]},returnType:{name:Xg.returnType,referenceType:vf.$type}},superTypes:[q9.$type]},ReferenceType:{name:ez.$type,properties:{isMulti:{name:ez.isMulti,defaultValue:!1},referenceType:{name:ez.referenceType}},superTypes:[Ok.$type]},RegexToken:{name:wk.$type,properties:{cardinality:{name:wk.cardinality},lookahead:{name:wk.lookahead},parenthesized:{name:wk.parenthesized,defaultValue:!1},regex:{name:wk.regex}},superTypes:[oh.$type]},ReturnType:{name:fre.$type,properties:{name:{name:fre.name}},superTypes:[]},RuleCall:{name:Ak.$type,properties:{arguments:{name:Ak.arguments,defaultValue:[]},cardinality:{name:Ak.cardinality},predicate:{name:Ak.predicate},rule:{name:Ak.rule,referenceType:P3.$type}},superTypes:[ah.$type]},SimpleType:{name:U3.$type,properties:{primitiveType:{name:U3.primitiveType},stringType:{name:U3.stringType},typeRef:{name:U3.typeRef,referenceType:vf.$type}},superTypes:[Ok.$type]},StringLiteral:{name:gre.$type,properties:{value:{name:gre.value}},superTypes:[_k.$type]},TerminalAlternatives:{name:Sk.$type,properties:{cardinality:{name:Sk.cardinality},elements:{name:Sk.elements,defaultValue:[]},lookahead:{name:Sk.lookahead},parenthesized:{name:Sk.parenthesized,defaultValue:!1}},superTypes:[oh.$type]},TerminalElement:{name:oh.$type,properties:{cardinality:{name:oh.cardinality},lookahead:{name:oh.lookahead},parenthesized:{name:oh.parenthesized,defaultValue:!1}},superTypes:[ah.$type]},TerminalGroup:{name:Tk.$type,properties:{cardinality:{name:Tk.cardinality},elements:{name:Tk.elements,defaultValue:[]},lookahead:{name:Tk.lookahead},parenthesized:{name:Tk.parenthesized,defaultValue:!1}},superTypes:[oh.$type]},TerminalRule:{name:ob.$type,properties:{definition:{name:ob.definition},fragment:{name:ob.fragment,defaultValue:!1},hidden:{name:ob.hidden,defaultValue:!1},name:{name:ob.name},type:{name:ob.type}},superTypes:[P3.$type]},TerminalRuleCall:{name:Ck.$type,properties:{cardinality:{name:Ck.cardinality},lookahead:{name:Ck.lookahead},parenthesized:{name:Ck.parenthesized,defaultValue:!1},rule:{name:Ck.rule,referenceType:ob.$type}},superTypes:[oh.$type]},Type:{name:tz.$type,properties:{name:{name:tz.name},type:{name:tz.type}},superTypes:[vf.$type]},TypeAttribute:{name:kk.$type,properties:{defaultValue:{name:kk.defaultValue},isOptional:{name:kk.isOptional,defaultValue:!1},name:{name:kk.name},type:{name:kk.type}},superTypes:[]},TypeDefinition:{name:Ok.$type,properties:{},superTypes:[]},UnionType:{name:yre.$type,properties:{types:{name:yre.types,defaultValue:[]}},superTypes:[Ok.$type]},UnorderedGroup:{name:rz.$type,properties:{cardinality:{name:rz.cardinality},elements:{name:rz.elements,defaultValue:[]}},superTypes:[ah.$type]},UntilToken:{name:Ek.$type,properties:{cardinality:{name:Ek.cardinality},lookahead:{name:Ek.lookahead},parenthesized:{name:Ek.parenthesized,defaultValue:!1},terminal:{name:Ek.terminal}},superTypes:[oh.$type]},ValueLiteral:{name:_k.$type,properties:{},superTypes:[]},Wildcard:{name:V3.$type,properties:{cardinality:{name:V3.cardinality},lookahead:{name:V3.lookahead},parenthesized:{name:V3.parenthesized,defaultValue:!1}},superTypes:[oh.$type]}}}},$(gL,"LangiumGrammarAstReflection"),gL),cn=new g5e;function kVt(t){let e=t,r=!1;for(;e;){const n=gk(e.grammarSource,cd);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(kVt,"getDatatypeNode");function G3(t){return new D3(t,e=>eb(e)?e.content:[],{includeRoot:!0})}$(G3,"streamCst");function OVt(t){return G3(t).filter(pk)}$(OVt,"flattenCst");function m5e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(m5e,"isChildNode");function nz(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(nz,"tokenToRange");function Q3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(Q3,"toDocumentSegment");var dv;(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"})(dv||(dv={}));function v5e(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return dv.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linedv.After}$(y5e,"inRange");var b5e=/^[\w\p{L}]$/u;function EVt(t,e,r=b5e){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return wre(t,e)}}$(EVt,"findDeclarationNodeAtOffset");function x5e(t,e){if(t){const r=S5e(t,!0);if(r&&xre(r,e))return r;if(Kte(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(xre(a,e))return a}}}}$(x5e,"findCommentNode");function xre(t,e){return pk(t)&&e.includes(t.tokenType.name)}$(xre,"isCommentNode");function wre(t,e){if(pk(t))return t;if(eb(t)){const r=A5e(t,e,!1);if(r)return wre(r,e)}}$(wre,"findLeafNodeAtOffset");function w5e(t,e){if(pk(t))return t;if(eb(t)){const r=A5e(t,e,!0);if(r)return w5e(r,e)}}$(w5e,"findLeafNodeBeforeOffset");function A5e(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}$(A5e,"binarySearch");function S5e(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}}$(S5e,"getPreviousNode");function _Vt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nF5e,findNameAssignment:()=>Mre,findNodeForKeyword:()=>$5e,findNodeForProperty:()=>Rre,findNodesForKeyword:()=>UVt,findNodesForKeywordInternal:()=>Lre,findNodesForProperty:()=>B5e,getActionAtElement:()=>U5e,getActionType:()=>G5e,getAllReachableRules:()=>_re,getAllRulesUsedForCrossReferences:()=>zVt,getCrossReferenceTerminal:()=>P5e,getEntryRule:()=>L5e,getExplicitRuleType:()=>az,getHiddenRules:()=>M5e,getRuleType:()=>Q5e,getRuleTypeName:()=>WVt,getTypeName:()=>Lk,isArrayCardinality:()=>GVt,isArrayOperator:()=>QVt,isCommentTerminal:()=>N5e,isDataType:()=>HVt,isDataTypeRule:()=>iz,isOptionalCardinality:()=>VVt,terminalRegex:()=>oz});var Are=(mL=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(mL,"ErrorWithLocation"),mL);function D2(t,e="Error: Got unexpected value."){throw new Error(e)}$(D2,"assertUnreachable");function k5e(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(k5e,"assertCondition");var O5e={};T2(O5e,{NEWLINE_REGEXP:()=>NVt,escapeRegExp:()=>W3,getTerminalParts:()=>$Vt,isMultilineComment:()=>_5e,isWhitespace:()=>Ere,partialMatches:()=>R5e,partialRegExp:()=>D5e,whitespaceCharacters:()=>FVt});function An(t){return t.charCodeAt(0)}$(An,"cc");function Sre(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(Sre,"insertToSet");function H3(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$(H3,"addFlag");function Rk(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(Rk,"ASSERT_EXISTS");function MVt(){throw Error("Internal Error - Should never get here!")}$(MVt,"ASSERT_NEVER_REACH_HERE");function E5e(t){return t.type==="Character"}$(E5e,"isCharacter");var Tre=[];for(let t=An("0");t<=An("9");t++)Tre.push(t);var Cre=[An("_")].concat(Tre);for(let t=An("a");t<=An("z");t++)Cre.push(t);for(let t=An("A");t<=An("Z");t++)Cre.push(t);var IVt=[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")],JUn=/[0-9a-fA-F]/,kre=/[0-9]/,eVn=/[1-9]/,PVt=(vL=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":H3(n,"global");break;case"i":H3(n,"ignoreCase");break;case"m":H3(n,"multiLine");break;case"u":H3(n,"unicode");break;case"y":H3(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}}Rk(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return MVt()}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;Rk(r);break}if(!(e===!0&&r===void 0)&&Rk(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()),Rk(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=Tre;break;case"D":e=Tre,r=!0;break;case"s":e=IVt;break;case"S":e=IVt,r=!0;break;case"w":e=Cre;break;case"W":e=Cre,r=!0;break}if(Rk(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(Rk(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}}},$(vL,"RegExpParser"),vL),Ore=(yL=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){}},$(yL,"BaseRegExpVisitor"),yL),NVt=/\r?\n/gm,BVt=new PVt,tVn=(bL=class extends Ore{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=W3(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)}},$(bL,"TerminalRegExpVisitor"),bL),Dk=new tVn;function $Vt(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=BVt.pattern(t),r=[];for(const n of e.value.value)Dk.reset(t),Dk.visit(n),r.push({start:Dk.startRegexp,end:Dk.endRegex});return r}catch{return[]}}$($Vt,"getTerminalParts");function _Re(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Dk.reset(t),Dk.visit(BVt.pattern(t)),Dk.multiline}catch{return!1}}$(_Re,"isMultilineComment");var FVt=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function Ere(t){const e=typeof t=="string"?new RegExp(t):t;return FVt.some(r=>e.test(r))}$(Ere,"isWhitespace");function W3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(W3,"escapeRegExp");function RRe(t,e){const r=DRe(t),n=e.match(r);return!!n&&n[0].length>0}$(RRe,"partialMatches");function DRe(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)}$(DRe,"partialRegExp");function LRe(t){return t.rules.find(e=>cd(e)&&e.entry)}$(LRe,"getEntryRule");function MRe(t){return t.rules.filter(e=>$p(e)&&e.hidden)}$(MRe,"getHiddenRules");function _re(t,e){const r=new Set,n=LRe(t);if(!n)return new Set(t.rules);const i=[n].concat(MRe(t));for(const o of i)IRe(o,r,e);const a=new Set;for(const o of t.rules)(r.has(o.name)||$p(o)&&o.hidden)&&a.add(o);return a}$(_re,"getAllReachableRules");function IRe(t,e,r){e.add(t.name),tb(t).forEach(n=>{if(ab(n)||r&&mre(n)){const i=n.rule.ref;i&&!e.has(i.name)&&IRe(i,e,r)}})}$(IRe,"ruleDfs");function zVt(t){const e=new Set;return tb(t).forEach(r=>{vk(r)&&(cd(r.type.ref)&&e.add(r.type.ref),Z9(r.type.ref)&&cd(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(zVt,"getAllRulesUsedForCrossReferences");function PRe(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Mre(t.type.ref);return e==null?void 0:e.terminal}}$(PRe,"getCrossReferenceTerminal");function NRe(t){return t.hidden&&!Ere(oz(t))}$(NRe,"isCommentTerminal");function BRe(t,e){return!t||!e?[]:Dre(t,e,t.astNode,!0)}$(BRe,"findNodesForProperty");function Rre(t,e,r){if(!t||!e)return;const n=Dre(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]}$(Rre,"findNodeForProperty");function Dre(t,e,r,n){if(!n){const i=gk(t.grammarSource,rb);if(i&&i.feature===e)return[t]}return eb(t)&&t.astNode===r?t.content.flatMap(i=>Dre(i,e,r,!1)):[]}$(Dre,"findNodesForPropertyInternal");function UVt(t,e){return t?Lre(t,e,t==null?void 0:t.astNode):[]}$(UVt,"findNodesForKeyword");function $Re(t,e,r){if(!t)return;const n=Lre(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]}$($Re,"findNodeForKeyword");function Lre(t,e,r){if(t.astNode!==r)return[];if(ib(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=G3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const o=i.value;o.astNode===r?ib(o.grammarSource)&&o.grammarSource.value===e&&a.push(o):n.prune()}while(!i.done);return a}$(Lre,"findNodesForKeywordInternal");function FRe(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=gk(t.grammarSource,rb);if(n)return n;t=t.container}}$(FRe,"findAssignment");function Mre(t){let e=t;return Z9(e)&&(k2(e.$container)?e=e.$container.$container:mk(e.$container)?e=e.$container:D2(e.$container)),zRe(t,e,new Map)}$(Mre,"findNameAssignment");function zRe(t,e,r){var i;function n(a,o){let s;return gk(a,rb)||(s=zRe(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 tb(e)){if(rb(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(ab(a)&&cd(a.rule.ref))return n(a,a.rule.ref);if(pre(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(zRe,"findNameAssignmentInternal");function URe(t){const e=t.$container;if(bk(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(k2(a))return a;{const o=tb(r[i]).find(k2);if(o)return o}}}if(tre(e))return URe(e)}$(URe,"getActionAtElement");function VVt(t,e){return t==="?"||t==="*"||bk(e)&&!!e.guardCondition}$(VVt,"isOptionalCardinality");function GVt(t){return t==="*"||t==="+"}$(GVt,"isArrayCardinality");function QVt(t){return t==="+="}$(QVt,"isArrayOperator");function iz(t){return VRe(t,new Set)}$(iz,"isDataTypeRule");function VRe(t,e){if(e.has(t))return!0;e.add(t);for(const r of tb(t))if(ab(r)){if(!r.rule.ref||cd(r.rule.ref)&&!VRe(r.rule.ref,e)||N3(r.rule.ref))return!1}else{if(rb(r))return!1;if(k2(r))return!1}return!!t.definition}$(VRe,"isDataTypeRuleInternal");function HVt(t){return Ire(t.type,new Set)}$(HVt,"isDataType");function Ire(t,e){if(e.has(t))return!0;if(e.add(t),K5e(t))return!1;if(sRe(t))return!1;if(hRe(t))return t.types.every(r=>Ire(r,e));if(pre(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 vre(r)?Ire(r.type,e):!1}else return!1}else return!1}$(Ire,"isDataTypeInternal");function az(t){if(!$p(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}}}$(az,"getExplicitRuleType");function Lk(t){if(mk(t))return cd(t)&&iz(t)?t.name:az(t)??t.name;if(nRe(t)||vre(t)||cRe(t))return t.name;if(k2(t)){const e=GRe(t);if(e)return e}else if(Z9(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(Lk,"getTypeName");function GRe(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Lk(t.type.ref)}$(GRe,"getActionType");function WVt(t){var e;return $p(t)?((e=t.type)==null?void 0:e.name)??"string":cd(t)&&iz(t)?t.name:az(t)??t.name}$(WVt,"getRuleTypeName");function QRe(t){var e;return $p(t)?((e=t.type)==null?void 0:e.name)??"string":az(t)??t.name}$(QRe,"getRuleType");function oz(t){const e={s:!1,i:!1,u:!1},r=Mk(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(oz,"terminalRegex");var HRe=/[\s\S]/.source;function Mk(t,e){var r;if(uRe(t))return YVt(t);if(dRe(t))return qVt(t);if(J5e(t))return KVt(t);if(mre(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return hv(Mk(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(iRe(t))return XVt(t);if(fRe(t))return jVt(t);if(lRe(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")),hv(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(pRe(t))return hv(HRe,{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}`)}}}$(Mk,"abstractElementToRegex");function YVt(t){return hv(t.elements.map(e=>Mk(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(YVt,"terminalAlternativesToRegex");function qVt(t){return hv(t.elements.map(e=>Mk(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(qVt,"terminalGroupToRegex");function jVt(t){return hv(`${HRe}*?${Mk(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(jVt,"untilTokenToRegex");function XVt(t){return hv(`(?!${Mk(t.terminal)})${HRe}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(XVt,"negateTokenToRegex");function KVt(t){return t.right?hv(`[${Pre(t.left)}-${Pre(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):hv(Pre(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(KVt,"characterRangeToRegex");function Pre(t){return W3(t.value)}$(Pre,"keywordToRegex");function hv(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(hv,"withCardinality");function WRe(t){const e=[],r=t.Grammar;for(const n of r.rules)$p(n)&&NRe(n)&&_Re(oz(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:bRe}}$(WRe,"createGrammarConfig");var rVn=typeof global=="object"&&global&&global.Object===Object&&global,ZVt=rVn,nVn=typeof self=="object"&&self&&self.Object===Object&&self,iVn=ZVt||nVn||Function("return this")(),fv=iVn,aVn=fv.Symbol,Fp=aVn,JVt=Object.prototype,oVn=JVt.hasOwnProperty,sVn=JVt.toString,sz=Fp?Fp.toStringTag:void 0;function eGt(t){var e=oVn.call(t,sz),r=t[sz];try{t[sz]=void 0;var n=!0}catch{}var i=sVn.call(t);return n&&(e?t[sz]=r:delete t[sz]),i}$(eGt,"getRawTag");var lVn=eGt,cVn=Object.prototype,uVn=cVn.toString;function tGt(t){return uVn.call(t)}$(tGt,"objectToString");var dVn=tGt,hVn="[object Null]",fVn="[object Undefined]",rGt=Fp?Fp.toStringTag:void 0;function nGt(t){return t==null?t===void 0?fVn:hVn:rGt&&rGt in Object(t)?lVn(t):dVn(t)}$(nGt,"baseGetTag");var L2=nGt;function iGt(t){return t!=null&&typeof t=="object"}$(iGt,"isObjectLike");var Kg=iGt,pVn="[object Symbol]";function aGt(t){return typeof t=="symbol"||Kg(t)&&L2(t)==pVn}$(aGt,"isSymbol");var Nre=aGt;function oGt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=XVn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(_Gt,"shortOut");var JVn=_Gt;function RGt(t){return function(){return t}}$(RGt,"constant");var eGn=RGt,tGn=function(){try{var t=Pk(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Bre=tGn,rGn=Bre?function(t,e){return Bre(t,"toString",{configurable:!0,enumerable:!1,value:eGn(e),writable:!0})}:uz,nGn=rGn,iGn=JVn(nGn),aGn=iGn;function DGt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$($Gt,"arrayIncludes");var FGt=$Gt,lGn=9007199254740991,cGn=/^(?:0|[1-9]\d*)$/;function zGt(t,e){var r=typeof t;return e=e??lGn,!!e&&(r=="number"||r!="symbol"&&cGn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=fGn}$(qGt,"isLength");var JRe=qGt;function jGt(t){return t!=null&&JRe(t.length)&&!sb(t)}$(jGt,"isArrayLike");var pv=jGt;function XGt(t,e,r){if(!zp(r))return!1;var n=typeof e;return(n=="number"?pv(r)&&$re(e,r.length):n=="string"&&e in r)?dz(r[e],t):!1}$(XGt,"isIterateeCall");var zre=XGt;function KGt(t){return ZRe(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&&zre(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(LQt,"listCacheHas");var DQn=LQt;function MQt(t,e){var r=this.__data__,n=Gre(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(MQt,"listCacheSet");var LQn=MQt;function Bk(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(s)?e>1?a4e(s,e-1,r,n,i):i4e(i,s):n||(i[i.length]=s)}return i}$(a4e,"baseFlatten");var o4e=a4e;function XQt(t){var e=t==null?0:t.length;return e?o4e(t,1):[]}$(XQt,"flatten");var Zg=XQt,KQn=pQt(Object.getPrototypeOf,Object),KQt=KQn;function ZQt(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),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=r&UWn?new f4e:void 0;for(a.set(t,e),a.set(e,t);++h2?e[2]:void 0;for(i&&zre(e[0],e[1],i)&&(n=1);++r=IYn&&(a=p4e,o=!1,e=new f4e(e));e:for(;++i-1?i[a?e[o]:o]:void 0}}$(KWt,"createFind");var zYn=KWt,UYn=Math.max;function ZWt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:cz(r);return i<0&&(i=UYn(n+i,0)),IGt(t,gv(e),i)}$(ZWt,"findIndex");var VYn=ZWt,GYn=zYn(VYn),j3=GYn;function JWt(t){return t&&t.length?t[0]:void 0}$(JWt,"head");var em=JWt;function eYt(t,e){var r=-1,n=pv(t)?Array(t.length):[];return Uk(t,function(i,a,o){n[++r]=e(i,a,o)}),n}$(eYt,"baseMap");var QYn=eYt;function tYt(t,e){var r=zi(t)?lz:QYn;return r(t,gv(e))}$(tYt,"map");var Wr=tYt;function rYt(t,e){return o4e(Wr(t,e),1)}$(rYt,"flatMap");var Vp=rYt,HYn=Object.prototype,WYn=HYn.hasOwnProperty,YYn=DYn(function(t,e,r){WYn.call(t,r)?t[r].push(e):KRe(t,r,[e])}),qYn=YYn,jYn=Object.prototype,XYn=jYn.hasOwnProperty;function nYt(t,e){return t!=null&&XYn.call(t,e)}$(nYt,"baseHas");var KYn=nYt;function iYt(t,e){return t!=null&&wWt(t,e,KYn)}$(iYt,"has");var dn=iYt,ZYn="[object String]";function aYt(t){return typeof t=="string"||!zi(t)&&Kg(t)&&L2(t)==ZYn}$(aYt,"isString");var sh=aYt;function oYt(t,e){return lz(e,function(r){return t[r]})}$(oYt,"baseValues");var JYn=oYt;function sYt(t){return t==null?[]:JYn(t,yf(t))}$(sYt,"values");var vl=sYt,eqn=Math.max;function lYt(t,e,r,n){t=pv(t)?t:vl(t),r=r&&!n?cz(r):0;var i=t.length;return r<0&&(r=eqn(i+r,0)),sh(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&XRe(t,e,r)>-1}$(lYt,"includes");var ud=lYt,tqn=Math.max;function cYt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:cz(r);return i<0&&(i=tqn(n+i,0)),XRe(t,e,i)}$(cYt,"indexOf");var uYt=cYt,rqn="[object Map]",nqn="[object Set]",iqn=Object.prototype,aqn=iqn.hasOwnProperty;function dYt(t){if(t==null)return!0;if(pv(t)&&(zi(t)||typeof t=="string"||typeof t.splice=="function"||pz(t)||t4e(t)||Ure(t)))return!t.length;var e=q3(t);if(e==rqn||e==nqn)return!t.size;if(fz(t))return!mQt(t).length;for(var r in t)if(aqn.call(t,r))return!1;return!0}$(dYt,"isEmpty");var Qa=dYt,oqn="[object RegExp]";function hYt(t){return Kg(t)&&L2(t)==oqn}$(hYt,"baseIsRegExp");var sqn=hYt,fYt=M2&&M2.isRegExp,lqn=fYt?gz(fYt):sqn,lb=lqn;function pYt(t){return t===void 0}$(pYt,"isUndefined");var cb=pYt,cqn="Expected a function";function gYt(t){if(typeof t!="function")throw new TypeError(cqn);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)}}$(gYt,"negate");var uqn=gYt;function mYt(t,e,r,n){if(!zp(t))return t;e=qre(e,t);for(var i=-1,a=e.length,o=a-1,s=t;s!=null&&++i=yqn){var u=e?null:vqn(t);if(u)return g4e(u);o=!1,i=p4e,l=new f4e}else l=e?[]:s;e:for(;++n{r.accept(e)})}},$(xL,"AbstractProduction"),xL),dd=(wL=class extends mv{constructor(e){super([]),this.idx=1,bf(this,tm(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$(wL,"NonTerminal"),wL),X3=(AL=class extends mv{constructor(e){super(e.definition),this.orgText="",bf(this,tm(e,r=>r!==void 0))}},$(AL,"Rule"),AL),lh=(SL=class extends mv{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,bf(this,tm(e,r=>r!==void 0))}},$(SL,"Alternative"),SL),Lc=(TL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(TL,"Option"),TL),wf=(CL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(CL,"RepetitionMandatory"),CL),Af=(kL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(kL,"RepetitionMandatoryWithSeparator"),kL),ns=(OL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(OL,"Repetition"),OL),ch=(EL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(EL,"RepetitionWithSeparator"),EL),uh=(_L=class extends mv{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,bf(this,tm(e,r=>r!==void 0))}},$(_L,"Alternation"),_L),go=(RL=class{constructor(e){this.idx=1,bf(this,tm(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(RL,"Terminal"),RL);function _Yt(t){return Wr(t,Cz)}$(_Yt,"serializeGrammar");function Cz(t){function e(r){return Wr(r,Cz)}if($(e,"convertDefinition"),t instanceof dd){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return sh(t.label)&&(r.label=t.label),r}else{if(t instanceof lh)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Lc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof wf)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Af)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Cz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ch)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Cz(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 uh)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof go){const r={type:"Terminal",name:t.terminalType.name,label:OYt(t.terminalType),idx:t.idx};sh(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=lb(n)?n.source:n),r}else{if(t instanceof X3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(Cz,"serializeProduction");var K3=(DL=class{visit(e){const r=e;switch(r.constructor){case dd:return this.visitNonTerminal(r);case lh:return this.visitAlternative(r);case Lc:return this.visitOption(r);case wf:return this.visitRepetitionMandatory(r);case Af:return this.visitRepetitionMandatoryWithSeparator(r);case ch:return this.visitRepetitionWithSeparator(r);case ns:return this.visitRepetition(r);case uh:return this.visitAlternation(r);case go:return this.visitTerminal(r);case X3: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){}},$(DL,"GAstVisitor"),DL);function RYt(t){return t instanceof lh||t instanceof Lc||t instanceof ns||t instanceof wf||t instanceof Af||t instanceof ch||t instanceof go||t instanceof X3}$(RYt,"isSequenceProd");function kz(t,e=[]){return t instanceof Lc||t instanceof ns||t instanceof ch?!0:t instanceof uh?TYt(t.definition,n=>kz(n,e)):t instanceof dd&&ud(e,t)?!1:t instanceof mv?(t instanceof dd&&e.push(t),Jg(t.definition,n=>kz(n,e))):!1}$(kz,"isOptionalProd");function DYt(t){return t instanceof uh}$(DYt,"isBranchingProd");function rm(t){if(t instanceof dd)return"SUBRULE";if(t instanceof Lc)return"OPTION";if(t instanceof uh)return"OR";if(t instanceof wf)return"AT_LEAST_ONE";if(t instanceof Af)return"AT_LEAST_ONE_SEP";if(t instanceof ch)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(rm,"getProductionDslName");var ene=(LL=class{walk(e,r=[]){Sn(e.definition,(n,i)=>{const a=Dc(e.definition,i+1);if(n instanceof dd)this.walkProdRef(n,a,r);else if(n instanceof go)this.walkTerminal(n,a,r);else if(n instanceof lh)this.walkFlat(n,a,r);else if(n instanceof Lc)this.walkOption(n,a,r);else if(n instanceof wf)this.walkAtLeastOne(n,a,r);else if(n instanceof Af)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ch)this.walkManySep(n,a,r);else if(n instanceof ns)this.walkMany(n,a,r);else if(n instanceof uh)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 Lc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=S4e(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Lc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=S4e(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Sn(e.definition,a=>{const o=new lh({definition:[a]});this.walk(o,i)})}},$(LL,"RestWalker"),LL);function S4e(t,e,r){return[new Lc({definition:[new go({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(S4e,"restForRepetitionWithSeparator");function Z3(t){if(t instanceof dd)return Z3(t.referencedRule);if(t instanceof go)return IYt(t);if(RYt(t))return LYt(t);if(DYt(t))return MYt(t);throw Error("non exhaustive match")}$(Z3,"first");function LYt(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,o=!0;for(;i&&o;)a=r[n],o=kz(a),e=e.concat(Z3(a)),n=n+1,i=r.length>n;return b4e(e)}$(LYt,"firstForSequence");function MYt(t){const e=Wr(t.definition,r=>Z3(r));return b4e(Zg(e))}$(MYt,"firstForBranching");function IYt(t){return[t.terminalType]}$(IYt,"firstForTerminal");var PYt="_~IN~_",xqn=(ML=class extends ene{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=BYt(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),o=new lh({definition:a}),s=Z3(o);this.follows[i]=s}},$(ML,"ResyncFollowsWalker"),ML);function NYt(t){const e={};return Sn(t,r=>{const n=new xqn(r).startWalking();bf(e,n)}),e}$(NYt,"computeAllProdsFollows");function BYt(t,e){return t.name+e+PYt}$(BYt,"buildBetweenProdsFollowPrefix");var tne={},wqn=new PVt;function Oz(t){const e=t.toString();if(tne.hasOwnProperty(e))return tne[e];{const r=wqn.pattern(e);return tne[e]=r,r}}$(Oz,"getRegExpAst");function $Yt(){tne={}}$($Yt,"clearRegExpParserCache");var FYt="Complement Sets are not supported for first char optimization",rne=`Unable to use "first char" lexer optimizations: +`.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)}},$(bL,"TerminalRegExpVisitor"),bL),Dk=new tVn;function $Vt(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=BVt.pattern(t),r=[];for(const n of e.value.value)Dk.reset(t),Dk.visit(n),r.push({start:Dk.startRegexp,end:Dk.endRegex});return r}catch{return[]}}$($Vt,"getTerminalParts");function _5e(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Dk.reset(t),Dk.visit(BVt.pattern(t)),Dk.multiline}catch{return!1}}$(_5e,"isMultilineComment");var FVt=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function Ere(t){const e=typeof t=="string"?new RegExp(t):t;return FVt.some(r=>e.test(r))}$(Ere,"isWhitespace");function W3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(W3,"escapeRegExp");function R5e(t,e){const r=D5e(t),n=e.match(r);return!!n&&n[0].length>0}$(R5e,"partialMatches");function D5e(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)}$(D5e,"partialRegExp");function L5e(t){return t.rules.find(e=>cd(e)&&e.entry)}$(L5e,"getEntryRule");function M5e(t){return t.rules.filter(e=>$p(e)&&e.hidden)}$(M5e,"getHiddenRules");function _re(t,e){const r=new Set,n=L5e(t);if(!n)return new Set(t.rules);const i=[n].concat(M5e(t));for(const o of i)I5e(o,r,e);const a=new Set;for(const o of t.rules)(r.has(o.name)||$p(o)&&o.hidden)&&a.add(o);return a}$(_re,"getAllReachableRules");function I5e(t,e,r){e.add(t.name),tb(t).forEach(n=>{if(ab(n)||r&&mre(n)){const i=n.rule.ref;i&&!e.has(i.name)&&I5e(i,e,r)}})}$(I5e,"ruleDfs");function zVt(t){const e=new Set;return tb(t).forEach(r=>{vk(r)&&(cd(r.type.ref)&&e.add(r.type.ref),Z9(r.type.ref)&&cd(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(zVt,"getAllRulesUsedForCrossReferences");function P5e(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Mre(t.type.ref);return e==null?void 0:e.terminal}}$(P5e,"getCrossReferenceTerminal");function N5e(t){return t.hidden&&!Ere(oz(t))}$(N5e,"isCommentTerminal");function B5e(t,e){return!t||!e?[]:Dre(t,e,t.astNode,!0)}$(B5e,"findNodesForProperty");function Rre(t,e,r){if(!t||!e)return;const n=Dre(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]}$(Rre,"findNodeForProperty");function Dre(t,e,r,n){if(!n){const i=gk(t.grammarSource,rb);if(i&&i.feature===e)return[t]}return eb(t)&&t.astNode===r?t.content.flatMap(i=>Dre(i,e,r,!1)):[]}$(Dre,"findNodesForPropertyInternal");function UVt(t,e){return t?Lre(t,e,t==null?void 0:t.astNode):[]}$(UVt,"findNodesForKeyword");function $5e(t,e,r){if(!t)return;const n=Lre(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]}$($5e,"findNodeForKeyword");function Lre(t,e,r){if(t.astNode!==r)return[];if(ib(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=G3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const o=i.value;o.astNode===r?ib(o.grammarSource)&&o.grammarSource.value===e&&a.push(o):n.prune()}while(!i.done);return a}$(Lre,"findNodesForKeywordInternal");function F5e(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=gk(t.grammarSource,rb);if(n)return n;t=t.container}}$(F5e,"findAssignment");function Mre(t){let e=t;return Z9(e)&&(k2(e.$container)?e=e.$container.$container:mk(e.$container)?e=e.$container:D2(e.$container)),z5e(t,e,new Map)}$(Mre,"findNameAssignment");function z5e(t,e,r){var i;function n(a,o){let s;return gk(a,rb)||(s=z5e(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 tb(e)){if(rb(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(ab(a)&&cd(a.rule.ref))return n(a,a.rule.ref);if(pre(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(z5e,"findNameAssignmentInternal");function U5e(t){const e=t.$container;if(bk(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(k2(a))return a;{const o=tb(r[i]).find(k2);if(o)return o}}}if(tre(e))return U5e(e)}$(U5e,"getActionAtElement");function VVt(t,e){return t==="?"||t==="*"||bk(e)&&!!e.guardCondition}$(VVt,"isOptionalCardinality");function GVt(t){return t==="*"||t==="+"}$(GVt,"isArrayCardinality");function QVt(t){return t==="+="}$(QVt,"isArrayOperator");function iz(t){return V5e(t,new Set)}$(iz,"isDataTypeRule");function V5e(t,e){if(e.has(t))return!0;e.add(t);for(const r of tb(t))if(ab(r)){if(!r.rule.ref||cd(r.rule.ref)&&!V5e(r.rule.ref,e)||N3(r.rule.ref))return!1}else{if(rb(r))return!1;if(k2(r))return!1}return!!t.definition}$(V5e,"isDataTypeRuleInternal");function HVt(t){return Ire(t.type,new Set)}$(HVt,"isDataType");function Ire(t,e){if(e.has(t))return!0;if(e.add(t),KRe(t))return!1;if(s5e(t))return!1;if(h5e(t))return t.types.every(r=>Ire(r,e));if(pre(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 vre(r)?Ire(r.type,e):!1}else return!1}else return!1}$(Ire,"isDataTypeInternal");function az(t){if(!$p(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}}}$(az,"getExplicitRuleType");function Lk(t){if(mk(t))return cd(t)&&iz(t)?t.name:az(t)??t.name;if(n5e(t)||vre(t)||c5e(t))return t.name;if(k2(t)){const e=G5e(t);if(e)return e}else if(Z9(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(Lk,"getTypeName");function G5e(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Lk(t.type.ref)}$(G5e,"getActionType");function WVt(t){var e;return $p(t)?((e=t.type)==null?void 0:e.name)??"string":cd(t)&&iz(t)?t.name:az(t)??t.name}$(WVt,"getRuleTypeName");function Q5e(t){var e;return $p(t)?((e=t.type)==null?void 0:e.name)??"string":az(t)??t.name}$(Q5e,"getRuleType");function oz(t){const e={s:!1,i:!1,u:!1},r=Mk(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(oz,"terminalRegex");var H5e=/[\s\S]/.source;function Mk(t,e){var r;if(u5e(t))return YVt(t);if(d5e(t))return qVt(t);if(JRe(t))return KVt(t);if(mre(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return hv(Mk(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(i5e(t))return XVt(t);if(f5e(t))return jVt(t);if(l5e(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")),hv(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(p5e(t))return hv(H5e,{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}`)}}}$(Mk,"abstractElementToRegex");function YVt(t){return hv(t.elements.map(e=>Mk(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(YVt,"terminalAlternativesToRegex");function qVt(t){return hv(t.elements.map(e=>Mk(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(qVt,"terminalGroupToRegex");function jVt(t){return hv(`${H5e}*?${Mk(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(jVt,"untilTokenToRegex");function XVt(t){return hv(`(?!${Mk(t.terminal)})${H5e}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(XVt,"negateTokenToRegex");function KVt(t){return t.right?hv(`[${Pre(t.left)}-${Pre(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):hv(Pre(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(KVt,"characterRangeToRegex");function Pre(t){return W3(t.value)}$(Pre,"keywordToRegex");function hv(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(hv,"withCardinality");function W5e(t){const e=[],r=t.Grammar;for(const n of r.rules)$p(n)&&N5e(n)&&_5e(oz(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:b5e}}$(W5e,"createGrammarConfig");var rVn=typeof global=="object"&&global&&global.Object===Object&&global,ZVt=rVn,nVn=typeof self=="object"&&self&&self.Object===Object&&self,iVn=ZVt||nVn||Function("return this")(),fv=iVn,aVn=fv.Symbol,Fp=aVn,JVt=Object.prototype,oVn=JVt.hasOwnProperty,sVn=JVt.toString,sz=Fp?Fp.toStringTag:void 0;function eGt(t){var e=oVn.call(t,sz),r=t[sz];try{t[sz]=void 0;var n=!0}catch{}var i=sVn.call(t);return n&&(e?t[sz]=r:delete t[sz]),i}$(eGt,"getRawTag");var lVn=eGt,cVn=Object.prototype,uVn=cVn.toString;function tGt(t){return uVn.call(t)}$(tGt,"objectToString");var dVn=tGt,hVn="[object Null]",fVn="[object Undefined]",rGt=Fp?Fp.toStringTag:void 0;function nGt(t){return t==null?t===void 0?fVn:hVn:rGt&&rGt in Object(t)?lVn(t):dVn(t)}$(nGt,"baseGetTag");var L2=nGt;function iGt(t){return t!=null&&typeof t=="object"}$(iGt,"isObjectLike");var Kg=iGt,pVn="[object Symbol]";function aGt(t){return typeof t=="symbol"||Kg(t)&&L2(t)==pVn}$(aGt,"isSymbol");var Nre=aGt;function oGt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=XVn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(_Gt,"shortOut");var JVn=_Gt;function RGt(t){return function(){return t}}$(RGt,"constant");var eGn=RGt,tGn=function(){try{var t=Pk(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Bre=tGn,rGn=Bre?function(t,e){return Bre(t,"toString",{configurable:!0,enumerable:!1,value:eGn(e),writable:!0})}:uz,nGn=rGn,iGn=JVn(nGn),aGn=iGn;function DGt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$($Gt,"arrayIncludes");var FGt=$Gt,lGn=9007199254740991,cGn=/^(?:0|[1-9]\d*)$/;function zGt(t,e){var r=typeof t;return e=e??lGn,!!e&&(r=="number"||r!="symbol"&&cGn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=fGn}$(qGt,"isLength");var J5e=qGt;function jGt(t){return t!=null&&J5e(t.length)&&!sb(t)}$(jGt,"isArrayLike");var pv=jGt;function XGt(t,e,r){if(!zp(r))return!1;var n=typeof e;return(n=="number"?pv(r)&&$re(e,r.length):n=="string"&&e in r)?dz(r[e],t):!1}$(XGt,"isIterateeCall");var zre=XGt;function KGt(t){return Z5e(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&&zre(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(LQt,"listCacheHas");var DQn=LQt;function MQt(t,e){var r=this.__data__,n=Gre(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(MQt,"listCacheSet");var LQn=MQt;function Bk(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(s)?e>1?a4e(s,e-1,r,n,i):i4e(i,s):n||(i[i.length]=s)}return i}$(a4e,"baseFlatten");var o4e=a4e;function XQt(t){var e=t==null?0:t.length;return e?o4e(t,1):[]}$(XQt,"flatten");var Zg=XQt,KQn=pQt(Object.getPrototypeOf,Object),KQt=KQn;function ZQt(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),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=r&UWn?new f4e:void 0;for(a.set(t,e),a.set(e,t);++h2?e[2]:void 0;for(i&&zre(e[0],e[1],i)&&(n=1);++r=IYn&&(a=p4e,o=!1,e=new f4e(e));e:for(;++i-1?i[a?e[o]:o]:void 0}}$(KWt,"createFind");var zYn=KWt,UYn=Math.max;function ZWt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:cz(r);return i<0&&(i=UYn(n+i,0)),IGt(t,gv(e),i)}$(ZWt,"findIndex");var VYn=ZWt,GYn=zYn(VYn),j3=GYn;function JWt(t){return t&&t.length?t[0]:void 0}$(JWt,"head");var em=JWt;function eYt(t,e){var r=-1,n=pv(t)?Array(t.length):[];return Uk(t,function(i,a,o){n[++r]=e(i,a,o)}),n}$(eYt,"baseMap");var QYn=eYt;function tYt(t,e){var r=zi(t)?lz:QYn;return r(t,gv(e))}$(tYt,"map");var Wr=tYt;function rYt(t,e){return o4e(Wr(t,e),1)}$(rYt,"flatMap");var Vp=rYt,HYn=Object.prototype,WYn=HYn.hasOwnProperty,YYn=DYn(function(t,e,r){WYn.call(t,r)?t[r].push(e):K5e(t,r,[e])}),qYn=YYn,jYn=Object.prototype,XYn=jYn.hasOwnProperty;function nYt(t,e){return t!=null&&XYn.call(t,e)}$(nYt,"baseHas");var KYn=nYt;function iYt(t,e){return t!=null&&wWt(t,e,KYn)}$(iYt,"has");var dn=iYt,ZYn="[object String]";function aYt(t){return typeof t=="string"||!zi(t)&&Kg(t)&&L2(t)==ZYn}$(aYt,"isString");var sh=aYt;function oYt(t,e){return lz(e,function(r){return t[r]})}$(oYt,"baseValues");var JYn=oYt;function sYt(t){return t==null?[]:JYn(t,yf(t))}$(sYt,"values");var vl=sYt,eqn=Math.max;function lYt(t,e,r,n){t=pv(t)?t:vl(t),r=r&&!n?cz(r):0;var i=t.length;return r<0&&(r=eqn(i+r,0)),sh(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&X5e(t,e,r)>-1}$(lYt,"includes");var ud=lYt,tqn=Math.max;function cYt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:cz(r);return i<0&&(i=tqn(n+i,0)),X5e(t,e,i)}$(cYt,"indexOf");var uYt=cYt,rqn="[object Map]",nqn="[object Set]",iqn=Object.prototype,aqn=iqn.hasOwnProperty;function dYt(t){if(t==null)return!0;if(pv(t)&&(zi(t)||typeof t=="string"||typeof t.splice=="function"||pz(t)||t4e(t)||Ure(t)))return!t.length;var e=q3(t);if(e==rqn||e==nqn)return!t.size;if(fz(t))return!mQt(t).length;for(var r in t)if(aqn.call(t,r))return!1;return!0}$(dYt,"isEmpty");var Qa=dYt,oqn="[object RegExp]";function hYt(t){return Kg(t)&&L2(t)==oqn}$(hYt,"baseIsRegExp");var sqn=hYt,fYt=M2&&M2.isRegExp,lqn=fYt?gz(fYt):sqn,lb=lqn;function pYt(t){return t===void 0}$(pYt,"isUndefined");var cb=pYt,cqn="Expected a function";function gYt(t){if(typeof t!="function")throw new TypeError(cqn);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)}}$(gYt,"negate");var uqn=gYt;function mYt(t,e,r,n){if(!zp(t))return t;e=qre(e,t);for(var i=-1,a=e.length,o=a-1,s=t;s!=null&&++i=yqn){var u=e?null:vqn(t);if(u)return g4e(u);o=!1,i=p4e,l=new f4e}else l=e?[]:s;e:for(;++n{r.accept(e)})}},$(xL,"AbstractProduction"),xL),dd=(wL=class extends mv{constructor(e){super([]),this.idx=1,bf(this,tm(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$(wL,"NonTerminal"),wL),X3=(AL=class extends mv{constructor(e){super(e.definition),this.orgText="",bf(this,tm(e,r=>r!==void 0))}},$(AL,"Rule"),AL),lh=(SL=class extends mv{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,bf(this,tm(e,r=>r!==void 0))}},$(SL,"Alternative"),SL),Lc=(TL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(TL,"Option"),TL),wf=(CL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(CL,"RepetitionMandatory"),CL),Af=(kL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(kL,"RepetitionMandatoryWithSeparator"),kL),ns=(OL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(OL,"Repetition"),OL),ch=(EL=class extends mv{constructor(e){super(e.definition),this.idx=1,bf(this,tm(e,r=>r!==void 0))}},$(EL,"RepetitionWithSeparator"),EL),uh=(_L=class extends mv{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,bf(this,tm(e,r=>r!==void 0))}},$(_L,"Alternation"),_L),go=(RL=class{constructor(e){this.idx=1,bf(this,tm(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(RL,"Terminal"),RL);function _Yt(t){return Wr(t,Cz)}$(_Yt,"serializeGrammar");function Cz(t){function e(r){return Wr(r,Cz)}if($(e,"convertDefinition"),t instanceof dd){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return sh(t.label)&&(r.label=t.label),r}else{if(t instanceof lh)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Lc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof wf)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Af)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Cz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ch)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Cz(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 uh)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof go){const r={type:"Terminal",name:t.terminalType.name,label:OYt(t.terminalType),idx:t.idx};sh(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=lb(n)?n.source:n),r}else{if(t instanceof X3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(Cz,"serializeProduction");var K3=(DL=class{visit(e){const r=e;switch(r.constructor){case dd:return this.visitNonTerminal(r);case lh:return this.visitAlternative(r);case Lc:return this.visitOption(r);case wf:return this.visitRepetitionMandatory(r);case Af:return this.visitRepetitionMandatoryWithSeparator(r);case ch:return this.visitRepetitionWithSeparator(r);case ns:return this.visitRepetition(r);case uh:return this.visitAlternation(r);case go:return this.visitTerminal(r);case X3: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){}},$(DL,"GAstVisitor"),DL);function RYt(t){return t instanceof lh||t instanceof Lc||t instanceof ns||t instanceof wf||t instanceof Af||t instanceof ch||t instanceof go||t instanceof X3}$(RYt,"isSequenceProd");function kz(t,e=[]){return t instanceof Lc||t instanceof ns||t instanceof ch?!0:t instanceof uh?TYt(t.definition,n=>kz(n,e)):t instanceof dd&&ud(e,t)?!1:t instanceof mv?(t instanceof dd&&e.push(t),Jg(t.definition,n=>kz(n,e))):!1}$(kz,"isOptionalProd");function DYt(t){return t instanceof uh}$(DYt,"isBranchingProd");function rm(t){if(t instanceof dd)return"SUBRULE";if(t instanceof Lc)return"OPTION";if(t instanceof uh)return"OR";if(t instanceof wf)return"AT_LEAST_ONE";if(t instanceof Af)return"AT_LEAST_ONE_SEP";if(t instanceof ch)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(rm,"getProductionDslName");var ene=(LL=class{walk(e,r=[]){Sn(e.definition,(n,i)=>{const a=Dc(e.definition,i+1);if(n instanceof dd)this.walkProdRef(n,a,r);else if(n instanceof go)this.walkTerminal(n,a,r);else if(n instanceof lh)this.walkFlat(n,a,r);else if(n instanceof Lc)this.walkOption(n,a,r);else if(n instanceof wf)this.walkAtLeastOne(n,a,r);else if(n instanceof Af)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ch)this.walkManySep(n,a,r);else if(n instanceof ns)this.walkMany(n,a,r);else if(n instanceof uh)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 Lc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=S4e(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Lc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=S4e(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Sn(e.definition,a=>{const o=new lh({definition:[a]});this.walk(o,i)})}},$(LL,"RestWalker"),LL);function S4e(t,e,r){return[new Lc({definition:[new go({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(S4e,"restForRepetitionWithSeparator");function Z3(t){if(t instanceof dd)return Z3(t.referencedRule);if(t instanceof go)return IYt(t);if(RYt(t))return LYt(t);if(DYt(t))return MYt(t);throw Error("non exhaustive match")}$(Z3,"first");function LYt(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,o=!0;for(;i&&o;)a=r[n],o=kz(a),e=e.concat(Z3(a)),n=n+1,i=r.length>n;return b4e(e)}$(LYt,"firstForSequence");function MYt(t){const e=Wr(t.definition,r=>Z3(r));return b4e(Zg(e))}$(MYt,"firstForBranching");function IYt(t){return[t.terminalType]}$(IYt,"firstForTerminal");var PYt="_~IN~_",xqn=(ML=class extends ene{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=BYt(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),o=new lh({definition:a}),s=Z3(o);this.follows[i]=s}},$(ML,"ResyncFollowsWalker"),ML);function NYt(t){const e={};return Sn(t,r=>{const n=new xqn(r).startWalking();bf(e,n)}),e}$(NYt,"computeAllProdsFollows");function BYt(t,e){return t.name+e+PYt}$(BYt,"buildBetweenProdsFollowPrefix");var tne={},wqn=new PVt;function Oz(t){const e=t.toString();if(tne.hasOwnProperty(e))return tne[e];{const r=wqn.pattern(e);return tne[e]=r,r}}$(Oz,"getRegExpAst");function $Yt(){tne={}}$($Yt,"clearRegExpParserCache");var FYt="Complement Sets are not supported for first char optimization",rne=`Unable to use "first char" lexer optimizations: `;function zYt(t,e=!1){try{const r=Oz(t);return nne(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===FYt)e&&x4e(`${rne} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. @@ -1752,8 +1752,8 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis For further details.`);this.skipValidations=dn(r,"skipValidations")?r.skipValidations:db.skipValidations}},$(kO,"Parser"),kO);e3e.DEFER_DEFINITION_ERRORS_HANDLING=!1,Sjt(e3e,[zqn,Vqn,Hqn,Wqn,qqn,Yqn,jqn,Xqn,Zqn,Jqn]);var ejn=(fM=class extends e3e{constructor(e,r=db){const n=Rc(r);n.outputCst=!1,super(e,n)}},$(fM,"EmbeddedActionsParser"),fM);function Tjt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}$(Ljt,"listCacheHas");var ojn=Ljt;function Mjt(t,e){var r=this.__data__,n=wne(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(Mjt,"listCacheSet");var sjn=Mjt;function Wk(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=r&fXn?new gXt:void 0;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t-1&&t%1==0&&t<=qXn}$(QXt,"isLength");var a3e=QXt,jXn="[object Arguments]",XXn="[object Array]",KXn="[object Boolean]",ZXn="[object Date]",JXn="[object Error]",eKn="[object Function]",tKn="[object Map]",rKn="[object Number]",nKn="[object Object]",iKn="[object RegExp]",aKn="[object Set]",oKn="[object String]",sKn="[object WeakMap]",lKn="[object ArrayBuffer]",cKn="[object DataView]",uKn="[object Float32Array]",dKn="[object Float64Array]",hKn="[object Int8Array]",fKn="[object Int16Array]",pKn="[object Int32Array]",gKn="[object Uint8Array]",mKn="[object Uint8ClampedArray]",vKn="[object Uint16Array]",yKn="[object Uint32Array]",mo={};mo[uKn]=mo[dKn]=mo[hKn]=mo[fKn]=mo[pKn]=mo[gKn]=mo[mKn]=mo[vKn]=mo[yKn]=!0,mo[jXn]=mo[XXn]=mo[lKn]=mo[KXn]=mo[cKn]=mo[ZXn]=mo[JXn]=mo[eKn]=mo[tKn]=mo[rKn]=mo[nKn]=mo[iKn]=mo[aKn]=mo[oKn]=mo[sKn]=!1;function HXt(t){return oD(t)&&a3e(t.length)&&!!mo[iD(t)]}$(HXt,"baseIsTypedArray");var bKn=HXt;function WXt(t){return function(e){return t(e)}}$(WXt,"baseUnary");var xKn=WXt,YXt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gz=YXt&&typeof module=="object"&&module&&!module.nodeType&&module,wKn=Gz&&Gz.exports===YXt,o3e=wKn&&$jt.process,AKn=function(){try{var t=Gz&&Gz.require&&Gz.require("util").types;return t||o3e&&o3e.binding&&o3e.binding("util")}catch{}}(),qXt=AKn,jXt=qXt&&qXt.isTypedArray,SKn=jXt?xKn(jXt):bKn,s3e=SKn,TKn=Object.prototype,CKn=TKn.hasOwnProperty;function XXt(t,e){var r=pd(t),n=!r&&kne(t),i=!r&&!n&&One(t),a=!r&&!n&&!i&&s3e(t),o=r||n||i||a,s=o?BXn(t.length,String):[],l=s.length;for(var u in t)(e||CKn.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||GXt(u,l)))&&s.push(u);return s}$(XXt,"arrayLikeKeys");var kKn=XXt,OKn=Object.prototype;function KXt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||OKn;return t===r}$(KXt,"isPrototype");var ZXt=KXt;function JXt(t,e){return function(r){return t(e(r))}}$(JXt,"overArg");var EKn=JXt,_Kn=EKn(Object.keys,Object),RKn=_Kn,DKn=Object.prototype,LKn=DKn.hasOwnProperty;function eKt(t){if(!ZXt(t))return RKn(t);var e=[];for(var r in Object(t))LKn.call(t,r)&&r!="constructor"&&e.push(r);return e}$(eKt,"baseKeys");var tKt=eKt;function rKt(t){return t!=null&&a3e(t.length)&&!Wjt(t)}$(rKt,"isArrayLike");var Ene=rKt;function nKt(t){return Ene(t)?kKn(t):tKt(t)}$(nKt,"keys");var l3e=nKt;function iKt(t){return DXn(t,l3e,NXn)}$(iKt,"getAllKeys");var aKt=iKt,MKn=1,IKn=Object.prototype,PKn=IKn.hasOwnProperty;function oKt(t,e,r,n,i,a){var o=r&MKn,s=aKt(t),l=s.length,u=aKt(e),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var f=s[h];if(!(o?f in e:PKn.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;++hx3e(t,e,o));return Jk(t,e,n,r,...i)}$(lZt,"alternation");function cZt(t,e,r){const n=yl(t,e,r,{type:N2});pb(t,n);const i=Jk(t,e,n,r,B2(t,e,r));return uZt(t,e,r,i)}$(cZt,"option");function B2(t,e,r){const n=LZn(fb(r.definition,i=>x3e(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:hZt(t,n)}$(B2,"block");function w3e(t,e,r,n,i){const a=n.left,o=n.right,s=yl(t,e,r,{type:BZn});pb(t,s);const l=yl(t,e,r,{type:eZt});return a.loopback=s,l.loopback=s,t.decisionMap[Zk(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}}$(w3e,"plus");function A3e(t,e,r,n,i){const a=n.left,o=n.right,s=yl(t,e,r,{type:NZn});pb(t,s);const l=yl(t,e,r,{type:eZt}),u=yl(t,e,r,{type:PZn});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[Zk(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:l}}$(A3e,"star");function uZt(t,e,r,n){const i=n.left,a=n.right;return Ss(i,a),t.decisionMap[Zk(e,"Option",r.idx)]=i,n}$(uZt,"optional");function pb(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}$(pb,"defineDecisionState");function Jk(t,e,r,n,...i){const a=yl(t,e,n,{type:IZn,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[Zk(e,dZt(n),n.idx)]=r,o}$(Jk,"makeAlts");function dZt(t){if(t instanceof uh)return"Alternation";if(t instanceof Lc)return"Option";if(t instanceof ns)return"Repetition";if(t instanceof ch)return"RepetitionWithSeparator";if(t instanceof wf)return"RepetitionMandatory";if(t instanceof Af)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}$(dZt,"getProdType");function hZt(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}},$(yM,"ATNConfigSet"),yM);function T3e(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}$(T3e,"getATNConfigKey");function mZt(t,e,r){for(var n=-1,i=t.length;++n0&&r(s)?e>1?C3e(s,e-1,r,n,i):OXt(i,s):n||(i[i.length]=s)}return i}$(C3e,"baseFlatten");var wZt=C3e;function AZt(t,e){return wZt(fb(t,e),1)}$(AZt,"flatMap");var VZn=AZt;function SZt(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}$(OZt,"arrayIncludes");var YZn=OZt;function EZt(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=JZn){var u=e?null:ZZn(t);if(u)return n3e(u);o=!1,i=yXt,l=new gXt}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}}$(UZt,"createDFACache");var VZt=(bM=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=rZt(e.rules),this.dfas=QZt(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=Zk(n,"Alternation",r),d=this.atn.decisionMap[l].decision,h=fb(N4e({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>fb(f,p=>p[0]));if(O3e(h,!1)&&!a){const f=zZt(h,(p,g,m)=>(k3e(g,v=>{v&&(p[v.tokenTypeIdx]=m,k3e(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 VZt,g=f===void 0?0:f.length;for(let v=0;vfb(f,p=>p[0]));if(O3e(h)&&h[0][0]&&!a){const f=h[0],p=rJn(f);if(p.length===1&&cJn(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=zZt(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,k3e(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=$ne.call(this,o,d,GZt,s);return typeof f=="object"?!1:f===0}}},$(xM,"LLStarLookaheadStrategy"),xM);function O3e(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}$(O3e,"isLL1Sequence");function QZt(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nQk(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${jZt(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}$(qZt,"buildAmbiguityError");function jZt(t){if(t instanceof dd)return"SUBRULE";if(t instanceof Lc)return"OPTION";if(t instanceof uh)return"OR";if(t instanceof wf)return"AT_LEAST_ONE";if(t instanceof Af)return"AT_LEAST_ONE_SEP";if(t instanceof ch)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(jZt,"getProductionDslName");function XZt(t,e,r){const n=VZn(e.configs.elements,a=>a.state.transitions),i=tJn(n.filter(a=>a instanceof y3e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(XZt,"buildAdaptivePredictError");function KZt(t,e){return t.edges[e.tokenTypeIdx]}$(KZt,"getExistingTargetState");function ZZt(t,e,r){const n=new S3e,i=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Qz){i.push(o);continue}const s=o.state.transitions.length;for(let l=0;l0&&!nJt(a))for(const o of i)a.add(o);return a}$(ZZt,"computeReachSet");function JZt(t,e){if(t instanceof y3e&&I4e(e,t.tokenType))return t.target}$(JZt,"getReachableTarget");function eJt(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}$(eJt,"getUniqueAlt");function E3e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(E3e,"newDFAState");function _3e(t,e,r,n){return n=R3e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(_3e,"addDFAEdge");function R3e(t,e){if(e===Bne)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 tJt(t){const e=new S3e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Hz(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}$(sJt,"hasConflictingAltSet");function lJt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(lJt,"hasStateAssociatedWithOneAlt"),G9();var cJt=(wM=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new L3e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new zne;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Fne(e.startOffset,e.image.length,nz(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 Fne(a.startOffset,a.image.length,nz(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)}},$(wM,"CstNodeBuilder"),wM),D3e=(AM=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)}},$(AM,"AbstractCstNode"),AM),Fne=(SM=class extends D3e{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}},$(SM,"LeafCstNodeImpl"),SM),zne=(TM=class extends D3e{constructor(){super(...arguments),this.content=new fJn(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]}},$(TM,"CompositeCstNodeImpl"),TM),fJn=(OO=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,OO.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}},$(OO,"CstNodeContainer"),OO),L3e=(CM=class extends zne{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(CM,"RootCstNodeImpl"),CM),Une=Symbol("Datatype");function Vne(t){return t.$type===Une}$(Vne,"isDataTypeNode");var uJt="​",dJt=$(t=>t.endsWith(uJt)?t:t+uJt,"withRuleSuffix"),M3e=(kM=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 gJn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new gJt(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()}},$(kM,"AbstractLangiumParser"),kM),hJt=(OM=class extends M3e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new cJt,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;N3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(dJt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),cd(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===Une?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 d=ib(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,d,o,l)}else if(Vne(u)){let d=i.image;ib(n)||(d=this.converter.convert(d,o).toString()),u.value+=d}}}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(Vne(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)):Vne(e)?this.converter.convert(e.value,e.$cstNode):(j5e(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),d=n.slice(a+1),h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:s},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:d,operators:l},p=this.constructInfix(h,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=gk(e,rb);this.assignmentMap.set(e,{assignment:r,crossRef:r&&vk(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}},$(OM,"LangiumParser"),OM),fJt=(EM=class{buildMismatchTokenMessage(e){return rD.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return rD.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return rD.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return rD.buildEarlyExitMessage(e)}},$(EM,"AbstractParserErrorMessageProvider"),EM),I3e=(_M=class extends fJt{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}\`.`}},$(_M,"LangiumParserErrorMessageProvider"),_M),pJt=(RM=class extends M3e{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(dJt(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}},$(RM,"LangiumCompletionParser"),RM),pJn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new I3e},gJt=(DM=class extends ejn{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...pJn,lookaheadStrategy:n?new Y4e({maxLookahead:r.maxLookahead}):new hJn({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,{})}},$(DM,"ChevrotainWrapper"),DM),gJn=(LM=class extends gJt{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))}}},$(LM,"ProfilerWrapper"),LM);function Gne(t,e,r){return mJt({parser:e,tokens:r,ruleNames:new Map},t),e}$(Gne,"createParser");function mJt(t,e){const r=_re(e,!1),n=ha(e.rules).filter(cd).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,$2(o,a.definition))}const i=ha(e.rules).filter(N3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,vJt(t,a))}$(mJt,"buildRules");function vJt(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($p(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 h=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:$(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=Qne(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:$(()=>{t.parser.alternatives(0,h),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}$(vJt,"buildInfixRule");function $2(t,e,r=!1){let n;if(ib(e))n=TJt(t,e);else if(k2(e))n=yJt(t,e);else if(rb(e))n=$2(t,e.terminal);else if(vk(e))n=P3e(t,e);else if(ab(e))n=bJt(t,e);else if(rre(e))n=wJt(t,e);else if(bre(e))n=AJt(t,e);else if(bk(e))n=SJt(t,e);else if(rRe(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,I2,e),"method")}else throw new Are(e.$cstNode,`Unexpected element type: ${e.$type}`);return N3e(t,r?void 0:Wz(e),n,e.cardinality)}$($2,"buildElement");function yJt(t,e){const r=Lk(e);return()=>t.parser.action(r,e)}$(yJt,"buildAction");function bJt(t,e){const r=e.rule.ref;if(mk(r)){const n=t.subrule++,i=cd(r)&&r.fragment,a=e.arguments.length>0?xJt(r,e.arguments):()=>({});let o;return s=>{o??(o=Qne(t,r)),t.parser.subrule(n,o,i,e,a(s))}}else if($p(r)){const n=t.consume++,i=Hne(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)D2();else throw new Are(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(bJt,"buildRuleCall");function xJt(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:nm(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=>nm(i.value));return i=>{const a={};for(let o=0;oe(n)||r(n)}else if(eRe(t)){const e=nm(t.left),r=nm(t.right);return n=>e(n)&&r(n)}else if(aRe(t)){const e=nm(t.value);return r=>!e(r)}else if(oRe(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Z5e(t)){const e=!!t.true;return()=>e}D2()}$(nm,"buildPredicate");function wJt(t,e){if(e.elements.length===1)return $2(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:$2(t,i,!0)},o=Wz(i);o&&(a.GATE=nm(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}))}}$(wJt,"buildAlternatives");function AJt(t,e){if(e.elements.length===1)return $2(t,e.elements[0]);const r=[];for(const s of e.elements){const l={ALT:$2(t,s,!0)},u=Wz(s);u&&(l.GATE=nm(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 d={ALT:$(()=>!0,"ALT")},h=t.parser;d.ALT=()=>{if(l.ALT(s),!h.isRecording()){const p=i(n,h);h.unorderedGroups.get(p)||h.unorderedGroups.set(p,[]);const g=h.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?d.GATE=()=>f(s):d.GATE=()=>{const p=h.unorderedGroups.get(i(n,h));return!(p!=null&&p[u])},d})),"alternatives"),o=N3e(t,Wz(e),a,"*");return s=>{o(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(AJt,"buildUnorderedGroup");function SJt(t,e){const r=e.elements.map(n=>$2(t,n));return n=>r.forEach(i=>i(n))}$(SJt,"buildGroup");function Wz(t){if(bk(t))return t.guardCondition}$(Wz,"getGuardCondition");function P3e(t,e,r=e.terminal){if(r)if(ab(r)&&cd(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return o=>{a??(a=Qne(t,n)),t.parser.subrule(i,a,!1,e,o)}}else if(ab(r)&&$p(r.rule.ref)){const n=t.consume++,i=Hne(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(ib(r)){const n=t.consume++,i=Hne(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=Mre(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Lk(e.type.ref));return P3e(t,e,i)}}$(P3e,"buildCrossReference");function TJt(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)}$(TJt,"buildKeyword");function N3e(t,e,r,n){const i=e&&nm(e);if(!n)if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:$(()=>r(o),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:J4e(),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:J4e(),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 D2()}$(N3e,"wrap");function Qne(t,e){const r=CJt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Qne,"getRule");function CJt(t,e){if(mk(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!cd(n);)(bk(n)||rre(n)||bre(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(CJt,"getRuleName");function Hne(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Hne,"getToken");function B3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new pJt(t);return Gne(e,n,r.definition),n.finalize(),n}$(B3e,"createCompletionParser");function $3e(t){const e=F3e(t);return e.finalize(),e}$($3e,"createLangiumParser");function F3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new hJt(t);return Gne(e,n,r.definition)}$(F3e,"prepareLangiumParser");var Wne=(MM=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ha(_re(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($p).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=oz(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=Ere(r)?hd.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(mk).flatMap(i=>tb(i).filter(ib)).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(W3(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},[])}},$(MM,"DefaultTokenBuilder"),MM),z3e=(IM=class{convert(e,r){let n=r.grammarSource;if(vk(n)&&(n=PRe(n)),ab(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 yv.convertInt(r);case"STRING":return yv.convertString(r);case"ID":return yv.convertID(r)}switch((i=QRe(e))==null?void 0:i.toLowerCase()){case"number":return yv.convertNumber(r);case"boolean":return yv.convertBoolean(r);case"bigint":return yv.convertBigint(r);case"date":return yv.convertDate(r);default:return r}}},$(IM,"DefaultValueConverter"),IM),yv;(function(t){function e(u){let d="";for(let h=1;h{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Yne,"delayNextTick");var qne=0,kJt=10;function jne(){return qne=performance.now(),new Ha.CancellationTokenSource}$(jne,"startCancelableOperation");function U3e(t){kJt=t}$(U3e,"setInterruptionPeriod");var bv=Symbol("OperationCancelled");function eO(t){return t===bv}$(eO,"isOperationCancelled");async function Xl(t){if(t===Ha.CancellationToken.None)return;const e=performance.now();if(e-qne>=kJt&&(qne=e,await Yne(),qne=performance.now()),t.isCancellationRequested)throw bv}$(Xl,"interruptAndCheck");var gb=(PM=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(PM,"Deferred"),PM),OJt=(j2=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(j2.isIncremental(n)){const i=Q3e(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 d=V3e(n.text,!1,a);if(l-s===d.length)for(let f=0,p=d.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}},$(j2,"FullTextDocument"),j2),Xne;(function(t){function e(i,a,o,s){return new OJt(i,a,o,s)}$(e,"create"),t.create=e;function r(i,a,o){if(i instanceof OJt)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=Kne(a.map(EJt),(d,h)=>{const f=d.range.start.line-h.range.start.line;return f===0?d.range.start.character-h.range.start.character:f});let l=0;const u=[];for(const d of s){const h=i.offsetAt(d.range.start);if(hl&&u.push(o.substring(l,h)),d.newText.length&&u.push(d.newText),l=i.offsetAt(d.range.end)}return u.push(o.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Xne||(Xne={}));function Kne(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Kne(n,e),Kne(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}$(Q3e,"getWellformedRange");function EJt(t){const e=Q3e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(EJt,"getWellformedEdit");var _Jt;(()=>{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,G=0;G<=I.length;++G){if(G2){var H=B.lastIndexOf("/");if(H!==B.length-1){H===-1?(B="",V=0):V=(B=B.slice(0,H)).length-1-B.lastIndexOf("/"),z=G,U=0;continue}}else if(B.length===2||B.length===1){B="",V=0,z=G,U=0;continue}}N&&(B.length>0?B+="/..":B="..",V=2)}else B.length>0?B+="/"+I.slice(z+1,G):B=I.slice(z+1,G),V=G-z-1;z=G,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;FG){if(N.charCodeAt(z+j)===47)return N.slice(z+j+1);if(j===0)return N.slice(z+j)}else V>G&&(I.charCodeAt(F+j)===47?H=j:j===0&&(H=0));break}var q=I.charCodeAt(F+j);if(q!==N.charCodeAt(z+j))break;q===47&&(H=j)}var ne="";for(j=F+H+1;j<=B;++j)j!==B&&I.charCodeAt(j)!==47||(ne.length===0?ne+="..":ne+="/..");return ne.length>0?ne+N.slice(z+H):(z+=H,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,G=-1;for(F=I.length-1;F>=0;--F){var H=I.charCodeAt(F);if(H===47){if(!z){B=F+1;break}}else G===-1&&(z=!1,G=F+1),U>=0&&(H===N.charCodeAt(U)?--U==-1&&(V=F):(U=-1,V=G))}return B===V?V=G: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 G=I.charCodeAt(U);if(G!==47)B===-1&&(V=!1,B=U+1),G===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,G=-1,H=!0,j=I.length-1,q=0;j>=F;--j)if((B=I.charCodeAt(j))!==47)G===-1&&(H=!1,G=j+1),B===46?z===-1?z=j:q!==1&&(q=1):z!==-1&&(q=-1);else if(!H){U=j+1;break}return z===-1||G===-1||q===0||q===1&&z===G-1&&z===U+1?G!==-1&&(N.base=N.name=U===0&&V?I.slice(1,G):I.slice(U,G)):(U===0&&V?(N.name=I.slice(1,z),N.base=I.slice(1,G)):(N.name=I.slice(U,z),N.base=I.slice(U,G)),N.ext=I.slice(z,G)),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="",d="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=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]!==d&&(V=d+V):V=d}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=h.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,d)),R[0]===d&&R[1]===d){const M=R.indexOf(d,2);M===-1?(D=R.substring(2),R=d):(D=R.substring(2,M),R=R.substring(M)||d)}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+=d,M+=d),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,O="/";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]!==O&&(M=O+M,I=!0);let N=C.resolve(M,...D);return I&&N[0]===O&&!R.authority&&(N=N.substring(1)),R.with({path:N})},L.dirname=function(R){if(R.path.length===0||R.path===O)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={})),_Jt=n})();var{URI:Sf,Utils:Yz}=_Jt,gd;(function(t){t.basename=Yz.basename,t.dirname=Yz.dirname,t.extname=Yz.extname,t.joinPath=Yz.joinPath,t.resolvePath=Yz.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"?Sf.parse(o).path:o.path,u=typeof s=="string"?Sf.parse(s).path:s.path,d=l.split("/").filter(m=>m.length>0),h=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]!==h[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:gd.joinPath(Sf.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(gd.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}},$(NM,"UriTrie"),NM),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 RJt=(BM=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??Sf.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=Xne.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(BM,"DefaultLangiumDocumentFactory"),BM),DJt=($M=class{constructor(e){this.documentTrie=new H3e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ha(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}},$($M,"DefaultLangiumDocuments"),$M),tO=Symbol("RefResolving"),LJt=(FM=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 jg(e.parseResult.value))await Xl(r),I3(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 jg(e.parseResult.value))await Xl(r),I3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=tO;try{const i=this.getCandidate(e);if(fk(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=tO;try{const i=this.getCandidates(e),a=[];if(fk(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(Ks(this._ref))return this._ref;if(W5e(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=tO;const s=M3(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(fk(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=M3(e.container).$document;n&&n.statevk(r)&&r.isMulti)}findDeclarations(e){if(e){const r=FRe(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(sd(i)||lv(i))return Zte(i);if(Array.isArray(i)){for(const a of i)if((sd(a)||lv(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Zte(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||mRe(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 I3(n))if(lv(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=>gd.equals(a.sourceUri,r.documentUri))),n.push(...i),ha(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const o=qg(i),s=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:o.uri,sourcePath:s,targetUri:o.uri,targetPath:s,segment:Q3(a),local:!0})}}return n}},$(UM,"DefaultReferences"),UM),mb=(VM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return W9.sum(ha(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?ha(r):R3}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 ha(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ha(this.map.keys())}values(){return ha(this.map.values()).flat()}entriesGroupedByKey(){return ha(this.map.entries())}},$(VM,"MultiMap"),VM),Zne=(GM=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}},$(GM,"BiMap"),GM),PJt=(QM=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=Y9,i=Ha.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const o of n(e))await Xl(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 mb;for(const a of tb(n))await Xl(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))}}},$(QM,"DefaultScopeComputation"),QM),Y3e=(HM=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}},$(HM,"StreamScope"),HM),mJn=(WM=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?ha(i).concat(this.outerScope.getElements(e)):ha(i)}getAllElements(){let e=ha(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(WM,"MapScope"),WM),NJt=(YM=class{constructor(e,r,n){this.elements=new mb,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?ha(n).concat(this.outerScope.getElements(e)):ha(n)}getAllElements(){let e=ha(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(YM,"MultiMapScope"),YM),vJn={getElement(){},getElements(){return R3},getAllElements(){return R3}},Jne=(qM=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")}},$(qM,"DisposableCache"),qM),q3e=(jM=class extends Jne{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()}},$(jM,"SimpleCache"),jM),eie=(XM=class extends Jne{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}},$(XM,"ContextCache"),XM),BJt=(KM=class extends eie{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)}))}},$(KM,"DocumentCache"),KM),j3e=(ZM=class extends q3e{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()}))}},$(ZM,"WorkspaceCache"),ZM),$Jt=(JM=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 j3e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qg(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 Y3e(ha(e),r,n)}createScopeForNodes(e,r,n){const i=ha(e).map(a=>{const o=this.nameProvider.getName(a);if(o)return this.descriptions.createDescription(a,o)}).nonNullable();return new Y3e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new NJt(this.indexManager.allElements(e)))}},$(JM,"DefaultScopeProvider"),JM);function X3e(t){return typeof t.$comment=="string"}$(X3e,"isAstNodeWithComment");function K3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(K3e,"isIntermediateReference");var FJt=(eI=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=qg(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,d;if(!this.ignoreProperties.has(e))if(sd(r)){const h=r.ref,f=n?r.$refText:void 0;if(h){const p=qg(h);let g="";this.currentDocument&&this.currentDocument!==p&&(s?g=s(p.uri,h):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(h);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(lv(r)){const h=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qg(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:h}}else if(Ks(r)){let h;if(a&&(h=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(h??(h={...r}),h.$sourceText=(d=r.$cstNode)==null?void 0:d.text),o){h??(h={...r});const f=this.commentProvider.getComment(r);f&&(h.$comment=f.replace(/\r/g,""))}return h??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=BRe(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 d=0;d{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(eO(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=ha(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}},$(rI,"ValidationRegistry"),rI),VJt=Object.freeze({validateNode:!0,validateChildren:!0}),GJt=(nI=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 Xl(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)===Gp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Gp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Gp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(o){if(eO(o))throw o;console.error("An error occurred during validation:",o)}return await Xl(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:qz(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:J3e(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=nz(i.token);if(a){const o={severity:qz("error"),range:a,message:i.message,data:rO(Gp.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:Gp.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 Xl(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=jg(e).iterator();for(const l of s){o.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const d=this.validationRegistry.getChecks(l.$type,r.categories);for(const h of d)await h(l,n,i)}finally{o.stopSubTask(l.$type)}u.validateChildren||s.prune()}}finally{o.stop()}}else{const o=jg(e).iterator();for(const s of o){await Xl(i);const l=this.validateSingleNodeOptions(s,r);if(l.validateNode){const u=this.validationRegistry.getChecks(s.$type,r.categories);for(const d of u)await d(s,n,i)}l.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return VJt}async validateAstAfter(e,r,n,i=Ha.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const o of a)await Xl(i),await o(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Z3e(n),severity:qz(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},$(nI,"DefaultDocumentValidator"),nI);function Z3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Rre(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=$Re(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}}}$(Z3e,"getDiagnosticRange");function qz(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)}}$(qz,"toDiagnosticSeverity");function J3e(t){switch(t){case"error":return rO(Gp.LexingError);case"warning":return rO(Gp.LexingWarning);case"info":return rO(Gp.LexingInfo);case"hint":return rO(Gp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(J3e,"toDiagnosticData");var Gp;(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"})(Gp||(Gp={}));var QJt=(iI=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qg(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=Q3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return s()},selectionSegment:Q3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(iI,"DefaultAstNodeDescriptionProvider"),iI),HJt=(aI=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 jg(i))await Xl(r),I3(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=[];sd(r)&&r.$nodeDescription?n=[r.$nodeDescription]:lv(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),o=[],s=Q3(r.$refNode);for(const l of n)o.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:s,local:gd.equals(l.documentUri,i)});return o}},$(aI,"DefaultReferenceDescriptionProvider"),aI),WJt=(oI=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)}},$(oI,"DefaultAstNodeLocator"),oI),rie={};Ute(rie,z_e(E3()));var YJt=(sI=class{constructor(e){this._ready=new gb,this.onConfigurationSectionUpdateEmitter=new rie.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}},$(sI,"DefaultConfigurationProvider"),sI),nie=z_e(KUn()),nO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(nO||(nO={}));var qJt=(lI=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new mb,this.documentPhaseListeners=new mb,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 d of u)i.push(d.uri),this.cleanUpDeleted(d)}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=ha(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 Xl(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 ha(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),nO.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),nO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),nO.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(bv);if(this.currentState>=e&&e>i.state)return Promise.reject(new nie.ResponseError(nie.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 nie.ResponseError(nie.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,o)=>{const s=this.onDocumentPhase(e,u=>{gd.equals(u.uri,r)&&(s.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{s.dispose(),l.dispose(),o(bv)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(bv):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),o.dispose(),n()}),o=r.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(bv)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const o of a)try{await Xl(n),await o(e,n)}catch(s){if(!eO(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 Xl(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=ha(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)??{}}},$(lI,"DefaultDocumentBuilder"),lI),jJt=(cI=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new eie,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(o=>{gd.equals(o.targetUri,n)&&o.targetPath===r&&i.push(o)})}),ha(i)}allElements(e,r){let n=ha(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}},$(cI,"DefaultIndexManager"),cI),XJt=(uI=class{constructor(e){this.initialBuildOptions={},this._ready=new gb,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 Xl(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=ha(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 Sf.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=gd.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(uI,"DefaultWorkspaceManager"),uI),KJt=(dI=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return L4e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return L4e.buildUnableToPopLexerModeMessage(e)}},$(dI,"DefaultLexerErrorMessageProvider"),dI),eDe={mode:"full"},tDe=(hI=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=oie(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new hd(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=eDe){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(oie(e))return e;const r=aie(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(hI,"DefaultLexer"),hI);function iie(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(iie,"isTokenTypeArray");function aie(t){return t&&"modes"in t&&"defaultMode"in t}$(aie,"isIMultiModeLexerDefinition");function oie(t){return!iie(t)&&!aie(t)}$(oie,"isTokenTypeDictionary"),G9();function rDe(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ta.create(0,0));const a=iDe(t),o=lie(n),s=JJt({lines:a,position:i,options:o});return rer({index:0,tokens:s,position:i})}$(rDe,"parseJSDoc");function nDe(t,e){const r=lie(e),n=iDe(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))}$(nDe,"isJSDoc");function iDe(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(NVt)}$(iDe,"getLines");var ZJt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,yJn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function JJt(t){var i,a,o;const e=[];let r=t.position.line,n=t.position.character;for(let s=0;s=d.length){if(e.length>0){const p=ta.create(r,n);e.push({type:"break",content:"",range:Di.create(p,p)})}}else{ZJt.lastIndex=h;const p=ZJt.exec(d);if(p){const g=p[0],m=p[1],v=ta.create(r,n+h),y=ta.create(r,n+h+g.length);e.push({type:"tag",content:m,range:Di.create(v,y)}),h+=g.length,h=sie(d,h)}if(h0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(JJt,"tokenize");function eer(t,e,r,n){const i=[];if(t.length===0){const a=ta.create(r,n),o=ta.create(r,n+e.length);i.push({type:"text",content:e,range:Di.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:Di.create(ta.create(r,a+n),ta.create(r,l+n))});let d=u.length+1;const h=s[1];if(i.push({type:"inline-tag",content:h,range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+h.length+n))}),d+=h.length,s.length===4){d+=s[2].length;const f=s[3];i.push({type:"text",content:f,range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+f.length+n))})}else i.push({type:"text",content:"",range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+n))});a=l+s[0].length}const o=e.substring(a);o.length>0&&i.push({type:"text",content:o,range:Di.create(ta.create(r,a+n),ta.create(r,a+n+o.length))})}return i}$(eer,"buildInlineTokens");var bJn=/\S/,xJn=/\s*$/;function sie(t,e){const r=t.substring(e).match(bJn);return r?e+r.index:t.length}$(sie,"skipWhitespace");function ter(t){const e=t.match(xJn);if(e&&typeof e.index=="number")return e.index}$(ter,"lastCharacter");function rer(t){var a,o;const e=ta.create(t.position.line,t.position.character);if(t.tokens.length===0)return new oer([],Di.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+=uDe(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+=uDe(r)+i}return r.trim()}},$(fI,"JSDocCommentImpl"),fI),lDe=(pI=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +For Further details.`,n}$(qZt,"buildAmbiguityError");function jZt(t){if(t instanceof dd)return"SUBRULE";if(t instanceof Lc)return"OPTION";if(t instanceof uh)return"OR";if(t instanceof wf)return"AT_LEAST_ONE";if(t instanceof Af)return"AT_LEAST_ONE_SEP";if(t instanceof ch)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(jZt,"getProductionDslName");function XZt(t,e,r){const n=VZn(e.configs.elements,a=>a.state.transitions),i=tJn(n.filter(a=>a instanceof y3e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(XZt,"buildAdaptivePredictError");function KZt(t,e){return t.edges[e.tokenTypeIdx]}$(KZt,"getExistingTargetState");function ZZt(t,e,r){const n=new S3e,i=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Qz){i.push(o);continue}const s=o.state.transitions.length;for(let l=0;l0&&!nJt(a))for(const o of i)a.add(o);return a}$(ZZt,"computeReachSet");function JZt(t,e){if(t instanceof y3e&&I4e(e,t.tokenType))return t.target}$(JZt,"getReachableTarget");function eJt(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}$(eJt,"getUniqueAlt");function E3e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(E3e,"newDFAState");function _3e(t,e,r,n){return n=R3e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(_3e,"addDFAEdge");function R3e(t,e){if(e===Bne)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 tJt(t){const e=new S3e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Hz(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}$(sJt,"hasConflictingAltSet");function lJt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(lJt,"hasStateAssociatedWithOneAlt"),G9();var cJt=(wM=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new L3e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new zne;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Fne(e.startOffset,e.image.length,nz(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 Fne(a.startOffset,a.image.length,nz(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)}},$(wM,"CstNodeBuilder"),wM),D3e=(AM=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)}},$(AM,"AbstractCstNode"),AM),Fne=(SM=class extends D3e{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}},$(SM,"LeafCstNodeImpl"),SM),zne=(TM=class extends D3e{constructor(){super(...arguments),this.content=new fJn(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]}},$(TM,"CompositeCstNodeImpl"),TM),fJn=(OO=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,OO.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}},$(OO,"CstNodeContainer"),OO),L3e=(CM=class extends zne{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(CM,"RootCstNodeImpl"),CM),Une=Symbol("Datatype");function Vne(t){return t.$type===Une}$(Vne,"isDataTypeNode");var uJt="​",dJt=$(t=>t.endsWith(uJt)?t:t+uJt,"withRuleSuffix"),M3e=(kM=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 gJn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new gJt(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()}},$(kM,"AbstractLangiumParser"),kM),hJt=(OM=class extends M3e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new cJt,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;N3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(dJt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),cd(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===Une?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 d=ib(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,d,o,l)}else if(Vne(u)){let d=i.image;ib(n)||(d=this.converter.convert(d,o).toString()),u.value+=d}}}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(Vne(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)):Vne(e)?this.converter.convert(e.value,e.$cstNode):(jRe(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),d=n.slice(a+1),h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:s},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:d,operators:l},p=this.constructInfix(h,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=gk(e,rb);this.assignmentMap.set(e,{assignment:r,crossRef:r&&vk(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}},$(OM,"LangiumParser"),OM),fJt=(EM=class{buildMismatchTokenMessage(e){return rD.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return rD.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return rD.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return rD.buildEarlyExitMessage(e)}},$(EM,"AbstractParserErrorMessageProvider"),EM),I3e=(_M=class extends fJt{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}\`.`}},$(_M,"LangiumParserErrorMessageProvider"),_M),pJt=(RM=class extends M3e{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(dJt(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}},$(RM,"LangiumCompletionParser"),RM),pJn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new I3e},gJt=(DM=class extends ejn{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...pJn,lookaheadStrategy:n?new Y4e({maxLookahead:r.maxLookahead}):new hJn({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,{})}},$(DM,"ChevrotainWrapper"),DM),gJn=(LM=class extends gJt{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))}}},$(LM,"ProfilerWrapper"),LM);function Gne(t,e,r){return mJt({parser:e,tokens:r,ruleNames:new Map},t),e}$(Gne,"createParser");function mJt(t,e){const r=_re(e,!1),n=ha(e.rules).filter(cd).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,$2(o,a.definition))}const i=ha(e.rules).filter(N3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,vJt(t,a))}$(mJt,"buildRules");function vJt(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($p(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 h=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:$(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=Qne(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:$(()=>{t.parser.alternatives(0,h),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}$(vJt,"buildInfixRule");function $2(t,e,r=!1){let n;if(ib(e))n=TJt(t,e);else if(k2(e))n=yJt(t,e);else if(rb(e))n=$2(t,e.terminal);else if(vk(e))n=P3e(t,e);else if(ab(e))n=bJt(t,e);else if(rre(e))n=wJt(t,e);else if(bre(e))n=AJt(t,e);else if(bk(e))n=SJt(t,e);else if(r5e(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,I2,e),"method")}else throw new Are(e.$cstNode,`Unexpected element type: ${e.$type}`);return N3e(t,r?void 0:Wz(e),n,e.cardinality)}$($2,"buildElement");function yJt(t,e){const r=Lk(e);return()=>t.parser.action(r,e)}$(yJt,"buildAction");function bJt(t,e){const r=e.rule.ref;if(mk(r)){const n=t.subrule++,i=cd(r)&&r.fragment,a=e.arguments.length>0?xJt(r,e.arguments):()=>({});let o;return s=>{o??(o=Qne(t,r)),t.parser.subrule(n,o,i,e,a(s))}}else if($p(r)){const n=t.consume++,i=Hne(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)D2();else throw new Are(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(bJt,"buildRuleCall");function xJt(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:nm(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=>nm(i.value));return i=>{const a={};for(let o=0;oe(n)||r(n)}else if(e5e(t)){const e=nm(t.left),r=nm(t.right);return n=>e(n)&&r(n)}else if(a5e(t)){const e=nm(t.value);return r=>!e(r)}else if(o5e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(ZRe(t)){const e=!!t.true;return()=>e}D2()}$(nm,"buildPredicate");function wJt(t,e){if(e.elements.length===1)return $2(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:$2(t,i,!0)},o=Wz(i);o&&(a.GATE=nm(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}))}}$(wJt,"buildAlternatives");function AJt(t,e){if(e.elements.length===1)return $2(t,e.elements[0]);const r=[];for(const s of e.elements){const l={ALT:$2(t,s,!0)},u=Wz(s);u&&(l.GATE=nm(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 d={ALT:$(()=>!0,"ALT")},h=t.parser;d.ALT=()=>{if(l.ALT(s),!h.isRecording()){const p=i(n,h);h.unorderedGroups.get(p)||h.unorderedGroups.set(p,[]);const g=h.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?d.GATE=()=>f(s):d.GATE=()=>{const p=h.unorderedGroups.get(i(n,h));return!(p!=null&&p[u])},d})),"alternatives"),o=N3e(t,Wz(e),a,"*");return s=>{o(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(AJt,"buildUnorderedGroup");function SJt(t,e){const r=e.elements.map(n=>$2(t,n));return n=>r.forEach(i=>i(n))}$(SJt,"buildGroup");function Wz(t){if(bk(t))return t.guardCondition}$(Wz,"getGuardCondition");function P3e(t,e,r=e.terminal){if(r)if(ab(r)&&cd(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return o=>{a??(a=Qne(t,n)),t.parser.subrule(i,a,!1,e,o)}}else if(ab(r)&&$p(r.rule.ref)){const n=t.consume++,i=Hne(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(ib(r)){const n=t.consume++,i=Hne(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=Mre(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Lk(e.type.ref));return P3e(t,e,i)}}$(P3e,"buildCrossReference");function TJt(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)}$(TJt,"buildKeyword");function N3e(t,e,r,n){const i=e&&nm(e);if(!n)if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:$(()=>r(o),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:J4e(),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:J4e(),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 D2()}$(N3e,"wrap");function Qne(t,e){const r=CJt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Qne,"getRule");function CJt(t,e){if(mk(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!cd(n);)(bk(n)||rre(n)||bre(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(CJt,"getRuleName");function Hne(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Hne,"getToken");function B3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new pJt(t);return Gne(e,n,r.definition),n.finalize(),n}$(B3e,"createCompletionParser");function $3e(t){const e=F3e(t);return e.finalize(),e}$($3e,"createLangiumParser");function F3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new hJt(t);return Gne(e,n,r.definition)}$(F3e,"prepareLangiumParser");var Wne=(MM=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ha(_re(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($p).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=oz(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=Ere(r)?hd.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(mk).flatMap(i=>tb(i).filter(ib)).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(W3(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&&R5e("^"+a.source+"$",e.value)&&n.push(i),n},[])}},$(MM,"DefaultTokenBuilder"),MM),z3e=(IM=class{convert(e,r){let n=r.grammarSource;if(vk(n)&&(n=P5e(n)),ab(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 yv.convertInt(r);case"STRING":return yv.convertString(r);case"ID":return yv.convertID(r)}switch((i=Q5e(e))==null?void 0:i.toLowerCase()){case"number":return yv.convertNumber(r);case"boolean":return yv.convertBoolean(r);case"bigint":return yv.convertBigint(r);case"date":return yv.convertDate(r);default:return r}}},$(IM,"DefaultValueConverter"),IM),yv;(function(t){function e(u){let d="";for(let h=1;h{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Yne,"delayNextTick");var qne=0,kJt=10;function jne(){return qne=performance.now(),new Ha.CancellationTokenSource}$(jne,"startCancelableOperation");function U3e(t){kJt=t}$(U3e,"setInterruptionPeriod");var bv=Symbol("OperationCancelled");function eO(t){return t===bv}$(eO,"isOperationCancelled");async function Xl(t){if(t===Ha.CancellationToken.None)return;const e=performance.now();if(e-qne>=kJt&&(qne=e,await Yne(),qne=performance.now()),t.isCancellationRequested)throw bv}$(Xl,"interruptAndCheck");var gb=(PM=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(PM,"Deferred"),PM),OJt=(j2=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(j2.isIncremental(n)){const i=Q3e(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 d=V3e(n.text,!1,a);if(l-s===d.length)for(let f=0,p=d.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}},$(j2,"FullTextDocument"),j2),Xne;(function(t){function e(i,a,o,s){return new OJt(i,a,o,s)}$(e,"create"),t.create=e;function r(i,a,o){if(i instanceof OJt)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=Kne(a.map(EJt),(d,h)=>{const f=d.range.start.line-h.range.start.line;return f===0?d.range.start.character-h.range.start.character:f});let l=0;const u=[];for(const d of s){const h=i.offsetAt(d.range.start);if(hl&&u.push(o.substring(l,h)),d.newText.length&&u.push(d.newText),l=i.offsetAt(d.range.end)}return u.push(o.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Xne||(Xne={}));function Kne(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Kne(n,e),Kne(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}$(Q3e,"getWellformedRange");function EJt(t){const e=Q3e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(EJt,"getWellformedEdit");var _Jt;(()=>{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,G=0;G<=I.length;++G){if(G2){var H=B.lastIndexOf("/");if(H!==B.length-1){H===-1?(B="",V=0):V=(B=B.slice(0,H)).length-1-B.lastIndexOf("/"),z=G,U=0;continue}}else if(B.length===2||B.length===1){B="",V=0,z=G,U=0;continue}}N&&(B.length>0?B+="/..":B="..",V=2)}else B.length>0?B+="/"+I.slice(z+1,G):B=I.slice(z+1,G),V=G-z-1;z=G,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;FG){if(N.charCodeAt(z+j)===47)return N.slice(z+j+1);if(j===0)return N.slice(z+j)}else V>G&&(I.charCodeAt(F+j)===47?H=j:j===0&&(H=0));break}var q=I.charCodeAt(F+j);if(q!==N.charCodeAt(z+j))break;q===47&&(H=j)}var ne="";for(j=F+H+1;j<=B;++j)j!==B&&I.charCodeAt(j)!==47||(ne.length===0?ne+="..":ne+="/..");return ne.length>0?ne+N.slice(z+H):(z+=H,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,G=-1;for(F=I.length-1;F>=0;--F){var H=I.charCodeAt(F);if(H===47){if(!z){B=F+1;break}}else G===-1&&(z=!1,G=F+1),U>=0&&(H===N.charCodeAt(U)?--U==-1&&(V=F):(U=-1,V=G))}return B===V?V=G: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 G=I.charCodeAt(U);if(G!==47)B===-1&&(V=!1,B=U+1),G===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,G=-1,H=!0,j=I.length-1,q=0;j>=F;--j)if((B=I.charCodeAt(j))!==47)G===-1&&(H=!1,G=j+1),B===46?z===-1?z=j:q!==1&&(q=1):z!==-1&&(q=-1);else if(!H){U=j+1;break}return z===-1||G===-1||q===0||q===1&&z===G-1&&z===U+1?G!==-1&&(N.base=N.name=U===0&&V?I.slice(1,G):I.slice(U,G)):(U===0&&V?(N.name=I.slice(1,z),N.base=I.slice(1,G)):(N.name=I.slice(U,z),N.base=I.slice(U,G)),N.ext=I.slice(z,G)),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="",d="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=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]!==d&&(V=d+V):V=d}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=h.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,d)),R[0]===d&&R[1]===d){const M=R.indexOf(d,2);M===-1?(D=R.substring(2),R=d):(D=R.substring(2,M),R=R.substring(M)||d)}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+=d,M+=d),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,O="/";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]!==O&&(M=O+M,I=!0);let N=C.resolve(M,...D);return I&&N[0]===O&&!R.authority&&(N=N.substring(1)),R.with({path:N})},L.dirname=function(R){if(R.path.length===0||R.path===O)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={})),_Jt=n})();var{URI:Sf,Utils:Yz}=_Jt,gd;(function(t){t.basename=Yz.basename,t.dirname=Yz.dirname,t.extname=Yz.extname,t.joinPath=Yz.joinPath,t.resolvePath=Yz.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"?Sf.parse(o).path:o.path,u=typeof s=="string"?Sf.parse(s).path:s.path,d=l.split("/").filter(m=>m.length>0),h=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]!==h[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:gd.joinPath(Sf.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(gd.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}},$(NM,"UriTrie"),NM),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 RJt=(BM=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??Sf.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=Xne.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(BM,"DefaultLangiumDocumentFactory"),BM),DJt=($M=class{constructor(e){this.documentTrie=new H3e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ha(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}},$($M,"DefaultLangiumDocuments"),$M),tO=Symbol("RefResolving"),LJt=(FM=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 jg(e.parseResult.value))await Xl(r),I3(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 jg(e.parseResult.value))await Xl(r),I3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=tO;try{const i=this.getCandidate(e);if(fk(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=tO;try{const i=this.getCandidates(e),a=[];if(fk(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(Ks(this._ref))return this._ref;if(WRe(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=tO;const s=M3(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(fk(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=M3(e.container).$document;n&&n.statevk(r)&&r.isMulti)}findDeclarations(e){if(e){const r=F5e(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(sd(i)||lv(i))return Zte(i);if(Array.isArray(i)){for(const a of i)if((sd(a)||lv(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Zte(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||m5e(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 I3(n))if(lv(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=>gd.equals(a.sourceUri,r.documentUri))),n.push(...i),ha(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const o=qg(i),s=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:o.uri,sourcePath:s,targetUri:o.uri,targetPath:s,segment:Q3(a),local:!0})}}return n}},$(UM,"DefaultReferences"),UM),mb=(VM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return W9.sum(ha(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?ha(r):R3}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 ha(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ha(this.map.keys())}values(){return ha(this.map.values()).flat()}entriesGroupedByKey(){return ha(this.map.entries())}},$(VM,"MultiMap"),VM),Zne=(GM=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}},$(GM,"BiMap"),GM),PJt=(QM=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=Y9,i=Ha.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const o of n(e))await Xl(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 mb;for(const a of tb(n))await Xl(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))}}},$(QM,"DefaultScopeComputation"),QM),Y3e=(HM=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}},$(HM,"StreamScope"),HM),mJn=(WM=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?ha(i).concat(this.outerScope.getElements(e)):ha(i)}getAllElements(){let e=ha(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(WM,"MapScope"),WM),NJt=(YM=class{constructor(e,r,n){this.elements=new mb,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?ha(n).concat(this.outerScope.getElements(e)):ha(n)}getAllElements(){let e=ha(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(YM,"MultiMapScope"),YM),vJn={getElement(){},getElements(){return R3},getAllElements(){return R3}},Jne=(qM=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")}},$(qM,"DisposableCache"),qM),q3e=(jM=class extends Jne{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()}},$(jM,"SimpleCache"),jM),eie=(XM=class extends Jne{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}},$(XM,"ContextCache"),XM),BJt=(KM=class extends eie{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)}))}},$(KM,"DocumentCache"),KM),j3e=(ZM=class extends q3e{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()}))}},$(ZM,"WorkspaceCache"),ZM),$Jt=(JM=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 j3e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qg(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 Y3e(ha(e),r,n)}createScopeForNodes(e,r,n){const i=ha(e).map(a=>{const o=this.nameProvider.getName(a);if(o)return this.descriptions.createDescription(a,o)}).nonNullable();return new Y3e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new NJt(this.indexManager.allElements(e)))}},$(JM,"DefaultScopeProvider"),JM);function X3e(t){return typeof t.$comment=="string"}$(X3e,"isAstNodeWithComment");function K3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(K3e,"isIntermediateReference");var FJt=(eI=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=qg(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,d;if(!this.ignoreProperties.has(e))if(sd(r)){const h=r.ref,f=n?r.$refText:void 0;if(h){const p=qg(h);let g="";this.currentDocument&&this.currentDocument!==p&&(s?g=s(p.uri,h):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(h);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(lv(r)){const h=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qg(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:h}}else if(Ks(r)){let h;if(a&&(h=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(h??(h={...r}),h.$sourceText=(d=r.$cstNode)==null?void 0:d.text),o){h??(h={...r});const f=this.commentProvider.getComment(r);f&&(h.$comment=f.replace(/\r/g,""))}return h??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=B5e(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 d=0;d{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(eO(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=ha(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}},$(rI,"ValidationRegistry"),rI),VJt=Object.freeze({validateNode:!0,validateChildren:!0}),GJt=(nI=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 Xl(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)===Gp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Gp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Gp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(o){if(eO(o))throw o;console.error("An error occurred during validation:",o)}return await Xl(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:qz(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:J3e(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=nz(i.token);if(a){const o={severity:qz("error"),range:a,message:i.message,data:rO(Gp.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:Gp.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 Xl(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=jg(e).iterator();for(const l of s){o.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const d=this.validationRegistry.getChecks(l.$type,r.categories);for(const h of d)await h(l,n,i)}finally{o.stopSubTask(l.$type)}u.validateChildren||s.prune()}}finally{o.stop()}}else{const o=jg(e).iterator();for(const s of o){await Xl(i);const l=this.validateSingleNodeOptions(s,r);if(l.validateNode){const u=this.validationRegistry.getChecks(s.$type,r.categories);for(const d of u)await d(s,n,i)}l.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return VJt}async validateAstAfter(e,r,n,i=Ha.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const o of a)await Xl(i),await o(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Z3e(n),severity:qz(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},$(nI,"DefaultDocumentValidator"),nI);function Z3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Rre(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=$5e(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}}}$(Z3e,"getDiagnosticRange");function qz(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)}}$(qz,"toDiagnosticSeverity");function J3e(t){switch(t){case"error":return rO(Gp.LexingError);case"warning":return rO(Gp.LexingWarning);case"info":return rO(Gp.LexingInfo);case"hint":return rO(Gp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(J3e,"toDiagnosticData");var Gp;(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"})(Gp||(Gp={}));var QJt=(iI=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qg(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=Q3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return s()},selectionSegment:Q3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(iI,"DefaultAstNodeDescriptionProvider"),iI),HJt=(aI=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 jg(i))await Xl(r),I3(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=[];sd(r)&&r.$nodeDescription?n=[r.$nodeDescription]:lv(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),o=[],s=Q3(r.$refNode);for(const l of n)o.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:s,local:gd.equals(l.documentUri,i)});return o}},$(aI,"DefaultReferenceDescriptionProvider"),aI),WJt=(oI=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)}},$(oI,"DefaultAstNodeLocator"),oI),rie={};Ute(rie,z_e(E3()));var YJt=(sI=class{constructor(e){this._ready=new gb,this.onConfigurationSectionUpdateEmitter=new rie.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}},$(sI,"DefaultConfigurationProvider"),sI),nie=z_e(KUn()),nO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(nO||(nO={}));var qJt=(lI=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new mb,this.documentPhaseListeners=new mb,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 d of u)i.push(d.uri),this.cleanUpDeleted(d)}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=ha(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 Xl(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 ha(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),nO.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),nO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),nO.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(bv);if(this.currentState>=e&&e>i.state)return Promise.reject(new nie.ResponseError(nie.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 nie.ResponseError(nie.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,o)=>{const s=this.onDocumentPhase(e,u=>{gd.equals(u.uri,r)&&(s.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{s.dispose(),l.dispose(),o(bv)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(bv):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),o.dispose(),n()}),o=r.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(bv)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const o of a)try{await Xl(n),await o(e,n)}catch(s){if(!eO(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 Xl(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=ha(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)??{}}},$(lI,"DefaultDocumentBuilder"),lI),jJt=(cI=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new eie,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(o=>{gd.equals(o.targetUri,n)&&o.targetPath===r&&i.push(o)})}),ha(i)}allElements(e,r){let n=ha(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}},$(cI,"DefaultIndexManager"),cI),XJt=(uI=class{constructor(e){this.initialBuildOptions={},this._ready=new gb,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 Xl(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=ha(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 Sf.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=gd.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(uI,"DefaultWorkspaceManager"),uI),KJt=(dI=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return L4e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return L4e.buildUnableToPopLexerModeMessage(e)}},$(dI,"DefaultLexerErrorMessageProvider"),dI),eDe={mode:"full"},tDe=(hI=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=oie(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new hd(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=eDe){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(oie(e))return e;const r=aie(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(hI,"DefaultLexer"),hI);function iie(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(iie,"isTokenTypeArray");function aie(t){return t&&"modes"in t&&"defaultMode"in t}$(aie,"isIMultiModeLexerDefinition");function oie(t){return!iie(t)&&!aie(t)}$(oie,"isTokenTypeDictionary"),G9();function rDe(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ta.create(0,0));const a=iDe(t),o=lie(n),s=JJt({lines:a,position:i,options:o});return rer({index:0,tokens:s,position:i})}$(rDe,"parseJSDoc");function nDe(t,e){const r=lie(e),n=iDe(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))}$(nDe,"isJSDoc");function iDe(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(NVt)}$(iDe,"getLines");var ZJt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,yJn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function JJt(t){var i,a,o;const e=[];let r=t.position.line,n=t.position.character;for(let s=0;s=d.length){if(e.length>0){const p=ta.create(r,n);e.push({type:"break",content:"",range:Di.create(p,p)})}}else{ZJt.lastIndex=h;const p=ZJt.exec(d);if(p){const g=p[0],m=p[1],v=ta.create(r,n+h),y=ta.create(r,n+h+g.length);e.push({type:"tag",content:m,range:Di.create(v,y)}),h+=g.length,h=sie(d,h)}if(h0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(JJt,"tokenize");function eer(t,e,r,n){const i=[];if(t.length===0){const a=ta.create(r,n),o=ta.create(r,n+e.length);i.push({type:"text",content:e,range:Di.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:Di.create(ta.create(r,a+n),ta.create(r,l+n))});let d=u.length+1;const h=s[1];if(i.push({type:"inline-tag",content:h,range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+h.length+n))}),d+=h.length,s.length===4){d+=s[2].length;const f=s[3];i.push({type:"text",content:f,range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+f.length+n))})}else i.push({type:"text",content:"",range:Di.create(ta.create(r,a+d+n),ta.create(r,a+d+n))});a=l+s[0].length}const o=e.substring(a);o.length>0&&i.push({type:"text",content:o,range:Di.create(ta.create(r,a+n),ta.create(r,a+n+o.length))})}return i}$(eer,"buildInlineTokens");var bJn=/\S/,xJn=/\s*$/;function sie(t,e){const r=t.substring(e).match(bJn);return r?e+r.index:t.length}$(sie,"skipWhitespace");function ter(t){const e=t.match(xJn);if(e&&typeof e.index=="number")return e.index}$(ter,"lastCharacter");function rer(t){var a,o;const e=ta.create(t.position.line,t.position.character);if(t.tokens.length===0)return new oer([],Di.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+=uDe(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+=uDe(r)+i}return r.trim()}},$(fI,"JSDocCommentImpl"),fI),lDe=(pI=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=ser(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}},$(pI,"JSDocTagImpl"),pI);function ser(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const s=sie(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))??ler(e,a)}}$(ser,"renderInlineTag");function ler(t,e){try{return Sf.parse(t,!0),`[${e}](${t})`}catch{return t}}$(ler,"renderLinkDefault");var cDe=(gI=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+=` @@ -1761,8 +1761,8 @@ ${r}`),this.inline?`{${i}}`:i}},$(pI,"JSDocTagImpl"),pI);function ser(t,e,r){var `)?` `:` -`}$(uDe,"fillNewlines");var uer=(vI=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&nDe(r))return rDe(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=qg(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)}},$(vI,"JSDocDocumentationProvider"),vI),der=(yI=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return X3e(e)?e.$comment:(r=xRe(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(yI,"DefaultCommentProvider"),yI),her=(bI=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(bI,"DefaultAsyncParser"),bI),wJn=(xI=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 gb;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 gb;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(bv)}),this.queue.push(r),r.promise}},$(xI,"AbstractThreadedAsyncParser"),xI),AJn=(wI=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new rie.Emitter,this.deferred=new gb,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(bv),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 gb,this.sendMessage(e),this.deferred.promise}},$(wI,"ParserWorker"),wI),fer=(AI=class{constructor(){this.previousTokenSource=new Ha.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=jne();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 gb,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){eO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(AI,"DefaultWorkspaceLock"),AI),per=(SI=class{constructor(e){this.grammarElementIdMap=new Zne,this.tokenTypeIdMap=new Zne,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 jg(e))r.set(i,{});if(e.$cstNode)for(const i of G3(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)Ks(s)?o.push(this.dehydrateAstNode(s,r)):sd(s)?o.push(this.dehydrateReference(s,r)):o.push(s)}else Ks(a)?n[i]=this.dehydrateAstNode(a,r):sd(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 Kte(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),eb(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):pk(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 jg(e))r.set(a,{});let i;if(e.$cstNode)for(const a of G3(e.$cstNode)){let o;"fullText"in a?(o=new L3e(a.fullText),i=o):"content"in a?o=new zne:"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)Ks(s)?o.push(this.setParent(this.hydrateAstNode(s,r),n)):sd(s)?o.push(this.hydrateReference(s,n,i,r)):o.push(s)}else Ks(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):sd(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),eb(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 Fne(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 jg(this.grammar))tre(r)&&this.grammarElementIdMap.set(r,e++)}},$(SI,"DefaultHydrator"),SI);function Kl(t){return{documentation:{CommentProvider:$(e=>new der(e),"CommentProvider"),DocumentationProvider:$(e=>new uer(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new her(e),"AsyncParser"),GrammarConfig:$(e=>WRe(e),"GrammarConfig"),LangiumParser:$(e=>$3e(e),"LangiumParser"),CompletionParser:$(e=>B3e(e),"CompletionParser"),ValueConverter:$(()=>new z3e,"ValueConverter"),TokenBuilder:$(()=>new Wne,"TokenBuilder"),Lexer:$(e=>new tDe(e),"Lexer"),ParserErrorMessageProvider:$(()=>new I3e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new KJt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new WJt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new QJt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new HJt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new LJt(e),"Linker"),NameProvider:$(()=>new MJt,"NameProvider"),ScopeProvider:$(e=>new $Jt(e),"ScopeProvider"),ScopeComputation:$(e=>new PJt(e),"ScopeComputation"),References:$(e=>new IJt(e),"References")},serializer:{Hydrator:$(e=>new per(e),"Hydrator"),JsonSerializer:$(e=>new FJt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new GJt(e),"DocumentValidator"),ValidationRegistry:$(e=>new UJt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(Kl,"createDefaultCoreModule");function Zl(t){return{ServiceRegistry:$(e=>new zJt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new DJt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new RJt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new qJt(e),"DocumentBuilder"),IndexManager:$(e=>new jJt(e),"IndexManager"),WorkspaceManager:$(e=>new XJt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new fer,"WorkspaceLock"),ConfigurationProvider:$(e=>new YJt(e),"ConfigurationProvider")},profilers:{}}}$(Zl,"createDefaultSharedCoreModule");var dDe;(function(t){t.merge=(e,r)=>lD(lD({},e),r)})(dDe||(dDe={}));function Ii(t,e,r,n,i,a,o,s,l){const u=[t,e,r,n,i,a,o,s,l].reduce(lD,{});return fDe(u)}$(Ii,"inject");var ger=Symbol("isProxy");function hDe(t){if(t&&t[ger])for(const e of Object.values(t))hDe(e);return t}$(hDe,"eagerLoad");function fDe(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===ger?!0:pDe(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(pDe(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(fDe,"_inject");var mer=Symbol();function pDe(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]===mer)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]=mer;try{t[e]=typeof i=="function"?i(n):fDe(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(pDe,"_resolve");function lD(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]=lD(i,n):t[r]=lD({},n)}else t[r]=n}return t}$(lD,"_merge");var gDe={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},iO;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(iO||(iO={}));var ver=(TI=class extends Wne{constructor(e=gDe){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...gDe,...e},this.indentTokenType=tD({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=tD({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!iie(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:o,ignoreIndentationDelimiters:s}=this.options;let l,u,d;const h=[];for(const f of n){for(const[p,g]of s)f.name===p?f.PUSH_MODE=iO.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===o?d=f:h.push(f)}if(!l||!u||!d)throw new Error("Some indentation/whitespace tokens not found!");return s.length>0?{modes:{[iO.REGULAR]:[l,u,...h,d],[iO.IGNORE_INDENTATION]:[...h,d]},defaultMode:iO.REGULAR}:[l,u,d,...h]}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 Mz(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 h,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:((h=s==null?void 0:s[0])==null?void 0:h.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,d=((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}},$(TI,"IndentationAwareTokenBuilder"),TI),SJn=(CI=class extends tDe{constructor(e){if(super(e),e.parser.TokenBuilder instanceof ver)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=eDe){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=[],d=n.tokens.length-1;for(let h=0;h=0&&u.push(n.tokens[d]),n.tokens=u,n}},$(CI,"IndentationAwareLexer"),CI),mDe={};T2(mDe,{AstUtils:()=>q5e,BiMap:()=>Zne,Cancellation:()=>Ha,ContextCache:()=>eie,CstUtils:()=>H5e,DONE_RESULT:()=>ld,Deferred:()=>gb,Disposable:()=>nO,DisposableCache:()=>Jne,DocumentCache:()=>BJt,EMPTY_STREAM:()=>R3,ErrorWithLocation:()=>Are,GrammarUtils:()=>CRe,MultiMap:()=>mb,OperationCancelled:()=>bv,Reduction:()=>W9,RegExpUtils:()=>ORe,SimpleCache:()=>q3e,StreamImpl:()=>cv,TreeStreamImpl:()=>D3,URI:()=>Sf,UriTrie:()=>H3e,UriUtils:()=>gd,WorkspaceCache:()=>j3e,assertCondition:()=>kRe,assertUnreachable:()=>D2,delayNextTick:()=>Yne,interruptAndCheck:()=>Xl,isOperationCancelled:()=>eO,loadGrammarFromJson:()=>Jl,setInterruptionPeriod:()=>U3e,startCancelableOperation:()=>jne,stream:()=>ha}),Ute(mDe,rie);var yer=(kI=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[]}},$(kI,"EmptyFileSystemProvider"),kI),Mc={fileSystemProvider:$(()=>new yer,"fileSystemProvider")},TJn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},CJn={AstReflection:$(()=>new gRe,"AstReflection")};function ber(){const t=Ii(Zl(Mc),CJn),e=Ii(Kl({shared:t}),TJn);return t.ServiceRegistry.register(e),e}$(ber,"createMinimalGrammarServices");function Jl(t){const e=ber(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Sf.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Jl,"loadGrammarFromJson"),Ute(oVt,mDe);var kJn=(OI=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new mb}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 xer(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,d)=>u+d);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])}},$(OI,"DefaultLangiumProfiler"),OI),xer=(EI=class{constructor(e,r){this.stack=[],this.entries=new mb,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)}},$(EI,"ProfilingTask"),EI),vDe;(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]+)\]/}})(vDe||(vDe={}));var yDe;(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]*/}})(yDe||(yDe={}));var bDe;(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]*/}})(bDe||(bDe={}));var xDe;(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])?/}})(xDe||(xDe={}));var wDe;(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]*/}})(wDe||(wDe={}));var ADe;(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]*/}})(ADe||(ADe={}));var SDe;(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]*/}})(SDe||(SDe={}));var TDe;(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]*/}})(TDe||(TDe={}));var CDe;(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]*/}})(CDe||(CDe={}));var kDe;(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]*?\*\)/}})(kDe||(kDe={}));var ODe;(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]*?\*\//}})(ODe||(ODe={}));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 _De;(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:/"[^"]*"|'[^']*'/}})(_De||(_De={}));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 DDe;(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]*/}})(DDe||(DDe={})),{...vDe.Terminals,...yDe.Terminals,...bDe.Terminals,...xDe.Terminals,...wDe.Terminals,...ADe.Terminals,...SDe.Terminals,...TDe.Terminals,...CDe.Terminals,...kDe.Terminals,...ODe.Terminals,...EDe.Terminals,...RDe.Terminals,..._De.Terminals,...DDe.Terminals};var wer={$type:"AbnfAlternation",alternatives:"alternatives"},Aer={$type:"AbnfConcatenation",elements:"elements"},LDe={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Ser={$type:"AbnfGroup",element:"element"},Ter={$type:"AbnfNumVal",value:"value"},Cer={$type:"AbnfOptionalGroup",element:"element"},cD={$type:"AbnfPrimary"},MDe={$type:"AbnfRule",definition:"definition",name:"name"},ker={$type:"AbnfRuleName",name:"name"},Oer={$type:"AbnfStringLiteral",value:"value"},uie={$type:"Accelerator",name:"name",x:"x",y:"y"},IDe={$type:"Alignment",direction:"direction",members:"members"},die={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},jz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},PDe={$type:"Annotations",x:"x",y:"y"},xv={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function OJn(t){return Ts.isInstance(t,xv.$type)}$(OJn,"isArchitecture");var hie={$type:"Axis",label:"label",name:"name"},fie={$type:"Branch",name:"name",order:"order"};function EJn(t){return Ts.isInstance(t,fie.$type)}$(EJn,"isBranch");var Eer={$type:"Checkout",branch:"branch"},pie={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},NDe={$type:"ClassDefStatement",className:"className",styleText:"styleText"},uD={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function _Jn(t){return Ts.isInstance(t,uD.$type)}$(_Jn,"isCommit");var gie={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},aO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},mie={$type:"Curve",entries:"entries",label:"label",name:"name"},oO={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function RJn(t){return Ts.isInstance(t,oO.$type)}$(RJn,"isCynefin");var vie={$type:"Deaccelerator",name:"name",x:"x",y:"y"},_er={$type:"Decorator",strategy:"strategy"},dD={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},yie={$type:"DomainBlock",domain:"domain",items:"items"};function DJn(t){return Ts.isInstance(t,yie.$type)}$(DJn,"isDomainBlock");var BDe={$type:"DomainItem",label:"label"};function LJn(t){return Ts.isInstance(t,BDe.$type)}$(LJn,"isDomainItem");var Rer={$type:"EbnfChoice",alternatives:"alternatives"},Der={$type:"EbnfExceptionPostfix",except:"except"},Ler={$type:"EbnfGroup",element:"element"},Mer={$type:"EbnfNonTerminal",name:"name"},Ier={$type:"EbnfOneOrMorePostfix",operator:"operator"},Per={$type:"EbnfOptional",element:"element"},Ner={$type:"EbnfOptionalPostfix",operator:"operator"},Xz={$type:"EbnfPostfix"},sO={$type:"EbnfPrimary"},Ber={$type:"EbnfRepetition",element:"element"},$De={$type:"EbnfRule",definition:"definition",name:"name"},$er={$type:"EbnfSequence",elements:"elements"},Fer={$type:"EbnfSpecial",text:"text"},FDe={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},zer={$type:"EbnfTerminal",value:"value"},Uer={$type:"EbnfZeroOrMorePostfix",operator:"operator"},wv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},hD={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},lO={$type:"EmFrame"},Kz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Ver={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},zDe={$type:"EmModelEntity",name:"name"};function MJn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(MJn,"isEmModelEntityType");var bie={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},vb={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Ger(t){return Ts.isInstance(t,vb.$type)}$(Ger,"isEmResetFrame");var F2={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},UDe={$type:"Entry",axis:"axis",value:"value"},yb={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Qer={$type:"Evolution",stages:"stages"},xie={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},VDe={$type:"Evolve",component:"component",target:"target"},cO={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function IJn(t){return Ts.isInstance(t,cO.$type)}$(IJn,"isGitGraph");var Zz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Jz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function PJn(t){return Ts.isInstance(t,Jz.$type)}$(PJn,"isInfo");var eU={$type:"Item",classSelector:"classSelector",name:"name"},GDe={$type:"Junction",id:"id",in:"in"},tU={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},wie={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},uO={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},fD={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function NJn(t){return Ts.isInstance(t,fD.$type)}$(NJn,"isMerge");var Aie={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},QDe={$type:"Option",name:"name",value:"value"},pD={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function BJn(t){return Ts.isInstance(t,pD.$type)}$(BJn,"isPacket");var gD={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function $Jn(t){return Ts.isInstance(t,gD.$type)}$($Jn,"isPacketBlock");var Her={$type:"PegAny",dot:"dot"},Wer={$type:"PegGroup",element:"element"},Yer={$type:"PegIdentifier",name:"name"},qer={$type:"PegLiteral",value:"value"},jer={$type:"PegOrderedChoice",alternatives:"alternatives"},HDe={$type:"PegPrefix",operator:"operator",suffix:"suffix"},rU={$type:"PegPrimary"},WDe={$type:"PegRule",definition:"definition",name:"name"},Xer={$type:"PegSequence",elements:"elements"},YDe={$type:"PegSuffix",operator:"operator",primary:"primary"},dO={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function FJn(t){return Ts.isInstance(t,dO.$type)}$(FJn,"isPie");var Sie={$type:"PieSection",label:"label",value:"value"};function zJn(t){return Ts.isInstance(t,Sie.$type)}$(zJn,"isPieSection");var qDe={$type:"Pipeline",components:"components",parent:"parent"},Tie={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},hO={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},mD={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function UJn(t){return Ts.isInstance(t,mD.$type)}$(UJn,"isRailroad");var vD={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function VJn(t){return Ts.isInstance(t,vD.$type)}$(VJn,"isRailroadAbnf");var Ker={$type:"RailroadChoiceExpr",alternatives:"alternatives"},yD={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function GJn(t){return Ts.isInstance(t,yD.$type)}$(GJn,"isRailroadEbnf");var bb={$type:"RailroadExpression"},Zer={$type:"RailroadNonTerminalExpr",name:"name"},Jer={$type:"RailroadOneOrMoreExpr",element:"element"},etr={$type:"RailroadOptionalExpr",element:"element"},bD={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function QJn(t){return Ts.isInstance(t,bD.$type)}$(QJn,"isRailroadPeg");var jDe={$type:"RailroadRule",definition:"definition",name:"name"},ttr={$type:"RailroadSequenceExpr",elements:"elements"},rtr={$type:"RailroadSpecialExpr",text:"text"},ntr={$type:"RailroadTerminalExpr",value:"value"},itr={$type:"RailroadZeroOrMoreExpr",element:"element"},XDe={$type:"Section",classSelector:"classSelector",name:"name"},xD={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},KDe={$type:"Size",height:"height",width:"width"},wD={$type:"Statement"},nU={$type:"Transition",from:"from",label:"label",to:"to"};function HJn(t){return Ts.isInstance(t,nU.$type)}$(HJn,"isTransition");var AD={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function WJn(t){return Ts.isInstance(t,AD.$type)}$(WJn,"isTreemap");var ZDe={$type:"TreemapRow",indent:"indent",item:"item"},SD={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},iU={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ic={$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 YJn(t){return Ts.isInstance(t,Ic.$type)}$(YJn,"isWardley");var atr=(_I=class extends Y5e{constructor(){super(...arguments),this.types={AbnfAlternation:{name:wer.$type,properties:{alternatives:{name:wer.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Aer.$type,properties:{elements:{name:Aer.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:LDe.$type,properties:{primary:{name:LDe.primary},repeat:{name:LDe.repeat}},superTypes:[]},AbnfGroup:{name:Ser.$type,properties:{element:{name:Ser.element}},superTypes:[cD.$type]},AbnfNumVal:{name:Ter.$type,properties:{value:{name:Ter.value}},superTypes:[cD.$type]},AbnfOptionalGroup:{name:Cer.$type,properties:{element:{name:Cer.element}},superTypes:[cD.$type]},AbnfPrimary:{name:cD.$type,properties:{},superTypes:[]},AbnfRule:{name:MDe.$type,properties:{definition:{name:MDe.definition},name:{name:MDe.name}},superTypes:[]},AbnfRuleName:{name:ker.$type,properties:{name:{name:ker.name}},superTypes:[cD.$type]},AbnfStringLiteral:{name:Oer.$type,properties:{value:{name:Oer.value}},superTypes:[cD.$type]},Accelerator:{name:uie.$type,properties:{name:{name:uie.name},x:{name:uie.x},y:{name:uie.y}},superTypes:[]},Alignment:{name:IDe.$type,properties:{direction:{name:IDe.direction},members:{name:IDe.members,defaultValue:[]}},superTypes:[]},Anchor:{name:die.$type,properties:{evolution:{name:die.evolution},name:{name:die.name},visibility:{name:die.visibility}},superTypes:[]},Annotation:{name:jz.$type,properties:{number:{name:jz.number},text:{name:jz.text},x:{name:jz.x},y:{name:jz.y}},superTypes:[]},Annotations:{name:PDe.$type,properties:{x:{name:PDe.x},y:{name:PDe.y}},superTypes:[]},Architecture:{name:xv.$type,properties:{accDescr:{name:xv.accDescr},accTitle:{name:xv.accTitle},alignments:{name:xv.alignments,defaultValue:[]},edges:{name:xv.edges,defaultValue:[]},groups:{name:xv.groups,defaultValue:[]},junctions:{name:xv.junctions,defaultValue:[]},services:{name:xv.services,defaultValue:[]},title:{name:xv.title}},superTypes:[]},Axis:{name:hie.$type,properties:{label:{name:hie.label},name:{name:hie.name}},superTypes:[]},Branch:{name:fie.$type,properties:{name:{name:fie.name},order:{name:fie.order}},superTypes:[wD.$type]},Checkout:{name:Eer.$type,properties:{branch:{name:Eer.branch}},superTypes:[wD.$type]},CherryPicking:{name:pie.$type,properties:{id:{name:pie.id},parent:{name:pie.parent},tags:{name:pie.tags,defaultValue:[]}},superTypes:[wD.$type]},ClassDefStatement:{name:NDe.$type,properties:{className:{name:NDe.className},styleText:{name:NDe.styleText}},superTypes:[]},Commit:{name:uD.$type,properties:{id:{name:uD.id},message:{name:uD.message},tags:{name:uD.tags,defaultValue:[]},type:{name:uD.type}},superTypes:[wD.$type]},Common:{name:gie.$type,properties:{accDescr:{name:gie.accDescr},accTitle:{name:gie.accTitle},title:{name:gie.title}},superTypes:[]},Component:{name:aO.$type,properties:{decorator:{name:aO.decorator},evolution:{name:aO.evolution},inertia:{name:aO.inertia,defaultValue:!1},label:{name:aO.label},name:{name:aO.name},visibility:{name:aO.visibility}},superTypes:[]},Curve:{name:mie.$type,properties:{entries:{name:mie.entries,defaultValue:[]},label:{name:mie.label},name:{name:mie.name}},superTypes:[]},Cynefin:{name:oO.$type,properties:{accDescr:{name:oO.accDescr},accTitle:{name:oO.accTitle},domains:{name:oO.domains,defaultValue:[]},title:{name:oO.title},transitions:{name:oO.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:vie.$type,properties:{name:{name:vie.name},x:{name:vie.x},y:{name:vie.y}},superTypes:[]},Decorator:{name:_er.$type,properties:{strategy:{name:_er.strategy}},superTypes:[]},Direction:{name:dD.$type,properties:{accDescr:{name:dD.accDescr},accTitle:{name:dD.accTitle},dir:{name:dD.dir},statements:{name:dD.statements,defaultValue:[]},title:{name:dD.title}},superTypes:[cO.$type]},DomainBlock:{name:yie.$type,properties:{domain:{name:yie.domain},items:{name:yie.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:BDe.$type,properties:{label:{name:BDe.label}},superTypes:[]},EbnfChoice:{name:Rer.$type,properties:{alternatives:{name:Rer.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Der.$type,properties:{except:{name:Der.except}},superTypes:[Xz.$type]},EbnfGroup:{name:Ler.$type,properties:{element:{name:Ler.element}},superTypes:[sO.$type]},EbnfNonTerminal:{name:Mer.$type,properties:{name:{name:Mer.name}},superTypes:[sO.$type]},EbnfOneOrMorePostfix:{name:Ier.$type,properties:{operator:{name:Ier.operator}},superTypes:[Xz.$type]},EbnfOptional:{name:Per.$type,properties:{element:{name:Per.element}},superTypes:[sO.$type]},EbnfOptionalPostfix:{name:Ner.$type,properties:{operator:{name:Ner.operator}},superTypes:[Xz.$type]},EbnfPostfix:{name:Xz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:sO.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Ber.$type,properties:{element:{name:Ber.element}},superTypes:[sO.$type]},EbnfRule:{name:$De.$type,properties:{definition:{name:$De.definition},name:{name:$De.name}},superTypes:[]},EbnfSequence:{name:$er.$type,properties:{elements:{name:$er.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Fer.$type,properties:{text:{name:Fer.text}},superTypes:[sO.$type]},EbnfTerm:{name:FDe.$type,properties:{base:{name:FDe.base},postfixes:{name:FDe.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:zer.$type,properties:{value:{name:zer.value}},superTypes:[sO.$type]},EbnfZeroOrMorePostfix:{name:Uer.$type,properties:{operator:{name:Uer.operator}},superTypes:[Xz.$type]},Edge:{name:wv.$type,properties:{lhsDir:{name:wv.lhsDir},lhsGroup:{name:wv.lhsGroup,defaultValue:!1},lhsId:{name:wv.lhsId},lhsInto:{name:wv.lhsInto,defaultValue:!1},rhsDir:{name:wv.rhsDir},rhsGroup:{name:wv.rhsGroup,defaultValue:!1},rhsId:{name:wv.rhsId},rhsInto:{name:wv.rhsInto,defaultValue:!1},title:{name:wv.title}},superTypes:[]},EmDataEntity:{name:hD.$type,properties:{dataBlockValue:{name:hD.dataBlockValue},dataType:{name:hD.dataType},name:{name:hD.name}},superTypes:[]},EmFrame:{name:lO.$type,properties:{},superTypes:[]},EmGwt:{name:Kz.$type,properties:{givenStatements:{name:Kz.givenStatements,defaultValue:[]},sourceFrame:{name:Kz.sourceFrame,referenceType:lO.$type},thenStatements:{name:Kz.thenStatements,defaultValue:[]},whenStatements:{name:Kz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Ver.$type,properties:{entityIdentifier:{name:Ver.entityIdentifier,referenceType:zDe.$type}},superTypes:[]},EmModelEntity:{name:zDe.$type,properties:{name:{name:zDe.name}},superTypes:[]},EmNoteEntity:{name:bie.$type,properties:{dataBlockValue:{name:bie.dataBlockValue},dataType:{name:bie.dataType},sourceFrame:{name:bie.sourceFrame,referenceType:lO.$type}},superTypes:[]},EmResetFrame:{name:vb.$type,properties:{dataInlineValue:{name:vb.dataInlineValue},dataReference:{name:vb.dataReference,referenceType:hD.$type},dataType:{name:vb.dataType},entityIdentifier:{name:vb.entityIdentifier},modelEntityType:{name:vb.modelEntityType},name:{name:vb.name},sourceFrames:{name:vb.sourceFrames,defaultValue:[],referenceType:lO.$type}},superTypes:[lO.$type]},EmTimeFrame:{name:F2.$type,properties:{dataInlineValue:{name:F2.dataInlineValue},dataReference:{name:F2.dataReference,referenceType:hD.$type},dataType:{name:F2.dataType},entityIdentifier:{name:F2.entityIdentifier},modelEntityType:{name:F2.modelEntityType},name:{name:F2.name},sourceFrames:{name:F2.sourceFrames,defaultValue:[],referenceType:lO.$type}},superTypes:[lO.$type]},Entry:{name:UDe.$type,properties:{axis:{name:UDe.axis,referenceType:hie.$type},value:{name:UDe.value}},superTypes:[]},EventModel:{name:yb.$type,properties:{accDescr:{name:yb.accDescr},accTitle:{name:yb.accTitle},dataEntities:{name:yb.dataEntities,defaultValue:[]},frames:{name:yb.frames,defaultValue:[]},gwtEntities:{name:yb.gwtEntities,defaultValue:[]},modelEntities:{name:yb.modelEntities,defaultValue:[]},noteEntities:{name:yb.noteEntities,defaultValue:[]},title:{name:yb.title}},superTypes:[]},Evolution:{name:Qer.$type,properties:{stages:{name:Qer.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:xie.$type,properties:{boundary:{name:xie.boundary},name:{name:xie.name},secondName:{name:xie.secondName}},superTypes:[]},Evolve:{name:VDe.$type,properties:{component:{name:VDe.component},target:{name:VDe.target}},superTypes:[]},GitGraph:{name:cO.$type,properties:{accDescr:{name:cO.accDescr},accTitle:{name:cO.accTitle},statements:{name:cO.statements,defaultValue:[]},title:{name:cO.title}},superTypes:[]},Group:{name:Zz.$type,properties:{icon:{name:Zz.icon},id:{name:Zz.id},in:{name:Zz.in},title:{name:Zz.title}},superTypes:[]},Info:{name:Jz.$type,properties:{accDescr:{name:Jz.accDescr},accTitle:{name:Jz.accTitle},title:{name:Jz.title}},superTypes:[]},Item:{name:eU.$type,properties:{classSelector:{name:eU.classSelector},name:{name:eU.name}},superTypes:[]},Junction:{name:GDe.$type,properties:{id:{name:GDe.id},in:{name:GDe.in}},superTypes:[]},Label:{name:tU.$type,properties:{negX:{name:tU.negX,defaultValue:!1},negY:{name:tU.negY,defaultValue:!1},offsetX:{name:tU.offsetX},offsetY:{name:tU.offsetY}},superTypes:[]},Leaf:{name:wie.$type,properties:{classSelector:{name:wie.classSelector},name:{name:wie.name},value:{name:wie.value}},superTypes:[eU.$type]},Link:{name:uO.$type,properties:{arrow:{name:uO.arrow},from:{name:uO.from},fromPort:{name:uO.fromPort},linkLabel:{name:uO.linkLabel},to:{name:uO.to},toPort:{name:uO.toPort}},superTypes:[]},Merge:{name:fD.$type,properties:{branch:{name:fD.branch},id:{name:fD.id},tags:{name:fD.tags,defaultValue:[]},type:{name:fD.type}},superTypes:[wD.$type]},Note:{name:Aie.$type,properties:{evolution:{name:Aie.evolution},text:{name:Aie.text},visibility:{name:Aie.visibility}},superTypes:[]},Option:{name:QDe.$type,properties:{name:{name:QDe.name},value:{name:QDe.value,defaultValue:!1}},superTypes:[]},Packet:{name:pD.$type,properties:{accDescr:{name:pD.accDescr},accTitle:{name:pD.accTitle},blocks:{name:pD.blocks,defaultValue:[]},title:{name:pD.title}},superTypes:[]},PacketBlock:{name:gD.$type,properties:{bits:{name:gD.bits},end:{name:gD.end},label:{name:gD.label},start:{name:gD.start}},superTypes:[]},PegAny:{name:Her.$type,properties:{dot:{name:Her.dot}},superTypes:[rU.$type]},PegGroup:{name:Wer.$type,properties:{element:{name:Wer.element}},superTypes:[rU.$type]},PegIdentifier:{name:Yer.$type,properties:{name:{name:Yer.name}},superTypes:[rU.$type]},PegLiteral:{name:qer.$type,properties:{value:{name:qer.value}},superTypes:[rU.$type]},PegOrderedChoice:{name:jer.$type,properties:{alternatives:{name:jer.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:HDe.$type,properties:{operator:{name:HDe.operator},suffix:{name:HDe.suffix}},superTypes:[]},PegPrimary:{name:rU.$type,properties:{},superTypes:[]},PegRule:{name:WDe.$type,properties:{definition:{name:WDe.definition},name:{name:WDe.name}},superTypes:[]},PegSequence:{name:Xer.$type,properties:{elements:{name:Xer.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:YDe.$type,properties:{operator:{name:YDe.operator},primary:{name:YDe.primary}},superTypes:[]},Pie:{name:dO.$type,properties:{accDescr:{name:dO.accDescr},accTitle:{name:dO.accTitle},sections:{name:dO.sections,defaultValue:[]},showData:{name:dO.showData,defaultValue:!1},title:{name:dO.title}},superTypes:[]},PieSection:{name:Sie.$type,properties:{label:{name:Sie.label},value:{name:Sie.value}},superTypes:[]},Pipeline:{name:qDe.$type,properties:{components:{name:qDe.components,defaultValue:[]},parent:{name:qDe.parent}},superTypes:[]},PipelineComponent:{name:Tie.$type,properties:{evolution:{name:Tie.evolution},label:{name:Tie.label},name:{name:Tie.name}},superTypes:[]},Radar:{name:hO.$type,properties:{accDescr:{name:hO.accDescr},accTitle:{name:hO.accTitle},axes:{name:hO.axes,defaultValue:[]},curves:{name:hO.curves,defaultValue:[]},options:{name:hO.options,defaultValue:[]},title:{name:hO.title}},superTypes:[]},Railroad:{name:mD.$type,properties:{accDescr:{name:mD.accDescr},accTitle:{name:mD.accTitle},rules:{name:mD.rules,defaultValue:[]},title:{name:mD.title}},superTypes:[]},RailroadAbnf:{name:vD.$type,properties:{accDescr:{name:vD.accDescr},accTitle:{name:vD.accTitle},rules:{name:vD.rules,defaultValue:[]},title:{name:vD.title}},superTypes:[]},RailroadChoiceExpr:{name:Ker.$type,properties:{alternatives:{name:Ker.alternatives,defaultValue:[]}},superTypes:[bb.$type]},RailroadEbnf:{name:yD.$type,properties:{accDescr:{name:yD.accDescr},accTitle:{name:yD.accTitle},rules:{name:yD.rules,defaultValue:[]},title:{name:yD.title}},superTypes:[]},RailroadExpression:{name:bb.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Zer.$type,properties:{name:{name:Zer.name}},superTypes:[bb.$type]},RailroadOneOrMoreExpr:{name:Jer.$type,properties:{element:{name:Jer.element}},superTypes:[bb.$type]},RailroadOptionalExpr:{name:etr.$type,properties:{element:{name:etr.element}},superTypes:[bb.$type]},RailroadPeg:{name:bD.$type,properties:{accDescr:{name:bD.accDescr},accTitle:{name:bD.accTitle},rules:{name:bD.rules,defaultValue:[]},title:{name:bD.title}},superTypes:[]},RailroadRule:{name:jDe.$type,properties:{definition:{name:jDe.definition},name:{name:jDe.name}},superTypes:[]},RailroadSequenceExpr:{name:ttr.$type,properties:{elements:{name:ttr.elements,defaultValue:[]}},superTypes:[bb.$type]},RailroadSpecialExpr:{name:rtr.$type,properties:{text:{name:rtr.text}},superTypes:[bb.$type]},RailroadTerminalExpr:{name:ntr.$type,properties:{value:{name:ntr.value}},superTypes:[bb.$type]},RailroadZeroOrMoreExpr:{name:itr.$type,properties:{element:{name:itr.element}},superTypes:[bb.$type]},Section:{name:XDe.$type,properties:{classSelector:{name:XDe.classSelector},name:{name:XDe.name}},superTypes:[eU.$type]},Service:{name:xD.$type,properties:{icon:{name:xD.icon},iconText:{name:xD.iconText},id:{name:xD.id},in:{name:xD.in},title:{name:xD.title}},superTypes:[]},Size:{name:KDe.$type,properties:{height:{name:KDe.height},width:{name:KDe.width}},superTypes:[]},Statement:{name:wD.$type,properties:{},superTypes:[]},Transition:{name:nU.$type,properties:{from:{name:nU.from},label:{name:nU.label},to:{name:nU.to}},superTypes:[]},TreeNode:{name:SD.$type,properties:{classAnnotation:{name:SD.classAnnotation},descAnnotation:{name:SD.descAnnotation},iconAnnotation:{name:SD.iconAnnotation},indent:{name:SD.indent},name:{name:SD.name}},superTypes:[]},TreeView:{name:iU.$type,properties:{accDescr:{name:iU.accDescr},accTitle:{name:iU.accTitle},nodes:{name:iU.nodes,defaultValue:[]},title:{name:iU.title}},superTypes:[]},Treemap:{name:AD.$type,properties:{accDescr:{name:AD.accDescr},accTitle:{name:AD.accTitle},title:{name:AD.title},TreemapRows:{name:AD.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:ZDe.$type,properties:{indent:{name:ZDe.indent},item:{name:ZDe.item}},superTypes:[]},Wardley:{name:Ic.$type,properties:{accDescr:{name:Ic.accDescr},accelerators:{name:Ic.accelerators,defaultValue:[]},accTitle:{name:Ic.accTitle},anchors:{name:Ic.anchors,defaultValue:[]},annotation:{name:Ic.annotation,defaultValue:[]},annotations:{name:Ic.annotations,defaultValue:[]},components:{name:Ic.components,defaultValue:[]},deaccelerators:{name:Ic.deaccelerators,defaultValue:[]},evolution:{name:Ic.evolution},evolves:{name:Ic.evolves,defaultValue:[]},links:{name:Ic.links,defaultValue:[]},notes:{name:Ic.notes,defaultValue:[]},pipelines:{name:Ic.pipelines,defaultValue:[]},size:{name:Ic.size},title:{name:Ic.title}},superTypes:[]}}}},$(_I,"MermaidAstReflection"),_I),Ts=new atr,otr,qJn=$(()=>otr??(otr=Jl(`{"$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"),str,jJn=$(()=>str??(str=Jl(`{"$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"),ltr,XJn=$(()=>ltr??(ltr=Jl('{"$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"),ctr,KJn=$(()=>ctr??(ctr=Jl(`{"$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"),utr,ZJn=$(()=>utr??(utr=Jl(`{"$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"),dtr,JJn=$(()=>dtr??(dtr=Jl(`{"$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"),htr,eei=$(()=>htr??(htr=Jl(`{"$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"),ftr,tei=$(()=>ftr??(ftr=Jl(`{"$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"),ptr,rei=$(()=>ptr??(ptr=Jl('{"$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"),gtr,nei=$(()=>gtr??(gtr=Jl(`{"$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"),mtr,iei=$(()=>mtr??(mtr=Jl(`{"$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"),vtr,aei=$(()=>vtr??(vtr=Jl(`{"$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"),ytr,oei=$(()=>ytr??(ytr=Jl(`{"$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"),btr,sei=$(()=>btr??(btr=Jl(`{"$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"),xtr,lei=$(()=>xtr??(xtr=Jl(`{"$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"),cei={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uei={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dei={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hei={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fei={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pei={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gei={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mei={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vei={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yei={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bei={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xei={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wei={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Aei={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sei={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},md={AstReflection:$(()=>new atr,"AstReflection")},Tei={Grammar:$(()=>qJn(),"Grammar"),LanguageMetaData:$(()=>cei,"LanguageMetaData"),parser:{}},Cei={Grammar:$(()=>jJn(),"Grammar"),LanguageMetaData:$(()=>uei,"LanguageMetaData"),parser:{}},kei={Grammar:$(()=>XJn(),"Grammar"),LanguageMetaData:$(()=>dei,"LanguageMetaData"),parser:{}},Oei={Grammar:$(()=>KJn(),"Grammar"),LanguageMetaData:$(()=>hei,"LanguageMetaData"),parser:{}},Eei={Grammar:$(()=>ZJn(),"Grammar"),LanguageMetaData:$(()=>fei,"LanguageMetaData"),parser:{}},_ei={Grammar:$(()=>JJn(),"Grammar"),LanguageMetaData:$(()=>pei,"LanguageMetaData"),parser:{}},Rei={Grammar:$(()=>eei(),"Grammar"),LanguageMetaData:$(()=>gei,"LanguageMetaData"),parser:{}},Dei={Grammar:$(()=>tei(),"Grammar"),LanguageMetaData:$(()=>mei,"LanguageMetaData"),parser:{}},Lei={Grammar:$(()=>rei(),"Grammar"),LanguageMetaData:$(()=>vei,"LanguageMetaData"),parser:{}},Mei={Grammar:$(()=>nei(),"Grammar"),LanguageMetaData:$(()=>yei,"LanguageMetaData"),parser:{}},Iei={Grammar:$(()=>iei(),"Grammar"),LanguageMetaData:$(()=>bei,"LanguageMetaData"),parser:{}},Pei={Grammar:$(()=>aei(),"Grammar"),LanguageMetaData:$(()=>xei,"LanguageMetaData"),parser:{}},Nei={Grammar:$(()=>oei(),"Grammar"),LanguageMetaData:$(()=>wei,"LanguageMetaData"),parser:{}},Bei={Grammar:$(()=>sei(),"Grammar"),LanguageMetaData:$(()=>Aei,"LanguageMetaData"),parser:{}},$ei={Grammar:$(()=>lei(),"Grammar"),LanguageMetaData:$(()=>Sei,"LanguageMetaData"),parser:{}},Fei=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,zei=/accTitle[\t ]*:([^\n\r]*)/,Uei=/title([\t ][^\n\r]*|)/,Vei={ACC_DESCR:Fei,ACC_TITLE:zei,TITLE:Uei},Av=(RI=class extends z3e{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=Vei[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,` +`}$(uDe,"fillNewlines");var uer=(vI=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&nDe(r))return rDe(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=qg(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)}},$(vI,"JSDocDocumentationProvider"),vI),der=(yI=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return X3e(e)?e.$comment:(r=x5e(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(yI,"DefaultCommentProvider"),yI),her=(bI=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(bI,"DefaultAsyncParser"),bI),wJn=(xI=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 gb;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 gb;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(bv)}),this.queue.push(r),r.promise}},$(xI,"AbstractThreadedAsyncParser"),xI),AJn=(wI=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new rie.Emitter,this.deferred=new gb,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(bv),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 gb,this.sendMessage(e),this.deferred.promise}},$(wI,"ParserWorker"),wI),fer=(AI=class{constructor(){this.previousTokenSource=new Ha.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=jne();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 gb,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){eO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(AI,"DefaultWorkspaceLock"),AI),per=(SI=class{constructor(e){this.grammarElementIdMap=new Zne,this.tokenTypeIdMap=new Zne,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 jg(e))r.set(i,{});if(e.$cstNode)for(const i of G3(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)Ks(s)?o.push(this.dehydrateAstNode(s,r)):sd(s)?o.push(this.dehydrateReference(s,r)):o.push(s)}else Ks(a)?n[i]=this.dehydrateAstNode(a,r):sd(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 Kte(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),eb(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):pk(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 jg(e))r.set(a,{});let i;if(e.$cstNode)for(const a of G3(e.$cstNode)){let o;"fullText"in a?(o=new L3e(a.fullText),i=o):"content"in a?o=new zne:"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)Ks(s)?o.push(this.setParent(this.hydrateAstNode(s,r),n)):sd(s)?o.push(this.hydrateReference(s,n,i,r)):o.push(s)}else Ks(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):sd(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),eb(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 Fne(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 jg(this.grammar))tre(r)&&this.grammarElementIdMap.set(r,e++)}},$(SI,"DefaultHydrator"),SI);function Kl(t){return{documentation:{CommentProvider:$(e=>new der(e),"CommentProvider"),DocumentationProvider:$(e=>new uer(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new her(e),"AsyncParser"),GrammarConfig:$(e=>W5e(e),"GrammarConfig"),LangiumParser:$(e=>$3e(e),"LangiumParser"),CompletionParser:$(e=>B3e(e),"CompletionParser"),ValueConverter:$(()=>new z3e,"ValueConverter"),TokenBuilder:$(()=>new Wne,"TokenBuilder"),Lexer:$(e=>new tDe(e),"Lexer"),ParserErrorMessageProvider:$(()=>new I3e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new KJt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new WJt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new QJt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new HJt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new LJt(e),"Linker"),NameProvider:$(()=>new MJt,"NameProvider"),ScopeProvider:$(e=>new $Jt(e),"ScopeProvider"),ScopeComputation:$(e=>new PJt(e),"ScopeComputation"),References:$(e=>new IJt(e),"References")},serializer:{Hydrator:$(e=>new per(e),"Hydrator"),JsonSerializer:$(e=>new FJt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new GJt(e),"DocumentValidator"),ValidationRegistry:$(e=>new UJt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(Kl,"createDefaultCoreModule");function Zl(t){return{ServiceRegistry:$(e=>new zJt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new DJt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new RJt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new qJt(e),"DocumentBuilder"),IndexManager:$(e=>new jJt(e),"IndexManager"),WorkspaceManager:$(e=>new XJt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new fer,"WorkspaceLock"),ConfigurationProvider:$(e=>new YJt(e),"ConfigurationProvider")},profilers:{}}}$(Zl,"createDefaultSharedCoreModule");var dDe;(function(t){t.merge=(e,r)=>lD(lD({},e),r)})(dDe||(dDe={}));function Ii(t,e,r,n,i,a,o,s,l){const u=[t,e,r,n,i,a,o,s,l].reduce(lD,{});return fDe(u)}$(Ii,"inject");var ger=Symbol("isProxy");function hDe(t){if(t&&t[ger])for(const e of Object.values(t))hDe(e);return t}$(hDe,"eagerLoad");function fDe(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===ger?!0:pDe(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(pDe(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(fDe,"_inject");var mer=Symbol();function pDe(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]===mer)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]=mer;try{t[e]=typeof i=="function"?i(n):fDe(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(pDe,"_resolve");function lD(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]=lD(i,n):t[r]=lD({},n)}else t[r]=n}return t}$(lD,"_merge");var gDe={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},iO;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(iO||(iO={}));var ver=(TI=class extends Wne{constructor(e=gDe){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...gDe,...e},this.indentTokenType=tD({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=tD({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!iie(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:o,ignoreIndentationDelimiters:s}=this.options;let l,u,d;const h=[];for(const f of n){for(const[p,g]of s)f.name===p?f.PUSH_MODE=iO.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===o?d=f:h.push(f)}if(!l||!u||!d)throw new Error("Some indentation/whitespace tokens not found!");return s.length>0?{modes:{[iO.REGULAR]:[l,u,...h,d],[iO.IGNORE_INDENTATION]:[...h,d]},defaultMode:iO.REGULAR}:[l,u,d,...h]}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 Mz(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 h,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:((h=s==null?void 0:s[0])==null?void 0:h.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,d=((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}},$(TI,"IndentationAwareTokenBuilder"),TI),SJn=(CI=class extends tDe{constructor(e){if(super(e),e.parser.TokenBuilder instanceof ver)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=eDe){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=[],d=n.tokens.length-1;for(let h=0;h=0&&u.push(n.tokens[d]),n.tokens=u,n}},$(CI,"IndentationAwareLexer"),CI),mDe={};T2(mDe,{AstUtils:()=>qRe,BiMap:()=>Zne,Cancellation:()=>Ha,ContextCache:()=>eie,CstUtils:()=>HRe,DONE_RESULT:()=>ld,Deferred:()=>gb,Disposable:()=>nO,DisposableCache:()=>Jne,DocumentCache:()=>BJt,EMPTY_STREAM:()=>R3,ErrorWithLocation:()=>Are,GrammarUtils:()=>C5e,MultiMap:()=>mb,OperationCancelled:()=>bv,Reduction:()=>W9,RegExpUtils:()=>O5e,SimpleCache:()=>q3e,StreamImpl:()=>cv,TreeStreamImpl:()=>D3,URI:()=>Sf,UriTrie:()=>H3e,UriUtils:()=>gd,WorkspaceCache:()=>j3e,assertCondition:()=>k5e,assertUnreachable:()=>D2,delayNextTick:()=>Yne,interruptAndCheck:()=>Xl,isOperationCancelled:()=>eO,loadGrammarFromJson:()=>Jl,setInterruptionPeriod:()=>U3e,startCancelableOperation:()=>jne,stream:()=>ha}),Ute(mDe,rie);var yer=(kI=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[]}},$(kI,"EmptyFileSystemProvider"),kI),Mc={fileSystemProvider:$(()=>new yer,"fileSystemProvider")},TJn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},CJn={AstReflection:$(()=>new g5e,"AstReflection")};function ber(){const t=Ii(Zl(Mc),CJn),e=Ii(Kl({shared:t}),TJn);return t.ServiceRegistry.register(e),e}$(ber,"createMinimalGrammarServices");function Jl(t){const e=ber(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Sf.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Jl,"loadGrammarFromJson"),Ute(oVt,mDe);var kJn=(OI=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new mb}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 xer(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,d)=>u+d);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])}},$(OI,"DefaultLangiumProfiler"),OI),xer=(EI=class{constructor(e,r){this.stack=[],this.entries=new mb,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)}},$(EI,"ProfilingTask"),EI),vDe;(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]+)\]/}})(vDe||(vDe={}));var yDe;(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]*/}})(yDe||(yDe={}));var bDe;(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]*/}})(bDe||(bDe={}));var xDe;(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])?/}})(xDe||(xDe={}));var wDe;(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]*/}})(wDe||(wDe={}));var ADe;(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]*/}})(ADe||(ADe={}));var SDe;(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]*/}})(SDe||(SDe={}));var TDe;(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]*/}})(TDe||(TDe={}));var CDe;(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]*/}})(CDe||(CDe={}));var kDe;(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]*?\*\)/}})(kDe||(kDe={}));var ODe;(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]*?\*\//}})(ODe||(ODe={}));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 _De;(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:/"[^"]*"|'[^']*'/}})(_De||(_De={}));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 DDe;(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]*/}})(DDe||(DDe={})),{...vDe.Terminals,...yDe.Terminals,...bDe.Terminals,...xDe.Terminals,...wDe.Terminals,...ADe.Terminals,...SDe.Terminals,...TDe.Terminals,...CDe.Terminals,...kDe.Terminals,...ODe.Terminals,...EDe.Terminals,...RDe.Terminals,..._De.Terminals,...DDe.Terminals};var wer={$type:"AbnfAlternation",alternatives:"alternatives"},Aer={$type:"AbnfConcatenation",elements:"elements"},LDe={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Ser={$type:"AbnfGroup",element:"element"},Ter={$type:"AbnfNumVal",value:"value"},Cer={$type:"AbnfOptionalGroup",element:"element"},cD={$type:"AbnfPrimary"},MDe={$type:"AbnfRule",definition:"definition",name:"name"},ker={$type:"AbnfRuleName",name:"name"},Oer={$type:"AbnfStringLiteral",value:"value"},uie={$type:"Accelerator",name:"name",x:"x",y:"y"},IDe={$type:"Alignment",direction:"direction",members:"members"},die={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},jz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},PDe={$type:"Annotations",x:"x",y:"y"},xv={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function OJn(t){return Ts.isInstance(t,xv.$type)}$(OJn,"isArchitecture");var hie={$type:"Axis",label:"label",name:"name"},fie={$type:"Branch",name:"name",order:"order"};function EJn(t){return Ts.isInstance(t,fie.$type)}$(EJn,"isBranch");var Eer={$type:"Checkout",branch:"branch"},pie={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},NDe={$type:"ClassDefStatement",className:"className",styleText:"styleText"},uD={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function _Jn(t){return Ts.isInstance(t,uD.$type)}$(_Jn,"isCommit");var gie={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},aO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},mie={$type:"Curve",entries:"entries",label:"label",name:"name"},oO={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function RJn(t){return Ts.isInstance(t,oO.$type)}$(RJn,"isCynefin");var vie={$type:"Deaccelerator",name:"name",x:"x",y:"y"},_er={$type:"Decorator",strategy:"strategy"},dD={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},yie={$type:"DomainBlock",domain:"domain",items:"items"};function DJn(t){return Ts.isInstance(t,yie.$type)}$(DJn,"isDomainBlock");var BDe={$type:"DomainItem",label:"label"};function LJn(t){return Ts.isInstance(t,BDe.$type)}$(LJn,"isDomainItem");var Rer={$type:"EbnfChoice",alternatives:"alternatives"},Der={$type:"EbnfExceptionPostfix",except:"except"},Ler={$type:"EbnfGroup",element:"element"},Mer={$type:"EbnfNonTerminal",name:"name"},Ier={$type:"EbnfOneOrMorePostfix",operator:"operator"},Per={$type:"EbnfOptional",element:"element"},Ner={$type:"EbnfOptionalPostfix",operator:"operator"},Xz={$type:"EbnfPostfix"},sO={$type:"EbnfPrimary"},Ber={$type:"EbnfRepetition",element:"element"},$De={$type:"EbnfRule",definition:"definition",name:"name"},$er={$type:"EbnfSequence",elements:"elements"},Fer={$type:"EbnfSpecial",text:"text"},FDe={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},zer={$type:"EbnfTerminal",value:"value"},Uer={$type:"EbnfZeroOrMorePostfix",operator:"operator"},wv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},hD={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},lO={$type:"EmFrame"},Kz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Ver={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},zDe={$type:"EmModelEntity",name:"name"};function MJn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(MJn,"isEmModelEntityType");var bie={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},vb={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Ger(t){return Ts.isInstance(t,vb.$type)}$(Ger,"isEmResetFrame");var F2={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},UDe={$type:"Entry",axis:"axis",value:"value"},yb={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Qer={$type:"Evolution",stages:"stages"},xie={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},VDe={$type:"Evolve",component:"component",target:"target"},cO={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function IJn(t){return Ts.isInstance(t,cO.$type)}$(IJn,"isGitGraph");var Zz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Jz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function PJn(t){return Ts.isInstance(t,Jz.$type)}$(PJn,"isInfo");var eU={$type:"Item",classSelector:"classSelector",name:"name"},GDe={$type:"Junction",id:"id",in:"in"},tU={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},wie={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},uO={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},fD={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function NJn(t){return Ts.isInstance(t,fD.$type)}$(NJn,"isMerge");var Aie={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},QDe={$type:"Option",name:"name",value:"value"},pD={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function BJn(t){return Ts.isInstance(t,pD.$type)}$(BJn,"isPacket");var gD={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function $Jn(t){return Ts.isInstance(t,gD.$type)}$($Jn,"isPacketBlock");var Her={$type:"PegAny",dot:"dot"},Wer={$type:"PegGroup",element:"element"},Yer={$type:"PegIdentifier",name:"name"},qer={$type:"PegLiteral",value:"value"},jer={$type:"PegOrderedChoice",alternatives:"alternatives"},HDe={$type:"PegPrefix",operator:"operator",suffix:"suffix"},rU={$type:"PegPrimary"},WDe={$type:"PegRule",definition:"definition",name:"name"},Xer={$type:"PegSequence",elements:"elements"},YDe={$type:"PegSuffix",operator:"operator",primary:"primary"},dO={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function FJn(t){return Ts.isInstance(t,dO.$type)}$(FJn,"isPie");var Sie={$type:"PieSection",label:"label",value:"value"};function zJn(t){return Ts.isInstance(t,Sie.$type)}$(zJn,"isPieSection");var qDe={$type:"Pipeline",components:"components",parent:"parent"},Tie={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},hO={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},mD={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function UJn(t){return Ts.isInstance(t,mD.$type)}$(UJn,"isRailroad");var vD={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function VJn(t){return Ts.isInstance(t,vD.$type)}$(VJn,"isRailroadAbnf");var Ker={$type:"RailroadChoiceExpr",alternatives:"alternatives"},yD={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function GJn(t){return Ts.isInstance(t,yD.$type)}$(GJn,"isRailroadEbnf");var bb={$type:"RailroadExpression"},Zer={$type:"RailroadNonTerminalExpr",name:"name"},Jer={$type:"RailroadOneOrMoreExpr",element:"element"},etr={$type:"RailroadOptionalExpr",element:"element"},bD={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function QJn(t){return Ts.isInstance(t,bD.$type)}$(QJn,"isRailroadPeg");var jDe={$type:"RailroadRule",definition:"definition",name:"name"},ttr={$type:"RailroadSequenceExpr",elements:"elements"},rtr={$type:"RailroadSpecialExpr",text:"text"},ntr={$type:"RailroadTerminalExpr",value:"value"},itr={$type:"RailroadZeroOrMoreExpr",element:"element"},XDe={$type:"Section",classSelector:"classSelector",name:"name"},xD={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},KDe={$type:"Size",height:"height",width:"width"},wD={$type:"Statement"},nU={$type:"Transition",from:"from",label:"label",to:"to"};function HJn(t){return Ts.isInstance(t,nU.$type)}$(HJn,"isTransition");var AD={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function WJn(t){return Ts.isInstance(t,AD.$type)}$(WJn,"isTreemap");var ZDe={$type:"TreemapRow",indent:"indent",item:"item"},SD={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},iU={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ic={$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 YJn(t){return Ts.isInstance(t,Ic.$type)}$(YJn,"isWardley");var atr=(_I=class extends YRe{constructor(){super(...arguments),this.types={AbnfAlternation:{name:wer.$type,properties:{alternatives:{name:wer.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Aer.$type,properties:{elements:{name:Aer.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:LDe.$type,properties:{primary:{name:LDe.primary},repeat:{name:LDe.repeat}},superTypes:[]},AbnfGroup:{name:Ser.$type,properties:{element:{name:Ser.element}},superTypes:[cD.$type]},AbnfNumVal:{name:Ter.$type,properties:{value:{name:Ter.value}},superTypes:[cD.$type]},AbnfOptionalGroup:{name:Cer.$type,properties:{element:{name:Cer.element}},superTypes:[cD.$type]},AbnfPrimary:{name:cD.$type,properties:{},superTypes:[]},AbnfRule:{name:MDe.$type,properties:{definition:{name:MDe.definition},name:{name:MDe.name}},superTypes:[]},AbnfRuleName:{name:ker.$type,properties:{name:{name:ker.name}},superTypes:[cD.$type]},AbnfStringLiteral:{name:Oer.$type,properties:{value:{name:Oer.value}},superTypes:[cD.$type]},Accelerator:{name:uie.$type,properties:{name:{name:uie.name},x:{name:uie.x},y:{name:uie.y}},superTypes:[]},Alignment:{name:IDe.$type,properties:{direction:{name:IDe.direction},members:{name:IDe.members,defaultValue:[]}},superTypes:[]},Anchor:{name:die.$type,properties:{evolution:{name:die.evolution},name:{name:die.name},visibility:{name:die.visibility}},superTypes:[]},Annotation:{name:jz.$type,properties:{number:{name:jz.number},text:{name:jz.text},x:{name:jz.x},y:{name:jz.y}},superTypes:[]},Annotations:{name:PDe.$type,properties:{x:{name:PDe.x},y:{name:PDe.y}},superTypes:[]},Architecture:{name:xv.$type,properties:{accDescr:{name:xv.accDescr},accTitle:{name:xv.accTitle},alignments:{name:xv.alignments,defaultValue:[]},edges:{name:xv.edges,defaultValue:[]},groups:{name:xv.groups,defaultValue:[]},junctions:{name:xv.junctions,defaultValue:[]},services:{name:xv.services,defaultValue:[]},title:{name:xv.title}},superTypes:[]},Axis:{name:hie.$type,properties:{label:{name:hie.label},name:{name:hie.name}},superTypes:[]},Branch:{name:fie.$type,properties:{name:{name:fie.name},order:{name:fie.order}},superTypes:[wD.$type]},Checkout:{name:Eer.$type,properties:{branch:{name:Eer.branch}},superTypes:[wD.$type]},CherryPicking:{name:pie.$type,properties:{id:{name:pie.id},parent:{name:pie.parent},tags:{name:pie.tags,defaultValue:[]}},superTypes:[wD.$type]},ClassDefStatement:{name:NDe.$type,properties:{className:{name:NDe.className},styleText:{name:NDe.styleText}},superTypes:[]},Commit:{name:uD.$type,properties:{id:{name:uD.id},message:{name:uD.message},tags:{name:uD.tags,defaultValue:[]},type:{name:uD.type}},superTypes:[wD.$type]},Common:{name:gie.$type,properties:{accDescr:{name:gie.accDescr},accTitle:{name:gie.accTitle},title:{name:gie.title}},superTypes:[]},Component:{name:aO.$type,properties:{decorator:{name:aO.decorator},evolution:{name:aO.evolution},inertia:{name:aO.inertia,defaultValue:!1},label:{name:aO.label},name:{name:aO.name},visibility:{name:aO.visibility}},superTypes:[]},Curve:{name:mie.$type,properties:{entries:{name:mie.entries,defaultValue:[]},label:{name:mie.label},name:{name:mie.name}},superTypes:[]},Cynefin:{name:oO.$type,properties:{accDescr:{name:oO.accDescr},accTitle:{name:oO.accTitle},domains:{name:oO.domains,defaultValue:[]},title:{name:oO.title},transitions:{name:oO.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:vie.$type,properties:{name:{name:vie.name},x:{name:vie.x},y:{name:vie.y}},superTypes:[]},Decorator:{name:_er.$type,properties:{strategy:{name:_er.strategy}},superTypes:[]},Direction:{name:dD.$type,properties:{accDescr:{name:dD.accDescr},accTitle:{name:dD.accTitle},dir:{name:dD.dir},statements:{name:dD.statements,defaultValue:[]},title:{name:dD.title}},superTypes:[cO.$type]},DomainBlock:{name:yie.$type,properties:{domain:{name:yie.domain},items:{name:yie.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:BDe.$type,properties:{label:{name:BDe.label}},superTypes:[]},EbnfChoice:{name:Rer.$type,properties:{alternatives:{name:Rer.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Der.$type,properties:{except:{name:Der.except}},superTypes:[Xz.$type]},EbnfGroup:{name:Ler.$type,properties:{element:{name:Ler.element}},superTypes:[sO.$type]},EbnfNonTerminal:{name:Mer.$type,properties:{name:{name:Mer.name}},superTypes:[sO.$type]},EbnfOneOrMorePostfix:{name:Ier.$type,properties:{operator:{name:Ier.operator}},superTypes:[Xz.$type]},EbnfOptional:{name:Per.$type,properties:{element:{name:Per.element}},superTypes:[sO.$type]},EbnfOptionalPostfix:{name:Ner.$type,properties:{operator:{name:Ner.operator}},superTypes:[Xz.$type]},EbnfPostfix:{name:Xz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:sO.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Ber.$type,properties:{element:{name:Ber.element}},superTypes:[sO.$type]},EbnfRule:{name:$De.$type,properties:{definition:{name:$De.definition},name:{name:$De.name}},superTypes:[]},EbnfSequence:{name:$er.$type,properties:{elements:{name:$er.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Fer.$type,properties:{text:{name:Fer.text}},superTypes:[sO.$type]},EbnfTerm:{name:FDe.$type,properties:{base:{name:FDe.base},postfixes:{name:FDe.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:zer.$type,properties:{value:{name:zer.value}},superTypes:[sO.$type]},EbnfZeroOrMorePostfix:{name:Uer.$type,properties:{operator:{name:Uer.operator}},superTypes:[Xz.$type]},Edge:{name:wv.$type,properties:{lhsDir:{name:wv.lhsDir},lhsGroup:{name:wv.lhsGroup,defaultValue:!1},lhsId:{name:wv.lhsId},lhsInto:{name:wv.lhsInto,defaultValue:!1},rhsDir:{name:wv.rhsDir},rhsGroup:{name:wv.rhsGroup,defaultValue:!1},rhsId:{name:wv.rhsId},rhsInto:{name:wv.rhsInto,defaultValue:!1},title:{name:wv.title}},superTypes:[]},EmDataEntity:{name:hD.$type,properties:{dataBlockValue:{name:hD.dataBlockValue},dataType:{name:hD.dataType},name:{name:hD.name}},superTypes:[]},EmFrame:{name:lO.$type,properties:{},superTypes:[]},EmGwt:{name:Kz.$type,properties:{givenStatements:{name:Kz.givenStatements,defaultValue:[]},sourceFrame:{name:Kz.sourceFrame,referenceType:lO.$type},thenStatements:{name:Kz.thenStatements,defaultValue:[]},whenStatements:{name:Kz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Ver.$type,properties:{entityIdentifier:{name:Ver.entityIdentifier,referenceType:zDe.$type}},superTypes:[]},EmModelEntity:{name:zDe.$type,properties:{name:{name:zDe.name}},superTypes:[]},EmNoteEntity:{name:bie.$type,properties:{dataBlockValue:{name:bie.dataBlockValue},dataType:{name:bie.dataType},sourceFrame:{name:bie.sourceFrame,referenceType:lO.$type}},superTypes:[]},EmResetFrame:{name:vb.$type,properties:{dataInlineValue:{name:vb.dataInlineValue},dataReference:{name:vb.dataReference,referenceType:hD.$type},dataType:{name:vb.dataType},entityIdentifier:{name:vb.entityIdentifier},modelEntityType:{name:vb.modelEntityType},name:{name:vb.name},sourceFrames:{name:vb.sourceFrames,defaultValue:[],referenceType:lO.$type}},superTypes:[lO.$type]},EmTimeFrame:{name:F2.$type,properties:{dataInlineValue:{name:F2.dataInlineValue},dataReference:{name:F2.dataReference,referenceType:hD.$type},dataType:{name:F2.dataType},entityIdentifier:{name:F2.entityIdentifier},modelEntityType:{name:F2.modelEntityType},name:{name:F2.name},sourceFrames:{name:F2.sourceFrames,defaultValue:[],referenceType:lO.$type}},superTypes:[lO.$type]},Entry:{name:UDe.$type,properties:{axis:{name:UDe.axis,referenceType:hie.$type},value:{name:UDe.value}},superTypes:[]},EventModel:{name:yb.$type,properties:{accDescr:{name:yb.accDescr},accTitle:{name:yb.accTitle},dataEntities:{name:yb.dataEntities,defaultValue:[]},frames:{name:yb.frames,defaultValue:[]},gwtEntities:{name:yb.gwtEntities,defaultValue:[]},modelEntities:{name:yb.modelEntities,defaultValue:[]},noteEntities:{name:yb.noteEntities,defaultValue:[]},title:{name:yb.title}},superTypes:[]},Evolution:{name:Qer.$type,properties:{stages:{name:Qer.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:xie.$type,properties:{boundary:{name:xie.boundary},name:{name:xie.name},secondName:{name:xie.secondName}},superTypes:[]},Evolve:{name:VDe.$type,properties:{component:{name:VDe.component},target:{name:VDe.target}},superTypes:[]},GitGraph:{name:cO.$type,properties:{accDescr:{name:cO.accDescr},accTitle:{name:cO.accTitle},statements:{name:cO.statements,defaultValue:[]},title:{name:cO.title}},superTypes:[]},Group:{name:Zz.$type,properties:{icon:{name:Zz.icon},id:{name:Zz.id},in:{name:Zz.in},title:{name:Zz.title}},superTypes:[]},Info:{name:Jz.$type,properties:{accDescr:{name:Jz.accDescr},accTitle:{name:Jz.accTitle},title:{name:Jz.title}},superTypes:[]},Item:{name:eU.$type,properties:{classSelector:{name:eU.classSelector},name:{name:eU.name}},superTypes:[]},Junction:{name:GDe.$type,properties:{id:{name:GDe.id},in:{name:GDe.in}},superTypes:[]},Label:{name:tU.$type,properties:{negX:{name:tU.negX,defaultValue:!1},negY:{name:tU.negY,defaultValue:!1},offsetX:{name:tU.offsetX},offsetY:{name:tU.offsetY}},superTypes:[]},Leaf:{name:wie.$type,properties:{classSelector:{name:wie.classSelector},name:{name:wie.name},value:{name:wie.value}},superTypes:[eU.$type]},Link:{name:uO.$type,properties:{arrow:{name:uO.arrow},from:{name:uO.from},fromPort:{name:uO.fromPort},linkLabel:{name:uO.linkLabel},to:{name:uO.to},toPort:{name:uO.toPort}},superTypes:[]},Merge:{name:fD.$type,properties:{branch:{name:fD.branch},id:{name:fD.id},tags:{name:fD.tags,defaultValue:[]},type:{name:fD.type}},superTypes:[wD.$type]},Note:{name:Aie.$type,properties:{evolution:{name:Aie.evolution},text:{name:Aie.text},visibility:{name:Aie.visibility}},superTypes:[]},Option:{name:QDe.$type,properties:{name:{name:QDe.name},value:{name:QDe.value,defaultValue:!1}},superTypes:[]},Packet:{name:pD.$type,properties:{accDescr:{name:pD.accDescr},accTitle:{name:pD.accTitle},blocks:{name:pD.blocks,defaultValue:[]},title:{name:pD.title}},superTypes:[]},PacketBlock:{name:gD.$type,properties:{bits:{name:gD.bits},end:{name:gD.end},label:{name:gD.label},start:{name:gD.start}},superTypes:[]},PegAny:{name:Her.$type,properties:{dot:{name:Her.dot}},superTypes:[rU.$type]},PegGroup:{name:Wer.$type,properties:{element:{name:Wer.element}},superTypes:[rU.$type]},PegIdentifier:{name:Yer.$type,properties:{name:{name:Yer.name}},superTypes:[rU.$type]},PegLiteral:{name:qer.$type,properties:{value:{name:qer.value}},superTypes:[rU.$type]},PegOrderedChoice:{name:jer.$type,properties:{alternatives:{name:jer.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:HDe.$type,properties:{operator:{name:HDe.operator},suffix:{name:HDe.suffix}},superTypes:[]},PegPrimary:{name:rU.$type,properties:{},superTypes:[]},PegRule:{name:WDe.$type,properties:{definition:{name:WDe.definition},name:{name:WDe.name}},superTypes:[]},PegSequence:{name:Xer.$type,properties:{elements:{name:Xer.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:YDe.$type,properties:{operator:{name:YDe.operator},primary:{name:YDe.primary}},superTypes:[]},Pie:{name:dO.$type,properties:{accDescr:{name:dO.accDescr},accTitle:{name:dO.accTitle},sections:{name:dO.sections,defaultValue:[]},showData:{name:dO.showData,defaultValue:!1},title:{name:dO.title}},superTypes:[]},PieSection:{name:Sie.$type,properties:{label:{name:Sie.label},value:{name:Sie.value}},superTypes:[]},Pipeline:{name:qDe.$type,properties:{components:{name:qDe.components,defaultValue:[]},parent:{name:qDe.parent}},superTypes:[]},PipelineComponent:{name:Tie.$type,properties:{evolution:{name:Tie.evolution},label:{name:Tie.label},name:{name:Tie.name}},superTypes:[]},Radar:{name:hO.$type,properties:{accDescr:{name:hO.accDescr},accTitle:{name:hO.accTitle},axes:{name:hO.axes,defaultValue:[]},curves:{name:hO.curves,defaultValue:[]},options:{name:hO.options,defaultValue:[]},title:{name:hO.title}},superTypes:[]},Railroad:{name:mD.$type,properties:{accDescr:{name:mD.accDescr},accTitle:{name:mD.accTitle},rules:{name:mD.rules,defaultValue:[]},title:{name:mD.title}},superTypes:[]},RailroadAbnf:{name:vD.$type,properties:{accDescr:{name:vD.accDescr},accTitle:{name:vD.accTitle},rules:{name:vD.rules,defaultValue:[]},title:{name:vD.title}},superTypes:[]},RailroadChoiceExpr:{name:Ker.$type,properties:{alternatives:{name:Ker.alternatives,defaultValue:[]}},superTypes:[bb.$type]},RailroadEbnf:{name:yD.$type,properties:{accDescr:{name:yD.accDescr},accTitle:{name:yD.accTitle},rules:{name:yD.rules,defaultValue:[]},title:{name:yD.title}},superTypes:[]},RailroadExpression:{name:bb.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Zer.$type,properties:{name:{name:Zer.name}},superTypes:[bb.$type]},RailroadOneOrMoreExpr:{name:Jer.$type,properties:{element:{name:Jer.element}},superTypes:[bb.$type]},RailroadOptionalExpr:{name:etr.$type,properties:{element:{name:etr.element}},superTypes:[bb.$type]},RailroadPeg:{name:bD.$type,properties:{accDescr:{name:bD.accDescr},accTitle:{name:bD.accTitle},rules:{name:bD.rules,defaultValue:[]},title:{name:bD.title}},superTypes:[]},RailroadRule:{name:jDe.$type,properties:{definition:{name:jDe.definition},name:{name:jDe.name}},superTypes:[]},RailroadSequenceExpr:{name:ttr.$type,properties:{elements:{name:ttr.elements,defaultValue:[]}},superTypes:[bb.$type]},RailroadSpecialExpr:{name:rtr.$type,properties:{text:{name:rtr.text}},superTypes:[bb.$type]},RailroadTerminalExpr:{name:ntr.$type,properties:{value:{name:ntr.value}},superTypes:[bb.$type]},RailroadZeroOrMoreExpr:{name:itr.$type,properties:{element:{name:itr.element}},superTypes:[bb.$type]},Section:{name:XDe.$type,properties:{classSelector:{name:XDe.classSelector},name:{name:XDe.name}},superTypes:[eU.$type]},Service:{name:xD.$type,properties:{icon:{name:xD.icon},iconText:{name:xD.iconText},id:{name:xD.id},in:{name:xD.in},title:{name:xD.title}},superTypes:[]},Size:{name:KDe.$type,properties:{height:{name:KDe.height},width:{name:KDe.width}},superTypes:[]},Statement:{name:wD.$type,properties:{},superTypes:[]},Transition:{name:nU.$type,properties:{from:{name:nU.from},label:{name:nU.label},to:{name:nU.to}},superTypes:[]},TreeNode:{name:SD.$type,properties:{classAnnotation:{name:SD.classAnnotation},descAnnotation:{name:SD.descAnnotation},iconAnnotation:{name:SD.iconAnnotation},indent:{name:SD.indent},name:{name:SD.name}},superTypes:[]},TreeView:{name:iU.$type,properties:{accDescr:{name:iU.accDescr},accTitle:{name:iU.accTitle},nodes:{name:iU.nodes,defaultValue:[]},title:{name:iU.title}},superTypes:[]},Treemap:{name:AD.$type,properties:{accDescr:{name:AD.accDescr},accTitle:{name:AD.accTitle},title:{name:AD.title},TreemapRows:{name:AD.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:ZDe.$type,properties:{indent:{name:ZDe.indent},item:{name:ZDe.item}},superTypes:[]},Wardley:{name:Ic.$type,properties:{accDescr:{name:Ic.accDescr},accelerators:{name:Ic.accelerators,defaultValue:[]},accTitle:{name:Ic.accTitle},anchors:{name:Ic.anchors,defaultValue:[]},annotation:{name:Ic.annotation,defaultValue:[]},annotations:{name:Ic.annotations,defaultValue:[]},components:{name:Ic.components,defaultValue:[]},deaccelerators:{name:Ic.deaccelerators,defaultValue:[]},evolution:{name:Ic.evolution},evolves:{name:Ic.evolves,defaultValue:[]},links:{name:Ic.links,defaultValue:[]},notes:{name:Ic.notes,defaultValue:[]},pipelines:{name:Ic.pipelines,defaultValue:[]},size:{name:Ic.size},title:{name:Ic.title}},superTypes:[]}}}},$(_I,"MermaidAstReflection"),_I),Ts=new atr,otr,qJn=$(()=>otr??(otr=Jl(`{"$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"),str,jJn=$(()=>str??(str=Jl(`{"$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"),ltr,XJn=$(()=>ltr??(ltr=Jl('{"$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"),ctr,KJn=$(()=>ctr??(ctr=Jl(`{"$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"),utr,ZJn=$(()=>utr??(utr=Jl(`{"$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"),dtr,JJn=$(()=>dtr??(dtr=Jl(`{"$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"),htr,eei=$(()=>htr??(htr=Jl(`{"$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"),ftr,tei=$(()=>ftr??(ftr=Jl(`{"$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"),ptr,rei=$(()=>ptr??(ptr=Jl('{"$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"),gtr,nei=$(()=>gtr??(gtr=Jl(`{"$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"),mtr,iei=$(()=>mtr??(mtr=Jl(`{"$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"),vtr,aei=$(()=>vtr??(vtr=Jl(`{"$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"),ytr,oei=$(()=>ytr??(ytr=Jl(`{"$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"),btr,sei=$(()=>btr??(btr=Jl(`{"$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"),xtr,lei=$(()=>xtr??(xtr=Jl(`{"$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"),cei={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uei={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dei={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hei={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fei={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pei={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gei={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mei={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vei={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yei={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bei={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xei={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wei={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Aei={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sei={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},md={AstReflection:$(()=>new atr,"AstReflection")},Tei={Grammar:$(()=>qJn(),"Grammar"),LanguageMetaData:$(()=>cei,"LanguageMetaData"),parser:{}},Cei={Grammar:$(()=>jJn(),"Grammar"),LanguageMetaData:$(()=>uei,"LanguageMetaData"),parser:{}},kei={Grammar:$(()=>XJn(),"Grammar"),LanguageMetaData:$(()=>dei,"LanguageMetaData"),parser:{}},Oei={Grammar:$(()=>KJn(),"Grammar"),LanguageMetaData:$(()=>hei,"LanguageMetaData"),parser:{}},Eei={Grammar:$(()=>ZJn(),"Grammar"),LanguageMetaData:$(()=>fei,"LanguageMetaData"),parser:{}},_ei={Grammar:$(()=>JJn(),"Grammar"),LanguageMetaData:$(()=>pei,"LanguageMetaData"),parser:{}},Rei={Grammar:$(()=>eei(),"Grammar"),LanguageMetaData:$(()=>gei,"LanguageMetaData"),parser:{}},Dei={Grammar:$(()=>tei(),"Grammar"),LanguageMetaData:$(()=>mei,"LanguageMetaData"),parser:{}},Lei={Grammar:$(()=>rei(),"Grammar"),LanguageMetaData:$(()=>vei,"LanguageMetaData"),parser:{}},Mei={Grammar:$(()=>nei(),"Grammar"),LanguageMetaData:$(()=>yei,"LanguageMetaData"),parser:{}},Iei={Grammar:$(()=>iei(),"Grammar"),LanguageMetaData:$(()=>bei,"LanguageMetaData"),parser:{}},Pei={Grammar:$(()=>aei(),"Grammar"),LanguageMetaData:$(()=>xei,"LanguageMetaData"),parser:{}},Nei={Grammar:$(()=>oei(),"Grammar"),LanguageMetaData:$(()=>wei,"LanguageMetaData"),parser:{}},Bei={Grammar:$(()=>sei(),"Grammar"),LanguageMetaData:$(()=>Aei,"LanguageMetaData"),parser:{}},$ei={Grammar:$(()=>lei(),"Grammar"),LanguageMetaData:$(()=>Sei,"LanguageMetaData"),parser:{}},Fei=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,zei=/accTitle[\t ]*:([^\n\r]*)/,Uei=/title([\t ][^\n\r]*|)/,Vei={ACC_DESCR:Fei,ACC_TITLE:zei,TITLE:Uei},Av=(RI=class extends z3e{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=Vei[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,` `)}}},$(RI,"AbstractMermaidValueConverter"),RI),TD=(DI=class extends Av{runCustomConverter(e,r,n){}},$(DI,"CommonValueConverter"),DI),vd=(LI=class extends Wne{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}},$(LI,"AbstractMermaidTokenBuilder"),LI);MI=class extends vd{},$(MI,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: @@ -1890,7 +1890,7 @@ ${r}`),this.inline?`{${i}}`:i}},$(pI,"JSDocTagImpl"),pI);function ser(t,e,r){var Expecting `+ze.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":we="Parse error on line "+(z+1)+": Unexpected "+(ie==H?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(we,{text:q.match,token:this.terminals_[ie]||ie,line:q.yylineno,loc:J,expected:ze})}if(Oe[0]instanceof Array&&Oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+ie);switch(Oe[0]){case 1:M.push(ie),N.push(q.yytext),F.push(q.yylloc),M.push(Oe[1]),ie=null,U=q.yyleng,V=q.yytext,z=q.yylineno,J=q.yylloc;break;case 2:if(xe=this.productions_[Oe[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,Oe[1],N,F].concat(j)),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_[Oe[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:k(function(D,M){if(this.yy.parser)this.yy.parser.parseError(D,M);else throw new Error(D)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(R){this.unput(this.match.slice(R))},"less"),pastInput:k(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:k(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:k(function(){var R=this.pastInput(),D=new Array(R.length+1).join("-");return R+this.upcomingInput()+` `+D+"^"},"showPosition"),test_match:k(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:k(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:k(function(){var D=this.next();return D||this.lex()},"lex"),begin:k(function(D){this.conditionStack.push(D)},"begin"),popState:k(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:k(function(D){this.begin(D)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(P,"Parser"),P.prototype=E,E.Parser=P,new P}();lLe.parser=lLe;var kri=lLe;Nl.extend(bri),Nl.extend(wri),Nl.extend(Sri);var grr={friday:5,saturday:6},Tv="",cLe="",uLe=void 0,dLe="",CD=[],kD=[],hLe=new Map,fLe=[],_ie=[],OD="",pLe="",mrr=["active","done","crit","milestone","vert"],gLe=[],ED="",lU=!1,mLe=!1,vLe="sunday",Rie="saturday",yLe=0,Ori=k(function(){fLe=[],_ie=[],OD="",gLe=[],Die=0,xLe=void 0,Lie=void 0,bl=[],Tv="",cLe="",pLe="",uLe=void 0,dLe="",CD=[],kD=[],lU=!1,mLe=!1,yLe=0,hLe=new Map,ED="",_a(),vLe="sunday",Rie="saturday"},"clear"),Eri=k(function(t){ED=t},"setDiagramId"),_ri=k(function(t){cLe=t},"setAxisFormat"),Rri=k(function(){return cLe},"getAxisFormat"),Dri=k(function(t){uLe=t},"setTickInterval"),Lri=k(function(){return uLe},"getTickInterval"),Mri=k(function(t){dLe=t},"setTodayMarker"),Iri=k(function(){return dLe},"getTodayMarker"),Pri=k(function(t){Tv=t},"setDateFormat"),Nri=k(function(){lU=!0},"enableInclusiveEndDates"),Bri=k(function(){return lU},"endDatesAreInclusive"),$ri=k(function(){mLe=!0},"enableTopAxis"),Fri=k(function(){return mLe},"topAxisEnabled"),zri=k(function(t){pLe=t},"setDisplayMode"),Uri=k(function(){return pLe},"getDisplayMode"),Vri=k(function(){return Tv},"getDateFormat"),vrr=k((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Gri=k(function(t){CD=vrr(CD,t)},"setIncludes"),Qri=k(function(){return CD},"getIncludes"),Hri=k(function(t){kD=vrr(kD,t)},"setExcludes"),Wri=k(function(){return kD},"getExcludes"),Yri=k(function(){return hLe},"getLinks"),qri=k(function(t){OD=t,fLe.push(t)},"addSection"),jri=k(function(){return fLe},"getSections"),Xri=k(function(){let t=Srr();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"),bLe=k(function(t,e,r){if(r=r.trim(),k(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 d=mO(u);d!==void 0&&(!s||d.endTime>s.endTime)&&(s=d)}if(s)return s.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let o=Nl(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"),xrr=k(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),wrr=k(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let d=null;for(const f of a.groups.ids.split(" ")){let p=mO(f);p!==void 0&&(!d||p.startTime{window.open(r,"_self")}),hLe.set(n,r))}),Trr(t,"clickable")},"setLink"),Trr=k(function(t,e){t.split(",").forEach(function(r){let n=mO(r);n!==void 0&&n.classes.push(e)})},"setClass"),oni=k(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"),Crr=k(function(t,e){gLe.push(function(){const r=ED?`${ED}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=ED?`${ED}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),sni=k(function(t,e,r){t.split(",").forEach(function(n){oni(n,e,r)}),Trr(t,"clickable")},"setClickEvent"),lni=k(function(t){gLe.forEach(function(e){e(t)})},"bindFunctions"),cni={getConfig:k(()=>Ye().gantt,"getConfig"),clear:Ori,setDateFormat:Pri,getDateFormat:Vri,enableInclusiveEndDates:Nri,endDatesAreInclusive:Bri,enableTopAxis:$ri,topAxisEnabled:Fri,setAxisFormat:_ri,getAxisFormat:Rri,setTickInterval:Dri,getTickInterval:Lri,setTodayMarker:Mri,getTodayMarker:Iri,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,setDiagramId:Eri,setDisplayMode:zri,getDisplayMode:Uri,setAccDescription:so,getAccDescription:lo,addSection:qri,getSections:jri,getTasks:Xri,addTask:nni,findTaskById:mO,addTaskOrg:ini,setIncludes:Gri,getIncludes:Qri,setExcludes:Hri,getExcludes:Wri,setClickEvent:sni,setLink:ani,getLinks:Yri,bindFunctions:lni,parseDuration:xrr,isInvalidDate:yrr,setWeekday:Kri,getWeekday:Zri,setWeekend:Jri};function wLe(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)})}k(wLe,"getTaskTags"),Nl.extend(Cri);var uni=k(function(){ye.debug("Something is calling, setConf, remove the call")},"setConf"),krr={monday:$7,tuesday:XAt,wednesday:KAt,thursday:XT,friday:ZAt,saturday:JAt,sunday:B7},dni=k((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"),Ab,ALe=1e4,hni=k(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);Ab=u.parentElement.offsetWidth,Ab===void 0&&(Ab=1200),i.useWidth!==void 0&&(Ab=i.useWidth);const d=n.db.getTasks(),h=d.filter(E=>!E.vert);let f=[];for(const E of h)f.push(E.type);f=O(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const E={};for(const P of h)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=dni(E[P],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[P]=L}}else{g+=h.length*(i.barHeight+i.barGap);for(const E of f)p[E]=h.filter(_=>_.type===E).length}u.setAttribute("viewBox","0 0 "+Ab+" "+g);const m=s.select(`[id="${e}"]`),v=bdn().domain([Ran(d,function(E){return E.startTime}),_an(d,function(E){return E.endTime})]).rangeRound([0,Ab-i.leftPadding-i.rightPadding]);function y(E,_){const P=E.startTime,L=_.startTime;let R=0;return P>L?R=1:PU.vert===G.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(G=>G.order===U));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(U,G){return G=U.order,G*_+P-2}).attr("width",function(){return M-i.rightPadding/2}).attr("height",_).attr("class",function(U){for(const[G,H]of f.entries())if(U.type===H)return"section section"+G%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,G){return G=U.order,U.vert?i.gridLineStartPadding:G*_+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,G){return G=U.order,(v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))).toString()+"px "+(G*_+P+.5*R).toString()+"px"}).attr("class",function(U){const G="task";let H="";U.classes.length>0&&(H=U.classes.join(" "));let j=0;for(const[ne,X]of f.entries())U.type===X&&(j=ne%i.numberSectionStyles);let q="";return U.active?U.crit?q+=" activeCrit":q=" active":U.done?U.crit?q=" doneCrit":q=" done":U.crit&&(q+=" crit"),q.length===0&&(q=" task"),U.milestone&&(q=" milestone "+q),U.vert&&(q=" vert "+q),q+=j,q+=" "+H,G+q}),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 G=v(U.startTime),H=v(U.renderEndTime||U.endTime);if(U.milestone&&(G+=.5*(v(U.endTime)-v(U.startTime))-.5*R,H=G+R),U.vert)return v(U.startTime)+L;const j=this.getBBox().width;return j>H-G?H+j+1.5*i.leftPadding>M?G+L-5:H+L+5:(H-G)/2+G+L}).attr("y",function(U,G){return U.vert?i.gridLineStartPadding+I.length*(i.barHeight+i.barGap)+60:(G=U.order,G*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(U){const G=v(U.startTime);let H=v(U.endTime);U.milestone&&(H=G+R);const j=this.getBBox().width;let q="";U.classes.length>0&&(q=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"),j>H-G?H+j+1.5*i.leftPadding>M?q+" taskTextOutsideLeft taskTextOutside"+ne+" "+X:q+" taskTextOutsideRight taskTextOutside"+ne+" "+X+" width-"+j:q+" taskText taskText"+ne+" "+X+" width-"+j}),Ye().securityLevel==="sandbox"){let U;U=_t("#i"+e);const G=U.nodes()[0].contentDocument;B.filter(function(H){return V.has(H.id)}).each(function(H){var j=G.querySelector("#"+CSS.escape(e+"-"+H.id)),q=G.querySelector("#"+CSS.escape(e+"-"+H.id+"-text"));const ne=j.parentNode;var X=G.createElement("a");X.setAttribute("xlink:href",V.get(H.id)),X.setAttribute("target","_top"),ne.appendChild(X),X.appendChild(j),X.appendChild(q)})}}k(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:H,endTime:j}of D)(N===void 0||HF)&&(F=j);if(!N||!F)return;if(Nl(F).diff(Nl(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=Nl(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",H=>e+"-exclude-"+H.start.format("YYYY-MM-DD")).attr("x",H=>v(H.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",H=>v(H.end.endOf("day"))-v(H.start.startOf("day"))).attr("height",R-_-i.gridLineStartPadding).attr("transform-origin",function(H,j){return(v(H.start)+P+.5*(v(H.end)-v(H.start))).toString()+"px "+(j*E+.5*R).toString()+"px"}).attr("class","exclude-range")}k(w,"drawExcludeDays");function A(E,_,P,L){if(P<=0||E>_)return 1/0;const R=_-E,D=Nl.duration({[L??"day"]:P}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}k(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=Fan(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(xX(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(),G=U[0],H=U[1],j=A(G,H,B,V);if(j>ALe)ye.warn(`The tick interval "${B}${V}" would generate ${j} ticks, which exceeds the maximum allowed (${ALe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":I.ticks(bR.every(B));break;case"second":I.ticks(xw.every(B));break;case"minute":I.ticks(P7.every(B));break;case"hour":I.ticks(N7.every(B));break;case"day":I.ticks(qT.every(B));break;case"week":I.ticks(krr[z].every(B));break;case"month":I.ticks(F7.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=$an(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(xX(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,G=v.domain(),H=G[0],j=G[1];if(A(H,j,V,z)<=ALe)switch(z){case"millisecond":B.ticks(bR.every(V));break;case"second":B.ticks(xw.every(V));break;case"minute":B.ticks(P7.every(V));break;case"hour":B.ticks(N7.every(V));break;case"day":B.ticks(qT.every(V));break;case"week":B.ticks(krr[U].every(V));break;case"month":B.ticks(F7.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)}}k(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:k(function(){var D=this.next();return D||this.lex()},"lex"),begin:k(function(D){this.conditionStack.push(D)},"begin"),popState:k(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:k(function(D){this.begin(D)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(P,"Parser"),P.prototype=E,E.Parser=P,new P}();lLe.parser=lLe;var kri=lLe;Nl.extend(bri),Nl.extend(wri),Nl.extend(Sri);var grr={friday:5,saturday:6},Tv="",cLe="",uLe=void 0,dLe="",CD=[],kD=[],hLe=new Map,fLe=[],_ie=[],OD="",pLe="",mrr=["active","done","crit","milestone","vert"],gLe=[],ED="",lU=!1,mLe=!1,vLe="sunday",Rie="saturday",yLe=0,Ori=k(function(){fLe=[],_ie=[],OD="",gLe=[],Die=0,xLe=void 0,Lie=void 0,bl=[],Tv="",cLe="",pLe="",uLe=void 0,dLe="",CD=[],kD=[],lU=!1,mLe=!1,yLe=0,hLe=new Map,ED="",_a(),vLe="sunday",Rie="saturday"},"clear"),Eri=k(function(t){ED=t},"setDiagramId"),_ri=k(function(t){cLe=t},"setAxisFormat"),Rri=k(function(){return cLe},"getAxisFormat"),Dri=k(function(t){uLe=t},"setTickInterval"),Lri=k(function(){return uLe},"getTickInterval"),Mri=k(function(t){dLe=t},"setTodayMarker"),Iri=k(function(){return dLe},"getTodayMarker"),Pri=k(function(t){Tv=t},"setDateFormat"),Nri=k(function(){lU=!0},"enableInclusiveEndDates"),Bri=k(function(){return lU},"endDatesAreInclusive"),$ri=k(function(){mLe=!0},"enableTopAxis"),Fri=k(function(){return mLe},"topAxisEnabled"),zri=k(function(t){pLe=t},"setDisplayMode"),Uri=k(function(){return pLe},"getDisplayMode"),Vri=k(function(){return Tv},"getDateFormat"),vrr=k((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Gri=k(function(t){CD=vrr(CD,t)},"setIncludes"),Qri=k(function(){return CD},"getIncludes"),Hri=k(function(t){kD=vrr(kD,t)},"setExcludes"),Wri=k(function(){return kD},"getExcludes"),Yri=k(function(){return hLe},"getLinks"),qri=k(function(t){OD=t,fLe.push(t)},"addSection"),jri=k(function(){return fLe},"getSections"),Xri=k(function(){let t=Srr();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"),bLe=k(function(t,e,r){if(r=r.trim(),k(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 d=mO(u);d!==void 0&&(!s||d.endTime>s.endTime)&&(s=d)}if(s)return s.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let o=Nl(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"),xrr=k(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),wrr=k(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let d=null;for(const f of a.groups.ids.split(" ")){let p=mO(f);p!==void 0&&(!d||p.startTime{window.open(r,"_self")}),hLe.set(n,r))}),Trr(t,"clickable")},"setLink"),Trr=k(function(t,e){t.split(",").forEach(function(r){let n=mO(r);n!==void 0&&n.classes.push(e)})},"setClass"),oni=k(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"),Crr=k(function(t,e){gLe.push(function(){const r=ED?`${ED}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=ED?`${ED}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),sni=k(function(t,e,r){t.split(",").forEach(function(n){oni(n,e,r)}),Trr(t,"clickable")},"setClickEvent"),lni=k(function(t){gLe.forEach(function(e){e(t)})},"bindFunctions"),cni={getConfig:k(()=>Ye().gantt,"getConfig"),clear:Ori,setDateFormat:Pri,getDateFormat:Vri,enableInclusiveEndDates:Nri,endDatesAreInclusive:Bri,enableTopAxis:$ri,topAxisEnabled:Fri,setAxisFormat:_ri,getAxisFormat:Rri,setTickInterval:Dri,getTickInterval:Lri,setTodayMarker:Mri,getTodayMarker:Iri,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,setDiagramId:Eri,setDisplayMode:zri,getDisplayMode:Uri,setAccDescription:so,getAccDescription:lo,addSection:qri,getSections:jri,getTasks:Xri,addTask:nni,findTaskById:mO,addTaskOrg:ini,setIncludes:Gri,getIncludes:Qri,setExcludes:Hri,getExcludes:Wri,setClickEvent:sni,setLink:ani,getLinks:Yri,bindFunctions:lni,parseDuration:xrr,isInvalidDate:yrr,setWeekday:Kri,getWeekday:Zri,setWeekend:Jri};function wLe(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)})}k(wLe,"getTaskTags"),Nl.extend(Cri);var uni=k(function(){ye.debug("Something is calling, setConf, remove the call")},"setConf"),krr={monday:$7,tuesday:XAt,wednesday:KAt,thursday:XT,friday:ZAt,saturday:JAt,sunday:B7},dni=k((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"),Ab,ALe=1e4,hni=k(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);Ab=u.parentElement.offsetWidth,Ab===void 0&&(Ab=1200),i.useWidth!==void 0&&(Ab=i.useWidth);const d=n.db.getTasks(),h=d.filter(E=>!E.vert);let f=[];for(const E of h)f.push(E.type);f=O(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const E={};for(const P of h)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=dni(E[P],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[P]=L}}else{g+=h.length*(i.barHeight+i.barGap);for(const E of f)p[E]=h.filter(_=>_.type===E).length}u.setAttribute("viewBox","0 0 "+Ab+" "+g);const m=s.select(`[id="${e}"]`),v=bdn().domain([Ran(d,function(E){return E.startTime}),_an(d,function(E){return E.endTime})]).rangeRound([0,Ab-i.leftPadding-i.rightPadding]);function y(E,_){const P=E.startTime,L=_.startTime;let R=0;return P>L?R=1:PU.vert===G.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(G=>G.order===U));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(U,G){return G=U.order,G*_+P-2}).attr("width",function(){return M-i.rightPadding/2}).attr("height",_).attr("class",function(U){for(const[G,H]of f.entries())if(U.type===H)return"section section"+G%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,G){return G=U.order,U.vert?i.gridLineStartPadding:G*_+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,G){return G=U.order,(v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))).toString()+"px "+(G*_+P+.5*R).toString()+"px"}).attr("class",function(U){const G="task";let H="";U.classes.length>0&&(H=U.classes.join(" "));let j=0;for(const[ne,X]of f.entries())U.type===X&&(j=ne%i.numberSectionStyles);let q="";return U.active?U.crit?q+=" activeCrit":q=" active":U.done?U.crit?q=" doneCrit":q=" done":U.crit&&(q+=" crit"),q.length===0&&(q=" task"),U.milestone&&(q=" milestone "+q),U.vert&&(q=" vert "+q),q+=j,q+=" "+H,G+q}),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 G=v(U.startTime),H=v(U.renderEndTime||U.endTime);if(U.milestone&&(G+=.5*(v(U.endTime)-v(U.startTime))-.5*R,H=G+R),U.vert)return v(U.startTime)+L;const j=this.getBBox().width;return j>H-G?H+j+1.5*i.leftPadding>M?G+L-5:H+L+5:(H-G)/2+G+L}).attr("y",function(U,G){return U.vert?i.gridLineStartPadding+I.length*(i.barHeight+i.barGap)+60:(G=U.order,G*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(U){const G=v(U.startTime);let H=v(U.endTime);U.milestone&&(H=G+R);const j=this.getBBox().width;let q="";U.classes.length>0&&(q=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"),j>H-G?H+j+1.5*i.leftPadding>M?q+" taskTextOutsideLeft taskTextOutside"+ne+" "+X:q+" taskTextOutsideRight taskTextOutside"+ne+" "+X+" width-"+j:q+" taskText taskText"+ne+" "+X+" width-"+j}),Ye().securityLevel==="sandbox"){let U;U=_t("#i"+e);const G=U.nodes()[0].contentDocument;B.filter(function(H){return V.has(H.id)}).each(function(H){var j=G.querySelector("#"+CSS.escape(e+"-"+H.id)),q=G.querySelector("#"+CSS.escape(e+"-"+H.id+"-text"));const ne=j.parentNode;var X=G.createElement("a");X.setAttribute("xlink:href",V.get(H.id)),X.setAttribute("target","_top"),ne.appendChild(X),X.appendChild(j),X.appendChild(q)})}}k(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:H,endTime:j}of D)(N===void 0||HF)&&(F=j);if(!N||!F)return;if(Nl(F).diff(Nl(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=Nl(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",H=>e+"-exclude-"+H.start.format("YYYY-MM-DD")).attr("x",H=>v(H.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",H=>v(H.end.endOf("day"))-v(H.start.startOf("day"))).attr("height",R-_-i.gridLineStartPadding).attr("transform-origin",function(H,j){return(v(H.start)+P+.5*(v(H.end)-v(H.start))).toString()+"px "+(j*E+.5*R).toString()+"px"}).attr("class","exclude-range")}k(w,"drawExcludeDays");function A(E,_,P,L){if(P<=0||E>_)return 1/0;const R=_-E,D=Nl.duration({[L??"day"]:P}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}k(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=Fan(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(xX(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(),G=U[0],H=U[1],j=A(G,H,B,V);if(j>ALe)ye.warn(`The tick interval "${B}${V}" would generate ${j} ticks, which exceeds the maximum allowed (${ALe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":I.ticks(b5.every(B));break;case"second":I.ticks(xw.every(B));break;case"minute":I.ticks(P7.every(B));break;case"hour":I.ticks(N7.every(B));break;case"day":I.ticks(qT.every(B));break;case"week":I.ticks(krr[z].every(B));break;case"month":I.ticks(F7.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=$an(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(xX(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,G=v.domain(),H=G[0],j=G[1];if(A(H,j,V,z)<=ALe)switch(z){case"millisecond":B.ticks(b5.every(V));break;case"second":B.ticks(xw.every(V));break;case"minute":B.ticks(P7.every(V));break;case"hour":B.ticks(N7.every(V));break;case"day":B.ticks(qT.every(V));break;case"week":B.ticks(krr[U].every(V));break;case"month":B.ticks(F7.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)}}k(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}; } @@ -2215,18 +2215,18 @@ Expecting `+ze.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":we="Parse erro font-size: ${t.pieLegendTextSize}; } `,"getStyles"),Bni=Nni,$ni=k(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 Idn().value(i=>i.value).sort(null)(r)},"createPieArcs"),Fni=k((t,e,r,n)=>{var q;ye.debug(`rendering pie chart -`+t);const i=n.db,a=Ye(),o=uo(i.getConfig(),a.pie),s=40,l=18,u=4,d=450,h=d,f=iu(e),p=f.append("g");p.attr("transform","translate("+h/2+","+d/2+")");const{themeVariables:g}=a;let[m]=s1(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(h,d)/2-s,w=SR().innerRadius(b*x).outerRadius(x),A=SR().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=$ni(T),O=[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=YT(O).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=d,N=h+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=((q=L.node())==null?void 0:q.getBoundingClientRect().width)??0,z=h/2-V/2,U=h/2+V/2,G=Math.min(0,z),j=Math.max(N,U)-G;f.attr("viewBox",`${G} 0 ${j} ${I}`),jo(f,I,j,o.useMaxWidth)},"draw"),zni={draw:Fni},Uni={parser:Pni,db:Orr,renderer:zni,styles:Bni};const Vni=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uni},Symbol.toStringTag,{value:"Module"}));var CLe=function(){var t=k(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],d=[1,37],h=[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],O=[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],G=[1,66],H=[1,67],j=[1,68],q=[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],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ee=[1,91],ue=[1,92],he=[1,93],xe=[1,100],ge=[1,94],ze=[1,97],we=[1,95],ke=[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:k(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:k(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:d,5:h,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:O,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:d,5:h,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:O,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:G,5:H,6:j,7:q,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:G,5:H,6:j,7:q,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,15:Ce,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[2,12]),t(l,[2,52],{58:31,43:84,4:d,5:h,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:d,5:h,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:he,8:xe,11:ge,13:ze,16:90,17:we,18:ke,19:Be,20:Z,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:d,5:h,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:d,5:h,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z}),{46:[1,102]},t(l,[2,29],{10:le}),t(be,[2,27],{16:104,4:Ee,5:ue,6:he,8:xe,11:ge,13:ze,17:we,18:ke,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z}),{4:Ee,5:ue,6:he,8:xe,11:ge,13:ze,16:90,17:we,18:ke,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:k(function(ve,ce){if(ce.recoverable)this.trace(ve);else{var De=new Error(ve);throw De.hash=ce,De}},"parseError"),parse:k(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 Ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ot)&&(St.yy[Ot]=this.yy[Ot]);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 Qt=Ie.options&&Ie.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(hr){De.length=De.length-2*hr,We.length=We.length-hr,Ne.length=Ne.length-hr}k(It,"popStack");function gt(){var hr;return hr=Le.pop()||Ie.lex()||Pe,typeof hr!="number"&&(hr instanceof Array&&(Le=hr,hr=Le.pop()),hr=ce.symbols_[hr]||hr),hr}k(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)+`: +`+t);const i=n.db,a=Ye(),o=uo(i.getConfig(),a.pie),s=40,l=18,u=4,d=450,h=d,f=iu(e),p=f.append("g");p.attr("transform","translate("+h/2+","+d/2+")");const{themeVariables:g}=a;let[m]=s1(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(h,d)/2-s,w=S5().innerRadius(b*x).outerRadius(x),A=S5().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=$ni(T),O=[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=YT(O).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=d,N=h+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=((q=L.node())==null?void 0:q.getBoundingClientRect().width)??0,z=h/2-V/2,U=h/2+V/2,G=Math.min(0,z),j=Math.max(N,U)-G;f.attr("viewBox",`${G} 0 ${j} ${I}`),jo(f,I,j,o.useMaxWidth)},"draw"),zni={draw:Fni},Uni={parser:Pni,db:Orr,renderer:zni,styles:Bni};const Vni=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uni},Symbol.toStringTag,{value:"Module"}));var CLe=function(){var t=k(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],d=[1,37],h=[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],O=[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],G=[1,66],H=[1,67],j=[1,68],q=[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],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ee=[1,91],ue=[1,92],he=[1,93],xe=[1,100],ge=[1,94],ze=[1,97],we=[1,95],ke=[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:k(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:k(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:d,5:h,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:O,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:d,5:h,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:O,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:G,5:H,6:j,7:q,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:d,5:h,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:G,5:H,6:j,7:q,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,15:Ce,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[2,12]),t(l,[2,52],{58:31,43:84,4:d,5:h,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:d,5:h,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:he,8:xe,11:ge,13:ze,16:90,17:we,18:ke,19:Be,20:Z,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:d,5:h,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:d,5:h,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z}),{46:[1,102]},t(l,[2,29],{10:le}),t(be,[2,27],{16:104,4:Ee,5:ue,6:he,8:xe,11:ge,13:ze,17:we,18:ke,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z}),{4:Ee,5:ue,6:he,8:xe,11:ge,13:ze,16:90,17:we,18:ke,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:he,8:xe,11:ge,13:ze,17:we,18:ke,19:Be,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:k(function(ve,ce){if(ce.recoverable)this.trace(ve);else{var De=new Error(ve);throw De.hash=ce,De}},"parseError"),parse:k(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 Ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ot)&&(St.yy[Ot]=this.yy[Ot]);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 Qt=Ie.options&&Ie.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(hr){De.length=De.length-2*hr,We.length=We.length-hr,Ne.length=Ne.length-hr}k(It,"popStack");function gt(){var hr;return hr=Le.pop()||Ie.lex()||Pe,typeof hr!="number"&&(hr instanceof Array&&(Le=hr,hr=Le.pop()),hr=ce.symbols_[hr]||hr),hr}k(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},Qt&&(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:k(function(ce,De){if(this.yy.parser)this.yy.parser.parseError(ce,De);else throw new Error(ce)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(ve){this.unput(this.match.slice(ve))},"less"),pastInput:k(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:k(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:k(function(){var ve=this.pastInput(),ce=new Array(ve.length+1).join("-");return ve+this.upcomingInput()+` `+ce+"^"},"showPosition"),test_match:k(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:k(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:k(function(){var ce=this.next();return ce||this.lex()},"lex"),begin:k(function(ce){this.conditionStack.push(ce)},"begin"),popState:k(function(){var ce=this.conditionStack.length-1;return ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(ce){return ce=this.conditionStack.length-1-Math.abs(ce||0),ce>=0?this.conditionStack[ce]:"INITIAL"},"topState"),pushState:k(function(ce){this.begin(ce)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(me,"Parser"),me.prototype=K,K.Parser=me,new me}();CLe.parser=CLe;var Gni=CLe,yd=Ky(),Qni=(oP=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,d,h,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:((d=Jn.quadrantChart)==null?void 0:d.quadrantLabelFontSize)||16,quadrantTextTopPadding:((h=Jn.quadrantChart)==null?void 0:h.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:yd.quadrant1Fill,quadrant2Fill:yd.quadrant2Fill,quadrant3Fill:yd.quadrant3Fill,quadrant4Fill:yd.quadrant4Fill,quadrant1TextFill:yd.quadrant1TextFill,quadrant2TextFill:yd.quadrant2TextFill,quadrant3TextFill:yd.quadrant3TextFill,quadrant4TextFill:yd.quadrant4TextFill,quadrantPointFill:yd.quadrantPointFill,quadrantPointTextFill:yd.quadrantPointTextFill,quadrantXAxisTextFill:yd.quadrantXAxisTextFill,quadrantYAxisTextFill:yd.quadrantYAxisTextFill,quadrantTitleFill:yd.quadrantTitleFill,quadrantInternalBorderStrokeFill:yd.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:yd.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,d={top:i?u:0},h=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+o.top+d.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-d.top,m=p/2,v=g/2;return{xAxisSpace:o,yAxisSpace:l,titleSpace:d,quadrantSpace:{quadrantLeft:h,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:d,quadrantTop:h,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?d/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+h+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+d+(p?d/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+h+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:h+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:h+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=yR().domain([0,1]).range([i,o+i]),l=yR().domain([0,1]).range([n+a,a]);return this.data.points.map(d=>{const h=this.classes.get(d.className);return h&&(d={...h,...d}),{x:s(d.x),y:l(d.y),fill:d.color??this.themeConfig.quadrantPointFill,radius:d.radius??this.config.pointRadius,text:{text:d.text,fill:this.themeConfig.quadrantPointTextFill,x:s(d.x),y:l(d.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:d.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:d.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)}}},k(oP,"QuadrantBuilder"),oP),Iie=(sP=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},k(sP,"InvalidStyleError"),sP);function kLe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}k(kLe,"validateHexCode");function Err(t){return!/^\d+$/.test(t)}k(Err,"validateNumber");function _rr(t){return!/^\d+px$/.test(t)}k(_rr,"validateSizeInPixels");function Cv(t){return li(t.trim(),Ye())}k(Cv,"textSanitizer");var Nc=new Qni;function Rrr(t){Nc.setData({quadrant1Text:Cv(t.text)})}k(Rrr,"setQuadrant1Text");function Drr(t){Nc.setData({quadrant2Text:Cv(t.text)})}k(Drr,"setQuadrant2Text");function Lrr(t){Nc.setData({quadrant3Text:Cv(t.text)})}k(Lrr,"setQuadrant3Text");function Mrr(t){Nc.setData({quadrant4Text:Cv(t.text)})}k(Mrr,"setQuadrant4Text");function Irr(t){Nc.setData({xAxisLeftText:Cv(t.text)})}k(Irr,"setXAxisLeftText");function Prr(t){Nc.setData({xAxisRightText:Cv(t.text)})}k(Prr,"setXAxisRightText");function Nrr(t){Nc.setData({yAxisTopText:Cv(t.text)})}k(Nrr,"setYAxisTopText");function Brr(t){Nc.setData({yAxisBottomText:Cv(t.text)})}k(Brr,"setYAxisBottomText");function Pie(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Err(i))throw new Iie(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(kLe(i))throw new Iie(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(kLe(i))throw new Iie(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(_rr(i))throw new Iie(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}k(Pie,"parseStyles");function $rr(t,e,r,n,i){const a=Pie(i);Nc.addPoints([{x:r,y:n,text:Cv(t.text),className:e,...a}])}k($rr,"addPoint");function Frr(t,e){Nc.addClass(t,Pie(e))}k(Frr,"addClass");function zrr(t){Nc.setConfig({chartWidth:t})}k(zrr,"setWidth");function Urr(t){Nc.setConfig({chartHeight:t})}k(Urr,"setHeight");function Vrr(){const t=Ye(),{themeVariables:e,quadrantChart:r}=t;return r&&Nc.setConfig(r),Nc.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}),Nc.setData({titleText:$a()}),Nc.build()}k(Vrr,"getQuadrantData");var Hni=k(function(){Nc.clear(),_a()},"clear"),Wni={setWidth:zrr,setHeight:Urr,setQuadrant1Text:Rrr,setQuadrant2Text:Drr,setQuadrant3Text:Lrr,setQuadrant4Text:Mrr,setXAxisLeftText:Irr,setXAxisRightText:Prr,setYAxisTopText:Nrr,setYAxisBottomText:Brr,parseStyles:Pie,addPoint:$rr,addClass:Frr,getQuadrantData:Vrr,clear:Hni,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},Yni=k((t,e,r,n)=>{var C,O,E;function i(_){return _==="top"?"hanging":"middle"}k(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}k(a,"getTextAnchor");function o(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}k(o,"getTransformation");const s=Ye();ye.debug(`Rendering quadrant chart +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var ce=this.next();return ce||this.lex()},"lex"),begin:k(function(ce){this.conditionStack.push(ce)},"begin"),popState:k(function(){var ce=this.conditionStack.length-1;return ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(ce){return ce=this.conditionStack.length-1-Math.abs(ce||0),ce>=0?this.conditionStack[ce]:"INITIAL"},"topState"),pushState:k(function(ce){this.begin(ce)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(me,"Parser"),me.prototype=K,K.Parser=me,new me}();CLe.parser=CLe;var Gni=CLe,yd=Ky(),Qni=(oP=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,d,h,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:((d=Jn.quadrantChart)==null?void 0:d.quadrantLabelFontSize)||16,quadrantTextTopPadding:((h=Jn.quadrantChart)==null?void 0:h.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:yd.quadrant1Fill,quadrant2Fill:yd.quadrant2Fill,quadrant3Fill:yd.quadrant3Fill,quadrant4Fill:yd.quadrant4Fill,quadrant1TextFill:yd.quadrant1TextFill,quadrant2TextFill:yd.quadrant2TextFill,quadrant3TextFill:yd.quadrant3TextFill,quadrant4TextFill:yd.quadrant4TextFill,quadrantPointFill:yd.quadrantPointFill,quadrantPointTextFill:yd.quadrantPointTextFill,quadrantXAxisTextFill:yd.quadrantXAxisTextFill,quadrantYAxisTextFill:yd.quadrantYAxisTextFill,quadrantTitleFill:yd.quadrantTitleFill,quadrantInternalBorderStrokeFill:yd.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:yd.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,d={top:i?u:0},h=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+o.top+d.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-d.top,m=p/2,v=g/2;return{xAxisSpace:o,yAxisSpace:l,titleSpace:d,quadrantSpace:{quadrantLeft:h,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:d,quadrantTop:h,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?d/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+h+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+d+(p?d/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+h+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:h+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:h+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=y5().domain([0,1]).range([i,o+i]),l=y5().domain([0,1]).range([n+a,a]);return this.data.points.map(d=>{const h=this.classes.get(d.className);return h&&(d={...h,...d}),{x:s(d.x),y:l(d.y),fill:d.color??this.themeConfig.quadrantPointFill,radius:d.radius??this.config.pointRadius,text:{text:d.text,fill:this.themeConfig.quadrantPointTextFill,x:s(d.x),y:l(d.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:d.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:d.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)}}},k(oP,"QuadrantBuilder"),oP),Iie=(sP=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},k(sP,"InvalidStyleError"),sP);function kLe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}k(kLe,"validateHexCode");function Err(t){return!/^\d+$/.test(t)}k(Err,"validateNumber");function _rr(t){return!/^\d+px$/.test(t)}k(_rr,"validateSizeInPixels");function Cv(t){return li(t.trim(),Ye())}k(Cv,"textSanitizer");var Nc=new Qni;function Rrr(t){Nc.setData({quadrant1Text:Cv(t.text)})}k(Rrr,"setQuadrant1Text");function Drr(t){Nc.setData({quadrant2Text:Cv(t.text)})}k(Drr,"setQuadrant2Text");function Lrr(t){Nc.setData({quadrant3Text:Cv(t.text)})}k(Lrr,"setQuadrant3Text");function Mrr(t){Nc.setData({quadrant4Text:Cv(t.text)})}k(Mrr,"setQuadrant4Text");function Irr(t){Nc.setData({xAxisLeftText:Cv(t.text)})}k(Irr,"setXAxisLeftText");function Prr(t){Nc.setData({xAxisRightText:Cv(t.text)})}k(Prr,"setXAxisRightText");function Nrr(t){Nc.setData({yAxisTopText:Cv(t.text)})}k(Nrr,"setYAxisTopText");function Brr(t){Nc.setData({yAxisBottomText:Cv(t.text)})}k(Brr,"setYAxisBottomText");function Pie(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Err(i))throw new Iie(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(kLe(i))throw new Iie(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(kLe(i))throw new Iie(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(_rr(i))throw new Iie(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}k(Pie,"parseStyles");function $rr(t,e,r,n,i){const a=Pie(i);Nc.addPoints([{x:r,y:n,text:Cv(t.text),className:e,...a}])}k($rr,"addPoint");function Frr(t,e){Nc.addClass(t,Pie(e))}k(Frr,"addClass");function zrr(t){Nc.setConfig({chartWidth:t})}k(zrr,"setWidth");function Urr(t){Nc.setConfig({chartHeight:t})}k(Urr,"setHeight");function Vrr(){const t=Ye(),{themeVariables:e,quadrantChart:r}=t;return r&&Nc.setConfig(r),Nc.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}),Nc.setData({titleText:$a()}),Nc.build()}k(Vrr,"getQuadrantData");var Hni=k(function(){Nc.clear(),_a()},"clear"),Wni={setWidth:zrr,setHeight:Urr,setQuadrant1Text:Rrr,setQuadrant2Text:Drr,setQuadrant3Text:Lrr,setQuadrant4Text:Mrr,setXAxisLeftText:Irr,setXAxisRightText:Prr,setYAxisTopText:Nrr,setYAxisBottomText:Brr,parseStyles:Pie,addPoint:$rr,addClass:Frr,getQuadrantData:Vrr,clear:Hni,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},Yni=k((t,e,r,n)=>{var C,O,E;function i(_){return _==="top"?"hanging":"middle"}k(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}k(a,"getTextAnchor");function o(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}k(o,"getTransformation");const s=Ye();ye.debug(`Rendering quadrant chart `+t);const l=s.securityLevel;let u;l==="sandbox"&&(u=_t("#i"+e));const h=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=h.append("g").attr("class","main"),p=((C=s.quadrantChart)==null?void 0:C.chartWidth)??500,g=((O=s.quadrantChart)==null?void 0:O.chartHeight)??500;jo(h,g,p,((E=s.quadrantChart)==null?void 0:E.useMaxWidth)??!0),h.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"),qni={draw:Yni},jni={parser:Gni,db:Wni,renderer:qni,styles:k(()=>"","styles")};const Xni=Object.freeze(Object.defineProperty({__proto__:null,diagram:jni},Symbol.toStringTag,{value:"Module"}));var OLe=function(){var t=k(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],d=[1,28],h=[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],O=[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:k(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:k(function(I,N,F,B,V,z,U){var G=z.length-1;switch(V){case 5:B.setOrientation(z[G]);break;case 9:B.setDiagramTitle(z[G].text.trim());break;case 12:B.setLineData({text:"",type:"text"},z[G]);break;case 13:B.setLineData(z[G-1],z[G]);break;case 14:B.setBarData({text:"",type:"text"},z[G]);break;case 15:B.setBarData(z[G-1],z[G]);break;case 16:this.$=z[G].trim(),B.setAccTitle(this.$);break;case 17:case 18:this.$=z[G].trim(),B.setAccDescription(this.$);break;case 19:this.$=z[G-1];break;case 20:case 30:this.$=[z[G-2],...z[G]];break;case 21:case 31:this.$=[z[G]];break;case 22:this.$={value:Number(z[G-1]),label:z[G]};break;case 23:this.$={value:Number(z[G]),label:""};break;case 24:B.setXAxisTitle(z[G]);break;case 25:B.setXAxisTitle(z[G-1]);break;case 26:B.setXAxisTitle({type:"text",text:""});break;case 27:B.setXAxisBand(z[G]);break;case 28:B.setXAxisRangeData(Number(z[G-2]),Number(z[G]));break;case 29:this.$=z[G-1];break;case 32:B.setYAxisTitle(z[G]);break;case 33:B.setYAxisTitle(z[G-1]);break;case 34:B.setYAxisTitle({type:"text",text:""});break;case 35:B.setYAxisRangeData(Number(z[G-2]),Number(z[G]));break;case 39:this.$={text:z[G],type:"text"};break;case 40:this.$={text:z[G],type:"text"};break;case 41:this.$={text:z[G],type:"markdown"};break;case 42:this.$=z[G];break;case 43:this.$=z[G-1]+""+z[G];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:d,43:h,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:d,43:h,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:d,43:h,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:d,43:h,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:d,43:h,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(O,[2,39],{41:55,42:d,43:h,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x}),t(O,[2,40]),t(O,[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:d,43:h,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:d,43:h,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:k(function(I,N){if(N.recoverable)this.trace(I);else{var F=new Error(I);throw F.hash=N,F}},"parseError"),parse:k(function(I){var N=this,F=[0],B=[],V=[null],z=[],U=this.table,G="",H=0,j=0,q=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}k(Ce,"popStack");function Oe(){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}k(Oe,"lex");for(var Ee,ue,he,xe,ge={},ze,we,ke,Be;;){if(ue=F[F.length-1],this.defaultActions[ue]?he=this.defaultActions[ue]:((Ee===null||typeof Ee>"u")&&(Ee=Oe()),he=U[ue]&&U[ue][Ee]),typeof he>"u"||!he.length||!he[0]){var Z="";Be=[];for(ze in U[ue])this.terminals_[ze]&&ze>q&&Be.push("'"+this.terminals_[ze]+"'");J.showPosition?Z="Parse error on line "+(H+1)+`: `+J.showPosition()+` Expecting `+Be.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":Z="Parse error on line "+(H+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(he[0]instanceof Array&&he.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ue+", token: "+Ee);switch(he[0]){case 1:F.push(Ee),V.push(J.yytext),z.push(J.yylloc),F.push(he[1]),Ee=null,j=J.yyleng,G=J.yytext,H=J.yylineno,pe=J.yylloc;break;case 2:if(we=this.productions_[he[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,[G,j,H,ee.yy,he[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_[he[1]][0]),V.push(ge.$),z.push(ge._$),ke=U[F[F.length-2]][F[F.length-1]],F.push(ke);break;case 3:return!0}}return!0},"parse")},R=function(){var M={EOF:1,parseError:k(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(I){this.unput(this.match.slice(I))},"less"),pastInput:k(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:k(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:k(function(){var I=this.pastInput(),N=new Array(I.length+1).join("-");return I+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:k(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:k(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:k(function(){var N=this.next();return N||this.lex()},"lex"),begin:k(function(N){this.conditionStack.push(N)},"begin"),popState:k(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:k(function(N){this.begin(N)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(D,"Parser"),D.prototype=L,L.Parser=D,new D}();OLe.parser=OLe;var Kni=OLe;function ELe(t){return t.type==="bar"}k(ELe,"isBarPlot");function Nie(t){return t.type==="band"}k(Nie,"isBandAxisData");function RD(t){return t.type==="linear"}k(RD,"isLinearAxisData");var Grr=(lP=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=jkt(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}},k(lP,"TextDimensionCalculatorWithFont"),lP),Qrr=.7,Hrr=.2,Wrr=(cP=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(){Qrr*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Qrr*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=Hrr*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=Hrr*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():[]}},k(cP,"BaseAxis"),cP),Zni=(uP=class extends Wrr{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=qbe().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=qbe().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]}},k(uP,"BandAxis"),uP),Jni=(dP=class extends Wrr{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=yR().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=yR().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},k(dP,"LinearAxis"),dP);function _Le(t,e,r,n){const i=new Grr(n);return Nie(t)?new Zni(e,r,t.categories,t.title,i):new Jni(e,r,[t.min,t.max],t.title,i)}k(_Le,"getAxis");var eii=(hP=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}},k(hP,"ChartTitle"),hP);function Yrr(t,e,r,n){const i=new Grr(n);return new eii(i,t,e,r)}k(Yrr,"getChartTitleComponent");var tii=(fP=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=H7().y(i=>i[0]).x(i=>i[1])(e):r=H7().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 d=this.plotData.pointLabels[s];d&&(this.orientation==="horizontal"?o.push({x:u+10,y:l,text:d,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):o.push({x:l,y:u-10,text:d,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}},k(fP,"LinePlot"),fP),rii=(pP=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}))}]}},k(pP,"BarPlot"),pP),nii=(gP=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 tii(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new rii(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},k(gP,"BasePlot"),gP);function qrr(t,e,r){return new nii(t,e,r)}k(qrr,"getPlotComponent");var iii=(mP=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Yrr(e,r,n,i),plot:qrr(e,r,n),xAxis:_Le(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:_Le(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}},k(mP,"Orchestrator"),mP),aii=(vP=class{static build(e,r,n,i){return new iii(e,r,n,i).getDrawableElement()}},k(vP,"XYChartBuilder"),vP),cU=0,jrr,uU=MLe(),dU=LLe(),Ui=ILe(),RLe=dU.plotColorPalette.split(",").map(t=>t.trim()),Bie=!1,DLe=!1;function LLe(){const t=Ky(),e=Dr();return uo(t.xyChart,e.themeVariables.xyChart)}k(LLe,"getChartDefaultThemeConfig");function MLe(){const t=Dr();return uo(Jn.xyChart,t.xyChart)}k(MLe,"getChartDefaultConfig");function ILe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}k(ILe,"getChartDefaultData");function hU(t){const e=Dr();return li(t.trim(),e)}k(hU,"textSanitizer");function Xrr(t){jrr=t}k(Xrr,"setTmpSVGG");function Krr(t){t==="horizontal"?uU.chartOrientation="horizontal":uU.chartOrientation="vertical"}k(Krr,"setOrientation");function Zrr(t){Ui.xAxis.title=hU(t.text)}k(Zrr,"setXAxisTitle");function PLe(t,e){Ui.xAxis={type:"linear",title:Ui.xAxis.title,min:t,max:e},Bie=!0}k(PLe,"setXAxisRangeData");function Jrr(t){Ui.xAxis={type:"band",title:Ui.xAxis.title,categories:t.map(e=>hU(e.text))},Bie=!0}k(Jrr,"setXAxisBand");function enr(t){Ui.yAxis.title=hU(t.text)}k(enr,"setYAxisTitle");function tnr(t,e){Ui.yAxis={type:"linear",title:Ui.yAxis.title,min:t,max:e},DLe=!0}k(tnr,"setYAxisRangeData");function rnr(t){const e=Math.min(...t),r=Math.max(...t),n=RD(Ui.yAxis)?Ui.yAxis.min:1/0,i=RD(Ui.yAxis)?Ui.yAxis.max:-1/0;Ui.yAxis={type:"linear",title:Ui.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}k(rnr,"setYAxisRangeFromPlotData");function NLe(t){let e=[];if(t.length===0)return e;if(!Bie){const r=RD(Ui.xAxis)?Ui.xAxis.min:1/0,n=RD(Ui.xAxis)?Ui.xAxis.max:-1/0;PLe(Math.min(r,1),Math.max(n,t.length))}if(Nie(Ui.xAxis)&&t.length>Ui.xAxis.categories.length&&(t=t.slice(0,Ui.xAxis.categories.length)),DLe||rnr(t),Nie(Ui.xAxis)&&(e=Ui.xAxis.categories.map((r,n)=>[r,t[n]])),RD(Ui.xAxis)){const r=Ui.xAxis.min,n=Ui.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}k(NLe,"transformDataWithoutCategory");function BLe(t){return RLe[t===0?0:t%RLe.length]}k(BLe,"getPlotColorFromPalette");function nnr(t,e){const r=e.map(o=>o.value),n=e.map(o=>o.label?hU(o.label):""),i=NLe(r),a=n.some(o=>o!=="");Ui.plots.push({type:"line",strokeFill:BLe(cU),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),cU++}k(nnr,"setLineData");function inr(t,e){const r=e.map(i=>i.value),n=NLe(r);Ui.plots.push({type:"bar",fill:BLe(cU),data:n}),cU++}k(inr,"setBarData");function anr(){if(Ui.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Ui.title=$a(),aii.build(uU,Ui,dU,jrr)}k(anr,"getDrawableElem");function onr(){return dU}k(onr,"getChartThemeConfig");function snr(){return uU}k(snr,"getChartConfig");function lnr(){return Ui}k(lnr,"getXYChartData");var oii=k(function(){_a(),cU=0,uU=MLe(),Ui=ILe(),dU=LLe(),RLe=dU.plotColorPalette.split(",").map(t=>t.trim()),Bie=!1,DLe=!1},"clear"),sii={getDrawableElem:anr,clear:oii,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,setOrientation:Krr,setXAxisTitle:Zrr,setXAxisRangeData:PLe,setXAxisBand:Jrr,setYAxisTitle:enr,setYAxisRangeData:tnr,setLineData:nnr,setBarData:inr,setTmpSVGG:Xrr,getChartThemeConfig:onr,getChartConfig:snr,getXYChartData:lnr},lii=k((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"}k(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}k(u,"getTextAnchor");function d(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}k(d,"getTextTransformation"),ye.debug(`Rendering xychart chart +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var N=this.next();return N||this.lex()},"lex"),begin:k(function(N){this.conditionStack.push(N)},"begin"),popState:k(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:k(function(N){this.begin(N)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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 k(D,"Parser"),D.prototype=L,L.Parser=D,new D}();OLe.parser=OLe;var Kni=OLe;function ELe(t){return t.type==="bar"}k(ELe,"isBarPlot");function Nie(t){return t.type==="band"}k(Nie,"isBandAxisData");function RD(t){return t.type==="linear"}k(RD,"isLinearAxisData");var Grr=(lP=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=jkt(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}},k(lP,"TextDimensionCalculatorWithFont"),lP),Qrr=.7,Hrr=.2,Wrr=(cP=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(){Qrr*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Qrr*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=Hrr*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=Hrr*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():[]}},k(cP,"BaseAxis"),cP),Zni=(uP=class extends Wrr{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=qbe().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=qbe().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]}},k(uP,"BandAxis"),uP),Jni=(dP=class extends Wrr{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=y5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=y5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},k(dP,"LinearAxis"),dP);function _Le(t,e,r,n){const i=new Grr(n);return Nie(t)?new Zni(e,r,t.categories,t.title,i):new Jni(e,r,[t.min,t.max],t.title,i)}k(_Le,"getAxis");var eii=(hP=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}},k(hP,"ChartTitle"),hP);function Yrr(t,e,r,n){const i=new Grr(n);return new eii(i,t,e,r)}k(Yrr,"getChartTitleComponent");var tii=(fP=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=H7().y(i=>i[0]).x(i=>i[1])(e):r=H7().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 d=this.plotData.pointLabels[s];d&&(this.orientation==="horizontal"?o.push({x:u+10,y:l,text:d,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):o.push({x:l,y:u-10,text:d,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}},k(fP,"LinePlot"),fP),rii=(pP=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}))}]}},k(pP,"BarPlot"),pP),nii=(gP=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 tii(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new rii(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},k(gP,"BasePlot"),gP);function qrr(t,e,r){return new nii(t,e,r)}k(qrr,"getPlotComponent");var iii=(mP=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Yrr(e,r,n,i),plot:qrr(e,r,n),xAxis:_Le(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:_Le(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}},k(mP,"Orchestrator"),mP),aii=(vP=class{static build(e,r,n,i){return new iii(e,r,n,i).getDrawableElement()}},k(vP,"XYChartBuilder"),vP),cU=0,jrr,uU=MLe(),dU=LLe(),Ui=ILe(),RLe=dU.plotColorPalette.split(",").map(t=>t.trim()),Bie=!1,DLe=!1;function LLe(){const t=Ky(),e=Dr();return uo(t.xyChart,e.themeVariables.xyChart)}k(LLe,"getChartDefaultThemeConfig");function MLe(){const t=Dr();return uo(Jn.xyChart,t.xyChart)}k(MLe,"getChartDefaultConfig");function ILe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}k(ILe,"getChartDefaultData");function hU(t){const e=Dr();return li(t.trim(),e)}k(hU,"textSanitizer");function Xrr(t){jrr=t}k(Xrr,"setTmpSVGG");function Krr(t){t==="horizontal"?uU.chartOrientation="horizontal":uU.chartOrientation="vertical"}k(Krr,"setOrientation");function Zrr(t){Ui.xAxis.title=hU(t.text)}k(Zrr,"setXAxisTitle");function PLe(t,e){Ui.xAxis={type:"linear",title:Ui.xAxis.title,min:t,max:e},Bie=!0}k(PLe,"setXAxisRangeData");function Jrr(t){Ui.xAxis={type:"band",title:Ui.xAxis.title,categories:t.map(e=>hU(e.text))},Bie=!0}k(Jrr,"setXAxisBand");function enr(t){Ui.yAxis.title=hU(t.text)}k(enr,"setYAxisTitle");function tnr(t,e){Ui.yAxis={type:"linear",title:Ui.yAxis.title,min:t,max:e},DLe=!0}k(tnr,"setYAxisRangeData");function rnr(t){const e=Math.min(...t),r=Math.max(...t),n=RD(Ui.yAxis)?Ui.yAxis.min:1/0,i=RD(Ui.yAxis)?Ui.yAxis.max:-1/0;Ui.yAxis={type:"linear",title:Ui.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}k(rnr,"setYAxisRangeFromPlotData");function NLe(t){let e=[];if(t.length===0)return e;if(!Bie){const r=RD(Ui.xAxis)?Ui.xAxis.min:1/0,n=RD(Ui.xAxis)?Ui.xAxis.max:-1/0;PLe(Math.min(r,1),Math.max(n,t.length))}if(Nie(Ui.xAxis)&&t.length>Ui.xAxis.categories.length&&(t=t.slice(0,Ui.xAxis.categories.length)),DLe||rnr(t),Nie(Ui.xAxis)&&(e=Ui.xAxis.categories.map((r,n)=>[r,t[n]])),RD(Ui.xAxis)){const r=Ui.xAxis.min,n=Ui.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}k(NLe,"transformDataWithoutCategory");function BLe(t){return RLe[t===0?0:t%RLe.length]}k(BLe,"getPlotColorFromPalette");function nnr(t,e){const r=e.map(o=>o.value),n=e.map(o=>o.label?hU(o.label):""),i=NLe(r),a=n.some(o=>o!=="");Ui.plots.push({type:"line",strokeFill:BLe(cU),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),cU++}k(nnr,"setLineData");function inr(t,e){const r=e.map(i=>i.value),n=NLe(r);Ui.plots.push({type:"bar",fill:BLe(cU),data:n}),cU++}k(inr,"setBarData");function anr(){if(Ui.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Ui.title=$a(),aii.build(uU,Ui,dU,jrr)}k(anr,"getDrawableElem");function onr(){return dU}k(onr,"getChartThemeConfig");function snr(){return uU}k(snr,"getChartConfig");function lnr(){return Ui}k(lnr,"getXYChartData");var oii=k(function(){_a(),cU=0,uU=MLe(),Ui=ILe(),dU=LLe(),RLe=dU.plotColorPalette.split(",").map(t=>t.trim()),Bie=!1,DLe=!1},"clear"),sii={getDrawableElem:anr,clear:oii,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,setOrientation:Krr,setXAxisTitle:Zrr,setXAxisRangeData:PLe,setXAxisBand:Jrr,setYAxisTitle:enr,setYAxisRangeData:tnr,setLineData:nnr,setBarData:inr,setTmpSVGG:Xrr,getChartThemeConfig:onr,getChartConfig:snr,getXYChartData:lnr},lii=k((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"}k(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}k(u,"getTextAnchor");function d(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}k(d,"getTextTransformation"),ye.debug(`Rendering xychart chart `+t);const h=iu(e),f=h.append("g").attr("class","main"),p=f.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");jo(h,o.height,o.width,!0),h.attr("viewBox",`0 0 ${o.width} ${o.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(h.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}k(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};k(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}),O=Math.floor(Math.min(...C)),E=k(_=>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",`${O}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};k(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)),O=k(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",O).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=>d(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"),cii={draw:lii},uii={parser:Kni,db:sii,renderer:cii};const dii=Object.freeze(Object.defineProperty({__proto__:null,diagram:uii},Symbol.toStringTag,{value:"Module"}));var $Le=function(){var t=k(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],d=[1,28],h=[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],O=[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],G=[1,86],H=[1,87],j=[1,88],q=[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],Oe=[1,110],Ee=[1,106],ue=[1,107],he=[1,108],xe=[1,109],ge=[1,111],ze=[1,116],we=[1,117],ke=[1,114],Be=[1,115],Z={trace:k(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:k(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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:d,24:h,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:O,89:S,90:T},{30:63,33:62,75:O,89:S,90:T},{30:64,33:62,75:O,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:O,89:S,90:T},{73:79,75:B,76:V,78:81,79:82,80:z,81:U,82:G,83:H,84:j,85:q,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:G,83:H,84:j,85:q,86:ne,87:X,88:J},{30:94,33:62,75:O,76:V,89:S,90:T},{5:[1,95]},{30:96,33:62,75:O,89:S,90:T},{5:[1,97]},{30:98,33:62,75:O,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:G,83:H,84:j,85:q,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:Oe,28:105,31:Ee,34:ue,36:he,38:xe,40:ge},{27:[1,112],76:V},{5:ze,40:we,56:113,57:ke,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:G,83:H,84:j,85:q,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:Oe,28:126,31:Ee,34:ue,36:he,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:ke,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:G,83:H,84:j,85:q,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:Oe,28:145,31:Ee,34:ue,36:he,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:ke,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:Oe,28:159,31:Ee,34:ue,36:he,38:xe,40:ge},{5:Oe,28:160,31:Ee,34:ue,36:he,38:xe,40:ge},{5:Oe,28:161,31:Ee,34:ue,36:he,38:xe,40:ge},{5:Oe,28:162,31:Ee,34:ue,36:he,38:xe,40:ge},{5:ze,40:we,56:163,57:ke,59:Be},{5:ze,40:we,56:164,57:ke,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:k(function(K,se){if(se.recoverable)this.trace(K);else{var me=new Error(K);throw me.hash=se,me}},"parseError"),parse:k(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}k(St,"popStack");function Ot(){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}k(Ot,"lex");for(var ut,Qt,It,gt,Te={},Bt,Et,At,Mt;;){if(Qt=me[me.length-1],this.defaultActions[Qt]?It=this.defaultActions[Qt]:((ut===null||typeof ut>"u")&&(ut=Ot()),It=De[Qt]&&De[Qt][ut]),typeof It>"u"||!It.length||!It[0]){var qr="";Mt=[];for(Bt in De[Qt])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: "+Qt+", 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:k(function(se,me){if(this.yy.parser)this.yy.parser.parseError(se,me);else throw new Error(se)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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). @@ -2310,7 +2310,7 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":qr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),mii=gii,cnr={};Lj(cnr,{draw:()=>vii});var vii=k(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=S3(e,i);l.type=n.type,l.layoutAlgorithm=b$(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 BR(l,u);const d=8;un.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(u,d,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),yii={parser:hii,get db(){return new fii},renderer:cnr,styles:mii};const bii=Object.freeze(Object.defineProperty({__proto__:null,diagram:yii},Symbol.toStringTag,{value:"Module"}));var FLe=function(){var t=k(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],d=[1,17],h=[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],O=[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],G=[1,83],H=[1,84],j=[1,85],q=[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],Oe=[1,95],Ee=[1,96],ue=[1,97],he=[1,98],xe=[1,99],ge=[1,100],ze=[1,101],we=[1,102],ke=[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:k(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:k(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:d,22:h,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:O,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:d,22:h,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:O,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:G,82:H,83:j,84:q,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:Oe,94:Ee,95:ue,96:he,97:xe,98:ge,99:ze,100:we,101:ke,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:G,82:H,83:j,84:q,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:Oe,94:Ee,95:ue,96:he,97:xe,98:ge,99:ze,100:we,101:ke,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:k(function(je,$e){if($e.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=$e,Ze}},"parseError"),parse:k(function(je){var $e=this,Ze=[0],He=[],et=[null],Pe=[],yt=this.table,Ie="",St=0,Ot=0,ut=2,Qt=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}k(Mt,"popStack");function qr(){var $r;return $r=He.pop()||gt.lex()||Qt,typeof $r!="number"&&($r instanceof Array&&(He=$r,$r=He.pop()),$r=$e.symbols_[$r]||$r),$r}k(qr,"lex");for(var Me,at,wt,Tt,hr={},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 On="";Ur=[];for(jr in yt[at])this.terminals_[jr]&&jr>ut&&Ur.push("'"+this.terminals_[jr]+"'");gt.showPosition?On="Parse error on line "+(St+1)+`: +`},"getStyles"),mii=gii,cnr={};Lj(cnr,{draw:()=>vii});var vii=k(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=S3(e,i);l.type=n.type,l.layoutAlgorithm=b$(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 B5(l,u);const d=8;un.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(u,d,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),yii={parser:hii,get db(){return new fii},renderer:cnr,styles:mii};const bii=Object.freeze(Object.defineProperty({__proto__:null,diagram:yii},Symbol.toStringTag,{value:"Module"}));var FLe=function(){var t=k(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],d=[1,17],h=[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],O=[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],G=[1,83],H=[1,84],j=[1,85],q=[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],Oe=[1,95],Ee=[1,96],ue=[1,97],he=[1,98],xe=[1,99],ge=[1,100],ze=[1,101],we=[1,102],ke=[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:k(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:k(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:d,22:h,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:O,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:d,22:h,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:O,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:G,82:H,83:j,84:q,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:Oe,94:Ee,95:ue,96:he,97:xe,98:ge,99:ze,100:we,101:ke,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:G,82:H,83:j,84:q,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:Oe,94:Ee,95:ue,96:he,97:xe,98:ge,99:ze,100:we,101:ke,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:d,22:h,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:O,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:k(function(je,$e){if($e.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=$e,Ze}},"parseError"),parse:k(function(je){var $e=this,Ze=[0],He=[],et=[null],Pe=[],yt=this.table,Ie="",St=0,Ot=0,ut=2,Qt=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}k(Mt,"popStack");function qr(){var $r;return $r=He.pop()||gt.lex()||Qt,typeof $r!="number"&&($r instanceof Array&&(He=$r,$r=He.pop()),$r=$e.symbols_[$r]||$r),$r}k(qr,"lex");for(var Me,at,wt,Tt,hr={},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 On="";Ur=[];for(jr in yt[at])this.terminals_[jr]&&jr>ut&&Ur.push("'"+this.terminals_[jr]+"'");gt.showPosition?On="Parse error on line "+(St+1)+`: `+gt.showPosition()+` Expecting `+Ur.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":On="Parse error on line "+(St+1)+": Unexpected "+(Me==Qt?"end of input":"'"+(this.terminals_[Me]||Me)+"'"),this.parseError(On,{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,Ot=gt.yyleng,Ie=gt.yytext,St=gt.yylineno,Et=gt.yylloc;break;case 2:if(Ir=this.productions_[wt[1]][1],hr.$=et[et.length-Ir],hr._$={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&&(hr._$.range=[Pe[Pe.length-(Ir||1)].range[0],Pe[Pe.length-1].range[1]]),Tt=this.performAction.apply(hr,[Ie,Ot,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(hr.$),Pe.push(hr._$),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:k(function($e,Ze){if(this.yy.parser)this.yy.parser.parseError($e,Ze);else throw new Error($e)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(je){this.unput(this.match.slice(je))},"less"),pastInput:k(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:k(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:k(function(){var je=this.pastInput(),$e=new Array(je.length+1).join("-");return je+this.upcomingInput()+` @@ -2476,7 +2476,7 @@ Expecting `+Ur.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":On="Parse erro 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: "+Ot+", 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]]),Qt=this.performAction.apply(It,[ce,Le,De,Ze.yy,ut[1],me,oe].concat(je)),typeof Qt<"u")return Qt;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:k(function(ae,K){if(this.yy.parser)this.yy.parser.parseError(ae,K);else throw new Error(ae)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(be){this.unput(this.match.slice(be))},"less"),pastInput:k(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:k(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:k(function(){var be=this.pastInput(),ae=new Array(be.length+1).join("-");return be+this.upcomingInput()+` `+ae+"^"},"showPosition"),test_match:k(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:k(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:k(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:k(function(ae){this.conditionStack.push(ae)},"begin"),popState:k(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:k(function(ae){this.begin(ae)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(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}();ke.lexer=Be;function Z(){this.yy={}}return k(Z,"Parser"),Z.prototype=ke,ke.Parser=Z,new Z}();GLe.parser=GLe;var Snr=GLe,Tnr=["#","+","~","-",""],Cnr=(xP=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+bw(this.id);this.memberType==="method"&&(e+=`(${bw(this.parameters.trim())})`,this.returnType&&(e+=" : "+bw(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(Tnr.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);Tnr.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:""}${bw(this.id)}${this.memberType==="method"?`(${bw(this.parameters)})${this.returnType?" : "+bw(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""}}},k(xP,"ClassMember"),xP),Gie="classId-",knr=0,xO=k(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),Onr=(X2=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=k(e=>{const r=C_e();_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(Xy.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=k(()=>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=xO(a[0]),n=xO(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Xt.sanitizeText(e,Ye());r&&(r=xO(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:Gie+a+"-"+knr}),knr++}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(xO(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new Cnr(a,"method")):a&&i.members.push(new Cnr(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)),xO(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=Gie+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=xO(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=Gie+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=xO(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,d=u&&r?r:i[o];this.namespaces.has(s)?u&&(this.namespaces.get(s).explicit=!0):this.namespaces.set(s,this.createNamespaceNode(s,d,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),d={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(d)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),d={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(d);const h=(s=this.classes.get(l.class))==null?void 0:s.id;if(h){const f={id:`edgeNote${l.index}`,start:l.id,end:h,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:RR(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()}}},k(X2,"ClassDB"),X2),gai=k(t=>`g.classGroup text { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:k(function(ae){this.conditionStack.push(ae)},"begin"),popState:k(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:k(function(ae){this.begin(ae)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(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}();ke.lexer=Be;function Z(){this.yy={}}return k(Z,"Parser"),Z.prototype=ke,ke.Parser=Z,new Z}();GLe.parser=GLe;var Snr=GLe,Tnr=["#","+","~","-",""],Cnr=(xP=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+bw(this.id);this.memberType==="method"&&(e+=`(${bw(this.parameters.trim())})`,this.returnType&&(e+=" : "+bw(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(Tnr.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);Tnr.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:""}${bw(this.id)}${this.memberType==="method"?`(${bw(this.parameters)})${this.returnType?" : "+bw(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""}}},k(xP,"ClassMember"),xP),Gie="classId-",knr=0,xO=k(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),Onr=(X2=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=k(e=>{const r=C_e();_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(Xy.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=k(()=>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=xO(a[0]),n=xO(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Xt.sanitizeText(e,Ye());r&&(r=xO(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:Gie+a+"-"+knr}),knr++}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(xO(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new Cnr(a,"method")):a&&i.members.push(new Cnr(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)),xO(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=Gie+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=xO(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=Gie+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=xO(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,d=u&&r?r:i[o];this.namespaces.has(s)?u&&(this.namespaces.get(s).explicit=!0):this.namespaces.set(s,this.createNamespaceNode(s,d,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),d={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(d)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),d={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(d);const h=(s=this.classes.get(l.class))==null?void 0:s.id;if(h){const f={id:`edgeNote${l.index}`,start:l.id,end:h,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:R5(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()}}},k(X2,"ClassDB"),X2),gai=k(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2676,12 +2676,12 @@ g.classGroup line { text-align: center; } ${M9()} -`,"getStyles"),Enr=gai,mai=k((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"),vai=k(function(t,e){return e.db.getClasses()},"getClasses"),yai=k(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=S3(e,i);s.type=n.type,s.layoutAlgorithm=b$(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 BR(s,l);const u=8;un.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),_nr={getClasses:vai,draw:yai,getDir:mai},bai={parser:Snr,get db(){return new Onr},renderer:_nr,styles:Enr,init:k(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const xai=Object.freeze(Object.defineProperty({__proto__:null,diagram:bai},Symbol.toStringTag,{value:"Module"}));var wai={parser:Snr,get db(){return new Onr},renderer:_nr,styles:Enr,init:k(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Aai=Object.freeze(Object.defineProperty({__proto__:null,diagram:wai},Symbol.toStringTag,{value:"Module"}));var QLe=function(){var t=k(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],d=[1,19],h=[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],O=[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:k(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:k(function(B,V,z,U,G,H,j){var q=H.length-1;switch(G){case 3:return U.setRootDoc(H[q]),H[q];case 4:this.$=[];break;case 5:H[q]!="nl"&&(H[q-1].push(H[q]),this.$=H[q-1]);break;case 6:case 7:this.$=H[q];break;case 8:this.$="nl";break;case 12:this.$=H[q];break;case 13:const ee=H[q-1];ee.description=U.trimColon(H[q]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:H[q-2],state2:H[q]};break;case 15:const te=U.trimColon(H[q]);this.$={stmt:"relation",state1:H[q-3],state2:H[q-1],description:te};break;case 19:this.$={stmt:"state",id:H[q-3],type:"default",description:"",doc:H[q-1]};break;case 20:var ne=H[q],X=H[q-2].trim();if(H[q].match(":")){var J=H[q].split(":");ne=J[0],X=[X,J[1]]}this.$={stmt:"state",id:ne,type:"default",description:X};break;case 21:this.$={stmt:"state",id:H[q-3],type:"default",description:H[q-5],doc:H[q-1]};break;case 22:this.$={stmt:"state",id:H[q],type:"fork"};break;case 23:this.$={stmt:"state",id:H[q],type:"join"};break;case 24:this.$={stmt:"state",id:H[q],type:"choice"};break;case 25:this.$={stmt:"state",id:U.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:H[q-1].trim(),note:{position:H[q-2].trim(),text:H[q].trim()}};break;case 29:this.$=H[q].trim(),U.setAccTitle(this.$);break;case 30:case 31:this.$=H[q].trim(),U.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:H[q-3],url:H[q-2],tooltip:H[q-1]};break;case 33:this.$={stmt:"click",id:H[q-3],url:H[q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:H[q-1].trim(),classes:H[q].trim()};break;case 36:this.$={stmt:"style",id:H[q-1].trim(),styleClass:H[q].trim()};break;case 37:this.$={stmt:"applyClass",id:H[q-1].trim(),styleClass:H[q].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:H[q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:H[q-2].trim(),classes:[H[q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:H[q-2].trim(),classes:[H[q].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:d,24:h,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:O,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:d,24:h,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:O,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:h,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:h,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:d,24:h,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:O,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:d,24:h,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:O,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:k(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:k(function(B){var V=this,z=[0],U=[],G=[null],H=[],j=this.table,q="",ne=0,X=0,J=2,ee=1,te=H.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 Oe=pe.yylloc;H.push(Oe);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,G.length=G.length-K,H.length=H.length-K}k(ue,"popStack");function he(){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}k(he,"lex");for(var xe,ge,ze,we,ke={},Be,Z,le,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((xe===null||typeof xe>"u")&&(xe=he()),ze=j[ge]&&j[ge][xe]),typeof ze>"u"||!ze.length||!ze[0]){var ae="";be=[];for(Be in j[ge])this.terminals_[Be]&&Be>J&&be.push("'"+this.terminals_[Be]+"'");pe.showPosition?ae="Parse error on line "+(ne+1)+`: +`,"getStyles"),Enr=gai,mai=k((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"),vai=k(function(t,e){return e.db.getClasses()},"getClasses"),yai=k(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=S3(e,i);s.type=n.type,s.layoutAlgorithm=b$(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 B5(s,l);const u=8;un.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),_nr={getClasses:vai,draw:yai,getDir:mai},bai={parser:Snr,get db(){return new Onr},renderer:_nr,styles:Enr,init:k(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const xai=Object.freeze(Object.defineProperty({__proto__:null,diagram:bai},Symbol.toStringTag,{value:"Module"}));var wai={parser:Snr,get db(){return new Onr},renderer:_nr,styles:Enr,init:k(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Aai=Object.freeze(Object.defineProperty({__proto__:null,diagram:wai},Symbol.toStringTag,{value:"Module"}));var QLe=function(){var t=k(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],d=[1,19],h=[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],O=[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:k(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:k(function(B,V,z,U,G,H,j){var q=H.length-1;switch(G){case 3:return U.setRootDoc(H[q]),H[q];case 4:this.$=[];break;case 5:H[q]!="nl"&&(H[q-1].push(H[q]),this.$=H[q-1]);break;case 6:case 7:this.$=H[q];break;case 8:this.$="nl";break;case 12:this.$=H[q];break;case 13:const ee=H[q-1];ee.description=U.trimColon(H[q]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:H[q-2],state2:H[q]};break;case 15:const te=U.trimColon(H[q]);this.$={stmt:"relation",state1:H[q-3],state2:H[q-1],description:te};break;case 19:this.$={stmt:"state",id:H[q-3],type:"default",description:"",doc:H[q-1]};break;case 20:var ne=H[q],X=H[q-2].trim();if(H[q].match(":")){var J=H[q].split(":");ne=J[0],X=[X,J[1]]}this.$={stmt:"state",id:ne,type:"default",description:X};break;case 21:this.$={stmt:"state",id:H[q-3],type:"default",description:H[q-5],doc:H[q-1]};break;case 22:this.$={stmt:"state",id:H[q],type:"fork"};break;case 23:this.$={stmt:"state",id:H[q],type:"join"};break;case 24:this.$={stmt:"state",id:H[q],type:"choice"};break;case 25:this.$={stmt:"state",id:U.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:H[q-1].trim(),note:{position:H[q-2].trim(),text:H[q].trim()}};break;case 29:this.$=H[q].trim(),U.setAccTitle(this.$);break;case 30:case 31:this.$=H[q].trim(),U.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:H[q-3],url:H[q-2],tooltip:H[q-1]};break;case 33:this.$={stmt:"click",id:H[q-3],url:H[q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:H[q-1].trim(),classes:H[q].trim()};break;case 36:this.$={stmt:"style",id:H[q-1].trim(),styleClass:H[q].trim()};break;case 37:this.$={stmt:"applyClass",id:H[q-1].trim(),styleClass:H[q].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:H[q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:H[q-2].trim(),classes:[H[q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:H[q-2].trim(),classes:[H[q].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:d,24:h,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:O,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:d,24:h,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:O,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:h,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:h,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:d,24:h,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:O,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:d,24:h,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:O,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:k(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:k(function(B){var V=this,z=[0],U=[],G=[null],H=[],j=this.table,q="",ne=0,X=0,J=2,ee=1,te=H.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 Oe=pe.yylloc;H.push(Oe);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,G.length=G.length-K,H.length=H.length-K}k(ue,"popStack");function he(){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}k(he,"lex");for(var xe,ge,ze,we,ke={},Be,Z,le,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((xe===null||typeof xe>"u")&&(xe=he()),ze=j[ge]&&j[ge][xe]),typeof ze>"u"||!ze.length||!ze[0]){var ae="";be=[];for(Be in j[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:Oe,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),G.push(pe.yytext),H.push(pe.yylloc),z.push(ze[1]),xe=null,X=pe.yyleng,q=pe.yytext,ne=pe.yylineno,Oe=pe.yylloc;break;case 2:if(Z=this.productions_[ze[1]][1],ke.$=G[G.length-Z],ke._$={first_line:H[H.length-(Z||1)].first_line,last_line:H[H.length-1].last_line,first_column:H[H.length-(Z||1)].first_column,last_column:H[H.length-1].last_column},Ee&&(ke._$.range=[H[H.length-(Z||1)].range[0],H[H.length-1].range[1]]),we=this.performAction.apply(ke,[q,X,ne,ie.yy,ze[1],G,H].concat(te)),typeof we<"u")return we;Z&&(z=z.slice(0,-1*Z*2),G=G.slice(0,-1*Z),H=H.slice(0,-1*Z)),z.push(this.productions_[ze[1]][0]),G.push(ke.$),H.push(ke._$),le=j[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:k(function(V,z){if(this.yy.parser)this.yy.parser.parseError(V,z);else throw new Error(V)},"parseError"),setInput:k(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:k(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:k(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 G=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=[G[0],G[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(B){this.unput(this.match.slice(B))},"less"),pastInput:k(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:k(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:k(function(){var B=this.pastInput(),V=new Array(B.length+1).join("-");return B+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:k(function(B,V){var z,U,G;if(this.options.backtrack_lexer&&(G={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&&(G.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 H in G)this[H]=G[H];return!1}return!1},"test_match"),next:k(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 G=this._currentRules(),H=0;HV[0].length)){if(V=z,U=H,this.options.backtrack_lexer){if(B=this.test_match(z,G[H]),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,G[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:k(function(){var V=this.next();return V||this.lex()},"lex"),begin:k(function(V){this.conditionStack.push(V)},"begin"),popState:k(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:k(function(V){this.begin(V)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(V,z,U,G){function H(){const j=z.yytext.indexOf("%%");if(j===0)return!1;if(j>0){const q=z.yytext.slice(0,j),ne=z.yytext.slice(j);ne&&V.lexer.unput(ne),z.yytext=q}return!0}switch(k(H,"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 H()?(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 H()?(this.popState(),"ID"):void 0;case 66:return H()?(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 H()?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 k(N,"Parser"),N.prototype=M,M.Parser=N,new N}();QLe.parser=QLe;var Rnr=QLe,Sai="TB",Dnr="TB",Lnr="dir",MD="state",ID="root",HLe="relation",Tai="classDef",Cai="style",kai="applyClass",pU="default",Mnr="divider",Inr="fill:none",Pnr="fill: #333",Nnr="c",Bnr="markdown",$nr="normal",WLe="rect",YLe="rectWithTitle",Oai="stateStart",Eai="stateEnd",Fnr="divider",znr="roundedWithTitle",_ai="note",Rai="noteGroup",gU="statediagram",Dai="state",Lai=`${gU}-${Dai}`,Unr="transition",Mai="note",Iai="note-edge",Pai=`${Unr} ${Iai}`,Nai=`${gU}-${Mai}`,Bai="cluster",$ai=`${gU}-${Bai}`,Fai="cluster-alt",zai=`${gU}-${Fai}`,Vnr="parent",Gnr="note",Uai="state",qLe="----",Vai=`${qLe}${Gnr}`,Qnr=`${qLe}${Vnr}`,Hnr=k((t,e=Dnr)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Gai=k(function(t,e){return e.db.getClasses()},"getClasses"),Qai=k(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=S3(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 BR(s,l);const d=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(h){ye.error("❌ Error injecting clickable links:",h)}un.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(l,d,gU,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Hai={getClasses:Gai,draw:Qai,getDir:Hnr},Qie=new Map,Q2=0;function Hie(t="",e=0,r="",n=qLe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Uai}-${t}${i}-${e}`}k(Hie,"stateDomId");var Wai=k((t,e,r,n,i,a,o,s)=>{ye.trace("items",e),e.forEach(l=>{switch(l.stmt){case MD:vU(t,l,r,n,i,a,o,s);break;case pU:vU(t,l,r,n,i,a,o,s);break;case HLe:{vU(t,l.state1,r,n,i,a,o,s),vU(t,l.state2,r,n,i,a,o,s);const u=o==="neo",d={id:"edge"+Q2,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Inr,labelStyle:"",label:Xt.sanitizeText(l.description??"",Ye()),arrowheadStyle:Pnr,labelpos:Nnr,labelType:Bnr,thickness:$nr,classes:Unr,look:o};i.push(d),Q2++}break}})},"setupDoc"),Wnr=k((t,e=Dnr)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function mU(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)}k(mU,"insertOrUpdateNode");function Ynr(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}k(Ynr,"getClassesFromDbInfo");function qnr(t){return(t==null?void 0:t.styles)??[]}k(qnr,"getStylesFromDbInfo");var vU=k((t,e,r,n,i,a,o,s)=>{var p,g,m;const l=e.id,u=r.get(l),d=Ynr(u),h=qnr(u),f=Ye();if(ye.info("dataFetcher parsedItem",e,u,h),l!=="root"){let v=WLe;e.start===!0?v=Oai:e.start===!1&&(v=Eai),e.type!==pU&&(v=e.type),Qie.get(l)||Qie.set(l,{id:l,shape:v,description:Xt.sanitizeText(l,f),cssClasses:`${d} ${Lai}`,cssStyles:h});const y=Qie.get(l);e.description&&(Array.isArray(y.description)?(y.shape=YLe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=YLe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=WLe,y.description=e.description),y.description=Xt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===YLe&&(y.type==="group"?y.shape=znr:y.shape=WLe),!y.type&&e.doc&&(ye.info("Setting cluster for XCX",l,Wnr(e)),y.type="group",y.isGroup=!0,y.dir=Wnr(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Mnr?Fnr:znr,y.cssClasses=`${y.cssClasses} ${$ai} ${a?zai:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Hie(l,Q2),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(b.shape===Fnr&&(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:_ai,label:e.note.text,labelType:"markdown",cssClasses:Nai,cssStyles:[],cssCompiledStyles:[],id:l+Vai+"-"+Q2,domId:Hie(l,Q2,Gnr),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:o,position:e.note.position},w=l+Qnr,A={labelStyle:"",shape:Rai,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Qnr,domId:Hie(l,Q2,Vnr),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};Q2++,A.id=w,x.parentId=w,mU(n,A,s),mU(n,x,s),mU(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:Inr,labelStyle:"",classes:Pai,arrowheadStyle:Pnr,labelpos:Nnr,labelType:Bnr,thickness:$nr,look:o})}else mU(n,b,s)}e.doc&&(ye.trace("Adding nodes children "),Wai(e,e.doc,r,n,i,!a,o,s))},"dataFetcher"),Yai=k(()=>{Qie.clear(),Q2=0},"reset"),bd={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},jnr=k(()=>new Map,"newClassesList"),Xnr=k(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Wie=k(t=>JSON.parse(JSON.stringify(t)),"clone"),wO=(EO=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=jnr(),this.documents={root:Xnr()},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 MD:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case HLe:this.addRelation(i.state1,i.state2,i.description);break;case Tai:this.addStyleClass(i.id.trim(),i.classes);break;case Cai:this.handleStyleDef(i);break;case kai: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();Yai(),vU(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===HLe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===MD&&(r.id===bd.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==ID&&r.stmt!==MD||!r.doc)return;const i=[];let a=[];for(const o of r.doc)if(o.type===Mnr){const s=Wie(o);s.doc=Wie(a),i.push(s),a=[]}else a.push(o);if(i.length>0&&a.length>0){const o={stmt:MD,id:lkt(),type:"divider",doc:Wie(a)};i.push(Wie(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}getRootDocV2(){return this.docTranslator({id:ID,stmt:ID},{id:ID,stmt:ID,doc:this.rootDoc},!0),{id:ID,doc:this.rootDoc}}addState(e,r=pU,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:MD,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const d=this.currentDocument.states.get(u);if(!d)throw new Error(`State not found: ${u}`);d.doc||(d.doc=n),d.type||(d.type=r)}if(i&&(ye.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(h=>this.addDescription(u,h.trim()))),a){const d=this.currentDocument.states.get(u);if(!d)throw new Error(`State not found: ${u}`);d.note=a,d.note.text=Xt.sanitizeText(d.note.text,Ye())}o&&(ye.info("Setting state classes",u,o),(Array.isArray(o)?o:[o]).forEach(h=>this.setCssClass(u,h.trim()))),s&&(ye.info("Setting state styles",u,s),(Array.isArray(s)?s:[s]).forEach(h=>this.setStyle(u,h.trim()))),l&&(ye.info("Setting state styles",u,s),(Array.isArray(l)?l:[l]).forEach(h=>this.setTextStyle(u,h.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Xnr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=jnr(),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===bd.START_NODE?(this.startEndCount++,`${bd.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=pU){return e===bd.START_NODE?bd.START_TYPE:r}endIdIfNeeded(e=""){return e===bd.END_NODE?(this.startEndCount++,`${bd.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=pU){return e===bd.END_NODE?bd.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(bd.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(bd.COLOR_KEYWORD).exec(i)){const s=a.replace(bd.FILL_KEYWORD,bd.BG_FILL).replace(bd.COLOR_KEYWORD,bd.FILL_KEYWORD);n.textStyles.push(s)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=C_e();_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(Xy.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===Lnr)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Sai}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Lnr,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:Hnr(this.getRootDocV2())}}getConfig(){return Ye().state}},k(EO,"StateDB"),EO.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},EO),qai=k(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var V=this.next();return V||this.lex()},"lex"),begin:k(function(V){this.conditionStack.push(V)},"begin"),popState:k(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:k(function(V){this.begin(V)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(V,z,U,G){function H(){const j=z.yytext.indexOf("%%");if(j===0)return!1;if(j>0){const q=z.yytext.slice(0,j),ne=z.yytext.slice(j);ne&&V.lexer.unput(ne),z.yytext=q}return!0}switch(k(H,"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 H()?(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 H()?(this.popState(),"ID"):void 0;case 66:return H()?(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 H()?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 k(N,"Parser"),N.prototype=M,M.Parser=N,new N}();QLe.parser=QLe;var Rnr=QLe,Sai="TB",Dnr="TB",Lnr="dir",MD="state",ID="root",HLe="relation",Tai="classDef",Cai="style",kai="applyClass",pU="default",Mnr="divider",Inr="fill:none",Pnr="fill: #333",Nnr="c",Bnr="markdown",$nr="normal",WLe="rect",YLe="rectWithTitle",Oai="stateStart",Eai="stateEnd",Fnr="divider",znr="roundedWithTitle",_ai="note",Rai="noteGroup",gU="statediagram",Dai="state",Lai=`${gU}-${Dai}`,Unr="transition",Mai="note",Iai="note-edge",Pai=`${Unr} ${Iai}`,Nai=`${gU}-${Mai}`,Bai="cluster",$ai=`${gU}-${Bai}`,Fai="cluster-alt",zai=`${gU}-${Fai}`,Vnr="parent",Gnr="note",Uai="state",qLe="----",Vai=`${qLe}${Gnr}`,Qnr=`${qLe}${Vnr}`,Hnr=k((t,e=Dnr)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Gai=k(function(t,e){return e.db.getClasses()},"getClasses"),Qai=k(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=S3(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 B5(s,l);const d=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(h){ye.error("❌ Error injecting clickable links:",h)}un.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),ck(l,d,gU,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Hai={getClasses:Gai,draw:Qai,getDir:Hnr},Qie=new Map,Q2=0;function Hie(t="",e=0,r="",n=qLe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Uai}-${t}${i}-${e}`}k(Hie,"stateDomId");var Wai=k((t,e,r,n,i,a,o,s)=>{ye.trace("items",e),e.forEach(l=>{switch(l.stmt){case MD:vU(t,l,r,n,i,a,o,s);break;case pU:vU(t,l,r,n,i,a,o,s);break;case HLe:{vU(t,l.state1,r,n,i,a,o,s),vU(t,l.state2,r,n,i,a,o,s);const u=o==="neo",d={id:"edge"+Q2,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Inr,labelStyle:"",label:Xt.sanitizeText(l.description??"",Ye()),arrowheadStyle:Pnr,labelpos:Nnr,labelType:Bnr,thickness:$nr,classes:Unr,look:o};i.push(d),Q2++}break}})},"setupDoc"),Wnr=k((t,e=Dnr)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function mU(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)}k(mU,"insertOrUpdateNode");function Ynr(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}k(Ynr,"getClassesFromDbInfo");function qnr(t){return(t==null?void 0:t.styles)??[]}k(qnr,"getStylesFromDbInfo");var vU=k((t,e,r,n,i,a,o,s)=>{var p,g,m;const l=e.id,u=r.get(l),d=Ynr(u),h=qnr(u),f=Ye();if(ye.info("dataFetcher parsedItem",e,u,h),l!=="root"){let v=WLe;e.start===!0?v=Oai:e.start===!1&&(v=Eai),e.type!==pU&&(v=e.type),Qie.get(l)||Qie.set(l,{id:l,shape:v,description:Xt.sanitizeText(l,f),cssClasses:`${d} ${Lai}`,cssStyles:h});const y=Qie.get(l);e.description&&(Array.isArray(y.description)?(y.shape=YLe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=YLe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=WLe,y.description=e.description),y.description=Xt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===YLe&&(y.type==="group"?y.shape=znr:y.shape=WLe),!y.type&&e.doc&&(ye.info("Setting cluster for XCX",l,Wnr(e)),y.type="group",y.isGroup=!0,y.dir=Wnr(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Mnr?Fnr:znr,y.cssClasses=`${y.cssClasses} ${$ai} ${a?zai:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Hie(l,Q2),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(b.shape===Fnr&&(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:_ai,label:e.note.text,labelType:"markdown",cssClasses:Nai,cssStyles:[],cssCompiledStyles:[],id:l+Vai+"-"+Q2,domId:Hie(l,Q2,Gnr),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:o,position:e.note.position},w=l+Qnr,A={labelStyle:"",shape:Rai,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Qnr,domId:Hie(l,Q2,Vnr),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};Q2++,A.id=w,x.parentId=w,mU(n,A,s),mU(n,x,s),mU(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:Inr,labelStyle:"",classes:Pai,arrowheadStyle:Pnr,labelpos:Nnr,labelType:Bnr,thickness:$nr,look:o})}else mU(n,b,s)}e.doc&&(ye.trace("Adding nodes children "),Wai(e,e.doc,r,n,i,!a,o,s))},"dataFetcher"),Yai=k(()=>{Qie.clear(),Q2=0},"reset"),bd={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},jnr=k(()=>new Map,"newClassesList"),Xnr=k(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Wie=k(t=>JSON.parse(JSON.stringify(t)),"clone"),wO=(EO=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=jnr(),this.documents={root:Xnr()},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 MD:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case HLe:this.addRelation(i.state1,i.state2,i.description);break;case Tai:this.addStyleClass(i.id.trim(),i.classes);break;case Cai:this.handleStyleDef(i);break;case kai: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();Yai(),vU(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===HLe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===MD&&(r.id===bd.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==ID&&r.stmt!==MD||!r.doc)return;const i=[];let a=[];for(const o of r.doc)if(o.type===Mnr){const s=Wie(o);s.doc=Wie(a),i.push(s),a=[]}else a.push(o);if(i.length>0&&a.length>0){const o={stmt:MD,id:lkt(),type:"divider",doc:Wie(a)};i.push(Wie(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}getRootDocV2(){return this.docTranslator({id:ID,stmt:ID},{id:ID,stmt:ID,doc:this.rootDoc},!0),{id:ID,doc:this.rootDoc}}addState(e,r=pU,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:MD,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const d=this.currentDocument.states.get(u);if(!d)throw new Error(`State not found: ${u}`);d.doc||(d.doc=n),d.type||(d.type=r)}if(i&&(ye.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(h=>this.addDescription(u,h.trim()))),a){const d=this.currentDocument.states.get(u);if(!d)throw new Error(`State not found: ${u}`);d.note=a,d.note.text=Xt.sanitizeText(d.note.text,Ye())}o&&(ye.info("Setting state classes",u,o),(Array.isArray(o)?o:[o]).forEach(h=>this.setCssClass(u,h.trim()))),s&&(ye.info("Setting state styles",u,s),(Array.isArray(s)?s:[s]).forEach(h=>this.setStyle(u,h.trim()))),l&&(ye.info("Setting state styles",u,s),(Array.isArray(l)?l:[l]).forEach(h=>this.setTextStyle(u,h.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Xnr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=jnr(),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===bd.START_NODE?(this.startEndCount++,`${bd.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=pU){return e===bd.START_NODE?bd.START_TYPE:r}endIdIfNeeded(e=""){return e===bd.END_NODE?(this.startEndCount++,`${bd.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=pU){return e===bd.END_NODE?bd.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(bd.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(bd.COLOR_KEYWORD).exec(i)){const s=a.replace(bd.FILL_KEYWORD,bd.BG_FILL).replace(bd.COLOR_KEYWORD,bd.FILL_KEYWORD);n.textStyles.push(s)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=C_e();_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(Xy.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===Lnr)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Sai}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Lnr,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:Hnr(this.getRootDocV2())}}getConfig(){return Ye().state}},k(EO,"StateDB"),EO.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},EO),qai=k(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -3044,12 +3044,12 @@ Expecting `+G.join(", ")+", got '"+(this.terminals_[M]||M)+"'":H="Parse error on ${t.actor5?`fill: ${t.actor5}`:""}; } ${M9()} -`,"getStyles"),Toi=Soi,ZLe=k(function(t,e){return Mte(t,e)},"drawRect"),Coi=k(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=SR().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)+")")}k(a,"smile");function o(l){const u=SR().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)+")")}k(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 k(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),nir=k(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"),iir=k(function(t,e){return K9n(t,e)},"drawText"),koi=k(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)}k(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,iir(t,e)},"drawLabel"),Ooi=k(function(t,e,r){const n=t.append("g"),i=mf();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,ZLe(n,i),air(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),JLe=-1,Eoi=k(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");JLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+JLe).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"),Coi(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=mf();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,ZLe(a,s);let l=e.x+14;e.people.forEach(u=>{const d=e.actors[u].color,h={cx:l,cy:e.y,r:7,fill:d,stroke:"#000",title:u,pos:e.actors[u].position};nir(a,h),l+=10}),air(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),_oi=k(function(t,e){BUt(t,e)},"drawBackgroundRect"),air=function(){function t(i,a,o,s,l,u,d,h){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(t,"byText");function e(i,a,o,s,l,u,d,h,f){const{taskFontSize:p,taskFontFamily:g}=h,m=i.split(//gi);for(let v=0;v{const a=Cb[i].color,o={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Cb[i].position};xU.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 d=i.split(" ");let h="";s=t.append("text").attr("visibility","hidden"),d.forEach(f=>{const p=h?`${h} ${f}`:f;if(s.text(p),s.node().getBoundingClientRect().width>r){if(h&&u.push(h),h=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);h=m}}else h=p}),h&&u.push(h),s.remove()}u.forEach((d,h)=>{const f={x:40,y:n+7+h*20,fill:"#666",text:d,textMargin:e.boxTextMargin??5},g=xU.drawText(t,f).node().getBoundingClientRect().width;g>Yie&&g>e.leftMargin-g&&(Yie=g)}),n+=Math.max(20,u.length*20)})}k(oir,"drawActorLegend");var am=Ye().journey,H2=0,Loi=k(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 d=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Hp.init();const h=d.select("#"+e);xU.initGraphics(h,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in Cb)delete Cb[w];let m=0;g.forEach(w=>{Cb[w]={color:am.actorColours[m%am.actorColours.length],position:m},m++}),oir(h),H2=am.leftMargin+Yie,Hp.insert(0,0,H2,Object.keys(Cb).length*50),Moi(h,f,0,e);const v=Hp.getBounds();p&&h.append("text").text(p).attr("x",H2).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*am.diagramMarginY,b=H2+v.stopx+2*am.diagramMarginX;jo(h,y,b,am.useMaxWidth),h.append("line").attr("x1",H2).attr("y1",am.height*4).attr("x2",b-H2-4).attr("y2",am.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;h.attr("viewBox",`${v.startx} -25 ${b} ${y+x}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",y+x+25)},"draw"),Hp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:k(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:k(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:k(function(t,e,r,n){const i=Ye().journey,a=this;let o=0;function s(l){return k(function(d){o++;const h=a.sequenceItems.length-o+1;a.updateVal(d,"starty",e-h*i.boxMargin,Math.min),a.updateVal(d,"stopy",n+h*i.boxMargin,Math.max),a.updateVal(Hp.data,"startx",t-h*i.boxMargin,Math.min),a.updateVal(Hp.data,"stopx",r+h*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(d,"startx",t-h*i.boxMargin,Math.min),a.updateVal(d,"stopx",r+h*i.boxMargin,Math.max),a.updateVal(Hp.data,"starty",e-h*i.boxMargin,Math.min),a.updateVal(Hp.data,"stopy",n+h*i.boxMargin,Math.max))},"updateItemBounds")}k(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:k(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(Hp.data,"startx",i,Math.min),this.updateVal(Hp.data,"starty",o,Math.min),this.updateVal(Hp.data,"stopx",a,Math.max),this.updateVal(Hp.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:k(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:k(function(){return this.verticalPos},"getVerticalPos"),getBounds:k(function(){return this.data},"getBounds")},eMe=am.sectionFills,sir=am.sectionColours,Moi=k(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",d="black",h=0;for(const[f,p]of e.entries()){if(a!==p.section){u=eMe[l%eMe.length],h=l%eMe.length,d=sir[l%sir.length];let m=0;const v=p.section;for(let b=f;b(Cb[v]&&(m[v]=Cb[v]),m),{});p.x=f*i.taskMargin+f*i.width+H2,p.y=s,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=d,p.fill=u,p.num=h,p.actors=g,xU.drawTask(t,p,i,n),Hp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),lir={setConf:Doi,draw:Loi},Ioi={parser:poi,db:rir,renderer:lir,styles:Toi,init:k(t=>{lir.setConf(t.journey),rir.clear()},"init")};const Poi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ioi},Symbol.toStringTag,{value:"Module"}));var tMe=function(){var t=k(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:k(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:k(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:k(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:k(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,S=0,T=2,C=1,O=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(q){m.length=m.length-2*q,y.length=y.length-q,b.length=b.length-q}k(D,"popStack");function M(){var q;return q=v.pop()||E.lex()||C,typeof q!="number"&&(q instanceof Array&&(v=q,q=v.pop()),q=g.symbols_[q]||q),q}k(M,"lex");for(var I,N,F,B,V={},z,U,G,H;;){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 j="";H=[];for(z in x[N])this.terminals_[z]&&z>T&&H.push("'"+this.terminals_[z]+"'");E.showPosition?j="Parse error on line "+(A+1)+`: +`,"getStyles"),Toi=Soi,ZLe=k(function(t,e){return Mte(t,e)},"drawRect"),Coi=k(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=S5().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)+")")}k(a,"smile");function o(l){const u=S5().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)+")")}k(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 k(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),nir=k(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"),iir=k(function(t,e){return K9n(t,e)},"drawText"),koi=k(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)}k(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,iir(t,e)},"drawLabel"),Ooi=k(function(t,e,r){const n=t.append("g"),i=mf();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,ZLe(n,i),air(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),JLe=-1,Eoi=k(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");JLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+JLe).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"),Coi(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=mf();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,ZLe(a,s);let l=e.x+14;e.people.forEach(u=>{const d=e.actors[u].color,h={cx:l,cy:e.y,r:7,fill:d,stroke:"#000",title:u,pos:e.actors[u].position};nir(a,h),l+=10}),air(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),_oi=k(function(t,e){BUt(t,e)},"drawBackgroundRect"),air=function(){function t(i,a,o,s,l,u,d,h){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(t,"byText");function e(i,a,o,s,l,u,d,h,f){const{taskFontSize:p,taskFontFamily:g}=h,m=i.split(//gi);for(let v=0;v{const a=Cb[i].color,o={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Cb[i].position};xU.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 d=i.split(" ");let h="";s=t.append("text").attr("visibility","hidden"),d.forEach(f=>{const p=h?`${h} ${f}`:f;if(s.text(p),s.node().getBoundingClientRect().width>r){if(h&&u.push(h),h=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);h=m}}else h=p}),h&&u.push(h),s.remove()}u.forEach((d,h)=>{const f={x:40,y:n+7+h*20,fill:"#666",text:d,textMargin:e.boxTextMargin??5},g=xU.drawText(t,f).node().getBoundingClientRect().width;g>Yie&&g>e.leftMargin-g&&(Yie=g)}),n+=Math.max(20,u.length*20)})}k(oir,"drawActorLegend");var am=Ye().journey,H2=0,Loi=k(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 d=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Hp.init();const h=d.select("#"+e);xU.initGraphics(h,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in Cb)delete Cb[w];let m=0;g.forEach(w=>{Cb[w]={color:am.actorColours[m%am.actorColours.length],position:m},m++}),oir(h),H2=am.leftMargin+Yie,Hp.insert(0,0,H2,Object.keys(Cb).length*50),Moi(h,f,0,e);const v=Hp.getBounds();p&&h.append("text").text(p).attr("x",H2).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*am.diagramMarginY,b=H2+v.stopx+2*am.diagramMarginX;jo(h,y,b,am.useMaxWidth),h.append("line").attr("x1",H2).attr("y1",am.height*4).attr("x2",b-H2-4).attr("y2",am.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;h.attr("viewBox",`${v.startx} -25 ${b} ${y+x}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",y+x+25)},"draw"),Hp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:k(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:k(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:k(function(t,e,r,n){const i=Ye().journey,a=this;let o=0;function s(l){return k(function(d){o++;const h=a.sequenceItems.length-o+1;a.updateVal(d,"starty",e-h*i.boxMargin,Math.min),a.updateVal(d,"stopy",n+h*i.boxMargin,Math.max),a.updateVal(Hp.data,"startx",t-h*i.boxMargin,Math.min),a.updateVal(Hp.data,"stopx",r+h*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(d,"startx",t-h*i.boxMargin,Math.min),a.updateVal(d,"stopx",r+h*i.boxMargin,Math.max),a.updateVal(Hp.data,"starty",e-h*i.boxMargin,Math.min),a.updateVal(Hp.data,"stopy",n+h*i.boxMargin,Math.max))},"updateItemBounds")}k(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:k(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(Hp.data,"startx",i,Math.min),this.updateVal(Hp.data,"starty",o,Math.min),this.updateVal(Hp.data,"stopx",a,Math.max),this.updateVal(Hp.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:k(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:k(function(){return this.verticalPos},"getVerticalPos"),getBounds:k(function(){return this.data},"getBounds")},eMe=am.sectionFills,sir=am.sectionColours,Moi=k(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",d="black",h=0;for(const[f,p]of e.entries()){if(a!==p.section){u=eMe[l%eMe.length],h=l%eMe.length,d=sir[l%sir.length];let m=0;const v=p.section;for(let b=f;b(Cb[v]&&(m[v]=Cb[v]),m),{});p.x=f*i.taskMargin+f*i.width+H2,p.y=s,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=d,p.fill=u,p.num=h,p.actors=g,xU.drawTask(t,p,i,n),Hp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),lir={setConf:Doi,draw:Loi},Ioi={parser:poi,db:rir,renderer:lir,styles:Toi,init:k(t=>{lir.setConf(t.journey),rir.clear()},"init")};const Poi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ioi},Symbol.toStringTag,{value:"Module"}));var tMe=function(){var t=k(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:k(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:k(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:k(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:k(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,S=0,T=2,C=1,O=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(q){m.length=m.length-2*q,y.length=y.length-q,b.length=b.length-q}k(D,"popStack");function M(){var q;return q=v.pop()||E.lex()||C,typeof q!="number"&&(q instanceof Array&&(v=q,q=v.pop()),q=g.symbols_[q]||q),q}k(M,"lex");for(var I,N,F,B,V={},z,U,G,H;;){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 j="";H=[];for(z in x[N])this.terminals_[z]&&z>T&&H.push("'"+this.terminals_[z]+"'");E.showPosition?j="Parse error on line "+(A+1)+`: `+E.showPosition()+` Expecting `+H.join(", ")+", got '"+(this.terminals_[I]||I)+"'":j="Parse error on line "+(A+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(j,{text:E.match,token:this.terminals_[I]||I,line:E.yylineno,loc:L,expected:H})}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(O)),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._$),G=x[m[m.length-2]][m[m.length-1]],m.push(G);break;case 3:return!0}}return!0},"parse")},d=function(){var f={EOF:1,parseError:k(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:k(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:k(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:k(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:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(p){this.unput(this.match.slice(p))},"less"),pastInput:k(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:k(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:k(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:k(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:k(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:k(function(){var g=this.next();return g||this.lex()},"lex"),begin:k(function(g){this.conditionStack.push(g)},"begin"),popState:k(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:k(function(g){this.begin(g)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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=d;function h(){this.yy={}}return k(h,"Parser"),h.prototype=u,u.Parser=h,new h}();tMe.parser=tMe;var Noi=tMe,cir={};Lj(cir,{addEvent:()=>bir,addSection:()=>gir,addTask:()=>yir,addTaskOrg:()=>xir,clear:()=>hir,default:()=>Boi,getCommonDb:()=>dir,getDirection:()=>pir,getSections:()=>mir,getTasks:()=>vir,setDirection:()=>fir});var ND="",uir=0,rMe="LR",nMe=[],qie=[],BD=[],dir=k(()=>ube,"getCommonDb"),hir=k(function(){nMe.length=0,qie.length=0,ND="",BD.length=0,rMe="LR",_a()},"clear"),fir=k(function(t){rMe=t},"setDirection"),pir=k(function(){return rMe},"getDirection"),gir=k(function(t){ND=t,nMe.push(t)},"addSection"),mir=k(function(){return nMe},"getSections"),vir=k(function(){let t=wir();const e=100;let r=0;for(;!t&&rr.id===uir-1).events.push(t)},"addEvent"),xir=k(function(t){const e={section:ND,type:ND,description:t,task:t,classes:[]};qie.push(e)},"addTaskOrg"),wir=k(function(){const t=k(function(r){return BD[r].processed},"compileTask");let e=!0;for(const[r,n]of BD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Boi={clear:hir,getCommonDb:dir,getDirection:pir,setDirection:fir,addSection:gir,getSections:mir,getTasks:vir,addTask:yir,addTaskOrg:xir,addEvent:bir},Air=0,jie=k(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"),$oi=k(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=SR().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)+")")}k(a,"smile");function o(l){const u=SR().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)+")")}k(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 k(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),Foi=k(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"),Sir=k(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"),zoi=k(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)}k(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,Sir(t,e)},"drawLabel"),Uoi=k(function(t,e,r){const n=t.append("g"),i=aMe();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,jie(n,i),Tir(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),iMe=-1,Voi=k(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");iMe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+iMe).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"),$oi(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=aMe();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,jie(a,s),Tir(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),Goi=k(function(t,e){jie(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Qoi=k(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),aMe=k(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Tir=function(){function t(i,a,o,s,l,u,d,h){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(t,"byText");function e(i,a,o,s,l,u,d,h,f){const{taskFontSize:p,taskFontFamily:g}=h,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 d=0;de||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))})}k(oMe,"wrap");var Woi=k(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,d=r%u-1,h=t.append("g");e.section=d,h.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+d));const f=h.append("g"),p=h.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(oMe,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})`),qoi(f,e,d,i,n),s==="neo"&&(h.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 O=S.select("defs");(O.empty()?S.append("defs"):O).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"),Yoi=k(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(oMe,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"),qoi=k(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-"+Air++).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"),fh={drawRect:jie,drawCircle:Foi,drawSection:Uoi,drawText:Sir,drawLabel:zoi,drawTask:Voi,drawBackgroundRect:Goi,getTextObj:Qoi,getNoteRect:aMe,initGraphics:Hoi,drawNode:Woi,getVirtualNodeHeight:Yoi},joi=k(function(t,e,r,n){var D,M,I;const i=Ye(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:d}=s,h=((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),fh.initGraphics(m,e);const b=n.db.getSections();ye.debug("sections",b);let x=0,w=0,A=0,S=0,T=50+h,C=50;S=50;let O=0,E=!0;b.forEach(function(N){const F={number:O,descr:N,section:O,width:150,padding:20,maxHeight:x},B=fh.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=fh.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 G={descr:U,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};z+=fh.getVirtualNodeHeight(m,G,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:O,descr:N,section:O,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:x};ye.debug("sectionNode",B);const V=m.append("g"),z=fh.drawNode(V,B,O,i,e);ye.debug("sectionNode output",z),V.attr("transform",`translate(${T}, ${S})`),C+=x+50,F.length>0&&Cir(m,F,O,T,C,w,i,_,P,x,!1,e),T+=200*Math.max(F.length,1),C=S,O++}):(E=!1,Cir(m,v,O,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+h:L.width/2-h).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",h).attr("y1",A).attr("x2",L.width+3*h).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",d).attr("stop-opacity",1)}dR(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((I=i.timeline)==null?void 0:I.useMaxWidth)??!1)},"draw"),Cir=k(function(t,e,r,n,i,a,o,s,l,u,d,h){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=fh.drawNode(m,g,r,o,h).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+Xoi(t,p.events,r,n,i,o,h),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(#${h}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,d&&!((f=o.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Xoi=k(function(t,e,r,n,i,a,o){let s=0;const l=i;i=i+100;for(const u of e){const d={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ye.debug("eventNode",d);const h=t.append("g").attr("class","eventWrapper"),p=fh.drawNode(h,d,r,a,o,!0).height;s=s+p,h.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),Koi={setConf:k(()=>{},"setConf"),draw:joi},Xie=200,kb=5,Zoi=Xie+kb*2,sMe=Xie+100,Joi=sMe+kb*2,kir=10,esi=0,Oir=20,Eir=20,_ir=30,Rir=50,tsi=k(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=iu(e);o.append("g");const s=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ye.debug("task",s),fh.initGraphics(o);const u=n.db.getSections();ye.debug("sections",u);let d=0,h=0;const f=50+a;let p=50;const g=p,m=f,v=Zoi+Eir,y=Joi+Rir,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,S=Math.max(50,v+y-kb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:S,padding:kb,maxHeight:d},z=fh.getVirtualNodeHeight(o,V,i);ye.debug("sectionHeight before draw",z),d=Math.max(d,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:Xie,padding:kb,maxHeight:h},U=fh.getVirtualNodeHeight(o,z,i);ye.debug("taskHeight before draw",U),h=Math.max(h,U);let G=0;for(const H of V.events){const j={descr:H,section:V.section,number:V.section,width:sMe,padding:kb,maxHeight:50};G+=fh.getVirtualNodeHeight(o,j,i)}V.events.length>0&&(G+=(V.events.length-1)*kir),T=Math.max(T,G)+esi}ye.debug("maxSectionHeight before draw",d),ye.debug("maxTaskHeight before draw",h);const O=Math.max(h,T)+_ir;w?u.forEach(B=>{const V=s.filter(X=>X.section===B),z={number:x,descr:B,section:x,width:S,padding:kb,maxHeight:d};ye.debug("sectionNode",z);const U=o.append("g"),G=fh.drawNode(U,z,x,i);ye.debug("sectionNode output",G);const H=A-v;U.attr("transform",`translate(${H}, ${p})`);const j=p+G.height+Oir;V.length>0&&Dir(o,V,x,A,j,h,i,O,!1);const q=V.length,ne=G.height+Oir+O*Math.max(q,1)-(q>0?_ir*2:0);p+=ne,x++}):Dir(o,s,x,A,p,h,i,O,!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[_]=s1(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(),dR(void 0,o,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Dir=k(function(t,e,r,n,i,a,o,s,l){var u;for(const d of e){const h={descr:d.task,section:r,number:r,width:Xie,padding:kb,maxHeight:a};ye.debug("taskNode",h);const f=t.append("g").attr("class","taskWrapper"),p=fh.drawNode(f,h,r,o),g=p.height;ye.debug("taskHeight after draw",g);const m=n-Eir-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),d.events&&d.events.length>0){const v=i,y=n+Rir;rsi(t,d.events,r,n,y,v,o)}i=i+s,l&&!((u=o.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),rsi=k(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:sMe,padding:kb,maxHeight:0};ye.debug("eventNode",u);const d=t.append("g").attr("class","eventWrapper"),f=fh.drawNode(d,u,r,o).height;d.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+kir}return s-a},"drawEvents"),nsi={setConf:k(()=>{},"setConf"),draw:tsi},isi=k(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:k(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:k(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:k(function(g){this.begin(g)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(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=d;function h(){this.yy={}}return k(h,"Parser"),h.prototype=u,u.Parser=h,new h}();tMe.parser=tMe;var Noi=tMe,cir={};Lj(cir,{addEvent:()=>bir,addSection:()=>gir,addTask:()=>yir,addTaskOrg:()=>xir,clear:()=>hir,default:()=>Boi,getCommonDb:()=>dir,getDirection:()=>pir,getSections:()=>mir,getTasks:()=>vir,setDirection:()=>fir});var ND="",uir=0,rMe="LR",nMe=[],qie=[],BD=[],dir=k(()=>ube,"getCommonDb"),hir=k(function(){nMe.length=0,qie.length=0,ND="",BD.length=0,rMe="LR",_a()},"clear"),fir=k(function(t){rMe=t},"setDirection"),pir=k(function(){return rMe},"getDirection"),gir=k(function(t){ND=t,nMe.push(t)},"addSection"),mir=k(function(){return nMe},"getSections"),vir=k(function(){let t=wir();const e=100;let r=0;for(;!t&&rr.id===uir-1).events.push(t)},"addEvent"),xir=k(function(t){const e={section:ND,type:ND,description:t,task:t,classes:[]};qie.push(e)},"addTaskOrg"),wir=k(function(){const t=k(function(r){return BD[r].processed},"compileTask");let e=!0;for(const[r,n]of BD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Boi={clear:hir,getCommonDb:dir,getDirection:pir,setDirection:fir,addSection:gir,getSections:mir,getTasks:vir,addTask:yir,addTaskOrg:xir,addEvent:bir},Air=0,jie=k(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"),$oi=k(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=S5().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)+")")}k(a,"smile");function o(l){const u=S5().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)+")")}k(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 k(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),Foi=k(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"),Sir=k(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"),zoi=k(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)}k(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,Sir(t,e)},"drawLabel"),Uoi=k(function(t,e,r){const n=t.append("g"),i=aMe();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,jie(n,i),Tir(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),iMe=-1,Voi=k(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");iMe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+iMe).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"),$oi(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=aMe();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,jie(a,s),Tir(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),Goi=k(function(t,e){jie(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Qoi=k(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),aMe=k(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Tir=function(){function t(i,a,o,s,l,u,d,h){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(t,"byText");function e(i,a,o,s,l,u,d,h,f){const{taskFontSize:p,taskFontFamily:g}=h,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 d=0;de||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))})}k(oMe,"wrap");var Woi=k(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,d=r%u-1,h=t.append("g");e.section=d,h.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+d));const f=h.append("g"),p=h.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(oMe,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})`),qoi(f,e,d,i,n),s==="neo"&&(h.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 O=S.select("defs");(O.empty()?S.append("defs"):O).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"),Yoi=k(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(oMe,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"),qoi=k(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-"+Air++).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"),fh={drawRect:jie,drawCircle:Foi,drawSection:Uoi,drawText:Sir,drawLabel:zoi,drawTask:Voi,drawBackgroundRect:Goi,getTextObj:Qoi,getNoteRect:aMe,initGraphics:Hoi,drawNode:Woi,getVirtualNodeHeight:Yoi},joi=k(function(t,e,r,n){var D,M,I;const i=Ye(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:d}=s,h=((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),fh.initGraphics(m,e);const b=n.db.getSections();ye.debug("sections",b);let x=0,w=0,A=0,S=0,T=50+h,C=50;S=50;let O=0,E=!0;b.forEach(function(N){const F={number:O,descr:N,section:O,width:150,padding:20,maxHeight:x},B=fh.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=fh.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 G={descr:U,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};z+=fh.getVirtualNodeHeight(m,G,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:O,descr:N,section:O,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:x};ye.debug("sectionNode",B);const V=m.append("g"),z=fh.drawNode(V,B,O,i,e);ye.debug("sectionNode output",z),V.attr("transform",`translate(${T}, ${S})`),C+=x+50,F.length>0&&Cir(m,F,O,T,C,w,i,_,P,x,!1,e),T+=200*Math.max(F.length,1),C=S,O++}):(E=!1,Cir(m,v,O,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+h:L.width/2-h).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",h).attr("y1",A).attr("x2",L.width+3*h).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",d).attr("stop-opacity",1)}d5(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((I=i.timeline)==null?void 0:I.useMaxWidth)??!1)},"draw"),Cir=k(function(t,e,r,n,i,a,o,s,l,u,d,h){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=fh.drawNode(m,g,r,o,h).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+Xoi(t,p.events,r,n,i,o,h),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(#${h}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,d&&!((f=o.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Xoi=k(function(t,e,r,n,i,a,o){let s=0;const l=i;i=i+100;for(const u of e){const d={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ye.debug("eventNode",d);const h=t.append("g").attr("class","eventWrapper"),p=fh.drawNode(h,d,r,a,o,!0).height;s=s+p,h.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),Koi={setConf:k(()=>{},"setConf"),draw:joi},Xie=200,kb=5,Zoi=Xie+kb*2,sMe=Xie+100,Joi=sMe+kb*2,kir=10,esi=0,Oir=20,Eir=20,_ir=30,Rir=50,tsi=k(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=iu(e);o.append("g");const s=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ye.debug("task",s),fh.initGraphics(o);const u=n.db.getSections();ye.debug("sections",u);let d=0,h=0;const f=50+a;let p=50;const g=p,m=f,v=Zoi+Eir,y=Joi+Rir,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,S=Math.max(50,v+y-kb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:S,padding:kb,maxHeight:d},z=fh.getVirtualNodeHeight(o,V,i);ye.debug("sectionHeight before draw",z),d=Math.max(d,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:Xie,padding:kb,maxHeight:h},U=fh.getVirtualNodeHeight(o,z,i);ye.debug("taskHeight before draw",U),h=Math.max(h,U);let G=0;for(const H of V.events){const j={descr:H,section:V.section,number:V.section,width:sMe,padding:kb,maxHeight:50};G+=fh.getVirtualNodeHeight(o,j,i)}V.events.length>0&&(G+=(V.events.length-1)*kir),T=Math.max(T,G)+esi}ye.debug("maxSectionHeight before draw",d),ye.debug("maxTaskHeight before draw",h);const O=Math.max(h,T)+_ir;w?u.forEach(B=>{const V=s.filter(X=>X.section===B),z={number:x,descr:B,section:x,width:S,padding:kb,maxHeight:d};ye.debug("sectionNode",z);const U=o.append("g"),G=fh.drawNode(U,z,x,i);ye.debug("sectionNode output",G);const H=A-v;U.attr("transform",`translate(${H}, ${p})`);const j=p+G.height+Oir;V.length>0&&Dir(o,V,x,A,j,h,i,O,!1);const q=V.length,ne=G.height+Oir+O*Math.max(q,1)-(q>0?_ir*2:0);p+=ne,x++}):Dir(o,s,x,A,p,h,i,O,!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[_]=s1(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(),d5(void 0,o,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Dir=k(function(t,e,r,n,i,a,o,s,l){var u;for(const d of e){const h={descr:d.task,section:r,number:r,width:Xie,padding:kb,maxHeight:a};ye.debug("taskNode",h);const f=t.append("g").attr("class","taskWrapper"),p=fh.drawNode(f,h,r,o),g=p.height;ye.debug("taskHeight after draw",g);const m=n-Eir-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),d.events&&d.events.length>0){const v=i,y=n+Rir;rsi(t,d.events,r,n,y,v,o)}i=i+s,l&&!((u=o.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),rsi=k(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:sMe,padding:kb,maxHeight:0};ye.debug("eventNode",u);const d=t.append("g").attr("class","eventWrapper"),f=fh.drawNode(d,u,r,o).height;d.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+kir}return s-a},"drawEvents"),nsi={setConf:k(()=>{},"setConf"),draw:tsi},isi=k(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;l20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(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:k(function(){var A=this.pastInput(),S=new Array(A.length+1).join("-");return A+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:k(function(A,S){var T,C,O;if(this.options.backtrack_lexer&&(O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(O.yylloc.range=this.yylloc.range.slice(0))),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 O)this[E]=O[E];return!1}return!1},"test_match"),next:k(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 O=this._currentRules(),E=0;ES[0].length)){if(S=T,C=E,this.options.backtrack_lexer){if(A=this.test_match(T,O[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,O[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:k(function(){var S=this.next();return S||this.lex()},"lex"),begin:k(function(S){this.conditionStack.push(S)},"begin"),popState:k(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:k(function(S){this.begin(S)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(S,T,C,O){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 k(x,"Parser"),x.prototype=y,y.Parser=x,new x}();lMe.parser=lMe;var msi=lMe,vsi=12,Ob={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ysi=(wP=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Ob,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 d,h;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=((d=o.mindmap)==null?void 0:d.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:((h=o.mindmap)==null?void 0:h.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%(vsi-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=k(l=>{var h;const d=(((h=n.theme)==null?void 0:h.toLowerCase())??"").includes("redux");switch(l){case Ob.CIRCLE:return"mindmapCircle";case Ob.RECT:return"rect";case Ob.ROUNDED_RECT:return"rounded";case Ob.CLOUD:return"cloud";case Ob.BANG:return"bang";case Ob.HEXAGON:return"hexagon";case Ob.DEFAULT:return d?"rounded":"defaultMindmapNode";case Ob.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=_2t().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-"+psi()}}getLogger(){return ye}},k(wP,"MindmapDB"),wP),bsi=k(async(t,e,r,n)=>{var f,p;ye.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),o=S3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=b$(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 BR(a,o);const{themeVariables:l}=Dr(),{useGradient:u,gradientStart:d,gradientStop:h}=l;if(u&&d&&h){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",d).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}ck(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"),xsi={draw:bsi},wsi=k(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{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 B5(a,o);const{themeVariables:l}=Dr(),{useGradient:u,gradientStart:d,gradientStop:h}=l;if(u&&d&&h){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",d).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}ck(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"),xsi={draw:bsi},wsi=k(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{switch(ye.debug("In get type",t,e),t){case"[":return xl.RECT;case"(":return e===")"?xl.ROUNDED_RECT:xl.CLOUD;case"((":return xl.CIRCLE;case")":return xl.CLOUD;case"))":return xl.BANG;case"{{":return xl.HEXAGON;default:return xl.DEFAULT}},"getType"),Msi=k((t,e)=>{hMe[t]=e},"setElementForId"),Isi=k(t=>{if(!t)return;const e=Ye(),r=Wp[Wp.length-1];t.icon&&(r.icon=li(t.icon,e)),t.class&&(r.cssClasses=li(t.class,e))},"decorateNode"),Psi=k(t=>{switch(t){case xl.DEFAULT:return"no-border";case xl.RECT:return"rect";case xl.ROUNDED_RECT:return"rounded-rect";case xl.CIRCLE:return"circle";case xl.CLOUD:return"cloud";case xl.BANG:return"bang";case xl.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Nsi=k(()=>ye,"getLogger"),Bsi=k(t=>hMe[t],"getElementById"),$si={clear:Esi,addNode:Dsi,getSections:Lir,getData:Rsi,nodeType:xl,getType:Lsi,setElementForId:Msi,decorateNode:Isi,type2Str:Psi,getLogger:Nsi,getElementById:Bsi},Fsi=$si,zsi=k(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=iu(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 d=a.nodes.filter(A=>A.isGroup);let h=0;const f=10,p=[];let g=25;for(const A of d){const S=((v=o==null?void 0:o.kanban)==null?void 0:v.sectionWidth)||200;h=h+1,A.x=S*h+(h-1)*f/2,A.width=S,A.y=0,A.height=S*3,A.rx=5,A.ry=5,A.cssClasses=A.cssClasses+" section-"+h;const T=await hK(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 d){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 O=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 f$(u,L,{config:o})).node().getBBox();L.y=O+D.height/2,await gK(L),O=L.y+D.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(O-C+3*f,50)+(g-25);_.attr("height",P)}dR(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"),Usi={draw:zsi},Vsi=k(t=>{let e="";for(let n=0;nt.darkMode?ht(n,i):dt(n,i),"adjuster");for(let n=0;nA.isGroup);let h=0;const f=10,p=[];let g=25;for(const A of d){const S=((v=o==null?void 0:o.kanban)==null?void 0:v.sectionWidth)||200;h=h+1,A.x=S*h+(h-1)*f/2,A.width=S,A.y=0,A.height=S*3,A.rx=5,A.ry=5,A.cssClasses=A.cssClasses+" section-"+h;const T=await hK(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 d){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 O=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 f$(u,L,{config:o})).node().getBBox();L.y=O+D.height/2,await gK(L),O=L.y+D.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(O-C+3*f,50)+(g-25);_.attr("height",P)}d5(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"),Usi={draw:zsi},Vsi=k(t=>{let e="";for(let n=0;nt.darkMode?ht(n,i):dt(n,i),"adjuster");for(let n=0;n20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(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:k(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:k(function(l,u){var d,h,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))),h=l[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.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],d=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,d,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=d,h=p,this.options.backtrack_lexer){if(l=this.test_match(d,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[h]),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:k(function(){var u=this.next();return u||this.lex()},"lex"),begin:k(function(u){this.conditionStack.push(u)},"begin"),popState:k(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:k(function(u){this.begin(u)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(u,d,h,f){switch(h){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 k(o,"Parser"),o.prototype=i,i.Parser=o,new o}();yMe.parser=yMe;var Jie=yMe,eae=[],tae=[],rae=new Map,fli=k(()=>{eae=[],tae=[],rae=new Map,_a()},"clear"),pli=(AP=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},k(AP,"SankeyLink"),AP),gli=k((t,e,r)=>{eae.push(new pli(t,e,r))},"addLink"),mli=(SP=class{constructor(e){this.ID=e}},k(SP,"SankeyNode"),SP),vli=k(t=>{t=Xt.sanitizeText(t,Ye());let e=rae.get(t);return e===void 0&&(e=new mli(t),rae.set(t,e),tae.push(e)),e},"findOrCreateNode"),yli=k(()=>tae,"getNodes"),bli=k(()=>eae,"getLinks"),xli=k(()=>({nodes:tae.map(t=>({id:t.ID})),links:eae.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),wli={nodesMap:rae,getConfig:k(()=>Ye().sankey,"getConfig"),getNodes:yli,getLinks:bli,getGraph:xli,addLink:gli,findOrCreateNode:vli,getAccTitle:oo,setAccTitle:Ba,getAccDescription:lo,setAccDescription:so,getDiagramTitle:$a,setDiagramTitle:co,clear:fli},Vir=(_b=class{static next(e){return new _b(e+ ++_b.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},k(_b,"Uid"),_b.count=0,_b),Ali={left:qsi,right:jsi,center:Xsi,justify:Pir},Sli=k(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"),Tli=k(function(t,e,r,n){const{securityLevel:i,sankey:a}=Ye(),o=F2t.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}"]`),d=(a==null?void 0:a.width)??o.width,h=(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=Ali[p];eli().nodeId(N=>N.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(S).extent([[0,0],[d,h]])(A);const C=Sli(A.nodes),O=YT(wdn),E=k(N=>w[N]??O(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(A.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=Vir.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 _=k(({id:N,value:F})=>v?`${N} -${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=k(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=Vir.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=k(N=>N.uid,"coloring");break;case"source":I=k(N=>E(N.source.id),"coloring");break;case"target":I=k(N=>E(N.target.id),"coloring");break;default:I=M}D.append("path").attr("d",hli()).attr("stroke",I).attr("stroke-width",N=>Math.max(1,N.width)),dR(void 0,u,0,f)},"draw"),Cli={draw:Tli},kli=k(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=k(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=Vir.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=k(N=>N.uid,"coloring");break;case"source":I=k(N=>E(N.source.id),"coloring");break;case"target":I=k(N=>E(N.target.id),"coloring");break;default:I=M}D.append("path").attr("d",hli()).attr("stroke",I).attr("stroke-width",N=>Math.max(1,N.width)),d5(void 0,u,0,f)},"draw"),Cli={draw:Tli},kli=k(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` `).trim(),"prepareTextForParsing"),Oli=k(t=>`.label { font-family: ${t.fontFamily}; } @@ -3576,7 +3576,7 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":pe="Parse error fill: ${t.textColor}; } ${M9()} -`,"getStyles"),Lci=Dci,Mci=k((t,e,r,n)=>{e.forEach(i=>{Gci[i](t,r,n)})},"insertMarkers"),Ici=k((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"),Pci=k((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"),Nci=k((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"),Bci=k((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"),$ci=k((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"),Fci=k((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"),zci=k((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"),Uci=k((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"),Vci=k((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"),Gci={extension:Ici,composition:Pci,aggregation:Nci,dependency:Bci,lollipop:$ci,point:Fci,circle:zci,cross:Uci,barb:Vci},Qci=Mci;function CMe(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}}k(CMe,"calculateBlockPosition");var Hci=k(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 aae(t,e,r=0,n=0,i=8){var s,l,u,d,h,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 O of t.children)aae(O,e,0,0,i);const b=Hci(t);a=b.width,o=b.height,ye.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,o);for(const O of t.children)O.size&&(ye.debug(`abc95 Setting size of children of ${t.id} id=${O.id} ${a} ${o} ${JSON.stringify(O.size)}`),O.size.width=a*(O.widthInColumns??1)+i*((O.widthInColumns??1)-1),O.size.height=o,O.size.x=0,O.size.y=0,ye.debug(`abc95 updating size of ${t.id} children child:${O.id} maxWidth:${a} maxHeight:${o}`));for(const O of t.children)aae(O,e,a,o,i);const x=t.columns??-1;let w=0;for(const O of t.children)w+=O.widthInColumns??1;let A=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(O>0){const E=(T-O*i-i)/O;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)}k(aae,"setBlockSizes");function kMe(t,e,r=8){var i,a,o,s,l,u,d,h,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}=CMe(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 O=0;ye.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let E=(d=t==null?void 0:t.size)!=null&&d.x?((h=t==null?void 0:t.size)==null?void 0:h.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}=CMe(n,O);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: ${O} (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&&kMe(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-O%n)),O+=N,ye.debug("abc88 columnsPos",P,O)}}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}`)}k(kMe,"layoutBlocks");function OMe(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}=OMe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}k(OMe,"findBounds");function lar(t){var u,d;const e=t.getBlock("root");if(!e)return;const r=((d=(u=Ye())==null?void 0:u.block)==null?void 0:d.padding)??8;aae(e,t,0,0,r),kMe(e,t,r),ye.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:o}=OMe(e),s=o-i,l=a-n;return{x:n,y:i,width:l,height:s}}k(lar,"layout");var Wci=k(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=ia(o);return await lu(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),sm=Wci,Yci=k((t,e,r,n,i)=>{e.arrowTypeStart&&car(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&car(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),qci={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},car=k((t,e,r,n,i,a)=>{const o=qci[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={},mu={},jci=k(async(t,e)=>{const r=Ye(),n=ia(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),o=e.labelType==="markdown",s=await lu(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 h=s.children[0],f=_t(s);l=h.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const h=_t(s).select("text").node();h&&typeof h.getBBox=="function"&&(u=h.getBBox())}a.attr("transform",T0(u,n)),EMe[e.id]=i,e.width=l.width,e.height=l.height;let d;if(e.startLabelLeft){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(f,e.startLabelLeft,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].startLeft=h,SU(d,e.startLabelLeft)}if(e.startLabelRight){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(f,e.startLabelRight,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].startRight=h,SU(d,e.startLabelRight)}if(e.endLabelLeft){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(h,e.endLabelLeft,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].endLeft=h,SU(d,e.endLabelLeft)}if(e.endLabelRight){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(h,e.endLabelRight,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].endRight=h,SU(d,e.endLabelRight)}return s},"insertEdgeLabel");function SU(t,e){ia(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}k(SU,"setTerminalWidth");var Xci=k((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}=DR(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=mu[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=mu[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=mu[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=mu[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"),Kci=k((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"),Zci=k((t,e,r)=>{ye.debug(`intersection calc abc89: +`,"getStyles"),Lci=Dci,Mci=k((t,e,r,n)=>{e.forEach(i=>{Gci[i](t,r,n)})},"insertMarkers"),Ici=k((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"),Pci=k((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"),Nci=k((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"),Bci=k((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"),$ci=k((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"),Fci=k((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"),zci=k((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"),Uci=k((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"),Vci=k((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"),Gci={extension:Ici,composition:Pci,aggregation:Nci,dependency:Bci,lollipop:$ci,point:Fci,circle:zci,cross:Uci,barb:Vci},Qci=Mci;function CMe(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}}k(CMe,"calculateBlockPosition");var Hci=k(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 aae(t,e,r=0,n=0,i=8){var s,l,u,d,h,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 O of t.children)aae(O,e,0,0,i);const b=Hci(t);a=b.width,o=b.height,ye.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,o);for(const O of t.children)O.size&&(ye.debug(`abc95 Setting size of children of ${t.id} id=${O.id} ${a} ${o} ${JSON.stringify(O.size)}`),O.size.width=a*(O.widthInColumns??1)+i*((O.widthInColumns??1)-1),O.size.height=o,O.size.x=0,O.size.y=0,ye.debug(`abc95 updating size of ${t.id} children child:${O.id} maxWidth:${a} maxHeight:${o}`));for(const O of t.children)aae(O,e,a,o,i);const x=t.columns??-1;let w=0;for(const O of t.children)w+=O.widthInColumns??1;let A=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(O>0){const E=(T-O*i-i)/O;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)}k(aae,"setBlockSizes");function kMe(t,e,r=8){var i,a,o,s,l,u,d,h,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}=CMe(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 O=0;ye.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let E=(d=t==null?void 0:t.size)!=null&&d.x?((h=t==null?void 0:t.size)==null?void 0:h.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}=CMe(n,O);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: ${O} (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&&kMe(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-O%n)),O+=N,ye.debug("abc88 columnsPos",P,O)}}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}`)}k(kMe,"layoutBlocks");function OMe(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}=OMe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}k(OMe,"findBounds");function lar(t){var u,d;const e=t.getBlock("root");if(!e)return;const r=((d=(u=Ye())==null?void 0:u.block)==null?void 0:d.padding)??8;aae(e,t,0,0,r),kMe(e,t,r),ye.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:o}=OMe(e),s=o-i,l=a-n;return{x:n,y:i,width:l,height:s}}k(lar,"layout");var Wci=k(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=ia(o);return await lu(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),sm=Wci,Yci=k((t,e,r,n,i)=>{e.arrowTypeStart&&car(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&car(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),qci={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},car=k((t,e,r,n,i,a)=>{const o=qci[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={},mu={},jci=k(async(t,e)=>{const r=Ye(),n=ia(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),o=e.labelType==="markdown",s=await lu(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 h=s.children[0],f=_t(s);l=h.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const h=_t(s).select("text").node();h&&typeof h.getBBox=="function"&&(u=h.getBBox())}a.attr("transform",T0(u,n)),EMe[e.id]=i,e.width=l.width,e.height=l.height;let d;if(e.startLabelLeft){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(f,e.startLabelLeft,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].startLeft=h,SU(d,e.startLabelLeft)}if(e.startLabelRight){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(f,e.startLabelRight,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].startRight=h,SU(d,e.startLabelRight)}if(e.endLabelLeft){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(h,e.endLabelLeft,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].endLeft=h,SU(d,e.endLabelLeft)}if(e.endLabelRight){const h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner"),p=await sm(h,e.endLabelRight,e.labelStyle);d=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",T0(g,n)),mu[e.id]||(mu[e.id]={}),mu[e.id].endRight=h,SU(d,e.endLabelRight)}return s},"insertEdgeLabel");function SU(t,e){ia(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}k(SU,"setTerminalWidth");var Xci=k((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}=D5(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=mu[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=mu[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=mu[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=mu[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"),Kci=k((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"),Zci=k((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 h=r.y{ye.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Kci(e,a)&&!i){const o=Zci(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"),Jci=k(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 d=a.node(e.w);d!=null&&d.intersect&&(u!=null&&u.intersect)&&(s=s.slice(1,r.points.length-1),s.unshift(u.intersect(s[0])),s.push(d.intersect(s[s.length-1]))),r.toCluster&&(ye.debug("to cluster abc88",n[r.toCluster]),s=uar(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ye.debug("from cluster abc88",n[r.fromCluster]),s=uar(s.reverse(),n[r.fromCluster].node).reverse(),l=!0);const h=s.filter(w=>!Number.isNaN(w.y));let f=W7;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=qEt(r),m=H7().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(h)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(Ye().flowchart.arrowMarkerAbsolute||Ye().state.arrowMarkerAbsolute)&&(b=Fj(!0)),Yci(y,r,b,o,i);let x={};return l&&(x.updatedPath=s),x.originalPath=r.points,x},"insertEdge"),eui=k(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"),tui=k((t,e,r,n)=>{const i=eui(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 dar(t,e){return t.intersect(e)}k(dar,"intersectNode");var rui=dar;function har(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}k(_Me,"sameSign");var iui=gar,aui=mar;function mar(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,d=0;d1&&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"),sui=oui,ko={node:rui,circle:nui,ellipse:far,polygon:aui,rect:sui},ec=k(async(t,e,r,n)=>{const i=Ye();let a;const o=e.useHtmlLabels||ia(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 d;e.labelType==="markdown"?d=lu(l,li(l1(u),i),{useHtmlLabels:o,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):d=await sm(l,li(l1(u),i),e.labelStyle,!1,n);let h=d.getBBox();const f=e.padding/2;if(ia(i)){const p=d.children[0],g=_t(d);await jxe(p,u),h=p.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}return o?l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):l.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:s,bbox:h,halfPadding:f,label:l}},"labelHelper"),as=k((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function lm(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+")")}k(lm,"insertPolygonShape");var lui=k(async(t,e)=>{e.useHtmlLabels||ia(Ye())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ec(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 ko.rect(e,s)},n},"note"),cui=lui,yar=k(t=>t?" "+t:"","formatClass"),Cf=k((t,e)=>`${e||"node default"}${yar(t.classes)} ${yar(t.class)}`,"getClassesFromNode"),bar=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,o,o,s);return l.attr("style",e.style),as(e,l),e.intersect=function(u){return ye.warn("Intersect called"),ko.polygon(e,s,u)},r},"question"),uui=k((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 ko.circle(e,14,o)},r},"choice"),dui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,s,a,l);return u.attr("style",e.style),as(e,u),e.intersect=function(d){return ko.polygon(e,l,d)},r},"hexagon"),hui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(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,d=tui(e.directions,n,e,u),h=lm(r,u,a,d);return h.attr("style",e.style),as(e,h),e.intersect=function(f){return ko.polygon(e,d,f)},r},"block_arrow"),fui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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 lm(r,i,a,o).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ko.polygon(e,o,l)},r},"rect_left_inv_arrow"),pui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"lean_right"),gui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"lean_left"),mui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"trapezoid"),vui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"inv_trapezoid"),yui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"rect_right_inv_arrow"),bui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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(d){const h=ko.rect(e,d),f=h.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,d.y-e.y>0&&(p=-p),h.y+=p}return h},r},"cylinder"),xui=k(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ec(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 d=new Set(Object.keys(e.props));e.props.borders&&(oae(a,e.props.borders,o,s),d.delete("borders")),d.forEach(h=>{ye.warn(`Unknown node property ${h}`)})}return as(e,a),e.intersect=function(d){return ko.rect(e,d)},r},"rect"),wui=k(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ec(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 d=new Set(Object.keys(e.props));e.props.borders&&(oae(a,e.props.borders,o,s),d.delete("borders")),d.forEach(h=>{ye.warn(`Unknown node property ${h}`)})}return as(e,a),e.intersect=function(d){return ko.rect(e,d)},r},"composite"),Aui=k(async(t,e)=>{const{shapeSvg:r}=await ec(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&&(oae(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 ko.rect(e,o)},r},"labelRect");function oae(t,e,r,n){const i=[],a=k(s=>{i.push(s,0)},"addBorder"),o=k(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(" "))}k(oae,"applyNodePropertyBorders");var Sui=k(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 sm(o,l,e.labelStyle,!0,!0);let d={width:0,height:0};if(ia(Ye())){const m=u.children[0],v=_t(u);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}ye.info("Text 2",s);const h=s.slice(1,s.length);let f=u.getBBox();const p=await sm(o,h.join?h.join("
"):h,e.labelStyle,!0,!0);if(ia(Ye())){const m=p.children[0],v=_t(p);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}const g=e.padding/2;return _t(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+g+5)+")"),_t(u).attr("transform","translate( "+(d.width{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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 ko.rect(e,s)},r},"stadium"),Cui=k(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ec(t,e,Cf(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),ko.circle(e,n.width/2+i,o)},r},"circle"),kui=k(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ec(t,e,Cf(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),ko.circle(e,n.width/2+i+a,u)},r},"doublecircle"),Oui=k(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ec(t,e,Cf(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=lm(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return ko.polygon(e,o,l)},r},"subroutine"),Eui=k((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 ko.circle(e,7,i)},r},"start"),xar=k((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 ko.rect(e,s)},n},"forkJoin"),_ui=k((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 ko.circle(e,7,a)},r},"end"),Rui=k(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 d=0,h=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 sm(f,m,e.labelStyle,!0,!0);let y=v.getBBox();if(ia(Ye())){const O=v.children[0],E=_t(v);y=O.getBoundingClientRect(),E.attr("width",y.width),E.attr("height",y.height)}e.classData.annotations[0]&&(h+=y.height+n,d+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(ia(Ye())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await sm(f,b,e.labelStyle,!0,!0);_t(x).attr("class","classTitle");let w=x.getBBox();if(ia(Ye())){const O=x.children[0],E=_t(x);w=O.getBoundingClientRect(),E.attr("width",w.width),E.attr("height",w.height)}h+=w.height+n,w.width>d&&(d=w.width);const A=[];e.classData.members.forEach(async O=>{const E=O.getDisplayDetails();let _=E.displayText;ia(Ye())&&(_=_.replace(//g,">"));const P=await sm(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(ia(Ye())){const R=P.children[0],D=_t(P);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>d&&(d=L.width),h+=L.height+n,A.push(P)}),h+=i;const S=[];if(e.classData.methods.forEach(async O=>{const E=O.getDisplayDetails();let _=E.displayText;ia(Ye())&&(_=_.replace(//g,">"));const P=await sm(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(ia(Ye())){const R=P.children[0],D=_t(P);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>d&&(d=L.width),h+=L.height+n,S.push(P)}),h+=i,g){let O=(d-y.width)/2;_t(v).attr("transform","translate( "+(-1*d/2+O)+", "+-1*h/2+")"),p=y.height+n}let T=(d-w.width)/2;return _t(x).attr("transform","translate( "+(-1*d/2+T)+", "+(-1*h/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-d/2-r).attr("x2",d/2+r).attr("y1",-h/2-r+i+p).attr("y2",-h/2-r+i+p),p+=i,A.forEach(O=>{_t(O).attr("transform","translate( "+-d/2+", "+(-1*h/2+p+i/2)+")");const E=O==null?void 0:O.getBBox();p+=((E==null?void 0:E.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-d/2-r).attr("x2",d/2+r).attr("y1",-h/2-r+i+p).attr("y2",-h/2-r+i+p),p+=i,S.forEach(O=>{_t(O).attr("transform","translate( "+-d/2+", "+(-1*h/2+p)+")");const E=O==null?void 0:O.getBBox();p+=((E==null?void 0:E.height)??0)+n}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-d/2-r).attr("y",-(h/2)-r).attr("width",d+e.padding).attr("height",h+e.padding),as(e,s),e.intersect=function(O){return ko.rect(e,O)},o},"class_box"),war={rhombus:bar,composite:wui,question:bar,rect:xui,labelRect:Aui,rectWithTitle:Sui,choice:uui,circle:Cui,doublecircle:kui,stadium:Tui,hexagon:dui,block_arrow:hui,rect_left_inv_arrow:fui,lean_right:pui,lean_left:gui,trapezoid:mui,inv_trapezoid:vui,rect_right_inv_arrow:yui,cylinder:bui,start:Eui,end:_ui,note:cui,subroutine:Oui,fork:xar,join:xar,class_box:Rui},sae={},Aar=k(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 war[e.shape](n,e,r)}else i=await war[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),sae[e.id]=n,e.haveCallback&&sae[e.id].attr("class",sae[e.id].attr("class")+" clickable"),n},"insertNode"),Dui=k(t=>{const e=sae[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=Yxe((n==null?void 0:n.styles)??[]),u=n.label,d=n.size??{width:0,height:0,x:0,y:0},h=e.getDiagramId();return{labelStyle:l.labelStyle,shape:o,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:h?`${h}-${n.id}`:n.id,directions:n.directions,width:d.width,height:d.height,x:d.x,y:d.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}}k(RMe,"getNodeFromBlock");async function Sar(t,e,r){const n=RMe(e,r,!1);if(n.type==="group")return;const i=Dr(),a=await Aar(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()}k(Sar,"calculateBlockSize");async function Tar(t,e,r){const n=RMe(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Dr();await Aar(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,Dui(n)}}k(Tar,"insertBlockPositioned");async function lae(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await lae(t,i.children,r,n)}k(lae,"performOperations");async function Car(t,e,r){await lae(t,e,r,Sar)}k(Car,"calculateBlockSizes");async function kar(t,e,r){await lae(t,e,r,Tar)}k(kar,"insertBlocks");async function Oar(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,d=l.size,h=[{x:u.x,y:u.y},{x:u.x+(d.x-u.x)/2,y:u.y+(d.y-u.y)/2},{x:d.x,y:d.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`;Jci(t,{v:o.start,w:o.end,name:f},{...o,id:f,arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:h,classes:m},void 0,"block",a,i),o.label&&(await jci(t,{...o,label:o.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:h,classes:m}),Xci({...o,x:h[1].x,y:h[1].y},{originalPath:h}))}}}k(Oar,"insertEdges");var Lui=k(function(t,e){return e.db.getClasses()},"getClasses"),Mui=k(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}"]`);Qci(u,["point","circle","cross"],n.type,e);const h=o.getBlocks(),f=o.getBlocksFlat(),p=o.getEdges(),g=u.insert("g").attr("class","block");await Car(g,h,o);const m=lar(o);if(await kar(g,h,o),await Oar(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"),Iui={draw:Mui,getClasses:Lui},Pui={parser:uci,db:Rci,renderer:Iui,styles:Lci};const Nui=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pui},Symbol.toStringTag,{value:"Module"}));var Ear=/[─━│┃└┗├┣]/,_ar=/[└┗├┣]/,Bui=/[─━]/,Rar=/^[\s│┃]+$/,Dar=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Lar=/^\s*%%/,$ui=" ";function Mar(t){return t.some(e=>Ear.test(e))}k(Mar,"isBoxDrawingFormat");function Iar(t){for(const e of t){const r=_ar.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}k(Iar,"inferSegmentWidth");function Par(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})}k(Par,"remapErrorLines");function Nar(t){const e=t.split(` @@ -3639,11 +3639,11 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":pe="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),Adi=wdi;function FMe(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}}k(FMe,"withSeededRandom");var zD=k(t=>`${t}`,"wrapIcon"),CU={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:zD('')},server:{body:zD('')},disk:{body:zD('')},internet:{body:zD('')},cloud:{body:zD('')},unknown:vkt,blank:{body:zD("")}}},Sdi=k(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:d,sourceDir:h,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:v,targetGroup:y,label:b}=Yar(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 O=i+4;if(p&&(xd(h)?x+=h==="L"?-O:O:w+=h==="T"?-O:O+18),y&&(xd(m)?T+=m==="L"?-O:O:C+=m==="T"?-O:O+18),!p&&((E=r.getNode(d))==null?void 0:E.type)==="junction"&&(xd(h)?x+=h==="L"?o:-o:w+=h==="T"?o:-o),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(xd(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}-${RR(d,g,{prefix:"L"})}`),f){const L=xd(h)?cae[h](x,s):x-l,R=W2(h)?cae[h](w,s):w-l;P.insert("polygon").attr("points",Qar[h](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=xd(m)?cae[m](T,s):T-l,R=W2(m)?cae[m](C,s):C-l;P.insert("polygon").attr("points",Qar[m](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=BMe(h,m)?"XY":xd(h)?"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 lu(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=$Me(h,m);if(M&&hdi(M)){const I=D.node().getBoundingClientRect(),[N,F]=gdi(M);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const B=D.node().getBoundingClientRect();D.attr("transform",` +`,"getStyles"),Adi=wdi;function FMe(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}}k(FMe,"withSeededRandom");var zD=k(t=>`${t}`,"wrapIcon"),CU={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:zD('')},server:{body:zD('')},disk:{body:zD('')},internet:{body:zD('')},cloud:{body:zD('')},unknown:vkt,blank:{body:zD("")}}},Sdi=k(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:d,sourceDir:h,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:v,targetGroup:y,label:b}=Yar(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 O=i+4;if(p&&(xd(h)?x+=h==="L"?-O:O:w+=h==="T"?-O:O+18),y&&(xd(m)?T+=m==="L"?-O:O:C+=m==="T"?-O:O+18),!p&&((E=r.getNode(d))==null?void 0:E.type)==="junction"&&(xd(h)?x+=h==="L"?o:-o:w+=h==="T"?o:-o),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(xd(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}-${R5(d,g,{prefix:"L"})}`),f){const L=xd(h)?cae[h](x,s):x-l,R=W2(h)?cae[h](w,s):w-l;P.insert("polygon").attr("points",Qar[h](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=xd(m)?cae[m](T,s):T-l,R=W2(m)?cae[m](C,s):C-l;P.insert("polygon").attr("points",Qar[m](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=BMe(h,m)?"XY":xd(h)?"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 lu(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=$Me(h,m);if(M&&hdi(M)){const I=D.node().getBoundingClientRect(),[N,F]=gdi(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"),Tdi=k(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 d=FD(u);if(d.type==="group"){const{h,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${d.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",h).attr("class","node-bkg");const v=t.append("g");let y=p,b=g;if(d.icon){const x=v.append("g");x.html(`${await c1(d.icon,{height:a,width:a,fallbackPrefix:CU.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=o/2-1-2}if(d.label){const x=v.append("g");await lu(x,d.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(d.id,m)}}))},"drawGroups"),Cdi=k(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 h=o.append("g");await lu(h,a.title,{useHtmlLabels:!1,width:s*1.5,classes:"architecture-service-label"},i),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+s/2+", "+s+")")}const l=o.append("g");if(a.icon)l.html(`${await c1(a.icon,{height:s,width:s,fallbackPrefix:CU.prefix})}`);else if(a.iconText){l.html(`${await c1("blank",{height:s,width:s,fallbackPrefix:CU.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:d}=o.node().getBBox();a.width=u,a.height=d,t.setElementForId(a.id,o)}return 0},"drawServices"),kdi=k(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");Zxe([{name:CU.prefix,icons:CU}]),iv.use(udi);function Xar(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"})})}k(Xar,"addServices");function Kar(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"})})}k(Kar,"addJunctions");function Zar(t,e){e.nodes().map(r=>{const n=FD(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)+")")})}k(Zar,"positionNodes");function Jar(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"})})}k(Jar,"addGroups");function eor(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:o,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:d,title:h}=r,f=BMe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:h,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:d,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}k(eor,"addEdges");function tor(t,e,r,n=[]){const i=k((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=k(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),d=u(o),h=u(s);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?d.push([...f.members]):h.push([...f.members]))}),{horizontal:d,vertical:h}}k(tor,"getAlignments");function ror(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),o=a*i,s=new Set;r.forEach(d=>{for(let h=0;h`${d[0]},${d[1]}`,"posToStr"),u=k(d=>d.split(",").map(h=>parseInt(h)),"strToPos");return t.forEach(d=>{const h=new Map([...d.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=h.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=h.get(w);if(A&&!p[w]){if(f.push(w),s.has(`${v}|${A}`))return;n.push({[Gar[b]]:A,[Gar[ddi(b)]]:v,gap:a*i})}})}}}}),n}k(ror,"getRelativeConstraints");function nor(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=iv({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(),Jar(r,u),Xar(t,u,i),Kar(e,u,i),eor(n,u);const d=i.getLayoutHints(),h=tor(i,a,o,d),f=ror(a,i,d),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}=FD(w),{parent:T}=FD(A);return S===T?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:S}=FD(w),{parent:T}=FD(A);return S===T?v:.001},alignmentConstraint:h,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,S,T,C){let O,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)),O=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));O=O/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,O=O*I,{distances:E,weights:O}}k(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:O}=A.target().position();if(S!==C&&T!==O){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:P}=Yar(A),[L,R]=W2(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(),FMe(y,()=>b.run())});try{FMe(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)})})}k(nor,"layoutArchitecture");var Odi=k(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(),d=iu(e),h=d.append("g");h.attr("class","architecture-edges");const f=d.append("g");f.attr("class","architecture-services");const p=d.append("g");p.attr("class","architecture-groups"),await Cdi(i,f,a,e),kdi(i,f,o,e);const g=await nor(a,o,s,l,i,u);await Sdi(h,g,i,e),await Tdi(p,g,i,e),Zar(i,g),dR(void 0,d,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Edi={draw:Odi},_di={parser:jar,get db(){return new qar},renderer:Edi,styles:Adi};const Rdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:_di},Symbol.toStringTag,{value:"Module"}));var ior="position frame",aor="frame positioned",zMe="position relation",oor="relation positioned",Ddi=k(function(t){ye.debug("options str",t)},"setOptions"),Ldi=k(function(){return{}},"getOptions"),Mdi=k(function(){sor(),_a()},"clear");function sor(){UMe={}}k(sor,"reset");var Idi=Jn.eventmodeling,Pdi=k(()=>uo({...Idi,...Dr().eventmodeling}),"getConfig"),UMe={};function lor(){let t=Ndi;const{ast:e}=UMe,r=VMe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=mor(n,e.dataEntities,r);t=dae(t,{$kind:ior,index:i,frame:n,textProps:a});let o;Aor(n)?(ye.debug("source frame",n.sourceFrames),o=e.frames.filter(s=>n.sourceFrames.some(l=>l.$refText===s.name)),o.forEach(s=>{t=dae(t,{$kind:zMe,index:i,frame:n,sourceFrame:s})})):t=dae(t,{$kind:zMe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:GMe(t.swimlanes)},t}k(lor,"getState");function cor(t){UMe.ast=t}k(cor,"setAst");var Hi={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 VMe(){return Hi}k(VMe,"getDiagramProps");var Ndi={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function uor(t){const e=t.split(".");if(e.length===2)return e[0]}k(uor,"extractNamespace");function dor(t){const e=t.split(".");return e.length===2?e[1]:t}k(dor,"extractName");function hor(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}k(hor,"findSwimlaneByNamespace");function uae(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}k(uae,"findNextAvailableIndex");function por(t,e){const r=uor(t.entityIdentifier),n=hor(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Hi.labelUiAutomation}:r?{index:uae(e,0,100),label:Hi.labelUiAutomationPrefix+r}:{index:0,label:Hi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Hi.labelCommandReadModel}:r?{index:uae(e,100,200),label:Hi.labelCommandReadModelPrefix+r}:{index:100,label:Hi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Hi.labelEvents}:r?{index:uae(e,200,300),label:Hi.labelEventsPrefix+r}:{index:200,label:Hi.labelEvents}}}k(por,"calculateSwimlaneProps");function gor(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"}}}k(gor,"calculateEntityVisualProps");function mor(t,e,r){const n=Dr(),i=li(dor(t.entityIdentifier)??"",n);let a;const o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${r$(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=r$(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(`{ + `)}}}}}))},"drawEdges"),Tdi=k(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 d=FD(u);if(d.type==="group"){const{h,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${d.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",h).attr("class","node-bkg");const v=t.append("g");let y=p,b=g;if(d.icon){const x=v.append("g");x.html(`${await c1(d.icon,{height:a,width:a,fallbackPrefix:CU.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=o/2-1-2}if(d.label){const x=v.append("g");await lu(x,d.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(d.id,m)}}))},"drawGroups"),Cdi=k(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 h=o.append("g");await lu(h,a.title,{useHtmlLabels:!1,width:s*1.5,classes:"architecture-service-label"},i),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+s/2+", "+s+")")}const l=o.append("g");if(a.icon)l.html(`${await c1(a.icon,{height:s,width:s,fallbackPrefix:CU.prefix})}`);else if(a.iconText){l.html(`${await c1("blank",{height:s,width:s,fallbackPrefix:CU.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:d}=o.node().getBBox();a.width=u,a.height=d,t.setElementForId(a.id,o)}return 0},"drawServices"),kdi=k(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");Zxe([{name:CU.prefix,icons:CU}]),iv.use(udi);function Xar(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"})})}k(Xar,"addServices");function Kar(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"})})}k(Kar,"addJunctions");function Zar(t,e){e.nodes().map(r=>{const n=FD(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)+")")})}k(Zar,"positionNodes");function Jar(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"})})}k(Jar,"addGroups");function eor(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:o,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:d,title:h}=r,f=BMe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:h,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:d,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}k(eor,"addEdges");function tor(t,e,r,n=[]){const i=k((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=k(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),d=u(o),h=u(s);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?d.push([...f.members]):h.push([...f.members]))}),{horizontal:d,vertical:h}}k(tor,"getAlignments");function ror(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),o=a*i,s=new Set;r.forEach(d=>{for(let h=0;h`${d[0]},${d[1]}`,"posToStr"),u=k(d=>d.split(",").map(h=>parseInt(h)),"strToPos");return t.forEach(d=>{const h=new Map([...d.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=h.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=h.get(w);if(A&&!p[w]){if(f.push(w),s.has(`${v}|${A}`))return;n.push({[Gar[b]]:A,[Gar[ddi(b)]]:v,gap:a*i})}})}}}}),n}k(ror,"getRelativeConstraints");function nor(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=iv({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(),Jar(r,u),Xar(t,u,i),Kar(e,u,i),eor(n,u);const d=i.getLayoutHints(),h=tor(i,a,o,d),f=ror(a,i,d),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}=FD(w),{parent:T}=FD(A);return S===T?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:S}=FD(w),{parent:T}=FD(A);return S===T?v:.001},alignmentConstraint:h,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,S,T,C){let O,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)),O=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));O=O/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,O=O*I,{distances:E,weights:O}}k(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:O}=A.target().position();if(S!==C&&T!==O){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:P}=Yar(A),[L,R]=W2(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(),FMe(y,()=>b.run())});try{FMe(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)})})}k(nor,"layoutArchitecture");var Odi=k(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(),d=iu(e),h=d.append("g");h.attr("class","architecture-edges");const f=d.append("g");f.attr("class","architecture-services");const p=d.append("g");p.attr("class","architecture-groups"),await Cdi(i,f,a,e),kdi(i,f,o,e);const g=await nor(a,o,s,l,i,u);await Sdi(h,g,i,e),await Tdi(p,g,i,e),Zar(i,g),d5(void 0,d,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Edi={draw:Odi},_di={parser:jar,get db(){return new qar},renderer:Edi,styles:Adi};const Rdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:_di},Symbol.toStringTag,{value:"Module"}));var ior="position frame",aor="frame positioned",zMe="position relation",oor="relation positioned",Ddi=k(function(t){ye.debug("options str",t)},"setOptions"),Ldi=k(function(){return{}},"getOptions"),Mdi=k(function(){sor(),_a()},"clear");function sor(){UMe={}}k(sor,"reset");var Idi=Jn.eventmodeling,Pdi=k(()=>uo({...Idi,...Dr().eventmodeling}),"getConfig"),UMe={};function lor(){let t=Ndi;const{ast:e}=UMe,r=VMe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=mor(n,e.dataEntities,r);t=dae(t,{$kind:ior,index:i,frame:n,textProps:a});let o;Aor(n)?(ye.debug("source frame",n.sourceFrames),o=e.frames.filter(s=>n.sourceFrames.some(l=>l.$refText===s.name)),o.forEach(s=>{t=dae(t,{$kind:zMe,index:i,frame:n,sourceFrame:s})})):t=dae(t,{$kind:zMe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:GMe(t.swimlanes)},t}k(lor,"getState");function cor(t){UMe.ast=t}k(cor,"setAst");var Hi={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 VMe(){return Hi}k(VMe,"getDiagramProps");var Ndi={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function uor(t){const e=t.split(".");if(e.length===2)return e[0]}k(uor,"extractNamespace");function dor(t){const e=t.split(".");return e.length===2?e[1]:t}k(dor,"extractName");function hor(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}k(hor,"findSwimlaneByNamespace");function uae(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}k(uae,"findNextAvailableIndex");function por(t,e){const r=uor(t.entityIdentifier),n=hor(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Hi.labelUiAutomation}:r?{index:uae(e,0,100),label:Hi.labelUiAutomationPrefix+r}:{index:0,label:Hi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Hi.labelCommandReadModel}:r?{index:uae(e,100,200),label:Hi.labelCommandReadModelPrefix+r}:{index:100,label:Hi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Hi.labelEvents}:r?{index:uae(e,200,300),label:Hi.labelEventsPrefix+r}:{index:200,label:Hi.labelEvents}}}k(por,"calculateSwimlaneProps");function gor(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"}}}k(gor,"calculateEntityVisualProps");function mor(t,e,r){const n=Dr(),i=li(dor(t.entityIdentifier)??"",n);let a;const o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${r$(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=r$(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=r$(a,r.textMaxWidth,o),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const d={fontSize:o.fontSize,fontWeight:o.fontWeight,fontFamily:o.fontFamily},h=QX(l,d),f=u?h.width/3:h.width,p={content:l,width:f,height:h.height};return ye.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}k(mor,"calculateTextProps");function vor(t,e){const r=e,n=gor(r.frame),i={width:r.textProps.width+2*Hi.boxTextPadding,height:r.textProps.height+2*Hi.boxTextPadding};return[{$kind:aor,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}k(vor,"decidePositionFrame");function yor(t,e,r){return e===void 0?Hi.contentStartX:e.index===t.index&&t.r?t.r+Hi.boxPadding:r===void 0?Hi.contentStartX:r.r-Hi.boxOverlap+Hi.boxPadding}k(yor,"calculateX");function bor(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}k(bor,"calculateMaxRight");function GMe(t){return Object.values(t).sort((e,r)=>e.index-r.index)}k(GMe,"sortedSwimlanesArray");function xor(t,e){const r=e,n=por(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*Hi.swimlaneMinHeight+Hi.swimlaneGap,height:Hi.swimlaneMinHeight,maxHeight:Hi.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(Hi.boxMinWidth,Math.min(Hi.boxMaxWidth,r.dimension.width))+2*Hi.boxPadding,height:Math.max(Hi.boxMinHeight,Math.min(Hi.boxMaxHeight,r.dimension.height))+2*Hi.boxPadding},l=yor(i,o,a),u=l+s.width+Hi.boxPadding,d=bor(Object.values(t.swimlanes),u);i.r=l+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(Hi.swimlaneMinHeight,i.maxHeight)+2*Hi.swimlanePadding;const h={x:l,y:Hi.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,h],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:d},p=GMe(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}k(Aor,"hasSourceFrame");function QMe(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}k(QMe,"findBoxByFrame");function Sor(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}k(Sor,"findBoxByLineIndex");function Tor(t,e){const r=e;if(Ger(r.frame)||wor(r.index,r.frame))return[];const n=QMe(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=QMe(t.boxes,r.sourceFrame):i=Sor(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:oor,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}k(Tor,"decidePositionRelation");function Cor(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]}}k(Cor,"evolveRelationPositioned");var Bdi={[ior]:vor,[zMe]:Tor},$di={[aor]:xor,[oor]:Cor};function kor(t,e){const r=Bdi[e.$kind];if(r==null)return[];const n=r(t,e);return ye.debug("decided events",n),n}k(kor,"decide");function Oor(t,e){const r=e.reduce((n,i)=>{const a=$di[i.$kind];return a==null?n:a(n,i)},t);return ye.debug("evolve events",{state:t,newState:r,events:e}),r}k(Oor,"evolve");function dae(t,e){const r=kor(t,e);return Oor(t,r)}k(dae,"dispatch");var HMe={getConfig:Pdi,setOptions:Ddi,getOptions:Ldi,clear:Mdi,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,setDiagramTitle:co,getDiagramTitle:$a,setAst:cor,getDiagramProps:VMe,getState:lor},Fdi={parse:k(async t=>{const e=await Qp("eventmodeling",t);ye.debug(e),HMe.setAst(e),od(e,HMe)},"parse")},WMe=Ye(),zdi=WMe==null?void 0:WMe.eventmodeling;function Eor(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)}}k(Eor,"renderD3Box");function _or(t,e){return t>e}k(_or,"dirUpwards");function Ror(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,o=i.targetBox.swimlane.y+e.swimlanePadding,s=_or(a,o),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let d,h;ye.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(d=a,h=o+i.targetBox.dimension.height):(d=a+i.sourceBox.dimension.height,h=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} ${d} L${u} ${h}`)}}k(Ror,"renderD3Relation");function Dor(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)}}k(Dor,"renderD3Swimlane");var Udi=k(function(t,e,r,n){if(ye.debug("in eventmodeling renderer",t+` `,"id:",e,r),!zdi)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(),d=`em-arrowhead-${e}`,h=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(Dor(s,u.maxR,l,a)),u.boxes.forEach(Eor(s,l)),u.relations.forEach(Ror(s,l,d,a)),s.append("defs").append("marker").attr("id",d).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",h),vbe(void 0,s,(o==null?void 0:o.padding)??30,o==null?void 0:o.useMaxWidth)},"draw"),Vdi={draw:Udi},Gdi=k(t=>"","getStyles"),Qdi=Gdi,Hdi={parser:Fdi,db:HMe,renderer:Vdi,styles:Qdi};const Wdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hdi},Symbol.toStringTag,{value:"Module"}));var YMe=function(){var t=k(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],d=[1,6,13,14],h=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:k(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:k(function(b,x,w,A,S,T,C){var O=T.length-1;switch(S){case 6:case 7:return A;case 15:A.addNode(T[O-1].length,T[O].trim());break;case 16:A.addNode(0,T[O].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(d,[2,14],{7:h,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(d,[2,13],{7:h,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:k(function(b,x){if(x.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=x,w}},"parseError"),parse:k(function(b){var x=this,w=[0],A=[],S=[null],T=[],C=this.table,O="",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}k(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}k(V,"lex");for(var z,U,G,H,j={},q,ne,X,J;;){if(U=w[w.length-1],this.defaultActions[U]?G=this.defaultActions[U]:((z===null||typeof z>"u")&&(z=V()),G=C[U]&&C[U][z]),typeof G>"u"||!G.length||!G[0]){var ee="";J=[];for(q in C[U])this.terminals_[q]&&q>P&&J.push("'"+this.terminals_[q]+"'");D.showPosition?ee="Parse error on line "+(E+1)+`: `+D.showPosition()+`